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

test(e2e): simplify cluster parameter extraction #5742

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

cameronmeissner
Copy link
Collaborator

@cameronmeissner cameronmeissner commented Feb 4, 2025

What type of PR is this?

What this PR does / why we need it:

right now we extract all cluster params except for the bootstrap token using a privileged pod running a node of the e2e cluster's system pool - this is an error prone process and requires at least one node to be running in the system pool at the time of test execution. it turns out we can get the cluster CA certificate data and cluster fqdn directly from the ListClusterAdminCredentials API on the AKS ARM client instead

further, this PR removes the API server cert and client key cluster parameters, as they aren't strictly needed with how we bootstrap nodes for e2e tests

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

@cameronmeissner cameronmeissner changed the title test(e2e): simplify e2e cluster parameter extraction test(e2e): simplify cluster parameter extraction Feb 4, 2025
@cameronmeissner
Copy link
Collaborator Author

linux e2es failing due to unrelated issues
windows e2e all green

}, nil
}

func extractClusterParameters(ctx context.Context, t *testing.T, kube *Kubeclient, cluster *armcontainerservice.ManagedCluster) (*ClusterParams, error) {
resp, err := config.Azure.AKS.ListClusterAdminCredentials(ctx, config.ResourceGroupName, *cluster.Name, nil)
Copy link
Contributor

@lilypan26 lilypan26 Feb 4, 2025

Choose a reason for hiding this comment

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

nit: ik we always set it, but should we include a nil check for cluster.Name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the cluster object comes from a call to AKS.Get/CreateOrUpdate, so it shouldn't ever be the case that we make it this far in test execution and Name is nil without an error having previously occurring

Copy link
Contributor

Choose a reason for hiding this comment

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

the result will be the same whether you check it for nil or not - a test will fail

Copy link
Contributor

Choose a reason for hiding this comment

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

A kube client is already passed to this function.
Does it mean we already loaded credentials before? Are we doing it second time?

The change makes sense, just wonder if we can optimize it a one step further

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah good point, and unfortunately I saw this after I pressed the merge button :D

@cameronmeissner cameronmeissner merged commit fae8d7b into master Feb 5, 2025
16 checks passed
@cameronmeissner cameronmeissner deleted the cameissner/e2e-params branch February 5, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants