Merge pull request #5243 from grosser/grosser/exelabe

add karmada.io/system label to created execution namespaces
This commit is contained in:
karmada-bot 2024-07-26 12:03:17 +08:00 committed by GitHub
commit 1430ecbd2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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,
},
},
}
}