Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASOAPI: add e2e test #4791

Merged
merged 1 commit into from
Apr 30, 2024
Merged

ASOAPI: add e2e test #4791

merged 1 commit into from
Apr 30, 2024

Conversation

nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Apr 29, 2024

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

This PR adds a basic e2e test for an ASOAPI AKS cluster which only checks that the cluster and its associated resources reach a ready state after being created.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #4713

Special notes for your reviewer:

There is at least one more step before a ClusterClass test will work. Setting up those templates will likely also be a bit tricker than these, so I elected to punt on that for now.

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 29, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2024
Comment on lines +39 to +40
networkProfile:
networkPlugin: azure
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary for Windows node pools, or at least an easy way to get them to work.

@@ -78,20 +82,15 @@ func DiscoverAndWaitForAKSControlPlaneInitialized(ctx context.Context, input Dis
Expect(input.Lister).NotTo(BeNil(), "Invalid argument. input.Lister can't be nil when calling DiscoverAndWaitForAKSControlPlaneInitialized")
Expect(input.Cluster).NotTo(BeNil(), "Invalid argument. input.Cluster can't be nil when calling DiscoverAndWaitForAKSControlPlaneInitialized")

controlPlane := GetAzureManagedControlPlaneByCluster(ctx, GetAzureManagedControlPlaneByClusterInput{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we only ever use the Name and Namespace from this controlPlane, I opted to pull those from the Cluster instead so we don't need an ASOAPI-typed equivalent for this GetAzureManagedControlPlaneByCluster function which is otherwise unused.

test/e2e/azure_test.go Outdated Show resolved Hide resolved
@@ -937,6 +955,28 @@ var _ = Describe("Workload cluster creation", func() {
})
})

Context("Creating an AKS cluster with the ASO API [Managed Kubernetes][OPTIONAL]", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd sort of prefer we remove the "OPTIONAL" label. Do we think there's a risk of adding PR friction? I would expect the new API to be operationally equivalent to the existing AKS CAPZ API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't suspect this test will be flakier than any of the other tests. I was just generally thinking that experimental things probably don't need to be required. I'll change it though and we can reevaluate if this becomes an issue.

Comment on lines 168 to +169
ammpList := &infrav1.AzureManagedMachinePoolList{}
asommpList := &infrav1exp.AzureASOManagedMachinePoolList{}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gist here is to build up one big list of all the CAPZ ManagedMachinePools, regardless of the exact type whether it's an AzureManagedMachinePool or AzureASOManagedMachinePool. Then we can use their shared metadata structure to get the owning MachinePool which is what we're ultimately checking here.

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Apr 29, 2024

/hold for squash

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Apr 29, 2024

transient github download failure:
/retest

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.48%. Comparing base (cef502c) to head (38b9def).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4791   +/-   ##
=======================================
  Coverage   62.48%   62.48%           
=======================================
  Files         196      196           
  Lines       16188    16188           
=======================================
  Hits        10115    10115           
  Misses       5333     5333           
  Partials      740      740           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 29, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Apr 30, 2024

/retest

Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

great to have these tests bootstrapped as part of the surface area leading up to the release!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4200c716a9e64961e8d9ee7fe7c8ee196566a3a8

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Apr 30, 2024

squashed!
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2024
@k8s-ci-robot k8s-ci-robot merged commit d817ab3 into kubernetes-sigs:main Apr 30, 2024
24 of 28 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.15 milestone Apr 30, 2024
@nojnhuh nojnhuh deleted the v2-e2e branch May 2, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants