Skip to content

Commit

Permalink
deprecate --master and --karmada-config flags for karmada-aggregrated…
Browse files Browse the repository at this point in the history
…-apiserver

Signed-off-by: carlory <[email protected]>
  • Loading branch information
carlory committed Feb 3, 2022
1 parent 98b5b1f commit 94390ce
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/aggregated-apiserver/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
genericoptions "k8s.io/apiserver/pkg/server/options"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
netutils "k8s.io/utils/net"

"github.com/karmada-io/karmada/pkg/aggregatedapiserver"
Expand Down Expand Up @@ -57,7 +56,9 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) {
o.RecommendedOptions.AddFlags(flags)

flags.StringVar(&o.karmadaConfig, "karmada-config", o.karmadaConfig, "Path to a karmada-apiserver KubeConfig.")
flags.MarkDeprecated("karmada-config", "This flag is currently no-op and will be deleted.")
flags.StringVar(&o.Master, "master", o.Master, "The address of the Karmada API server. Overrides any value in KubeConfig.")
flags.MarkDeprecated("master", "This flag is currently no-op and will be deleted.")
flags.Float32Var(&o.KubeAPIQPS, "kube-api-qps", 40.0, "QPS to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
flags.IntVar(&o.KubeAPIBurst, "kube-api-burst", 60, "Burst to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
utilfeature.DefaultMutableFeatureGate.AddFlag(flags)
Expand All @@ -82,10 +83,7 @@ func (o *Options) Run(ctx context.Context) error {
return err
}

restConfig, err := clientcmd.BuildConfigFromFlags(o.Master, o.karmadaConfig)
if err != nil {
return fmt.Errorf("error building kubeconfig: %w", err)
}
restConfig := config.GenericConfig.ClientConfig
restConfig.QPS, restConfig.Burst = o.KubeAPIQPS, o.KubeAPIBurst
kubeClientSet := kubernetes.NewForConfigOrDie(restConfig)

Expand Down

0 comments on commit 94390ce

Please sign in to comment.