Skip to content

Commit ef87b38

Browse files
authored
Merge pull request #5099 from grosser/grosser/rename
rename host-as-* to karmada-as-*
2 parents 03e7335 + b30210f commit ef87b38

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pkg/karmadactl/join/join.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ type CommandJoinOption struct {
107107
// more details about running Kubernetes in multiple zones.
108108
ClusterZones []string
109109

110-
// HostAs represents the host cluster username to impersonate for the operation. User could be a regular user or a service account in a namespace
111-
HostAs string
110+
// KarmadaAs represents the username to impersonate for the operation in karmada control plane. User could be a regular user or a service account in a namespace
111+
KarmadaAs string
112112

113-
// HostAsGroups represents the host cluster group to impersonate for the operation, this flag can be repeated to specify multiple groups
114-
HostAsGroups []string
113+
// KarmadaAsGroups represents groups to impersonate for the operation in karmada control plane, this flag can be repeated to specify multiple groups
114+
KarmadaAsGroups []string
115115

116-
// HostAsUID represents the host cluster UID to impersonate for the operation.
117-
HostAsUID string
116+
// KarmadaAsUID represents the UID to impersonate for the operation in karmada control plane.
117+
KarmadaAsUID string
118118

119119
// DryRun tells if run the command in dry-run mode, without making any server requests.
120120
DryRun bool
@@ -159,12 +159,12 @@ func (j *CommandJoinOption) AddFlags(flags *pflag.FlagSet) {
159159
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.")
160160
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.")
161161
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.")
162-
flags.StringVar(&j.HostAs, "host-as", "",
163-
"Host cluster username to impersonate for the operation. User could be a regular user or a service account in a namespace.")
164-
flags.StringArrayVar(&j.HostAsGroups, "host-as-group", []string{},
165-
"Host cluster group to impersonate for the operation, this flag can be repeated to specify multiple groups.")
166-
flags.StringVar(&j.HostAsUID, "host-as-uid", "",
167-
"Host cluster UID to impersonate for the operation.")
162+
flags.StringVar(&j.KarmadaAs, "karmada-as", "",
163+
"Username to impersonate for the operation in karmada control plane. User could be a regular user or a service account in a namespace.")
164+
flags.StringArrayVar(&j.KarmadaAsGroups, "karmada-as-group", []string{},
165+
"Group to impersonate for the operation in karmada control plane, this flag can be repeated to specify multiple groups.")
166+
flags.StringVar(&j.KarmadaAsUID, "karmada-as-uid", "",
167+
"UID to impersonate for the operation in karmada control plane.")
168168
flags.BoolVar(&j.DryRun, "dry-run", false, "Run the command in dry-run mode, without making any server requests.")
169169
}
170170

@@ -181,9 +181,9 @@ func (j *CommandJoinOption) Run(f cmdutil.Factory) error {
181181
}
182182

183183
// Configure impersonation
184-
controlPlaneRestConfig.Impersonate.UserName = j.HostAs
185-
controlPlaneRestConfig.Impersonate.Groups = j.HostAsGroups
186-
controlPlaneRestConfig.Impersonate.UID = j.HostAsUID
184+
controlPlaneRestConfig.Impersonate.UserName = j.KarmadaAs
185+
controlPlaneRestConfig.Impersonate.Groups = j.KarmadaAsGroups
186+
controlPlaneRestConfig.Impersonate.UID = j.KarmadaAsUID
187187

188188
// Get cluster config
189189
clusterConfig, err := apiclient.RestConfig(j.ClusterContext, j.ClusterKubeConfig)

0 commit comments

Comments
 (0)