mirror of https://git.rancher.io/charts
Add dummy openAPIV3Schema to initContainer and log patch
parent
d9130be8f0
commit
3202417f2d
Binary file not shown.
|
@ -30,10 +30,11 @@ spec:
|
||||||
{{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }}
|
{{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }}
|
||||||
{{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }}
|
{{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }}
|
||||||
if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then
|
if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then
|
||||||
patch="{\"spec\": {\"preserveUnknownFields\": false}}";
|
patch='{"spec": {"preserveUnknownFields": false}}';
|
||||||
if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}' 2>&1)" ]]; then
|
if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}')" ]]; then
|
||||||
patch="{\"spec\": {\"preserveUnknownFields\": false, \"versions\": [{\"name\": \"v1\", \"served\": false, \"storage\": true}]}}";
|
patch='{"spec": {"preserveUnknownFields": false, "versions": [{"name": "v1", "served": false, "storage": true, "schema": {"openAPIV3Schema": {"description": "placeholder", "type": "object"}}}]}}';
|
||||||
fi
|
fi
|
||||||
|
echo "Applying patch to {{ $crd }}: ${patch}"
|
||||||
if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then
|
if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then
|
||||||
{{- include "crd.established" $crd | nindent 18 }}
|
{{- include "crd.established" $crd | nindent 18 }}
|
||||||
fi;
|
fi;
|
||||||
|
|
|
@ -30,10 +30,11 @@ spec:
|
||||||
{{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }}
|
{{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }}
|
||||||
{{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }}
|
{{- $crd := get (get ($.Files.Get $path | fromYaml) "metadata") "name" }}
|
||||||
if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then
|
if [[ -n "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.preserveUnknownFields}')" ]]; then
|
||||||
patch="{\"spec\": {\"preserveUnknownFields\": false}}";
|
patch='{"spec": {"preserveUnknownFields": false}}';
|
||||||
if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}' 2>&1)" ]]; then
|
if [[ -z "$(kubectl get crd {{ $crd }} -o jsonpath='{.spec.versions[0].schema}')" ]]; then
|
||||||
patch="{\"spec\": {\"preserveUnknownFields\": false, \"versions\": [{\"name\": \"v1\", \"served\": false, \"storage\": true}]}}";
|
patch='{"spec": {"preserveUnknownFields": false, "versions": [{"name": "v1", "served": false, "storage": true, "schema": {"openAPIV3Schema": {"description": "placeholder", "type": "object"}}}]}}';
|
||||||
fi
|
fi
|
||||||
|
echo "Applying patch to {{ $crd }}: ${patch}"
|
||||||
if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then
|
if kubectl patch crd {{ $crd }} -p "${patch}" --type="merge"; then
|
||||||
{{- include "crd.established" $crd | nindent 18 }}
|
{{- include "crd.established" $crd | nindent 18 }}
|
||||||
fi;
|
fi;
|
||||||
|
|
Loading…
Reference in New Issue