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

feat(overrides): add JSON patch for deployments #875

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

Conversation

andrewbelu
Copy link

Add additional functionality to override spec to allow for JSON patching. This is to allow users to patch arrays inside deployment overrides, as this functionality is not possible with StrategicPatchMerge. Follows similar functionality to what Kustomize provides.

@andrewbelu
Copy link
Author

Addresses #793

Copy link
Owner

@alexandrevilain alexandrevilain left a comment

Choose a reason for hiding this comment

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

Thanks for this awesome contribution.
I really like this!
JsonPatch is way more common than overrides.
Both are maybe too much.

Maybe we can provide this feature for every components (adminstools, services, monitoring, istio, ...) ? In a next PR. This is already a good start!

errs = append(errs,
field.Forbidden(
field.NewPath("spec", "services", "overrides", "deployment", "jsonPatch"),
fmt.Sprintf("Can't set JsonPatch when Spec is set on Deployment override"),
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
fmt.Sprintf("Can't set JsonPatch when Spec is set on Deployment override"),
"Can't set JsonPatch when Spec is set on Deployment override",

No need for Sprintf :)

errs = append(errs,
field.Forbidden(
field.NewPath("spec", "services", string(service), "overrides", "deployment", "jsonPatch"),
fmt.Sprintf("Can't set JsonPatch when Spec is set on Deployment override"),
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
fmt.Sprintf("Can't set JsonPatch when Spec is set on Deployment override"),
"Can't set JsonPatch when Spec is set on Deployment override",

Copy link

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.

2 participants