agones icon indicating copy to clipboard operation
agones copied to clipboard

Add OpenAPI x-kubernetes-patch keys for patching CRDs

Open clrxbl opened this issue 1 year ago • 8 comments

Is your feature request related to a problem? Please describe. I am using Kustomize to patch Agones Fleets. If I attempt to do this right now without a custom OpenAPI schema, it will simply replace what I'm attempting to patch instead of merging.

Describe the solution you'd like Add x-kubernetes-patch keys to allow merging e.g. containers, initContainers and more.

Describe alternatives you've considered I can get this working locally by exporting the OpenAPI schema and adding the keys myself.

Additional context N/A

clrxbl avatar Apr 19 '23 17:04 clrxbl

I've been looking into this and looks like the keys are specifically being removed: https://github.com/googleforgames/agones/blob/9e4400b213e970db7021ac7f7c930e63fb7b8107/build/scripts/k8s-export-openapi/main.go#L221-L228 Why is this the case?

vytskalt avatar Nov 13 '23 06:11 vytskalt

I'm going back through history (since this was done a while ago), but as far as I can tell, those properties are not supported on CRDs, so we strip them off sub-resources, such as PodTemplateSpec.

Happy to be proven wrong however!

markmandel avatar Nov 13 '23 21:11 markmandel

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

github-actions[bot] avatar May 15 '24 10:05 github-actions[bot]

Just checking in to see if there is more we can do here, or if my comment above about non-support on CRDs makes this a non-starter?

markmandel avatar May 23 '24 16:05 markmandel

Just checking in to see if there is more we can do here, or if my comment above about non-support on CRDs makes this a non-starter?

I've been using patch merge keys for the past year for the past year or so without any issues on GameServer CRDs with Kustomize. I just had to end up exporting CRDs, manually modifying it to add the keys and passing it along to Kustomize to make it work.

clrxbl avatar May 23 '24 16:05 clrxbl

Sounds like it's worth a review!

Happy to also accept PRs with the changes to our tools and accompanying exports.

markmandel avatar May 23 '24 18:05 markmandel

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

github-actions[bot] avatar Jul 01 '24 10:07 github-actions[bot]

Moving to awaiting-maintainer since I do want to see this tackled at some point.

markmandel avatar Jul 02 '24 17:07 markmandel