From e4c2c5c1895ef46a2d440534fac8d6baa6543d10 Mon Sep 17 00:00:00 2001 From: Mario Valderrama Date: Fri, 24 May 2024 17:46:29 +0200 Subject: [PATCH] feat: add patch support for IonosCloudCluster Signed-off-by: Mario Valderrama --- config/rbac/role.yaml | 1 + controllers/kamajicontrolplane_controller_cluster_patch.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index e112658..260d376 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -54,6 +54,7 @@ rules: resources: - awsclusters - hetznerclusters + - ionoscloudclusters - kubevirtclusters - nutanixclusters - packetclusters diff --git a/controllers/kamajicontrolplane_controller_cluster_patch.go b/controllers/kamajicontrolplane_controller_cluster_patch.go index 3f3415a..cdaead3 100644 --- a/controllers/kamajicontrolplane_controller_cluster_patch.go +++ b/controllers/kamajicontrolplane_controller_cluster_patch.go @@ -38,6 +38,8 @@ func (r *KamajiControlPlaneReconciler) patchCluster(ctx context.Context, cluster return r.patchGenericCluster(ctx, cluster, endpoint, port, false) case "HetznerCluster": return r.patchGenericCluster(ctx, cluster, endpoint, port, false) + case "IonosCloudCluster": + return r.patchGenericCluster(ctx, cluster, endpoint, port, false) case "KubevirtCluster": return r.patchGenericCluster(ctx, cluster, endpoint, port, true) case "Metal3Cluster": @@ -72,7 +74,7 @@ func (r *KamajiControlPlaneReconciler) checkOrPatchGenericCluster(ctx context.Co return nil } -//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusters;hetznerclusters;kubevirtclusters;nutanixclusters;packetclusters,verbs=patch +//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusters;hetznerclusters;kubevirtclusters;nutanixclusters;packetclusters;ionoscloudclusters,verbs=patch //+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=kubevirtclusters/status;nutanixclusters/status;packetclusters/status,verbs=patch func (r *KamajiControlPlaneReconciler) patchGenericCluster(ctx context.Context, cluster capiv1beta1.Cluster, endpoint string, port int64, patchStatus bool) error {