Skip to content

Commit

Permalink
Do not validate 'volumes' until only k8s 1.17+ are supported
Browse files Browse the repository at this point in the history
Signed-off-by: Anderson Silva <[email protected]>
  • Loading branch information
anderson4u2 committed Apr 2, 2021
1 parent 858b867 commit 43c3589
Show file tree
Hide file tree
Showing 8 changed files with 8,494 additions and 18,331 deletions.
15 changes: 9 additions & 6 deletions hack/gen-crd-spec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ func removeK8S118Fields(un *unstructured.Unstructured) {
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.initContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.ephemeralContainers[].resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.ephemeralContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.requests")
// Replace this with "spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.{limits/requests}"
// when it's ok to only support k8s 1.17+
setValidationOverride(un, preserveUnknownFields, "spec.template.spec.volumes")
validation, _, _ := unstructured.NestedMap(un.Object, "spec", "validation", "openAPIV3Schema")
removeFieldHelper(validation, "x-kubernetes-list-type")
removeFieldHelper(validation, "x-kubernetes-list-map-keys")
Expand All @@ -275,8 +276,9 @@ func removeK8S118Fields(un *unstructured.Unstructured) {
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.initContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.ephemeralContainers[].resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.ephemeralContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.requests")
// Replace this with "spec.templates[].template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.{limits/requests}"
// when it's ok to only support k8s 1.17+
setValidationOverride(un, preserveUnknownFields, "spec.templates[].template.spec.volumes")
validation, _, _ := unstructured.NestedMap(un.Object, "spec", "validation", "openAPIV3Schema")
removeFieldHelper(validation, "x-kubernetes-list-type")
removeFieldHelper(validation, "x-kubernetes-list-map-keys")
Expand All @@ -288,8 +290,9 @@ func removeK8S118Fields(un *unstructured.Unstructured) {
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.initContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.ephemeralContainers[].resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.ephemeralContainers[].resources.requests")
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.limits")
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.requests")
// Replace this with "spec.metrics[].provider.job.spec.template.spec.volumes[].ephemeral.volumeClaimTemplate.spec.resources.{limits/requests}"
// when it's ok to only support k8s 1.17+
setValidationOverride(un, preserveUnknownFields, "spec.metrics[].provider.job.spec.template.spec.volumes")
validation, _, _ := unstructured.NestedMap(un.Object, "spec", "validation", "openAPIV3Schema")
removeFieldHelper(validation, "x-kubernetes-list-type")
removeFieldHelper(validation, "x-kubernetes-list-map-keys")
Expand Down
658 changes: 1 addition & 657 deletions manifests/crds/analysis-run-crd.yaml

Large diffs are not rendered by default.

658 changes: 1 addition & 657 deletions manifests/crds/analysis-template-crd.yaml

Large diffs are not rendered by default.

658 changes: 1 addition & 657 deletions manifests/crds/cluster-analysis-template-crd.yaml

Large diffs are not rendered by default.

658 changes: 1 addition & 657 deletions manifests/crds/experiment-crd.yaml

Large diffs are not rendered by default.

658 changes: 1 addition & 657 deletions manifests/crds/rollout-crd.yaml

Large diffs are not rendered by default.

11,760 changes: 4,240 additions & 7,520 deletions manifests/install.yaml

Large diffs are not rendered by default.

11,760 changes: 4,240 additions & 7,520 deletions manifests/namespace-install.yaml

Large diffs are not rendered by default.

0 comments on commit 43c3589

Please sign in to comment.