Skip to content

Commit

Permalink
workaround for jsonpath for slices
Browse files Browse the repository at this point in the history
  • Loading branch information
okozachenko1203 committed Jan 23, 2024
1 parent 8dd30f1 commit 4215366
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,15 @@ def get_object(self) -> objects.KubeadmControlPlaneTemplate:
"cloud-provider": "external",
"profiling": "false",
},
"extraVolumes": [],
"extraVolumes": [
# Note(oleks): Add this as default as a workaround of the json patch limitation # noqa: E501
# https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/write-clusterclass#json-patches-tips--tricks
{
"name": "webhooks",
"hostPath": "/etc/kubernetes/webhooks",
"mountPath": "/etc/kubernetes/webhooks",
}
],
},
"controllerManager": {
"extraArgs": {
Expand Down Expand Up @@ -1641,19 +1649,6 @@ def get_object(self) -> objects.ClusterClass:
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/authorization-mode", # noqa: E501
"value": "Node,RBAC,Webhook",
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraVolumes/-", # noqa: E501
"valueFrom": {
"template": textwrap.dedent(
"""\
name: webhooks
hostPath: /etc/kubernetes/webhooks
mountPath: /etc/kubernetes/webhooks
"""
),
},
},
],
}
],
Expand Down

0 comments on commit 4215366

Please sign in to comment.