Skip to content

Commit

Permalink
Update patch command
Browse files Browse the repository at this point in the history
  • Loading branch information
okozachenko1203 committed Aug 10, 2023
1 parent 6a73c66 commit 9fb7509
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions roles/cluster_api/tasks/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@

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

0 comments on commit 9fb7509

Please sign in to comment.