-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
1,198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
Oops, something went wrong.