serving icon indicating copy to clipboard operation
serving copied to clipboard

Add patch support (with merge strategy) for containers and env elements in the OpenAPI spec

Open idofl opened this issue 1 year ago • 0 comments

/area API /kind spec

Describe the feature

When using kustomize on a knative yaml (e.g. to create a Cloud Run service), patching env elements from multiple yaml files causes the elements to be replaced instead of being merged. To support merging env elements, as well as other array elements, we need to add x-kubernetes-patch-* attributes to the openAPI spec.

For example:

"env": {
  "description": "List of environment variables to set in the container.\nCannot be updated.",
  "items": {},
  "type": "array",
  "x-kubernetes-patch-merge-key": "name",
  "x-kubernetes-patch-strategy": "merge"
},

idofl avatar Jul 28 '24 08:07 idofl