add karmada.io/system label to created execution namespaces
Signed-off-by: Michael Grosser <michael@grosser.it>
This commit is contained in:
parent
721495dcf2
commit
13f0f6e6d8
|
@ -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)
|
||||
|
|
|
@ -29,6 +29,8 @@ import (
|
|||
"k8s.io/klog/v2"
|
||||
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
|
||||
aggregator "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
|
||||
|
||||
"github.com/karmada-io/karmada/pkg/util"
|
||||
)
|
||||
|
||||
// CreateService creates a Service if the target resource doesn't exist.
|
||||
|
@ -241,6 +243,9 @@ func NewNamespace(name string) *corev1.Namespace {
|
|||
return &corev1.Namespace{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Labels: map[string]string{
|
||||
util.KarmadaSystemLabel: util.KarmadaSystemLabelValue,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue