commands

package
v0.39.3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 59 Imported by: 3

Documentation

Index

Constants

View Source
const ShortHandRef = "$kpt-set"

Variables

View Source
var READMEExamples = `
    # run the tutorial for ` + "`" + `kpt cfg annotate` + "`" + `
    kpt ttl cfg annotate

    # run the tutorial at 2x speed
    kpt ttl cfg annotate -s 2

    # run the tutorial at 1/2x speed
    kpt ttl cfg annotate -s 0.5

    # print the full tutorial rather than playing it
    kpt ttl cfg annotate --print`
View Source
var READMELong = `
Tutorials simulates running a sequence of commands and their output by playing
an asciinema cast.

Requires [asciinema].
`
View Source
var READMEShort = `Run command tutorials`

Functions

func CreateSetterCommand added in v0.28.0

func CreateSetterCommand(parent string) *cobra.Command

func CreateSubstCommand added in v0.28.0

func CreateSubstCommand(parent string) *cobra.Command

func DeleteSetterCommand added in v0.31.0

func DeleteSetterCommand(parent string) *cobra.Command

func DeleteSubstitutionCommand added in v0.34.0

func DeleteSubstitutionCommand(parent string) *cobra.Command

func GetAnthosCommands

func GetAnthosCommands(name string) []*cobra.Command

func GetConfigCommand

func GetConfigCommand(name string) *cobra.Command

func GetFnCommand

func GetFnCommand(name string) *cobra.Command

func GetGuideCommand added in v0.16.0

func GetGuideCommand(name string) *cobra.Command

func GetKptCommands

func GetKptCommands(name string, f util.Factory) []*cobra.Command

GetKptCommands returns the set of kpt commands to be registered

func GetLiveCommand

func GetLiveCommand(name string, f util.Factory) *cobra.Command

func GetPkgCommand

func GetPkgCommand(name string) *cobra.Command

func GetTTLCommand

func GetTTLCommand(name string) *cobra.Command

func NewCmdInit added in v0.35.0

func NewCmdInit(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdInit returns the cobra command for the init command.

func NewCmdInstallRG added in v0.38.0

func NewCmdInstallRG(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdInstallRG returns the cobra command for the install-resource-group command.

func NewCmdMigrate added in v0.37.0

func NewCmdMigrate(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewCmdMigrate returns the cobra command for the migrate command.

func NormalizeCommand

func NormalizeCommand(c ...*cobra.Command)

NormalizeCommand will modify commands to be consistent, e.g. silencing errors

func SetCommand

func SetCommand(parent string) *cobra.Command

SetCommand wraps the kustomize set command in order to automatically update a project number if a project id is set.

Types

type ApplyRunnerWrapper added in v0.38.0

type ApplyRunnerWrapper struct {
	// contains filtered or unexported fields
}

ApplyRunnerWrapper encapsulates the cli-utils apply command ApplyRunner as well as structures necessary to run.

func GetApplyRunner added in v0.38.0

Get ApplyRunner returns a wrapper around the cli-utils apply command ApplyRunner. Sets up the Run on this wrapped runner to be the ApplyRunnerWrapper run.

func (*ApplyRunnerWrapper) Command added in v0.38.0

func (w *ApplyRunnerWrapper) Command() *cobra.Command

Command returns the wrapped ApplyRunner cobraCommand structure.

func (*ApplyRunnerWrapper) PreRunE added in v0.38.0

func (w *ApplyRunnerWrapper) PreRunE(_ *cobra.Command, args []string) error

func (*ApplyRunnerWrapper) RunE added in v0.38.0

func (w *ApplyRunnerWrapper) RunE(cmd *cobra.Command, args []string) error

RunE runs the ResourceGroup CRD installation as a pre-step if an environment variable exists. Then the wrapped ApplyRunner is invoked. Returns an error if one happened. Swallows the "AlreadyExists" error for CRD installation.

type DestroyRunnerWrapper added in v0.38.0

type DestroyRunnerWrapper struct {
	// contains filtered or unexported fields
}

DestroyRunnerWrapper encapsulates the cli-utils destroy command DestroyRunner as well as structures necessary to run.

func GetDestroyRunner added in v0.38.0

func GetDestroyRunner(provider provider.Provider, loader manifestreader.ManifestLoader, ioStreams genericclioptions.IOStreams) *DestroyRunnerWrapper

GetDestroyRunner returns a wrapper around the cli-utils destroy command DestroyRunner. Sets up the Run on this wrapped runner to be the DestroyRunnerWrapper run.

func (*DestroyRunnerWrapper) Command added in v0.38.0

func (w *DestroyRunnerWrapper) Command() *cobra.Command

Command returns the wrapped DestroyRunner cobraCommand structure.

func (*DestroyRunnerWrapper) RunE added in v0.38.0

func (w *DestroyRunnerWrapper) RunE(cmd *cobra.Command, args []string) error

RunE wraps the destroyRunner.RunE with the pre-processing for inventory policy.

type InstallRGRunner added in v0.38.0

type InstallRGRunner struct {
	Command *cobra.Command
	// contains filtered or unexported fields
}

InstallRGRunner encapsulates fields for the kpt live install-resource-group command.

func GetInstallRGRunner added in v0.38.0

func GetInstallRGRunner(factory cmdutil.Factory, ioStreams genericclioptions.IOStreams) *InstallRGRunner

GetInstallRGRunner returns a pointer to an initial InstallRGRunner structure.

func (*InstallRGRunner) Run added in v0.38.0

func (ir *InstallRGRunner) Run(reader io.Reader, args []string) error

Run executes the installation of the ResourceGroup custom resource definition. Uses the current context of the kube config file (or the kube config flags) to determine the APIServer to install the CRD.

type InvExistsError added in v0.37.0

type InvExistsError struct{}

InvExistsError defines new error when the inventory values have already been set on the Kptfile.

func (*InvExistsError) Error added in v0.37.0

func (i *InvExistsError) Error() string

type KptInitOptions added in v0.35.0

type KptInitOptions struct {
	Quiet bool // Print output or not
	// contains filtered or unexported fields
}

KptInitOptions encapsulates fields for kpt init command. This init command fills in inventory values in the Kptfile.

func NewKptInitOptions added in v0.35.0

func NewKptInitOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *KptInitOptions

NewKptInitOptions returns a pointer to an initial KptInitOptions structure.

func (*KptInitOptions) Run added in v0.35.0

func (io *KptInitOptions) Run(args []string) error

Complete fills in fields for KptInitOptions based on the passed "args".

type MigrateRunner added in v0.37.0

type MigrateRunner struct {
	Command *cobra.Command
	// contains filtered or unexported fields
}

MigrateRunner encapsulates fields for the kpt migrate command.

func GetMigrateRunner added in v0.37.0

func GetMigrateRunner(cmProvider provider.Provider, rgProvider provider.Provider,
	cmLoader manifestreader.ManifestLoader, rgLoader manifestreader.ManifestLoader,
	ioStreams genericclioptions.IOStreams) *MigrateRunner

NewMigrateRunner returns a pointer to an initial MigrateRunner structure.

func (*MigrateRunner) Run added in v0.37.0

func (mr *MigrateRunner) Run(reader io.Reader, args []string) error

Run executes the migration from the ConfigMap based inventory to the ResourceGroup based inventory.

type PreviewRunnerWrapper added in v0.38.0

type PreviewRunnerWrapper struct {
	// contains filtered or unexported fields
}

PreviewRunnerWrapper encapsulates the cli-utils preview command PreviewRunner as well as structures necessary to run.

func GetPreviewRunner added in v0.38.0

func GetPreviewRunner(provider provider.Provider, loader manifestreader.ManifestLoader, ioStreams genericclioptions.IOStreams) *PreviewRunnerWrapper

Get PreviewRunner returns a wrapper around the cli-utils preview command PreviewRunner. Sets up the Run on this wrapped runner to be the PreviewRunnerWrapper run.

func (*PreviewRunnerWrapper) Command added in v0.38.0

func (w *PreviewRunnerWrapper) Command() *cobra.Command

Command returns the wrapped PreviewRunner cobraCommand structure.

func (*PreviewRunnerWrapper) PreRunE added in v0.38.0

func (w *PreviewRunnerWrapper) PreRunE(_ *cobra.Command, args []string) error

func (*PreviewRunnerWrapper) RunE added in v0.38.0

func (w *PreviewRunnerWrapper) RunE(cmd *cobra.Command, args []string) error

RunE checks if required setters are set as a pre-step if Kptfile exists in the package path. Then the wrapped PreviewRunner is invoked. Returns an error if one happened.

Jump to

Keyboard shortcuts

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