cmd

package
v0.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagRegistry = []Flag{
	{
		Name:          "filename",
		Shorthand:     "f",
		Usage:         "Filename or URL to the pipeline file",
		Value:         &opts.ConfigurationFile,
		DefValue:      "skaffold.yaml",
		FlagAddMethod: "StringVar",
		DefinedOn:     []string{"all"},
	},
	{
		Name:          "profile",
		Shorthand:     "p",
		Usage:         "Activate profiles by name",
		Value:         &opts.Profiles,
		DefValue:      []string{},
		FlagAddMethod: "StringSliceVar",
		DefinedOn:     []string{"all"},
	},
	{
		Name:          "namespace",
		Shorthand:     "n",
		Usage:         "Run deployments in the specified namespace",
		Value:         &opts.Namespace,
		DefValue:      "",
		FlagAddMethod: "StringVar",
		DefinedOn:     []string{"all"},
	},
	{
		Name:          "default-repo",
		Shorthand:     "d",
		Usage:         "Default repository value (overrides global config)",
		Value:         &opts.DefaultRepo,
		DefValue:      "",
		FlagAddMethod: "StringVar",
		DefinedOn:     []string{"all"},
	},
	{
		Name:          "cache-artifacts",
		Usage:         "Set to true to enable caching of artifacts",
		Value:         &opts.CacheArtifacts,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "build", "run", "debug"},
	},
	{
		Name:          "cache-file",
		Usage:         "Specify the location of the cache file (default $HOME/.skaffold/cache)",
		Value:         &opts.CacheFile,
		DefValue:      "",
		FlagAddMethod: "StringVar",
		DefinedOn:     []string{"dev", "build", "run", "debug"},
	},
	{
		Name:          "insecure-registry",
		Usage:         "Target registries for built images which are not secure",
		Value:         &opts.InsecureRegistries,
		DefValue:      []string{},
		FlagAddMethod: "StringSliceVar",
		DefinedOn:     []string{"dev", "build", "run", "debug"},
	},
	{
		Name:          "enable-rpc",
		Usage:         "Enable gRPC for exposing Skaffold events (true by default for `skaffold dev`)",
		Value:         &opts.EnableRPC,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "build", "run", "debug", "deploy"},
	},
	{
		Name:          "rpc-port",
		Usage:         "tcp port to expose event API",
		Value:         &opts.RPCPort,
		DefValue:      constants.DefaultRPCPort,
		FlagAddMethod: "IntVar",
		DefinedOn:     []string{"dev", "build", "run", "debug", "deploy"},
	},
	{
		Name:          "rpc-http-port",
		Usage:         "tcp port to expose event REST API over HTTP",
		Value:         &opts.RPCHTTPPort,
		DefValue:      constants.DefaultRPCHTTPPort,
		FlagAddMethod: "IntVar",
		DefinedOn:     []string{"dev", "build", "run", "debug", "deploy"},
	},
	{
		Name:          "label",
		Shorthand:     "l",
		Usage:         "Add custom labels to deployed objects. Set multiple times for multiple labels",
		Value:         &opts.CustomLabels,
		DefValue:      []string{},
		FlagAddMethod: "StringSliceVar",
		DefinedOn:     []string{"dev", "run", "debug", "deploy"},
	},
	{
		Name:          "toot",
		Usage:         "Emit a terminal beep after the deploy is complete",
		Value:         &opts.Notification,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "build", "run", "debug", "deploy"},
	},

	{
		Name:          "tail",
		Usage:         "Stream logs from deployed objects (default false)",
		Value:         &opts.Tail,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"deploy", "run"},
	},
	{
		Name:          "tail",
		Usage:         "Stream logs from deployed objects",
		Value:         &opts.TailDev,
		DefValue:      true,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "debug"},
	},

	{
		Name:          "force",
		Usage:         "Recreate kubernetes resources if necessary for deployment (default false, warning: might cause downtime!)",
		Value:         &opts.Force,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"deploy"},
	},
	{
		Name:          "force",
		Usage:         "Recreate kubernetes resources if necessary for deployment (warning: might cause downtime!)",
		Value:         &opts.ForceDev,
		DefValue:      true,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "run", "debug"},
	},
	{
		Name:          "skip-tests",
		Usage:         "Whether to skip the tests after building",
		Value:         &opts.SkipTests,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "run", "debug", "build"},
	},
	{
		Name:          "cleanup",
		Usage:         "Delete deployments after dev or debug mode is interrupted",
		Value:         &opts.Cleanup,
		DefValue:      true,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "run", "debug"},
	},
	{
		Name:          "no-prune",
		Usage:         "Skip removing images and containers built by Skaffold",
		Value:         &opts.NoPrune,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "run", "debug"},
	},
	{
		Name:          "no-prune-children",
		Usage:         "Skip removing layers reused by Skaffold",
		Value:         &opts.NoPruneChildren,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "run", "debug"},
	},
	{
		Name:          "port-forward",
		Usage:         "Port-forward exposed container ports within pods",
		Value:         &opts.PortForward.Enabled,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "debug"},
	},
	{
		Name:          "status-check",
		Usage:         "Wait for deployed resources to stabilize",
		Value:         &opts.StatusCheck,
		DefValue:      false,
		FlagAddMethod: "BoolVar",
		DefinedOn:     []string{"dev", "debug", "deploy", "run"},
	},
}

FlagRegistry is a list of all Skaffold CLI flags. When adding a new flag to the registry, please specify the command/commands to which the flag belongs in `DefinedOn` field. If the flag is a global flag, or belongs to all the subcommands, / specify "all" FlagAddMethod is method which defines a flag value with specified name, default value, and usage string. e.g. `StringVar`, `BoolVar`

Functions

func AddFlags added in v0.30.0

func AddFlags(fs *pflag.FlagSet, cmdName string)

func FlagToEnvVarName added in v0.20.0

func FlagToEnvVarName(f *pflag.Flag) string

func NewCmdBuild added in v0.6.0

func NewCmdBuild() *cobra.Command

NewCmdBuild describes the CLI command to build artifacts.

func NewCmdCompletion added in v0.4.0

func NewCmdCompletion() *cobra.Command

NewCmdCompletion returns the cobra command that outputs shell completion code

func NewCmdConfig added in v0.13.0

func NewCmdConfig() *cobra.Command

func NewCmdDebug added in v0.26.0

func NewCmdDebug() *cobra.Command

NewCmdDebug describes the CLI command to run a pipeline in debug mode.

func NewCmdDelete added in v0.7.0

func NewCmdDelete() *cobra.Command

NewCmdDelete describes the CLI command to delete deployed resources.

func NewCmdDeploy added in v0.7.0

func NewCmdDeploy() *cobra.Command

NewCmdDeploy describes the CLI command to deploy artifacts.

func NewCmdDev

func NewCmdDev() *cobra.Command

NewCmdDev describes the CLI command to run a pipeline in development mode.

func NewCmdDiagnose added in v0.16.0

func NewCmdDiagnose() *cobra.Command

NewCmdDiagnose describes the CLI command to diagnose skaffold.

func NewCmdFindConfigs added in v0.32.0

func NewCmdFindConfigs() *cobra.Command

NewCmdFindConfigs list the skaffold config files in the specified directory.

func NewCmdFix added in v0.4.0

func NewCmdFix() *cobra.Command

func NewCmdInit added in v0.14.0

func NewCmdInit() *cobra.Command

NewCmdInit describes the CLI command to generate a Skaffold configuration.

func NewCmdList added in v0.31.0

func NewCmdList() *cobra.Command

func NewCmdOptions added in v0.34.0

func NewCmdOptions() *cobra.Command

func NewCmdRun

func NewCmdRun() *cobra.Command

NewCmdRun describes the CLI command to run a pipeline.

func NewCmdSet added in v0.31.0

func NewCmdSet() *cobra.Command

func NewCmdUnset added in v0.31.0

func NewCmdUnset() *cobra.Command

func NewCmdVersion

func NewCmdVersion() *cobra.Command

func NewSkaffoldCommand

func NewSkaffoldCommand(out, err io.Writer) *cobra.Command

func SetUpFlags added in v0.30.0

func SetUpFlags()

SetUpFlags creates pflag.Flag for all registered flags

Types

type Builder added in v0.31.0

type Builder interface {
	WithDescription(description string) Builder
	WithLongDescription(long string) Builder
	WithExample(comment, command string) Builder
	WithFlags(adder func(*pflag.FlagSet)) Builder
	WithCommonFlags() Builder
	Hidden() Builder
	ExactArgs(argCount int, action func(io.Writer, []string) error) *cobra.Command
	NoArgs(action func(io.Writer) error) *cobra.Command
}

Builder is used to build cobra commands.

func NewCmd added in v0.31.0

func NewCmd(use string) Builder

NewCmd creates a new command builder.

type Flag added in v0.30.0

type Flag struct {
	Name          string
	Shorthand     string
	Usage         string
	Value         interface{}
	DefValue      interface{}
	FlagAddMethod string
	DefinedOn     []string
}

Flag defines a Skaffold CLI flag which contains a list of subcommands the flag belongs to in `DefinedOn` field.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL