Skip to content

Commit

Permalink
fix: Set default values for imagePullPolicy in kubeadmConfigSpec of CRDs
Browse files Browse the repository at this point in the history
  • Loading branch information
okozachenko1203 committed Aug 10, 2023
1 parent 8be491b commit ebf9dd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions roles/cluster_api/tasks/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@
name: capi-controller-manager
- namespace: capo-system
name: capo-controller-manager

# Note(okozachenko1203): Until https://github.com/kubernetes-sigs/cluster-api/issues/9132 is fixed,
# set the default value of imagePullPolicy in CRDs.
- name: Set default values for imagePullPolicy in kubeadmConfigSpec of CRDs
changed_when: false
ansible.builtin.command: |
kubectl patch crd kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/kubeadmConfigSpec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/kubeadmConfigSpec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmconfigs.bootstrap.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmconfigs.bootstrap.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/template/properties/spec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmcontrolplanes.controlplane.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/initConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]' && \
kubectl patch crd kubeadmcontrolplanes.controlplane.cluster.x-k8s.io --type=json -p='[{"op": "add", "path": "/spec/versions/2/schema/openAPIV3Schema/properties/spec/properties/kubeadmConfigSpec/properties/joinConfiguration/properties/nodeRegistration/properties/imagePullPolicy/default", "value": "IfNotPresent"}]'

0 comments on commit ebf9dd1

Please sign in to comment.