diff --git a/completers/kustomize_completer/cmd/build.go b/completers/kustomize_completer/cmd/build.go new file mode 100644 index 0000000000..dc563c8e33 --- /dev/null +++ b/completers/kustomize_completer/cmd/build.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var buildCmd = &cobra.Command{ + Use: "build", + Short: "Build a kustomization target from a directory or URL.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(buildCmd).Standalone() + buildCmd.Flags().Bool("as-current-user", false, "use the uid and gid of the command executor to run the function in the container") + buildCmd.Flags().Bool("enable-alpha-plugins", false, "enable kustomize plugins") + buildCmd.Flags().Bool("enable-exec", false, "enable support for exec functions (raw executables); do not use for untrusted configs! (Alpha)") + buildCmd.Flags().Bool("enable-helm", false, "Enable use of the Helm chart inflator generator.") + buildCmd.Flags().Bool("enable-managedby-label", false, "enable adding app.kubernetes.io/managed-by") + buildCmd.Flags().Bool("enable-star", false, "enable support for starlark functions. (Alpha)") + buildCmd.Flags().StringArrayP("env", "e", []string{}, "a list of environment variables to be used by functions") + buildCmd.Flags().String("helm-command", "helm", "helm command (path to executable)") + buildCmd.Flags().String("load-restrictor", "LoadRestrictionsRootOnly", "if set to 'LoadRestrictionsNone', local kustomizations may load files from outside their root. This does, however, break the relocatability of the kustomization.") + buildCmd.Flags().StringArray("mount", []string{}, "a list of storage options read from the filesystem") + buildCmd.Flags().Bool("network", false, "enable network access for functions that declare it") + buildCmd.Flags().String("network-name", "bridge", "the docker network to run the container in") + buildCmd.Flags().StringP("output", "o", "", "If specified, write output to this path.") + buildCmd.Flags().String("reorder", "legacy", "Reorder the resources just before output. Use 'legacy' to apply a legacy reordering (Namespaces first, Webhooks last, etc). Use 'none' to suppress a final reordering.") + rootCmd.AddCommand(buildCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg.go b/completers/kustomize_completer/cmd/cfg.go new file mode 100644 index 0000000000..4156d5664b --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfgCmd = &cobra.Command{ + Use: "cfg", + Short: "Commands for reading and writing configuration.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfgCmd).Standalone() + rootCmd.AddCommand(cfgCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_annotate.go b/completers/kustomize_completer/cmd/cfg_annotate.go new file mode 100644 index 0000000000..585c9c1561 --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_annotate.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_annotateCmd = &cobra.Command{ + Use: "annotate", + Short: "[Alpha] Set an annotation on Resources.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_annotateCmd).Standalone() + cfg_annotateCmd.Flags().String("apiVersion", "", "Resource apiVersion to annotate") + cfg_annotateCmd.Flags().String("kind", "", "Resource kind to annotate") + cfg_annotateCmd.Flags().StringSlice("kv", []string{}, "annotation as KEY=VALUE") + cfg_annotateCmd.Flags().String("name", "", "Resource name to annotate") + cfg_annotateCmd.Flags().String("namespace", "", "Resource namespace to annotate") + cfg_annotateCmd.Flags().BoolP("recurse-subpackages", "R", false, "add annotations recursively in all the nested subpackages") + cfgCmd.AddCommand(cfg_annotateCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_cat.go b/completers/kustomize_completer/cmd/cfg_cat.go new file mode 100644 index 0000000000..a6747ae83b --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_cat.go @@ -0,0 +1,28 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_catCmd = &cobra.Command{ + Use: "cat", + Short: "[Alpha] Print Resource Config from a local directory.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_catCmd).Standalone() + cfg_catCmd.Flags().Bool("annotate", false, "annotate resources with their file origins.") + cfg_catCmd.Flags().String("dest", "", "if specified, write output to a file rather than stdout") + cfg_catCmd.Flags().Bool("exclude-non-local", false, "if true, exclude non-local-config in the output.") + cfg_catCmd.Flags().Bool("format", true, "format resource config yaml before printing.") + cfg_catCmd.Flags().String("function-config", "", "path to function config to put in ResourceList -- only if wrapped in a ResourceList.") + cfg_catCmd.Flags().Bool("include-local", false, "if true, include local-config in the output.") + cfg_catCmd.Flags().BoolP("recurse-subpackages", "R", true, "print resources recursively in all the nested subpackages") + cfg_catCmd.Flags().Bool("strip-comments", false, "remove comments from yaml.") + cfg_catCmd.Flags().StringSlice("style", []string{}, "yaml styles to apply. may be 'TaggedStyle', 'DoubleQuotedStyle', 'LiteralStyle', 'FoldedStyle', 'FlowStyle'.") + cfg_catCmd.Flags().String("wrap-kind", "", "if set, wrap the output in this list type kind.") + cfg_catCmd.Flags().String("wrap-version", "", "if set, wrap the output in this list type apiVersion.") + cfgCmd.AddCommand(cfg_catCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_count.go b/completers/kustomize_completer/cmd/cfg_count.go new file mode 100644 index 0000000000..e19e1e8d1a --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_count.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_countCmd = &cobra.Command{ + Use: "count", + Short: "[Alpha] Count Resources Config from a local directory.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_countCmd).Standalone() + cfg_countCmd.Flags().Bool("kind", true, "count resources by kind.") + cfg_countCmd.Flags().BoolP("recurse-subpackages", "R", true, "prints count of resources recursively in all the nested subpackages") + cfgCmd.AddCommand(cfg_countCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_createSetter.go b/completers/kustomize_completer/cmd/cfg_createSetter.go new file mode 100644 index 0000000000..77fa079912 --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_createSetter.go @@ -0,0 +1,25 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_createSetterCmd = &cobra.Command{ + Use: "create-setter", + Short: "[Alpha] Create a custom setter for a Resource field", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_createSetterCmd).Standalone() + cfg_createSetterCmd.Flags().String("description", "", "record a description for the current setter value.") + cfg_createSetterCmd.Flags().String("field", "", "name of the field to set, a suffix of the path to the field, or the full path to the field. Default is to match all fields.") + cfg_createSetterCmd.Flags().BoolP("recurse-subpackages", "R", false, "creates setter recursively in all the nested subpackages") + cfg_createSetterCmd.Flags().Bool("required", false, "indicates that this setter must be set by package consumer before live apply/preview") + cfg_createSetterCmd.Flags().String("schema-path", "", "openAPI schema file path for setter constraints -- file content e.g. {\"type\": \"string\", \"maxLength\": 15, \"enum\": [\"allowedValue1\", \"allowedValue2\"]}") + cfg_createSetterCmd.Flags().String("set-by", "", "record who the field was default by.") + cfg_createSetterCmd.Flags().String("type", "", "OpenAPI field type for the setter -- e.g. integer,boolean,string.") + cfg_createSetterCmd.Flags().String("value", "", "optional flag, alternative to specifying the value as an argument. e.g. used to specify values that start with '-'") + cfgCmd.AddCommand(cfg_createSetterCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_createSubst.go b/completers/kustomize_completer/cmd/cfg_createSubst.go new file mode 100644 index 0000000000..e038131c73 --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_createSubst.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_createSubstCmd = &cobra.Command{ + Use: "create-subst", + Short: "", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_createSubstCmd).Standalone() + cfg_createSubstCmd.Flags().String("field", "", "name of the field to set -- e.g. --field image") + cfg_createSubstCmd.Flags().String("field-value", "", "value of the field to create substitution for -- e.g. --field-value nginx:0.1.0") + cfg_createSubstCmd.Flags().String("pattern", "", "substitution pattern") + cfg_createSubstCmd.Flags().BoolP("recurse-subpackages", "R", false, "creates substitution recursively in all the nested subpackages") + cfgCmd.AddCommand(cfg_createSubstCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_fmt.go b/completers/kustomize_completer/cmd/cfg_fmt.go new file mode 100644 index 0000000000..77989f42ae --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_fmt.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_fmtCmd = &cobra.Command{ + Use: "fmt", + Short: "[Alpha] Format yaml configuration files.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_fmtCmd).Standalone() + cfg_fmtCmd.Flags().Bool("keep-annotations", false, "if true, keep index and filename annotations set on Resources.") + cfg_fmtCmd.Flags().Bool("override", false, "if true, override existing filepath annotations.") + cfg_fmtCmd.Flags().String("pattern", "%n_%k.yaml", "pattern to use for generating filenames for resources -- may contain the following") + cfg_fmtCmd.Flags().BoolP("recurse-subpackages", "R", false, "formats resource files recursively in all the nested subpackages") + cfg_fmtCmd.Flags().Bool("set-filenames", false, "if true, set default filenames on Resources without them") + cfg_fmtCmd.Flags().Bool("use-schema", false, "if true, uses openapi resource schema to format resources.") + cfgCmd.AddCommand(cfg_fmtCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_grep.go b/completers/kustomize_completer/cmd/cfg_grep.go new file mode 100644 index 0000000000..8acd29b02c --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_grep.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_grepCmd = &cobra.Command{ + Use: "grep", + Short: "[Alpha] Search for matching Resources in a directory or from stdin", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_grepCmd).Standalone() + cfg_grepCmd.Flags().Bool("annotate", true, "annotate resources with their file origins.") + cfg_grepCmd.Flags().Bool("invert-match", false, "Selected Resources are those not matching any of the specified patterns..") + cfg_grepCmd.Flags().BoolP("recurse-subpackages", "R", true, "also print resources recursively in all the nested subpackages") + cfgCmd.AddCommand(cfg_grepCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_init.go b/completers/kustomize_completer/cmd/cfg_init.go new file mode 100644 index 0000000000..9e60b01fa4 --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_init.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_initCmd = &cobra.Command{ + Use: "init", + Short: "[Alpha] Initialize a directory with a Krmfile.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_initCmd).Standalone() + cfgCmd.AddCommand(cfg_initCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_listSetters.go b/completers/kustomize_completer/cmd/cfg_listSetters.go new file mode 100644 index 0000000000..24fc4ede0b --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_listSetters.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_listSettersCmd = &cobra.Command{ + Use: "list-setters", + Short: "[Alpha] List setters for Resources.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_listSettersCmd).Standalone() + cfg_listSettersCmd.Flags().Bool("include-subst", false, "include substitutions in the output") + cfg_listSettersCmd.Flags().Bool("markdown", false, "output as github markdown") + cfg_listSettersCmd.Flags().BoolP("recurse-subpackages", "R", false, "list setters recursively in all the nested subpackages") + cfgCmd.AddCommand(cfg_listSettersCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_merge.go b/completers/kustomize_completer/cmd/cfg_merge.go new file mode 100644 index 0000000000..4010eedb2f --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_merge.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_mergeCmd = &cobra.Command{ + Use: "merge", + Short: "[Alpha] Merge Resource configuration files", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_mergeCmd).Standalone() + cfg_mergeCmd.Flags().Bool("invert-order", false, "if true, merge Resources in the reverse order") + cfgCmd.AddCommand(cfg_mergeCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_merge3.go b/completers/kustomize_completer/cmd/cfg_merge3.go new file mode 100644 index 0000000000..7a2f440beb --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_merge3.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_merge3Cmd = &cobra.Command{ + Use: "merge3", + Short: "[Alpha] Merge diff of Resource configuration files into a destination (3-way)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_merge3Cmd).Standalone() + cfg_merge3Cmd.Flags().String("ancestor", "", "Path to original package") + cfg_merge3Cmd.Flags().String("from", "", "Path to updated package") + cfg_merge3Cmd.Flags().Bool("path-merge-key", false, "Use the path as part of the merge key when merging resources") + cfg_merge3Cmd.Flags().String("to", "", "Path to destination package") + cfgCmd.AddCommand(cfg_merge3Cmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_set.go b/completers/kustomize_completer/cmd/cfg_set.go new file mode 100644 index 0000000000..e4757b91e8 --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_set.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_setCmd = &cobra.Command{ + Use: "set", + Short: "[Alpha] Set values on Resources fields values.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_setCmd).Standalone() + cfg_setCmd.Flags().String("description", "", "annotate the field with a description of its value") + cfg_setCmd.Flags().BoolP("recurse-subpackages", "R", false, "sets recursively in all the nested subpackages") + cfg_setCmd.Flags().String("set-by", "", "annotate the field with who set it") + cfg_setCmd.Flags().StringArray("values", []string{}, "optional flag, the values of the setter to be set to") + cfg_setCmd.Flags().String("version", "", "use this version of the setter format") + cfgCmd.AddCommand(cfg_setCmd) +} diff --git a/completers/kustomize_completer/cmd/cfg_tree.go b/completers/kustomize_completer/cmd/cfg_tree.go new file mode 100644 index 0000000000..62de9f97fc --- /dev/null +++ b/completers/kustomize_completer/cmd/cfg_tree.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var cfg_treeCmd = &cobra.Command{ + Use: "tree", + Short: "[Alpha] Display Resource structure from a directory or stdin.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cfg_treeCmd).Standalone() + cfg_treeCmd.Flags().Bool("all", false, "print all field infos") + cfg_treeCmd.Flags().Bool("args", false, "print args field") + cfg_treeCmd.Flags().Bool("command", false, "print command field") + cfg_treeCmd.Flags().Bool("env", false, "print env field") + cfg_treeCmd.Flags().Bool("exclude-non-local", false, "if true, exclude non-local-config in the output.") + cfg_treeCmd.Flags().StringSlice("field", []string{}, "print field") + cfg_treeCmd.Flags().String("graph-structure", "", "Graph structure to use for printing the tree. may be any of: owners,directory") + cfg_treeCmd.Flags().Bool("image", false, "print image field") + cfg_treeCmd.Flags().Bool("include-local", false, "if true, include local-config in the output.") + cfg_treeCmd.Flags().Bool("name", false, "print name field") + cfg_treeCmd.Flags().Bool("ports", false, "print ports field") + cfg_treeCmd.Flags().Bool("replicas", false, "print replicas field") + cfg_treeCmd.Flags().Bool("resources", false, "print resources field") + cfgCmd.AddCommand(cfg_treeCmd) +} diff --git a/completers/kustomize_completer/cmd/completion.go b/completers/kustomize_completer/cmd/completion.go new file mode 100644 index 0000000000..adaf4c786e --- /dev/null +++ b/completers/kustomize_completer/cmd/completion.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generate shell completion script", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completionCmd).Standalone() + rootCmd.AddCommand(completionCmd) +} diff --git a/completers/kustomize_completer/cmd/create.go b/completers/kustomize_completer/cmd/create.go new file mode 100644 index 0000000000..f70c7c81a2 --- /dev/null +++ b/completers/kustomize_completer/cmd/create.go @@ -0,0 +1,25 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "Create a new kustomization in the current directory", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(createCmd).Standalone() + createCmd.Flags().String("annotations", "", "Add one or more common annotations.") + createCmd.Flags().Bool("autodetect", false, "Search for kubernetes resources in the current directory to be added to the kustomization file.") + createCmd.Flags().String("labels", "", "Add one or more common labels.") + createCmd.Flags().String("nameprefix", "", "Sets the value of the namePrefix field in the kustomization file.") + createCmd.Flags().String("namespace", "", "Set the value of the namespace field in the customization file.") + createCmd.Flags().String("namesuffix", "", "Sets the value of the nameSuffix field in the kustomization file.") + createCmd.Flags().Bool("recursive", false, "Enable recursive directory searching for resource auto-detection.") + createCmd.Flags().String("resources", "", "Name of a file containing a file to add to the kustomization file.") + rootCmd.AddCommand(createCmd) +} diff --git a/completers/kustomize_completer/cmd/docsFn.go b/completers/kustomize_completer/cmd/docsFn.go new file mode 100644 index 0000000000..59a2ad4665 --- /dev/null +++ b/completers/kustomize_completer/cmd/docsFn.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var docsFnCmd = &cobra.Command{ + Use: "docs-fn", + Short: "[Alpha] Documentation for developing and invoking Configuration Functions.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(docsFnCmd).Standalone() + rootCmd.AddCommand(docsFnCmd) +} diff --git a/completers/kustomize_completer/cmd/docsFnSpec.go b/completers/kustomize_completer/cmd/docsFnSpec.go new file mode 100644 index 0000000000..92104a8a64 --- /dev/null +++ b/completers/kustomize_completer/cmd/docsFnSpec.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var docsFnSpecCmd = &cobra.Command{ + Use: "docs-fn-spec", + Short: "[Alpha] Documentation for Configuration Functions Specification.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(docsFnSpecCmd).Standalone() + rootCmd.AddCommand(docsFnSpecCmd) +} diff --git a/completers/kustomize_completer/cmd/docsIoAnnotations.go b/completers/kustomize_completer/cmd/docsIoAnnotations.go new file mode 100644 index 0000000000..d7629bb2c6 --- /dev/null +++ b/completers/kustomize_completer/cmd/docsIoAnnotations.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var docsIoAnnotationsCmd = &cobra.Command{ + Use: "docs-io-annotations", + Short: "[Alpha] Documentation for annotations used by io.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(docsIoAnnotationsCmd).Standalone() + rootCmd.AddCommand(docsIoAnnotationsCmd) +} diff --git a/completers/kustomize_completer/cmd/docsMerge.go b/completers/kustomize_completer/cmd/docsMerge.go new file mode 100644 index 0000000000..cf3a9e6991 --- /dev/null +++ b/completers/kustomize_completer/cmd/docsMerge.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var docsMergeCmd = &cobra.Command{ + Use: "docs-merge", + Short: "[Alpha] Documentation for merging Resources (2-way merge).", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(docsMergeCmd).Standalone() + rootCmd.AddCommand(docsMergeCmd) +} diff --git a/completers/kustomize_completer/cmd/docsMerge3.go b/completers/kustomize_completer/cmd/docsMerge3.go new file mode 100644 index 0000000000..97dd1b5f92 --- /dev/null +++ b/completers/kustomize_completer/cmd/docsMerge3.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var docsMerge3Cmd = &cobra.Command{ + Use: "docs-merge3", + Short: "[Alpha] Documentation for merging Resources (3-way merge).", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(docsMerge3Cmd).Standalone() + rootCmd.AddCommand(docsMerge3Cmd) +} diff --git a/completers/kustomize_completer/cmd/edit.go b/completers/kustomize_completer/cmd/edit.go new file mode 100644 index 0000000000..b25c90d8d1 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var editCmd = &cobra.Command{ + Use: "edit", + Short: "Edits a kustomization file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(editCmd).Standalone() + rootCmd.AddCommand(editCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add.go b/completers/kustomize_completer/cmd/edit_add.go new file mode 100644 index 0000000000..8adc1bfc1a --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_addCmd = &cobra.Command{ + Use: "add", + Short: "Adds an item to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_addCmd).Standalone() + editCmd.AddCommand(edit_addCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_annotation.go b/completers/kustomize_completer/cmd/edit_add_annotation.go new file mode 100644 index 0000000000..b2fd7056ac --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_annotation.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_annotationCmd = &cobra.Command{ + Use: "annotation", + Short: "Adds one or more commonAnnotations to kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_annotationCmd).Standalone() + edit_add_annotationCmd.Flags().BoolP("force", "f", false, "overwrite commonAnnotation if it already exists") + edit_addCmd.AddCommand(edit_add_annotationCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_base.go b/completers/kustomize_completer/cmd/edit_add_base.go new file mode 100644 index 0000000000..577631bbcf --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_base.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_baseCmd = &cobra.Command{ + Use: "base", + Short: "Adds one or more bases to the kustomization.yaml in current directory", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_baseCmd).Standalone() + edit_addCmd.AddCommand(edit_add_baseCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_component.go b/completers/kustomize_completer/cmd/edit_add_component.go new file mode 100644 index 0000000000..e28a874777 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_component.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_componentCmd = &cobra.Command{ + Use: "component", + Short: "Add the name of a file containing a component to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_componentCmd).Standalone() + edit_addCmd.AddCommand(edit_add_componentCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_configmap.go b/completers/kustomize_completer/cmd/edit_add_configmap.go new file mode 100644 index 0000000000..89f2d73f72 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_configmap.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_configmapCmd = &cobra.Command{ + Use: "configmap", + Short: "Adds a configmap to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_configmapCmd).Standalone() + edit_add_configmapCmd.Flags().String("behavior", "", "Specify the behavior for config map generation, i.e whether to create a new configmap (the default), to merge with a previously defined one, or to replace an existing one. Merge and replace should be used only when overriding an existing configmap defined in a base") + edit_add_configmapCmd.Flags().Bool("disableNameSuffixHash", false, "Disable the name suffix for the configmap") + edit_add_configmapCmd.Flags().String("from-env-file", "", "Specify the path to a file to read lines of key=val pairs to create a configmap (i.e. a Docker .env file).") + edit_add_configmapCmd.Flags().StringSlice("from-file", []string{}, "Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.") + edit_add_configmapCmd.Flags().StringArray("from-literal", []string{}, "Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)") + edit_addCmd.AddCommand(edit_add_configmapCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_generator.go b/completers/kustomize_completer/cmd/edit_add_generator.go new file mode 100644 index 0000000000..b6a5764c5c --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_generator.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_generatorCmd = &cobra.Command{ + Use: "generator", + Short: "Add the name of a file containing a generator configuration to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_generatorCmd).Standalone() + edit_addCmd.AddCommand(edit_add_generatorCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_label.go b/completers/kustomize_completer/cmd/edit_add_label.go new file mode 100644 index 0000000000..6085859a6d --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_label.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_labelCmd = &cobra.Command{ + Use: "label", + Short: "Adds one or more commonLabels to kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_labelCmd).Standalone() + edit_add_labelCmd.Flags().BoolP("force", "f", false, "overwrite commonLabel if it already exists") + edit_addCmd.AddCommand(edit_add_labelCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_patch.go b/completers/kustomize_completer/cmd/edit_add_patch.go new file mode 100644 index 0000000000..44141b87c5 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_patch.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_patchCmd = &cobra.Command{ + Use: "patch", + Short: "Add an item to patches field.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_patchCmd).Standalone() + edit_add_patchCmd.Flags().String("annotation-selector", "", "annotationSelector in patch target") + edit_add_patchCmd.Flags().String("group", "", "API group in patch target") + edit_add_patchCmd.Flags().String("kind", "", "Resource kind in patch target") + edit_add_patchCmd.Flags().String("label-selector", "", "labelSelector in patch target") + edit_add_patchCmd.Flags().String("name", "", "Resource name in patch target") + edit_add_patchCmd.Flags().String("namespace", "", "Resource namespace in patch target") + edit_add_patchCmd.Flags().String("patch", "", "Literal string of patch content. Cannot be used with --path at the same time.") + edit_add_patchCmd.Flags().String("path", "", "Path to the patch file. Cannot be used with --patch at the same time.") + edit_add_patchCmd.Flags().String("version", "", "API version in patch target") + edit_addCmd.AddCommand(edit_add_patchCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_resource.go b/completers/kustomize_completer/cmd/edit_add_resource.go new file mode 100644 index 0000000000..7e17a88514 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_resource.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_resourceCmd = &cobra.Command{ + Use: "resource", + Short: "Add the name of a file containing a resource to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_resourceCmd).Standalone() + edit_addCmd.AddCommand(edit_add_resourceCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_secret.go b/completers/kustomize_completer/cmd/edit_add_secret.go new file mode 100644 index 0000000000..77f29af15e --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_secret.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_secretCmd = &cobra.Command{ + Use: "secret", + Short: "Adds a secret to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_secretCmd).Standalone() + edit_add_secretCmd.Flags().Bool("disableNameSuffixHash", false, "Disable the name suffix for the secret") + edit_add_secretCmd.Flags().String("from-env-file", "", "Specify the path to a file to read lines of key=val pairs to create a secret (i.e. a Docker .env file).") + edit_add_secretCmd.Flags().StringSlice("from-file", []string{}, "Key file can be specified using its file path, in which case file basename will be used as secret key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid secret key.") + edit_add_secretCmd.Flags().StringArray("from-literal", []string{}, "Specify a key and literal value to insert in secret (i.e. mykey=somevalue)") + edit_add_secretCmd.Flags().String("namespace", "", "Specify the namespace of the secret") + edit_add_secretCmd.Flags().String("type", "Opaque", "Specify the secret type this can be 'Opaque' (default), or 'kubernetes.io/tls'") + edit_addCmd.AddCommand(edit_add_secretCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_add_transformer.go b/completers/kustomize_completer/cmd/edit_add_transformer.go new file mode 100644 index 0000000000..32f82bb585 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_add_transformer.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_add_transformerCmd = &cobra.Command{ + Use: "transformer", + Short: "Add the name of a file containing a transformer configuration to the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_add_transformerCmd).Standalone() + edit_addCmd.AddCommand(edit_add_transformerCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_alphaListBuiltinPlugin.go b/completers/kustomize_completer/cmd/edit_alphaListBuiltinPlugin.go new file mode 100644 index 0000000000..7cd31d32fa --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_alphaListBuiltinPlugin.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_alphaListBuiltinPluginCmd = &cobra.Command{ + Use: "alpha-list-builtin-plugin", + Short: "[Alpha] List the builtin plugins", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_alphaListBuiltinPluginCmd).Standalone() + editCmd.AddCommand(edit_alphaListBuiltinPluginCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_fix.go b/completers/kustomize_completer/cmd/edit_fix.go new file mode 100644 index 0000000000..da482d9721 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_fix.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_fixCmd = &cobra.Command{ + Use: "fix", + Short: "Fix the missing fields in kustomization file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_fixCmd).Standalone() + edit_fixCmd.Flags().Bool("vars", false, "If specified, kustomize will attempt to convert vars to replacements. ") + editCmd.AddCommand(edit_fixCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove.go b/completers/kustomize_completer/cmd/edit_remove.go new file mode 100644 index 0000000000..da10339f11 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_removeCmd = &cobra.Command{ + Use: "remove", + Short: "Removes items from the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_removeCmd).Standalone() + editCmd.AddCommand(edit_removeCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove_annotation.go b/completers/kustomize_completer/cmd/edit_remove_annotation.go new file mode 100644 index 0000000000..033c08dd2e --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove_annotation.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_remove_annotationCmd = &cobra.Command{ + Use: "annotation", + Short: "Removes one or more commonAnnotations from kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_remove_annotationCmd).Standalone() + edit_remove_annotationCmd.Flags().BoolP("ignore-non-existence", "i", false, "ignore error if the given label doesn't exist") + edit_removeCmd.AddCommand(edit_remove_annotationCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove_label.go b/completers/kustomize_completer/cmd/edit_remove_label.go new file mode 100644 index 0000000000..ab4fd73d4e --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove_label.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_remove_labelCmd = &cobra.Command{ + Use: "label", + Short: "Removes one or more commonLabels from kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_remove_labelCmd).Standalone() + edit_remove_labelCmd.Flags().BoolP("ignore-non-existence", "i", false, "ignore error if the given label doesn't exist") + edit_removeCmd.AddCommand(edit_remove_labelCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove_patch.go b/completers/kustomize_completer/cmd/edit_remove_patch.go new file mode 100644 index 0000000000..e8bc1f2a93 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove_patch.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_remove_patchCmd = &cobra.Command{ + Use: "patch", + Short: "Removes a patch from kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_remove_patchCmd).Standalone() + edit_remove_patchCmd.Flags().String("annotation-selector", "", "annotationSelector in patch target") + edit_remove_patchCmd.Flags().String("group", "", "API group in patch target") + edit_remove_patchCmd.Flags().String("kind", "", "Resource kind in patch target") + edit_remove_patchCmd.Flags().String("label-selector", "", "labelSelector in patch target") + edit_remove_patchCmd.Flags().String("name", "", "Resource name in patch target") + edit_remove_patchCmd.Flags().String("namespace", "", "Resource namespace in patch target") + edit_remove_patchCmd.Flags().String("patch", "", "Literal string of patch content. Cannot be used with --path at the same time.") + edit_remove_patchCmd.Flags().String("path", "", "Path to the patch file. Cannot be used with --patch at the same time.") + edit_remove_patchCmd.Flags().String("version", "", "API version in patch target") + edit_removeCmd.AddCommand(edit_remove_patchCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove_resource.go b/completers/kustomize_completer/cmd/edit_remove_resource.go new file mode 100644 index 0000000000..ceffcad954 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove_resource.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_remove_resourceCmd = &cobra.Command{ + Use: "resource", + Short: "Removes one or more resource file paths from kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_remove_resourceCmd).Standalone() + edit_removeCmd.AddCommand(edit_remove_resourceCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_remove_transformer.go b/completers/kustomize_completer/cmd/edit_remove_transformer.go new file mode 100644 index 0000000000..1bb8b4ed83 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_remove_transformer.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_remove_transformerCmd = &cobra.Command{ + Use: "transformer", + Short: "Removes one or more transformers from kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_remove_transformerCmd).Standalone() + edit_removeCmd.AddCommand(edit_remove_transformerCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set.go b/completers/kustomize_completer/cmd/edit_set.go new file mode 100644 index 0000000000..25e617e398 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_setCmd = &cobra.Command{ + Use: "set", + Short: "Sets the value of different fields in kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_setCmd).Standalone() + editCmd.AddCommand(edit_setCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_annotation.go b/completers/kustomize_completer/cmd/edit_set_annotation.go new file mode 100644 index 0000000000..6f53ad857d --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_annotation.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_annotationCmd = &cobra.Command{ + Use: "annotation", + Short: "Sets one or more commonAnnotations in kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_annotationCmd).Standalone() + edit_setCmd.AddCommand(edit_set_annotationCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_image.go b/completers/kustomize_completer/cmd/edit_set_image.go new file mode 100644 index 0000000000..991fb1f84f --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_image.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_imageCmd = &cobra.Command{ + Use: "image", + Short: "Sets images and their new names, new tags or digests in the kustomization file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_imageCmd).Standalone() + edit_setCmd.AddCommand(edit_set_imageCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_label.go b/completers/kustomize_completer/cmd/edit_set_label.go new file mode 100644 index 0000000000..1ae9e2c660 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_label.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_labelCmd = &cobra.Command{ + Use: "label", + Short: "Sets one or more commonLabels in kustomization.yaml", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_labelCmd).Standalone() + edit_setCmd.AddCommand(edit_set_labelCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_nameprefix.go b/completers/kustomize_completer/cmd/edit_set_nameprefix.go new file mode 100644 index 0000000000..f1ec439056 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_nameprefix.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_nameprefixCmd = &cobra.Command{ + Use: "nameprefix", + Short: "Sets the value of the namePrefix field in the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_nameprefixCmd).Standalone() + edit_setCmd.AddCommand(edit_set_nameprefixCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_namespace.go b/completers/kustomize_completer/cmd/edit_set_namespace.go new file mode 100644 index 0000000000..e4eb7b30a3 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_namespace.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_namespaceCmd = &cobra.Command{ + Use: "namespace", + Short: "Sets the value of the namespace field in the kustomization file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_namespaceCmd).Standalone() + edit_setCmd.AddCommand(edit_set_namespaceCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_namesuffix.go b/completers/kustomize_completer/cmd/edit_set_namesuffix.go new file mode 100644 index 0000000000..918a8cee1c --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_namesuffix.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_namesuffixCmd = &cobra.Command{ + Use: "namesuffix", + Short: "Sets the value of the nameSuffix field in the kustomization file.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_namesuffixCmd).Standalone() + edit_setCmd.AddCommand(edit_set_namesuffixCmd) +} diff --git a/completers/kustomize_completer/cmd/edit_set_replicas.go b/completers/kustomize_completer/cmd/edit_set_replicas.go new file mode 100644 index 0000000000..9809547d32 --- /dev/null +++ b/completers/kustomize_completer/cmd/edit_set_replicas.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var edit_set_replicasCmd = &cobra.Command{ + Use: "replicas", + Short: "Sets replicas count for resources in the kustomization file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(edit_set_replicasCmd).Standalone() + edit_setCmd.AddCommand(edit_set_replicasCmd) +} diff --git a/completers/kustomize_completer/cmd/fn.go b/completers/kustomize_completer/cmd/fn.go new file mode 100644 index 0000000000..24a8612b6f --- /dev/null +++ b/completers/kustomize_completer/cmd/fn.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fnCmd = &cobra.Command{ + Use: "fn", + Short: "Commands for running functions against configuration.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fnCmd).Standalone() + rootCmd.AddCommand(fnCmd) +} diff --git a/completers/kustomize_completer/cmd/fn_run.go b/completers/kustomize_completer/cmd/fn_run.go new file mode 100644 index 0000000000..945edda0c6 --- /dev/null +++ b/completers/kustomize_completer/cmd/fn_run.go @@ -0,0 +1,34 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fn_runCmd = &cobra.Command{ + Use: "run", + Short: "[Alpha] Reoncile config functions to Resources.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fn_runCmd).Standalone() + fn_runCmd.Flags().Bool("as-current-user", false, "use the uid and gid of the command executor to run the function in the container") + fn_runCmd.Flags().Bool("dry-run", false, "print results to stdout") + fn_runCmd.Flags().Bool("enable-exec", false, "enable support for exec functions -- note: exec functions run arbitrary code -- do not use for untrusted configs!!! (Alpha)") + fn_runCmd.Flags().Bool("enable-star", false, "enable support for starlark functions. (Alpha)") + fn_runCmd.Flags().StringArrayP("env", "e", []string{}, "a list of environment variables to be used by functions") + fn_runCmd.Flags().String("exec-path", "", "run an executable as a function. (Alpha)") + fn_runCmd.Flags().StringSlice("fn-path", []string{}, "read functions from these directories instead of the configuration directory.") + fn_runCmd.Flags().Bool("global-scope", false, "set global scope for functions.") + fn_runCmd.Flags().String("image", "", "run this image as a function instead of discovering them.") + fn_runCmd.Flags().Bool("include-subpackages", true, "also print resources from subpackages.") + fn_runCmd.Flags().Bool("log-steps", false, "log steps to stderr") + fn_runCmd.Flags().StringArray("mount", []string{}, "a list of storage options read from the filesystem") + fn_runCmd.Flags().Bool("network", false, "enable network access for functions that declare it") + fn_runCmd.Flags().String("results-dir", "", "write function results to this dir") + fn_runCmd.Flags().String("star-name", "", "name of starlark program. (Alpha)") + fn_runCmd.Flags().String("star-path", "", "run a starlark script as a function. (Alpha)") + fn_runCmd.Flags().String("star-url", "", "run a starlark script as a function. (Alpha)") + fnCmd.AddCommand(fn_runCmd) +} diff --git a/completers/kustomize_completer/cmd/fn_sink.go b/completers/kustomize_completer/cmd/fn_sink.go new file mode 100644 index 0000000000..d51acd3e55 --- /dev/null +++ b/completers/kustomize_completer/cmd/fn_sink.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fn_sinkCmd = &cobra.Command{ + Use: "sink", + Short: "[Alpha] Implement a Sink by writing input to a local directory.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fn_sinkCmd).Standalone() + fnCmd.AddCommand(fn_sinkCmd) +} diff --git a/completers/kustomize_completer/cmd/fn_source.go b/completers/kustomize_completer/cmd/fn_source.go new file mode 100644 index 0000000000..9b544ff508 --- /dev/null +++ b/completers/kustomize_completer/cmd/fn_source.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fn_sourceCmd = &cobra.Command{ + Use: "source", + Short: "[Alpha] Implement a Source by reading a local directory.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fn_sourceCmd).Standalone() + fn_sourceCmd.Flags().String("function-config", "", "path to function config.") + fn_sourceCmd.Flags().String("wrap-kind", "ResourceList", "output using this format.") + fn_sourceCmd.Flags().String("wrap-version", "config.kubernetes.io/v1", "output using this format.") + fnCmd.AddCommand(fn_sourceCmd) +} diff --git a/completers/kustomize_completer/cmd/fn_wrap.go b/completers/kustomize_completer/cmd/fn_wrap.go new file mode 100644 index 0000000000..5389365b4e --- /dev/null +++ b/completers/kustomize_completer/cmd/fn_wrap.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fn_wrapCmd = &cobra.Command{ + Use: "wrap", + Short: "Wrap an executable so it implements the config fn interface", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fn_wrapCmd).Standalone() + fn_wrapCmd.Flags().Bool("env-only", true, "only set env vars, not arguments.") + fn_wrapCmd.Flags().String("wrap-kind", "List", "wrap the input xargs give to the command in this type.") + fn_wrapCmd.Flags().String("wrap-version", "v1", "wrap the input xargs give to the command in this type.") + fnCmd.AddCommand(fn_wrapCmd) +} diff --git a/completers/kustomize_completer/cmd/fn_xargs.go b/completers/kustomize_completer/cmd/fn_xargs.go new file mode 100644 index 0000000000..0d27c7240c --- /dev/null +++ b/completers/kustomize_completer/cmd/fn_xargs.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var fn_xargsCmd = &cobra.Command{ + Use: "xargs", + Short: "Convert functionConfig to commandline flags and envs", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(fn_xargsCmd).Standalone() + fn_xargsCmd.Flags().Bool("env-only", false, "only add env vars, not flags") + fn_xargsCmd.Flags().String("wrap-kind", "List", "wrap the input xargs give to the command in this type.") + fn_xargsCmd.Flags().String("wrap-version", "v1", "wrap the input xargs give to the command in this type.") + fnCmd.AddCommand(fn_xargsCmd) +} diff --git a/completers/kustomize_completer/cmd/help.go b/completers/kustomize_completer/cmd/help.go new file mode 100644 index 0000000000..f55758d2d7 --- /dev/null +++ b/completers/kustomize_completer/cmd/help.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var helpCmd = &cobra.Command{ + Use: "help", + Short: "Help about any command", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(helpCmd).Standalone() + rootCmd.AddCommand(helpCmd) +} diff --git a/completers/kustomize_completer/cmd/root.go b/completers/kustomize_completer/cmd/root.go new file mode 100644 index 0000000000..232777372b --- /dev/null +++ b/completers/kustomize_completer/cmd/root.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "kustomize", + Short: "Manages declarative configuration of Kubernetes", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} + +func init() { + carapace.Gen(rootCmd).Standalone() + rootCmd.Flags().BoolP("help", "h", false, "help for kustomize") + rootCmd.PersistentFlags().Bool("stack-trace", false, "print a stack-trace on error") +} diff --git a/completers/kustomize_completer/cmd/tutorialsCommandBasics.go b/completers/kustomize_completer/cmd/tutorialsCommandBasics.go new file mode 100644 index 0000000000..4c7bf9c22a --- /dev/null +++ b/completers/kustomize_completer/cmd/tutorialsCommandBasics.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var tutorialsCommandBasicsCmd = &cobra.Command{ + Use: "tutorials-command-basics", + Short: "[Alpha] Tutorials for using basic config commands.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(tutorialsCommandBasicsCmd).Standalone() + rootCmd.AddCommand(tutorialsCommandBasicsCmd) +} diff --git a/completers/kustomize_completer/cmd/tutorialsFunctionBasics.go b/completers/kustomize_completer/cmd/tutorialsFunctionBasics.go new file mode 100644 index 0000000000..47e223809b --- /dev/null +++ b/completers/kustomize_completer/cmd/tutorialsFunctionBasics.go @@ -0,0 +1,17 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var tutorialsFunctionBasicsCmd = &cobra.Command{ + Use: "tutorials-function-basics", + Short: "[Alpha] Tutorials for using functions.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(tutorialsFunctionBasicsCmd).Standalone() + rootCmd.AddCommand(tutorialsFunctionBasicsCmd) +} diff --git a/completers/kustomize_completer/cmd/version.go b/completers/kustomize_completer/cmd/version.go new file mode 100644 index 0000000000..dbd87ed8cf --- /dev/null +++ b/completers/kustomize_completer/cmd/version.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Prints the kustomize version", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(versionCmd).Standalone() + versionCmd.Flags().Bool("short", false, "short form") + rootCmd.AddCommand(versionCmd) +} diff --git a/completers/kustomize_completer/main.go b/completers/kustomize_completer/main.go new file mode 100644 index 0000000000..5d71ac2790 --- /dev/null +++ b/completers/kustomize_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/kustomize_completer/cmd" + +func main() { + cmd.Execute() +}