You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//go:generate pflags UpdateClusterConfig --default-var DefaultUpdateClusterConfig --bind-default-var
var (
DefaultUpdateClusterConfig = &UpdateClusterConfig{
DryRun: false,
}
)
// UpdateClusterConfig used for updating clusters.
type UpdateClusterConfig struct {
DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."`
ClusterConfigFile string `json:"clusterConfigFile" pflag:",file containing the update cluster config parameters."`
// Using snake case here since
EnabledPlugins []string `json:"enabled_plugins" pflag:",comma separated list of plugins to be enabled on the cluster."`
EnabledProjects []string `json:"enabled_projects" pflag:",comma separated list of projects to be enabled on the cluster."`
}
generated pflagset
// GetPFlagSet will return strongly types pflags for all fields in UpdateClusterConfig and its nested types. The format of the
// flags is json-name.json-sub-name... etc.
func (cfg UpdateClusterConfig) GetPFlagSet(prefix string) *pflag.FlagSet {
cmdFlags := pflag.NewFlagSet("UpdateClusterConfig", pflag.ExitOnError)
cmdFlags.BoolVar(&DefaultUpdateClusterConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateClusterConfig.DryRun, "execute command without making any modifications.")
cmdFlags.StringVar(&DefaultUpdateClusterConfig.ClusterConfigFile, fmt.Sprintf("%v%v", prefix, "clusterConfigFile"), DefaultUpdateClusterConfig.ClusterConfigFile, "file containing the update cluster config parameters.")
cmdFlags.StringSliceVar(&[]string{}, fmt.Sprintf("%v%v", prefix, "enabled_plugins"), []string{}, "comma separated list of plugins to be enabled on the cluster.")
cmdFlags.StringSliceVar(&[]string{}, fmt.Sprintf("%v%v", prefix, "enabled_projects"), []string{}, "comma separated list of projects to be enabled on the cluster.")
return cmdFlags
}
Expected behavior
Expected
// GetPFlagSet will return strongly types pflags for all fields in UpdateClusterConfig and its nested types. The format of the
// flags is json-name.json-sub-name... etc.
func (cfg UpdateClusterConfig) GetPFlagSet(prefix string) *pflag.FlagSet {
cmdFlags := pflag.NewFlagSet("UpdateClusterConfig", pflag.ExitOnError)
cmdFlags.BoolVar(&DefaultUpdateClusterConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), DefaultUpdateClusterConfig.DryRun, "execute command without making any modifications.")
cmdFlags.StringVar(&DefaultUpdateClusterConfig.ClusterConfigFile, fmt.Sprintf("%v%v", prefix, "clusterConfigFile"), DefaultUpdateClusterConfig.ClusterConfigFile, "file containing the update cluster config parameters.")
cmdFlags.StringSliceVar(&DefaultUpdateClusterConfig.EnabledPlugins, fmt.Sprintf("%v%v", prefix, "enabledPlugins"), DefaultUpdateClusterConfig.EnabledPlugins, "comma separated list of plugins to be enabled on the cluster.")
cmdFlags.StringSliceVar(&DefaultUpdateClusterConfig.EnabledProjects, fmt.Sprintf("%v%v", prefix, "enabledProjects"), DefaultUpdateClusterConfig.EnabledProjects, "comma separated list of projects to be enabled on the cluster.")
return cmdFlags
}
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Yes
Have you read the Code of Conduct?
Yes
The text was updated successfully, but these errors were encountered:
Describe the bug
generated pflagset
Expected behavior
Expected
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: