Skip to content

Queue resyncs in ShouldEnqueueContentChange #1302

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ConnorJC3
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Resyncs are sent to an informer's update handler via a no-diff (i.e. new and old are identical) update. Currently, ShouldEnqueueContentChange will incorrectly return false in this case, as it detects no change.

We can reliably determine if an update is caused by a resync by comparing the resource versions, as any normal update will cause these to differ. This is also how the external-attacher handles this case in its similar shouldEnqueueVAChange: https://github.com/kubernetes-csi/external-attacher/blob/c8f0c14a7d985c33d8fe80a55ebb46a1ee3df877/pkg/controller/controller.go#L288-L291

Which issue(s) this PR fixes:

Partial fix of #1258

Special notes for your reviewer:

N/A

Does this PR introduce a user-facing change?:

Fix a bug preventing VolumeSnapshotContent objects from being re-synced

@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 May 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ConnorJC3
Once this PR has been reviewed and has the lgtm label, please assign xing-yang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 20, 2025
@ElijahQuinones
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2025
@akalenyu
Copy link
Contributor

looks great! I think it makes more sense than #1259
/lgtm

@k8s-ci-robot
Copy link
Contributor

@akalenyu: changing LGTM is restricted to collaborators

In response to this:

looks great! I think it makes more sense than #1259
/lgtm

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-sigs/prow repository.

@@ -693,7 +697,7 @@ func ShouldEnqueueContentChange(old *crdv1.VolumeSnapshotContent, new *crdv1.Vol
if sanitized.Annotations == nil {
sanitized.Annotations = map[string]string{}
}
for annotation, _ := range sidecarControlledContentAnnotations {
for annotation := range sidecarControlledContentAnnotations {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change (and the similar one below) was caused by gofmt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants