diff --git a/cmd/driver/config/config.go b/cmd/driver/config/config.go index b1d556ba5..825a0a15b 100644 --- a/cmd/driver/config/config.go +++ b/cmd/driver/config/config.go @@ -43,7 +43,7 @@ const ( type driverConfigOptions struct { *options.Common - Type options.DriverTypes + Type *options.DriverTypes Version string Repos []string Name string @@ -57,6 +57,7 @@ type driverConfigOptions struct { func NewDriverConfigCmd(ctx context.Context, opt *options.Common) *cobra.Command { o := driverConfigOptions{ Common: opt, + Type: options.NewDriverTypes(), } cmd := &cobra.Command{ @@ -69,7 +70,7 @@ func NewDriverConfigCmd(ctx context.Context, opt *options.Common) *cobra.Command }, } - cmd.Flags().Var(&o.Type, "type", "Driver type to be configured "+o.Type.Allowed()) + cmd.Flags().Var(o.Type, "type", "Driver type to be configured "+o.Type.Allowed()) cmd.Flags().StringVar(&o.Version, "version", config.DefaultDriver.Version, "Driver version to be configured.") cmd.Flags().StringSliceVar(&o.Repos, "repo", config.DefaultDriver.Repos, "Driver repo to be configured.") cmd.Flags().StringVar(&o.Name, "name", config.DefaultDriver.Name, "Driver name to be configured.") @@ -124,7 +125,7 @@ func (o *driverConfigOptions) RunDriverConfig(ctx context.Context, cmd *cobra.Co if f := cmd.Flags().Lookup("type"); f != nil && f.Changed { loggerArgs = append(loggerArgs, pterm.LoggerArgument{ Key: "driver type", - Value: o.Type, + Value: o.Type.String(), }) if o.Type.String() != "auto" { // Ok driver type was enforced by the user