Skip to content

Commit

Permalink
Add x-kubernetes-preserve-unknown-fields for ignition
Browse files Browse the repository at this point in the history
This allows MCC/MCD to validate the ignition section instead, much
like we've always done. Otherwise, any non-valid ignition section
will instead get pruned by the validation.

A bit more background: for oc explain to work, we need to have

preserveUnknownFields: false

which means all fields not defined by the crd schema will be pruned
upon generation of the CR. Since we only define ignition sections
that are allowed, an invalid ignition spec field will simply get
removed when the machineconfig is created. Adding the flag tells
validation that anything under Config is allowed, and we will let
MCC/MCD do the validation instead, like we do today.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
  • Loading branch information
yuqi-zhang authored and openshift-cherrypick-robot committed Feb 27, 2020
1 parent f63de12 commit 35995b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifests/machineconfig.crd.yaml
Expand Up @@ -66,6 +66,7 @@ spec:
config:
description: Config is a Ignition Config object.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- ignition
properties:
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/assets/bindata.go
Expand Up @@ -1324,6 +1324,7 @@ spec:
config:
description: Config is a Ignition Config object.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- ignition
properties:
Expand Down

0 comments on commit 35995b9

Please sign in to comment.