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

ignore AKS user-assigned ClientID/PrincipalID in diff #3962

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Sep 6, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it: This fixes a bug causing an endless reconciliation of AzureManagedControlPlane with spec.identity.type set to UserAssigned because of a continuous diff like this:

&armcontainerservice.ManagedCluster{
  	Location:         nil,
  	ExtendedLocation: nil,
  	Identity: &armcontainerservice.ManagedClusterIdentity{
  		DelegatedResources: nil,
  		Type:               &"UserAssigned",
  		UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
  			"/subscriptions/<sub>/resourcegroups/<group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<name>": &{
- 				ClientID:    nil,
+ 				ClientID:    &"00000000-0000-0000-00000-00000000000",
- 				PrincipalID: nil,
+ 				PrincipalID: &"00000000-0000-0000-00000-00000000000",
  			},
  		},
  		PrincipalID: nil,
  		TenantID:    nil,
  	},
  	Properties: &{AutoScalerProfile: &{}, IdentityProfile: {"kubeletidentity": &{ResourceID: &"/subscriptions/<sub>/resourcegrou"...}}, KubernetesVersion: &"1.26.3", NetworkProfile: &{}, ...},
  	SKU:        &{Name: &"Base", Tier: &"Free"},
  	... // 5 identical fields
  }

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

Special notes for your reviewer:

  • cherry-pick candidate <-- I'm guessing the SDK v1 implementation on the release branches has the same bug.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Fixed a bug causing AzureManagedControlPlanes with `spec.identity.type` set to `UserAssigned` to needlessly reconcile constantly.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 6, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 6, 2023
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

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

LGTM label has been added.

Git tree hash: 6930a10862232875232ce0742919b6a66dfe1dfe

@CecileRobertMichon
Copy link
Contributor

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot

@CecileRobertMichon: once the present PR merges, I will cherry-pick it on top of release-1.10 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

@mboersma mboersma 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

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mboersma

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 Sep 6, 2023
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.13% 🎉

Comparison is base (803f6dd) 56.04% compared to head (3a924b6) 56.17%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3962      +/-   ##
==========================================
+ Coverage   56.04%   56.17%   +0.13%     
==========================================
  Files         190      190              
  Lines       19480    19450      -30     
==========================================
+ Hits        10917    10926       +9     
+ Misses       7939     7899      -40     
- Partials      624      625       +1     
Files Changed Coverage Δ
azure/services/managedclusters/spec.go 51.22% <100.00%> (+0.72%) ⬆️

... and 6 files with indirect coverage changes

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

@k8s-ci-robot k8s-ci-robot merged commit 692b7be into kubernetes-sigs:main Sep 6, 2023
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone Sep 6, 2023
@k8s-infra-cherrypick-robot

@CecileRobertMichon: #3962 failed to apply on top of branch "release-1.10":

Applying: ignore AKS user-assigned ClientID/PrincipalID in diff
Using index info to reconstruct a base tree...
M	azure/services/managedclusters/spec.go
M	azure/services/managedclusters/spec_test.go
Falling back to patching base and 3-way merge...
Auto-merging azure/services/managedclusters/spec_test.go
CONFLICT (content): Merge conflict in azure/services/managedclusters/spec_test.go
Auto-merging azure/services/managedclusters/spec.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 ignore AKS user-assigned ClientID/PrincipalID in diff
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Sep 6, 2023

@CecileRobertMichon: #3962 failed to apply on top of branch "release-1.10":

#3963

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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants