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

fix NodeTaints and NodeLabels return type for AzureManagedMachinePools #4122

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

nawazkh
Copy link
Member

@nawazkh nawazkh commented Oct 12, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:

  • CAPZ will send out the below return types to AKS API so that the AKS API clears-out NodeLabels and NodeTaints respectively.
    • an empty Map when the NodeLabels are deleted.
    • an empty pointer array when the NodeTaints are deleted.

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 #4116

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

fix NodeTaints and NodeLabels return type for AzureManagedMachinePools

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 12, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 12, 2023
@nojnhuh
Copy link
Contributor

nojnhuh commented Oct 12, 2023

Does this address #4116?

Copy link
Contributor

@nojnhuh nojnhuh left a comment

Choose a reason for hiding this comment

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

I think this is correct. Could you please fix up this PR to be more descriptive and add tests? e2e tests might also need to be updated.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 12, 2023

Thanks, Jon!
I am trying to reproduce this, will fix up the description and add tests after that.
I think Jack has an improvement to build upon: #4124

@nawazkh nawazkh force-pushed the agentpools_labels_fix branch 2 times, most recently from 704441f to 9c3eba1 Compare October 12, 2023 22:23
@nawazkh nawazkh marked this pull request as draft October 12, 2023 22:23
@nawazkh
Copy link
Member Author

nawazkh commented Oct 12, 2023

Converted to draft so that I don't trigger any more tests on an in progress PR.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Oct 12, 2023
@nawazkh nawazkh marked this pull request as ready for review October 12, 2023 23:29
@nawazkh nawazkh changed the title [WIP] can CAPZ overwrite the values to nil using Azure SDK? fix NodeTaints and NodeLabels return type for AzureManagedMachinePools Oct 12, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 12, 2023
@nawazkh
Copy link
Member Author

nawazkh commented Oct 12, 2023

/cherry-pick release-1.11

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.11

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.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 12, 2023

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot

@nawazkh: 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.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 12, 2023

/cc @jackfrancis @CecileRobertMichon

@nojnhuh
Copy link
Contributor

nojnhuh commented Oct 13, 2023

@nawazkh When this PR is ready for review please mark it as such in the project board.

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 Oct 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: edf506c508359320c22efdbf231513f752c30b24

Copy link
Contributor

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

"foo": ptr.To("bar"),
"hello": ptr.To("world"),
},
expected: map[string]*string{},
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

@jackfrancis Are you still taking on updating the e2e tests?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nojnhuh

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 Oct 13, 2023
@nawazkh
Copy link
Member Author

nawazkh commented Oct 16, 2023

/test pull-cluster-api-provider-azure-e2e-aks

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

@k8s-ci-robot k8s-ci-robot merged commit b7de934 into kubernetes-sigs:main Oct 16, 2023
20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 16, 2023
@k8s-infra-cherrypick-robot

@nawazkh: #4122 failed to apply on top of branch "release-1.11":

Applying: Send empty type to AKS API when deleting NodeLabels, NodeTaints
Using index info to reconstruct a base tree...
M	azure/services/agentpools/spec.go
M	azure/services/agentpools/spec_test.go
Falling back to patching base and 3-way merge...
Auto-merging azure/services/agentpools/spec_test.go
CONFLICT (content): Merge conflict in azure/services/agentpools/spec_test.go
Auto-merging azure/services/agentpools/spec.go
CONFLICT (content): Merge conflict in azure/services/agentpools/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 Send empty type to AKS API when deleting NodeLabels, NodeTaints
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.11

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.

@k8s-infra-cherrypick-robot

@nawazkh: #4122 failed to apply on top of branch "release-1.10":

Applying: Send empty type to AKS API when deleting NodeLabels, NodeTaints
Using index info to reconstruct a base tree...
M	azure/services/agentpools/spec.go
M	azure/services/agentpools/spec_test.go
Falling back to patching base and 3-way merge...
Auto-merging azure/services/agentpools/spec_test.go
CONFLICT (content): Merge conflict in azure/services/agentpools/spec_test.go
Auto-merging azure/services/agentpools/spec.go
CONFLICT (content): Merge conflict in azure/services/agentpools/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 Send empty type to AKS API when deleting NodeLabels, NodeTaints
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

nojnhuh commented Oct 16, 2023

@nawazkh Are we sure this bug affects 1.10? Or do we know that this isn't related to the SDK v2 migration?

@nawazkh nawazkh deleted the agentpools_labels_fix branch October 16, 2023 18:50
@nawazkh
Copy link
Member Author

nawazkh commented Oct 16, 2023

Are we sure this bug affects 1.10? Or do we know that this isn't related to the SDK v2 migration?

Confirming. Will update in a bit.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 16, 2023

I see the endless reconciliation on release-1.10 as well. I believe we need this fix on release-1.10.
The cluster is still up in my sub, I see the below in my diff.

 containerservice.AgentPool{
  	Response: {},
  	ManagedClusterAgentPoolProfileProperties: &containerservice.ManagedClusterAgentPoolProfileProperties{
  		... // 27 identical fields
  		SpotMaxPrice:              nil,
  		Tags:                      nil,
- 		NodeLabels:                nil,
+ 		NodeLabels:                map[string]*string{"test": &"test"},
  		NodeTaints:                nil,
  		ProximityPlacementGroupID: nil,
  		... // 7 identical fields
  	},
  	ID:   nil,
  	Name: nil,
  	Type: nil,
  }

@nawazkh
Copy link
Member Author

nawazkh commented Oct 17, 2023

I should now be able to cherry-pick this PR onto release-1.11 since #4140 (comment) got merged onto release-1.11.

/cherry-pick release-1.11

@k8s-infra-cherrypick-robot

@nawazkh: new pull request created: #4147

In response to this:

I should now be able to cherry-pick this PR onto release-1.11 since #4140 (comment) got merged onto release-1.11.

/cherry-pick release-1.11

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.

@nawazkh
Copy link
Member Author

nawazkh commented Oct 18, 2023

I should be able to cherry-pick onto release-1.10 branch now that #4127 has merged.

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot

@nawazkh: #4122 failed to apply on top of branch "release-1.10":

Applying: Send empty type to AKS API when deleting NodeLabels, NodeTaints
Using index info to reconstruct a base tree...
M	azure/services/agentpools/spec.go
M	azure/services/agentpools/spec_test.go
Falling back to patching base and 3-way merge...
Auto-merging azure/services/agentpools/spec_test.go
Auto-merging azure/services/agentpools/spec.go
CONFLICT (content): Merge conflict in azure/services/agentpools/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 Send empty type to AKS API when deleting NodeLabels, NodeTaints
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:

I should be able to cherry-pick onto release-1.10 branch now that #4127 has merged.

/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.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
6 participants