-
Notifications
You must be signed in to change notification settings - Fork 181
WIP: use server-side-apply to update client-ca bundle #1918
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
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sanchezl 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 |
/test e2e-gcp-operator |
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.
Is this fixing an issue? It'd be ideal to have a regression test alongside (I see the PR is marked WIP but I thought I'd ask to better understand the context myself).
if (result != nil && result.ResourceVersion == "1") || creationRequired { | ||
// either the configmap was created or we expected it to be created and it failed | ||
resourcehelper.ReportCreateEvent(recorder, caBundleConfigMap, err) | ||
} else { | ||
// an existing configmap was updated, even if we expected it to be created | ||
resourcehelper.ReportUpdateEvent(recorder, caBundleConfigMap, err) | ||
} |
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.
IIRC apply responses will have HTTP status 201 if it caused the resource to be created and 200 otherwise. That would be 100% correct for cases where you get a response vs. a prediction based on the cached state.
tmp := &metav1.ObjectMeta{} | ||
additionalAnnotations.EnsureTLSMetadataUpdate(tmp) | ||
patch.WithAnnotations(tmp.Annotations) |
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.
We're likely to make a mistake eventually if we need to keep this in sync with CombineCABundleConfigMapsOptimistically. Can we build the apply configuration purely from requiredConfigMap
?
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 agree. I would image we would refactor the helpers to be a more appropriate, but for this POC just 'hacked' it in.
@sanchezl: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
No description provided.