Skip to content

Commit

Permalink
add karmada.io/system label to created execution namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Grosser <[email protected]>
  • Loading branch information
grosser committed Jul 24, 2024
1 parent 721495d commit 1e52105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ func (c *Controller) createExecutionSpace(cluster *clusterv1alpha1.Cluster) erro
executionSpace := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: executionSpaceName,
Labels: map[string]string{
util.KarmadaSystemLabel: util.KarmadaSystemLabelValue,
},
},
}
err = c.Client.Create(context.TODO(), executionSpace)
Expand Down
4 changes: 4 additions & 0 deletions pkg/karmadactl/util/idempotency.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"

"github.com/karmada-io/karmada/pkg/util"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
Expand Down Expand Up @@ -241,6 +242,9 @@ func NewNamespace(name string) *corev1.Namespace {
return &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: map[string]string{
util.KarmadaSystemLabel: util.KarmadaSystemLabelValue,
},
},
}
}
Expand Down

0 comments on commit 1e52105

Please sign in to comment.