diff --git a/assets/rancher-monitoring/rancher-monitoring-crd-100.0.0+up14.5.0.tgz b/assets/rancher-monitoring/rancher-monitoring-crd-100.0.0+up14.5.0.tgz index 61de14dc1..6aec60987 100644 Binary files a/assets/rancher-monitoring/rancher-monitoring-crd-100.0.0+up14.5.0.tgz and b/assets/rancher-monitoring/rancher-monitoring-crd-100.0.0+up14.5.0.tgz differ diff --git a/charts/rancher-monitoring/rancher-monitoring-crd/100.0.0+up14.5.0/templates/jobs.yaml b/charts/rancher-monitoring/rancher-monitoring-crd/100.0.0+up14.5.0/templates/jobs.yaml index a668d2989..acdd1138f 100644 --- a/charts/rancher-monitoring/rancher-monitoring-crd/100.0.0+up14.5.0/templates/jobs.yaml +++ b/charts/rancher-monitoring/rancher-monitoring-crd/100.0.0+up14.5.0/templates/jobs.yaml @@ -30,10 +30,11 @@ spec: {{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }} {{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }} if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then - patch="{\"spec\": {\"preserveUnknownFields\": false}}"; - if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}' 2>&1)" ]]; then - patch="{\"spec\": {\"preserveUnknownFields\": false, \"versions\": [{\"name\": \"v1\", \"served\": false, \"storage\": true}]}}"; + patch='{"spec": {"preserveUnknownFields": false}}'; + if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}')" ]]; then + patch='{"spec": {"preserveUnknownFields": false, "versions": [{"name": "v1", "served": false, "storage": true, "schema": {"openAPIV3Schema": {"description": "placeholder", "type": "object"}}}]}}'; fi + echo "Applying patch to {{ $crd }}: ${patch}" if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then {{- include "crd.established" $crd | nindent 18 }} fi; diff --git a/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml b/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml index a668d2989..acdd1138f 100644 --- a/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml +++ b/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml @@ -30,10 +30,11 @@ spec: {{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }} {{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }} if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then - patch="{\"spec\": {\"preserveUnknownFields\": false}}"; - if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}' 2>&1)" ]]; then - patch="{\"spec\": {\"preserveUnknownFields\": false, \"versions\": [{\"name\": \"v1\", \"served\": false, \"storage\": true}]}}"; + patch='{"spec": {"preserveUnknownFields": false}}'; + if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}')" ]]; then + patch='{"spec": {"preserveUnknownFields": false, "versions": [{"name": "v1", "served": false, "storage": true, "schema": {"openAPIV3Schema": {"description": "placeholder", "type": "object"}}}]}}'; fi + echo "Applying patch to {{ $crd }}: ${patch}" if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then {{- include "crd.established" $crd | nindent 18 }} fi;