Skip to content

Commit

Permalink
chore: Set preserveUnknownFields: false to prevent mistake (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsmfm authored Sep 23, 2020
1 parent a96bbdb commit 4fded3d
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ all: controller image
codegen: mocks
./hack/update-codegen.sh
./hack/update-openapigen.sh
PATH=$$DIST_DIR:$$PATH go run ./hack/gen-crd-spec/main.go
PATH=${DIST_DIR}:$$PATH go run ./hack/gen-crd-spec/main.go

.PHONY: controller
controller: clean-debug
Expand Down
6 changes: 6 additions & 0 deletions hack/gen-crd-spec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func NewCustomResourceDefinition() []*extensionsobj.CustomResourceDefinition {
"controller-gen",
"paths=./pkg/apis/rollouts/...",
"crd:trivialVersions=true",
"crd:preserveUnknownFields=false",
"output:crd:stdout",
).Output()
if err != nil {
Expand All @@ -72,6 +73,11 @@ func NewCustomResourceDefinition() []*extensionsobj.CustomResourceDefinition {
// clean up stuff left by controller-gen
deleteFile("config/webhook/manifests.yaml")
deleteFile("config/webhook")
deleteFile("config/argoproj.io_analysisruns.yaml")
deleteFile("config/argoproj.io_analysistemplates.yaml")
deleteFile("config/argoproj.io_clusteranalysistemplates.yaml")
deleteFile("config/argoproj.io_experiments.yaml")
deleteFile("config/argoproj.io_rollouts.yaml")
deleteFile("config")

crds := []*extensionsobj.CustomResourceDefinition{}
Expand Down
2 changes: 2 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/analysis-run-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
shortNames:
- ar
singular: analysisrun
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
shortNames:
- at
singular: analysistemplate
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/cluster-analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
shortNames:
- cat
singular: clusteranalysistemplate
preserveUnknownFields: false
scope: Cluster
validation:
openAPIV3Schema:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/experiment-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
shortNames:
- exp
singular: experiment
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ spec:
shortNames:
- ro
singular: rollout
preserveUnknownFields: false
scope: Namespaced
subresources:
scale:
Expand Down
11 changes: 7 additions & 4 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
shortNames:
- ar
singular: analysisrun
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down Expand Up @@ -2824,6 +2825,7 @@ spec:
shortNames:
- at
singular: analysistemplate
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down Expand Up @@ -5556,6 +5558,7 @@ spec:
shortNames:
- cat
singular: clusteranalysistemplate
preserveUnknownFields: false
scope: Cluster
validation:
openAPIV3Schema:
Expand Down Expand Up @@ -8293,6 +8296,7 @@ spec:
shortNames:
- exp
singular: experiment
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down Expand Up @@ -10964,13 +10968,11 @@ spec:
name: Current
type: integer
- JSONPath: .status.updatedReplicas
description: Total number of non-terminated pods targeted by this rollout that
have the desired template spec
description: Total number of non-terminated pods targeted by this rollout that have the desired template spec
name: Up-to-date
type: integer
- JSONPath: .status.availableReplicas
description: Total number of available pods (ready for at least minReadySeconds)
targeted by this rollout
description: Total number of available pods (ready for at least minReadySeconds) targeted by this rollout
name: Available
type: integer
group: argoproj.io
Expand All @@ -10981,6 +10983,7 @@ spec:
shortNames:
- ro
singular: rollout
preserveUnknownFields: false
scope: Namespaced
subresources:
scale:
Expand Down
11 changes: 7 additions & 4 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
shortNames:
- ar
singular: analysisrun
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down Expand Up @@ -2824,6 +2825,7 @@ spec:
shortNames:
- at
singular: analysistemplate
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down Expand Up @@ -5556,6 +5558,7 @@ spec:
shortNames:
- cat
singular: clusteranalysistemplate
preserveUnknownFields: false
scope: Cluster
validation:
openAPIV3Schema:
Expand Down Expand Up @@ -8293,6 +8296,7 @@ spec:
shortNames:
- exp
singular: experiment
preserveUnknownFields: false
scope: Namespaced
subresources: {}
validation:
Expand Down Expand Up @@ -10964,13 +10968,11 @@ spec:
name: Current
type: integer
- JSONPath: .status.updatedReplicas
description: Total number of non-terminated pods targeted by this rollout that
have the desired template spec
description: Total number of non-terminated pods targeted by this rollout that have the desired template spec
name: Up-to-date
type: integer
- JSONPath: .status.availableReplicas
description: Total number of available pods (ready for at least minReadySeconds)
targeted by this rollout
description: Total number of available pods (ready for at least minReadySeconds) targeted by this rollout
name: Available
type: integer
group: argoproj.io
Expand All @@ -10981,6 +10983,7 @@ spec:
shortNames:
- ro
singular: rollout
preserveUnknownFields: false
scope: Namespaced
subresources:
scale:
Expand Down

0 comments on commit 4fded3d

Please sign in to comment.