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: index readiness trackers by GK (not GVK) #2635

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

davis-haba
Copy link
Contributor

Signed-off-by: davis-haba [email protected]

What this PR does / why we need it:

Readiness tracking for the AssignImage mutator was not working properly because the generic Mutation controller was hard coded to use version v1 to look up its tracker, however AssignImage is still in v1alpha1.

Indexing trackers by version is unnecessary. The same tracker can be used to track resources of the same GK but different versions, with no impact to the current behavior.

Fixes #2634

Why not change objKey struct to store GK instead of GVK? This presents some complications. objKey is not strictly being used as a key, but also as a data store to denote a list of GVK's to watch. These use cases would have to be decoupled, which is a much more significant refactor than the change proposed here.

@davis-haba davis-haba requested a review from maxsmythe March 23, 2023 00:59
@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2023

Codecov Report

Patch coverage: 85.71% and project coverage change: +0.10 🎉

Comparison is base (30eaf1b) 53.19% compared to head (e442ff1) 53.29%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2635      +/-   ##
==========================================
+ Coverage   53.19%   53.29%   +0.10%     
==========================================
  Files         120      120              
  Lines       10594    10594              
==========================================
+ Hits         5635     5646      +11     
+ Misses       4522     4513       -9     
+ Partials      437      435       -2     
Flag Coverage Δ
unittests 53.29% <85.71%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/readiness/ready_tracker.go 69.64% <85.71%> (+1.27%) ⬆️

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for fixing this!

@maxsmythe maxsmythe requested review from ritazh and sozercan March 24, 2023 01:55
@sozercan sozercan added this to the v3.12.0 RC milestone Mar 27, 2023
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the PR!

@ritazh ritazh merged commit 73d6a17 into open-policy-agent:master Mar 27, 2023
davis-haba added a commit to davis-haba/gatekeeper that referenced this pull request Mar 31, 2023
salaxander pushed a commit to salaxander/gatekeeper that referenced this pull request Apr 5, 2023
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.

Readiness tracker does not acknowledge AssignImage if resource exists prior to control plane bootstrapping
5 participants