diff --git a/cmd/controller-manager/app/options/options.go b/cmd/controller-manager/app/options/options.go index 210b92414e5f..264207c30afd 100644 --- a/cmd/controller-manager/app/options/options.go +++ b/cmd/controller-manager/app/options/options.go @@ -185,8 +185,9 @@ func (o *Options) AddFlags(flags *pflag.FlagSet, allControllers, disabledByDefau " for skip resources with a specific API group(e.g. networking.k8s.io),\n"+ "/ for skip resources with a specific API version(e.g. networking.k8s.io/v1beta1),\n"+ "//, for skip one or more specific resource(e.g. networking.k8s.io/v1beta1/Ingress,IngressClass) where the kinds are case-insensitive.") - flags.StringSliceVar(&o.SkippedPropagatingNamespaces, "skipped-propagating-namespaces", []string{}, - "Comma-separated namespaces that should be skipped from propagating in addition to the default skipped namespaces(karmada-system, karmada-cluster, namespaces prefixed by kube- and karmada-es-).") + flags.StringSliceVar(&o.SkippedPropagatingNamespaces, "skipped-propagating-namespaces", []string{"kube-.*"}, + "Comma-separated namespaces that should be skipped from propagating in addition to the default skipped namespaces 'kube-.*'.\n"+ + "Note: 'karmada-system', 'karmada-cluster', and 'karmada-es-.*' are Karmada reserved namespaces that also skip propagation.") flags.StringVar(&o.ClusterAPIContext, "cluster-api-context", "", "Name of the cluster context in cluster-api management cluster kubeconfig file.") flags.StringVar(&o.ClusterAPIKubeconfig, "cluster-api-kubeconfig", "", "Path to the cluster-api management cluster kubeconfig file.") flags.Float32Var(&o.ClusterAPIQPS, "cluster-api-qps", 40.0, "QPS to use while talking with cluster kube-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.") diff --git a/pkg/util/names/names.go b/pkg/util/names/names.go index 791ce90cb79b..daee8f70e913 100644 --- a/pkg/util/names/names.go +++ b/pkg/util/names/names.go @@ -11,11 +11,6 @@ import ( ) const ( - // KubernetesReservedNSPrefix is the prefix of namespace which reserved by Kubernetes system, such as: - // - kube-system - // - kube-public - // - kube-node-lease - KubernetesReservedNSPrefix = "kube-" // NamespaceKarmadaSystem is reserved namespace NamespaceKarmadaSystem = "karmada-system" // NamespaceKarmadaCluster is reserved namespace @@ -137,8 +132,7 @@ func GenerateEstimatorDeploymentName(clusterName string) string { func IsReservedNamespace(namespace string) bool { return namespace == NamespaceKarmadaSystem || namespace == NamespaceKarmadaCluster || - strings.HasPrefix(namespace, ExecutionSpacePrefix) || - strings.HasPrefix(namespace, KubernetesReservedNSPrefix) + strings.HasPrefix(namespace, ExecutionSpacePrefix) } // GenerateImpersonationSecretName generates the secret name of impersonation secret. diff --git a/pkg/util/names/names_test.go b/pkg/util/names/names_test.go index 8df34f2d6025..38f3c659a2aa 100644 --- a/pkg/util/names/names_test.go +++ b/pkg/util/names/names_test.go @@ -353,11 +353,6 @@ func TestIsReservedNamespace(t *testing.T) { namespace: NamespaceKarmadaCluster, expected: true, }, - { - name: "kube-", - namespace: KubernetesReservedNSPrefix, - expected: true, - }, { name: "karmada-es-", namespace: ExecutionSpacePrefix,