-
Notifications
You must be signed in to change notification settings - Fork 562
Catalog switcher #2281
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
Catalog switcher #2281
Conversation
Hi @jchunkins. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
658646e
to
295ba3e
Compare
/ok-to-test |
dfafccd
to
57ac4f4
Compare
57ac4f4
to
1c7258d
Compare
/approve |
/hold |
// of a value in the slice means that the template was either not found in the cache or its value has not been | ||
// fetched yet). Providing an empty catalogImageTemplate results in empty processedCatalogImageTemplate and | ||
// zero length unresolvedTemplates | ||
func ReplaceTemplates(catalogImageTemplate string) (processedCatalogImageTemplate string, unresolvedTemplates []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the dynamic gvk templating, this could probably be simplified to a call to the stdlib template package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also: since any unresolved components should mean the image reference is invalid, I'm not sure I get the value in returning a partially-resolved reference and a list of the unresolved ones: why not just return an error with the missing values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unresolvedTemplates are used to inform the user in a message about exactly what template that was not resolvable. It is used in messages exposed in both the log and the status conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the processedCatalogImageTemplate is used to inform the user of what the template looks like in the status conditions. It helps the user see what's wrong by looking at the message AND what the templating code computed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to address the security shortcomings of the GVK feature in the future, so I'd like to keep things as close to "working" as possible.
448a052
to
36c7f64
Compare
It looks like |
5b0e169
to
25bdeb6
Compare
It's a well known flake, I restarted it |
- implements catalog switching proposal See https://github.com/operator-framework/enhancements/blob/master/enhancements/automatic-catalog-switching-annotations.md - picks up v0.10.3 - change sed command in copy_crds.sh to be posix compliant The command + in sed is non-portable. The posix compliant version of this command is {1,} This change allows this script to run on a mac too (which uses BSD sed) See https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification Note: GVK was implemented but disabled due to security concerns. Future versions will address these concerns Signed-off-by: John Hunkins <[email protected]>
- reorganize imports - change logging common case to debug Signed-off-by: John Hunkins <[email protected]>
- this is the commit that should be reviewed later when it comes time to re-enable the GVK code Signed-off-by: John Hunkins <[email protected]>
Signed-off-by: John Hunkins <[email protected]>
- fix names that don't match Golang convention - fix misspelled package name - return nil for sync function casting Signed-off-by: John Hunkins <[email protected]>
Signed-off-by: John Hunkins <[email protected]>
- clean up every instance of the GVK templating feature - add last minute change for RWMutex instead of Mutex - this is the second commit that should be reviewed later when it comes time to re-enable the GVK code Signed-off-by: John Hunkins <[email protected]>
cc0db6b
to
c6b1437
Compare
Signed-off-by: John Hunkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking really good. thank you for addressing all the feedback so far! I think we're in the home stretch.
- update logging for clarity - clean up code blocks - refactor catalogsource helper functions: - remove mutex - remove two step get/update* in preference to update* even though this may result in more "the object has been modified" errors - rename helper functions to clarify usage - clarify the update helper function docs Signed-off-by: John Hunkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold cancel
/lgtm
@jchunkins thanks for sticking with this through all the feedback!
I'd be interested in any thoughts you have about your experience contributing; e.g. good, bad, suggestions. Maybe we can continue in slack.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jchunkins, kevinrizza, njhale 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 |
Description of the change:
Implementation of catalog switching enhancement proposal
Quick check for e2e test:
Motivation for the change:
See summary and motivation of enhancement proposal.
Reviewer Checklist
/doc