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 cluster-api-provider-last-applied-tags-on-volumes to recalculate the value on each reconcile #4531

Conversation

cnmcavoy
Copy link
Contributor

What type of PR is this?
/bug

What this PR does / why we need it: Fixes an issue with the value of the sigs.k8s.io/cluster-api-provider-aws-last-applied-tags annotation growing to an unbounded size, due to re-use of it's previous state. We only need to persist information about volumes currently attached, so recomputing and clearing the annotation value is sufficient.

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

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Fixed a bug with the `sigs.k8s.io/cluster-api-provider-aws-last-applied-tags` annotation that could cause excessive metadata values on AWSMachines. 

…the annotation value each reconcile instead of reusing the previous value
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Sep 28, 2023
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 28, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 28, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @cnmcavoy. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@Skarlso
Copy link
Contributor

Skarlso commented Sep 28, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 28, 2023
@Ankitasw
Copy link
Member

@cnmcavoy off-topic, would be good if you applied for membership of kubernetes-sigs org. Just noticed that you are not 😅 since you have made significant contributions in CAPA, it would be good to be added as a member.

@Ankitasw Ankitasw added the kind/bug Categorizes issue or PR as related to a bug. label Sep 29, 2023
@Ankitasw
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-blocking

@Ankitasw
Copy link
Member

/lgtm
/approve

Good find @cnmcavoy 👍

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitasw

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 29, 2023
@k8s-ci-robot k8s-ci-robot merged commit 0c5e997 into kubernetes-sigs:main Sep 29, 2023
21 checks passed
@cnmcavoy
Copy link
Contributor Author

@cnmcavoy off-topic, would be good if you applied for membership of kubernetes-sigs org. Just noticed that you are not 😅 since you have made significant contributions in CAPA, it would be good to be added as a member.

kubernetes/org#4474 😅

@Ankitasw
Copy link
Member

@cnmcavoy oopsie 😅

@Ankitasw
Copy link
Member

Ankitasw commented Oct 3, 2023

/cherry-pick release-2.2

@k8s-infra-cherrypick-robot

@Ankitasw: #4531 failed to apply on top of branch "release-2.2":

Applying: Fix cluster-api-provider-last-applied-tags-on-volumes to recalculate the annotation value each reconcile instead of reusing the previous value
Using index info to reconstruct a base tree...
M	controllers/awsmachine_controller.go
Falling back to patching base and 3-way merge...
Auto-merging controllers/awsmachine_controller.go
CONFLICT (content): Merge conflict in controllers/awsmachine_controller.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 Fix cluster-api-provider-last-applied-tags-on-volumes to recalculate the annotation value each reconcile instead of reusing the previous value
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-2.2

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. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWSMachine metadata can exceed safe sizes due to cluster-api-provider-aws-last-applied-tags values
5 participants