Skip to content

Commit f3a0dea

Browse files
committed
fix: fix typo
Signed-off-by: Liang Deng <[email protected]>
1 parent 10609e6 commit f3a0dea

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pkg/admiralctl/migrate/migrate.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var (
8282

8383
// NewCmdMigrate defines the `migrate` command that migrate resources from legacy clusters
8484
func NewCmdMigrate(f util.Factory, parentCommand string) *cobra.Command {
85-
opts := CommandmigrateOption{}
85+
opts := CommandMigrateOption{}
8686
opts.JSONYamlPrintFlags = genericclioptions.NewJSONYamlPrintFlags()
8787

8888
cmd := &cobra.Command{
@@ -114,8 +114,8 @@ func NewCmdMigrate(f util.Factory, parentCommand string) *cobra.Command {
114114
return cmd
115115
}
116116

117-
// CommandmigrateOption holds all command options for migrate
118-
type CommandmigrateOption struct {
117+
// CommandMigrateOption holds all command options for migrate
118+
type CommandMigrateOption struct {
119119
// Cluster is the name of legacy cluster
120120
Cluster string
121121

@@ -156,7 +156,7 @@ type CommandmigrateOption struct {
156156
}
157157

158158
// AddFlags adds flags to the specified FlagSet.
159-
func (o *CommandmigrateOption) AddFlags(flags *pflag.FlagSet) {
159+
func (o *CommandMigrateOption) AddFlags(flags *pflag.FlagSet) {
160160
flags.BoolVar(&o.AutoCreatePolicy, "auto-create-policy", true,
161161
"Automatically create a PropagationPolicy for namespace-scoped resources or "+
162162
"create a ClusterPropagationPolicy for cluster-scoped resources.")
@@ -176,7 +176,7 @@ func (o *CommandmigrateOption) AddFlags(flags *pflag.FlagSet) {
176176
}
177177

178178
// Preflight ensures that options are valid and marshals them if necessary
179-
func (o *CommandmigrateOption) Preflight(f util.Factory, args []string) error {
179+
func (o *CommandMigrateOption) Preflight(f util.Factory, args []string) error {
180180
var err error
181181

182182
if len(args) != 2 {
@@ -232,7 +232,7 @@ func (o *CommandmigrateOption) Preflight(f util.Factory, args []string) error {
232232
}
233233

234234
// Run migrate resources from legacy clusters
235-
func (o *CommandmigrateOption) Run(f util.Factory, args []string) error {
235+
func (o *CommandMigrateOption) Run(f util.Factory, args []string) error {
236236
var memberClusterFactory cmdutil.Factory
237237
var err error
238238

@@ -268,7 +268,7 @@ func (o *CommandmigrateOption) Run(f util.Factory, args []string) error {
268268
return o.migrate(controlPlaneRestConfig, obj, gvr)
269269
}
270270

271-
func (o *CommandmigrateOption) migrate(controlPlaneRestConfig *rest.Config, obj *unstructured.Unstructured,
271+
func (o *CommandMigrateOption) migrate(controlPlaneRestConfig *rest.Config, obj *unstructured.Unstructured,
272272
gvr schema.GroupVersionResource,
273273
) error {
274274
if err := preprocessResource(obj); err != nil {
@@ -277,7 +277,7 @@ func (o *CommandmigrateOption) migrate(controlPlaneRestConfig *rest.Config, obj
277277

278278
if o.OutputFormat != "" {
279279
// only print the resource template and Policy
280-
err := o.printObjectAndPolicy(obj, gvr)
280+
err := o.printObjectAndPolicy(obj)
281281

282282
return err
283283
}
@@ -393,7 +393,7 @@ type Obj struct {
393393
}
394394

395395
// getObjInfo get obj info in member cluster
396-
func (o *CommandmigrateOption) getObjInfo(f cmdutil.Factory, cluster string, args []string) (*Obj, error) {
396+
func (o *CommandMigrateOption) getObjInfo(f cmdutil.Factory, cluster string, args []string) (*Obj, error) {
397397
r := f.NewBuilder().
398398
Unstructured().
399399
NamespaceParam(o.Namespace).
@@ -425,7 +425,7 @@ func (o *CommandmigrateOption) getObjInfo(f cmdutil.Factory, cluster string, arg
425425
}
426426

427427
// printObjectAndPolicy print the converted resource
428-
func (o *CommandmigrateOption) printObjectAndPolicy(obj *unstructured.Unstructured, gvr schema.GroupVersionResource) error {
428+
func (o *CommandMigrateOption) printObjectAndPolicy(obj *unstructured.Unstructured) error {
429429
printer, err := o.Printer(nil, nil, false, false)
430430
if err != nil {
431431
return fmt.Errorf("failed to initialize k8s printer. err: %w", err)
@@ -458,7 +458,7 @@ func (o *CommandmigrateOption) printObjectAndPolicy(obj *unstructured.Unstructur
458458
}
459459

460460
// createPropagationPolicy create PropagationPolicy in Kubeadmiral control plane
461-
func (o *CommandmigrateOption) createPropagationPolicy(kubeadmiralClient *fedclient.Clientset) (string, error) {
461+
func (o *CommandMigrateOption) createPropagationPolicy(kubeadmiralClient *fedclient.Clientset) (string, error) {
462462
var policyName string
463463
if o.PolicyName == "" {
464464
policyName = names.GeneratePolicyName(o.Namespace, o.name, o.gvk.String())
@@ -482,7 +482,7 @@ func (o *CommandmigrateOption) createPropagationPolicy(kubeadmiralClient *fedcli
482482
}
483483

484484
// createClusterPropagationPolicy create ClusterPropagationPolicy in Kubeadmiral control plane
485-
func (o *CommandmigrateOption) createClusterPropagationPolicy(kubeadmiralClient *fedclient.Clientset) (string, error) {
485+
func (o *CommandMigrateOption) createClusterPropagationPolicy(kubeadmiralClient *fedclient.Clientset) (string, error) {
486486
var policyName string
487487
if o.PolicyName == "" {
488488
policyName = names.GeneratePolicyName("", o.name, o.gvk.String())

0 commit comments

Comments
 (0)