Skip to content

Commit

Permalink
ObjectMeta should use additionalProperties
Browse files Browse the repository at this point in the history
Rather than using `x-kubernetes-preserve-unknown-fields` which allows
both keys and values of any type, we should use `additionalProperties`
which only allows a specified type (in this case "string") for keys and
values.

Better validation!
  • Loading branch information
markmandel committed Jan 14, 2021
1 parent 7a4d1bc commit 3dea765
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions install/helm/agones/templates/crds/_gameserverspecschema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ properties:
properties:
labels:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalProperties:
type: string
annotations:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalProperties:
type: string
{{- end}}
spec:
type: object
Expand Down

0 comments on commit 3dea765

Please sign in to comment.