-
Notifications
You must be signed in to change notification settings - Fork 80
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
✨ Allow JSON merge patches for provider manifests #280
✨ Allow JSON merge patches for provider manifests #280
Conversation
@damdo this might also be interesting to you |
cfe28fc
to
522a16b
Compare
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.
Thanks for the PR @alexander-demicev!
Few suggestions inline from my side:
@@ -164,7 +240,16 @@ func (dst *InfrastructureProvider) ConvertFrom(srcRaw conversion.Hub) error { | |||
panic("expected to get an of object of type v1alpha2.InfrastructureProvider") | |||
} | |||
|
|||
return Convert_v1alpha2_InfrastructureProvider_To_v1alpha1_InfrastructureProvider(src, dst, nil) | |||
if err := Convert_v1alpha2_InfrastructureProvider_To_v1alpha1_InfrastructureProvider(src, dst, nil); err != nil { |
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.
looks like we do not have a conversion for addon provider? Is it because that was introduced in v1alpha2?
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.
no, we don't have addons in v1alpha1
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.
yeah that is what I actually meant as well
- kind: ServiceAccount | ||
name: serviceaccount-name | ||
namespace: namespace-name |
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.
probably you don't need this as it is already in the testObjectsToPatchYaml
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.
list of service accounts is an array so when merging it erases all previous values instead of appending
b69f7cf
to
392746f
Compare
/retest |
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.
/approve
Signed-off-by: alexander-demicev <[email protected]>
Signed-off-by: alexander-demicev <[email protected]>
Signed-off-by: alexander-demicev <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Fedosin 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 |
392746f
to
5c0a765
Compare
Signed-off-by: alexander-demicev <[email protected]>
@alexander-demicev: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
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.
/lgtm
LGTM label has been added. Git tree hash: 91ac7ab0f24dea11cd5ef7edd757d7b5ad37980c
|
What this PR does / why we need it:
Allow JSON merge patches for provider manifests, this makes it possible to modify provider manifests consistently across releases, for example, if the user needs to change labels/annotations on objects, example usage:
As a result of this patch, all services from this provider will get an additional label. There also filtering based on API version, namespace, and name, all described in the docs update.
Code for applying patches is similar to kind https://github.com/kubernetes-sigs/kind/tree/main/pkg/internal/patch but modified for usage in CAPI operator
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 #