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

SDK2: Update containerservice to v6 #3906

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

jaitaiwan
Copy link
Contributor

@jaitaiwan jaitaiwan commented Oct 17, 2024

Which issue this PR addresses:

Currently a shared rp deployment fails because the azure sdk's in use are out of support. This brings us back up to the latest version.

@jaitaiwan jaitaiwan force-pushed the jaitaiwan/ARO-11234 branch 3 times, most recently from 92e1bf3 to c905ee2 Compare October 24, 2024 23:53
Copy link

Please rebase pull request.

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Oct 24, 2024
@jaitaiwan jaitaiwan marked this pull request as ready for review October 24, 2024 23:57
@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Oct 24, 2024
@jaitaiwan jaitaiwan changed the title Jaitaiwan/aro 11234 SDK2: Update containerservice to v6 Oct 24, 2024
Copy link
Contributor

@kimorris27 kimorris27 left a comment

Choose a reason for hiding this comment

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

Mostly LGTM; I'm just requesting for the AKS SDK client to be moved to the track 2 directory and pointed out that the TODO comments can probably be removed.

Also: how'd you test this?

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

Please rebase pull request.

@jaitaiwan
Copy link
Contributor Author

Thanks for the review @kimorris27. We're planning on doing an integration test when all the track 2 PRs are ready by recreating the australiaeast environment (which is already broken and blocked by the need to go to track 2).

Apart from that, I haven't been able to come up with a good way to test it further.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Nov 5, 2024
@jaitaiwan
Copy link
Contributor Author

/azp run ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@kimorris27 kimorris27 left a comment

Choose a reason for hiding this comment

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

Makes sense! Since the PR touches pkg/env/core.go though, I'd like to see a successful E2E run before approving.

@kimorris27
Copy link
Contributor

/azp run e2e

Copy link

Azure Pipelines successfully started running 1 pipeline(s).


res, err := managedClustersClient.ListClusterAdminCredentials(ctx, aksResourceGroup, aksClusterName, "public")
res, err := managedClustersClient.ListClusterAdminCredentials(ctx, aksResourceGroup, aksClusterName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to delete "public"?

"github.com/Azure/go-autorest/autorest/to"
"go.uber.org/mock/gomock"
azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not a blocker for PR, but there's "k8s.io/utils/ptr" usages in other places.
We should discuss which we should use.

Comment on lines +97 to +126
if resultPage == nil {
t.Fatal(errors.New("result page is nil"))
}

hasMore := resultPage.More()
if !hasMore {
t.Fatal(errors.New("result page has no results"))
}

results, err := resultPage.NextPage(ctx)
if err != nil {
t.Fatal(err)
}
if len(results.Value) != len(managedClustersList) {
t.Fatal(errors.New("results page has an invalid number of results"))
}

if *results.Value[0].Name != *managedClustersList[0].Name {
t.Logf("expected %s to match %s", *results.Value[0].Name, *managedClustersList[0].Name)
t.Fatal(errors.New("expected name of first managed clusters list to match first page results"))
}

adminCredsResult, err := mcc.ListClusterAdminCredentials(ctx, "rp-eastus", "aro-ak-cluster-001")
if err != nil {
t.Fatal(err)
}

if len(adminCredsResult.CredentialResults.Kubeconfigs) != 1 {
t.Fatal(errors.New("invalid number of credentials returned"))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Do we want to exit the test when it fails? or just t.Fail or t.Error will do?

https://pkg.go.dev/testing#T.Fail
https://pkg.go.dev/testing#T.Fatal

@@ -75,12 +75,15 @@ func (c *core) Logger() *logrus.Entry {
}

func (c *core) NewLiveConfigManager(ctx context.Context) (liveconfig.Manager, error) {
msiAuthorizer, err := c.NewMSIAuthorizer(c.Environment().ResourceManagerScope)
tokenizer, err := c.NewMSITokenCredential()
Copy link
Collaborator

Choose a reason for hiding this comment

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

super nit: Should it be tokenizer or token? I guess token is better.

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