Documentation
¶
Overview ¶
Package apply provides the apply command for the minder CLI
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplyCmd = &cobra.Command{ Use: "apply (-f FILENAME)", Short: "Appy a configuration to a minder control plane", Long: `The minder apply command applies a configuration to a minder control plane.`, PreRun: func(cmd *cobra.Command, args []string) { err := viper.BindPFlags(cmd.Flags()) util.ExitNicelyOnError(err, "Error binding flags") }, Run: func(cmd *cobra.Command, args []string) { f := util.GetConfigValue(viper.GetViper(), "file", "file", cmd, "").(string) var data []byte var err error if f == "-" { data, err = io.ReadAll(os.Stdin) util.ExitNicelyOnError(err, "Error reading from stdin") } else { f = filepath.Clean(f) data, err = os.ReadFile(f) util.ExitNicelyOnError(err, "Error reading file") } objects, err := parseContent(data) util.ExitNicelyOnError(err, "Error parsing content") for _, object := range objects { params := object.Parameters for k, v := range params { valueType := reflect.TypeOf(v) if valueType.Kind() == reflect.Int { v1 := v.(int) viper.Set(k, int32(v1)) } else { viper.Set(k, v) } } } }, }
ApplyCmd is the root command for the apply subcommands
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.