Skip to content

Commit

Permalink
feat: replicating kamajicontrolplane metadata to tenantcontrolplane
Browse files Browse the repository at this point in the history
Signed-off-by: Dario Tranchitella <[email protected]>
  • Loading branch information
prometherion committed Oct 24, 2024
1 parent 77bbe06 commit c7c43db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions controllers/kamajicontrolplane_controller_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

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

for k, v := range kcp.Annotations {
if k == corev1.LastAppliedConfigAnnotation {
continue
}

tcp.Annotations[k] = v
}

tcp.Labels = kcp.Labels

if kubeconfigSecretKey := kcp.Annotations[kamajiv1alpha1.KubeconfigSecretKeyAnnotation]; kubeconfigSecretKey != "" {
tcp.Annotations[kamajiv1alpha1.KubeconfigSecretKeyAnnotation] = kubeconfigSecretKey
} else {
Expand Down

0 comments on commit c7c43db

Please sign in to comment.