Publish cmd/config as a Kustomize sub-command

This commit is contained in:
Phillip Wittrock
2019-11-25 10:25:02 -08:00
parent 598854440a
commit 4a65ea8056
3 changed files with 24 additions and 10 deletions

View File

@@ -10,20 +10,13 @@ import (
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts"
"sigs.k8s.io/kustomize/cmd/config/cmds"
)
// NewCmdConfig returns an instance of 'config' subcommand.
func NewCmdConfig(fSys filesys.FileSystem) *cobra.Command {
c := &cobra.Command{
Use: "config",
Short: "Config Kustomize transformers",
Long: "",
Example: `
# Save the default transformer configurations to a local directory
kustomize config save -d ~/.kustomize/config
`,
Args: cobra.MinimumNArgs(1),
}
c := cmds.NewConfigCommand("kustomize")
c.AddCommand(
newCmdSave(fSys),
)
@@ -57,6 +50,12 @@ func newCmdSave(fSys filesys.FileSystem) *cobra.Command {
}
return o.RunSave(fSys)
},
Hidden: true, // Don't display this command, but keep it for backwards compatibility.
Deprecated: `The save command is deprecated and will be removed in a future release.
If you require this command file an issue at https://github.com/kubernetes-sigs/kustomize/issues
so we can capture your requirements.
`,
}
c.Flags().StringVarP(
&o.saveDirectory,