Skip to content

Commit eb18c9d

Browse files
authored
feat: replicating kamajicontrolplane metadata to tenantcontrolplane (#142)
Signed-off-by: Dario Tranchitella <[email protected]>
1 parent 1b88822 commit eb18c9d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

controllers/kamajicontrolplane_controller_tcp.go

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
kamajiv1alpha1 "github.com/clastix/kamaji/api/v1alpha1"
1212
"github.com/pkg/errors"
13+
corev1 "k8s.io/api/core/v1"
1314
"k8s.io/client-go/util/retry"
1415
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
1516
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -42,6 +43,16 @@ func (r *KamajiControlPlaneReconciler) createOrUpdateTenantControlPlane(ctx cont
4243
tcp.Annotations = make(map[string]string)
4344
}
4445

46+
for k, v := range kcp.Annotations {
47+
if k == corev1.LastAppliedConfigAnnotation {
48+
continue
49+
}
50+
51+
tcp.Annotations[k] = v
52+
}
53+
54+
tcp.Labels = kcp.Labels
55+
4556
if kubeconfigSecretKey := kcp.Annotations[kamajiv1alpha1.KubeconfigSecretKeyAnnotation]; kubeconfigSecretKey != "" {
4657
tcp.Annotations[kamajiv1alpha1.KubeconfigSecretKeyAnnotation] = kubeconfigSecretKey
4758
} else {

0 commit comments

Comments
 (0)