Skip to content

Commit 8eb4322

Browse files
authored
Merge pull request #4967 from RainbowMango/pr_remove_deprecated_clusterzone
Removed deprecated --cluster-zone from karmadactl join command
2 parents ef14a98 + a0ace65 commit 8eb4322

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

pkg/karmadactl/join/join.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ type CommandJoinOption struct {
100100
// ClusterRegion represents the region of the cluster locate in.
101101
ClusterRegion string
102102

103-
// ClusterZone represents the zone of the cluster locate in.
104-
// Deprecated: Use ClusterZones instead.
105-
ClusterZone string
106-
107103
// ClusterZones represents the failure zones(also called availability zones) of the
108104
// member cluster. The zones are presented as a slice to support the case
109105
// that cluster runs across multiple failure zones.
@@ -141,9 +137,6 @@ func (j *CommandJoinOption) Validate(args []string) error {
141137
klog.Warningf("karmada-system is always reserved for Karmada control plane. We do not recommend using karmada-system to store secrets of member clusters. It may cause mistaken cleanup of resources.")
142138
}
143139

144-
if j.ClusterZone != "" && len(j.ClusterZones) > 0 {
145-
return fmt.Errorf("--cluster-zone and --cluster-zones can not co-exist")
146-
}
147140
return nil
148141
}
149142

@@ -156,9 +149,6 @@ func (j *CommandJoinOption) AddFlags(flags *pflag.FlagSet) {
156149
"Path of the cluster's kubeconfig.")
157150
flags.StringVar(&j.ClusterProvider, "cluster-provider", "", "Provider of the joining cluster. The Karmada scheduler can use this information to spread workloads across providers for higher availability.")
158151
flags.StringVar(&j.ClusterRegion, "cluster-region", "", "The region of the joining cluster. The Karmada scheduler can use this information to spread workloads across regions for higher availability.")
159-
flags.StringVar(&j.ClusterZone, "cluster-zone", "", "The zone of the joining cluster.")
160-
// nolint: errcheck
161-
flags.MarkDeprecated("cluster-zone", "This flag is deprecated and will be removed in future releases. Use --cluster-zones instead.")
162152
flags.StringSliceVar(&j.ClusterZones, "cluster-zones", nil, "The zones of the joining cluster. The Karmada scheduler can use this information to spread workloads across zones for higher availability.")
163153
flags.BoolVar(&j.DryRun, "dry-run", false, "Run the command in dry-run mode, without making any server requests.")
164154
}
@@ -198,7 +188,6 @@ func (j *CommandJoinOption) RunJoinCluster(controlPlaneRestConfig, clusterConfig
198188
ReportSecrets: []string{util.KubeCredentials, util.KubeImpersonator},
199189
ClusterProvider: j.ClusterProvider,
200190
ClusterRegion: j.ClusterRegion,
201-
ClusterZone: j.ClusterZone,
202191
ClusterZones: j.ClusterZones,
203192
DryRun: j.DryRun,
204193
ControlPlaneConfig: controlPlaneRestConfig,
@@ -259,10 +248,6 @@ func generateClusterInControllerPlane(opts util.ClusterRegisterOption) (*cluster
259248
clusterObj.Spec.Provider = opts.ClusterProvider
260249
}
261250

262-
if opts.ClusterZone != "" {
263-
clusterObj.Spec.Zone = opts.ClusterZone
264-
}
265-
266251
if len(opts.ClusterZones) > 0 {
267252
clusterObj.Spec.Zones = opts.ClusterZones
268253
}

pkg/util/cluster.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ type ClusterRegisterOption struct {
5757
ProxyServerAddress string
5858
ClusterProvider string
5959
ClusterRegion string
60-
// Deprecated: Use ClusterZones instead.
61-
ClusterZone string
62-
ClusterZones []string
63-
DryRun bool
60+
ClusterZones []string
61+
DryRun bool
6462

6563
ControlPlaneConfig *rest.Config
6664
ClusterConfig *rest.Config

0 commit comments

Comments
 (0)