promote

package
v1.9.0-preview1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdPromote

func NewCmdPromote(f util.Factory, parentCommand string) *cobra.Command

NewCmdPromote defines the `promote` command that promote resources from legacy clusters

Types

type CommandPromoteOption

type CommandPromoteOption struct {
	// Cluster is the name of legacy cluster
	Cluster string

	// Namespace is the namespace of legacy resource
	Namespace string

	// ClusterContext is the cluster's context that we are going to join with.
	ClusterContext string

	// ClusterKubeConfig is the cluster's kubeconfig path.
	ClusterKubeConfig string

	// Deps tells if promote resource with its dependencies automatically, default to false
	Deps bool

	// DryRun tells if run the command in dry-run mode, without making any server requests.
	DryRun bool

	// AutoCreatePolicy tells if the promote command should create the
	// PropagationPolicy(or ClusterPropagationPolicy) by default.
	// It default to true.
	AutoCreatePolicy bool

	// PolicyName is the name of the PropagationPolicy(or ClusterPropagationPolicy),
	// It defaults to the promoting resource name with a random hash suffix.
	// It will be ingnored if AutoCreatePolicy is false.
	PolicyName string

	resource.FilenameOptions

	JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags
	OutputFormat       string
	Printer            func(*meta.RESTMapping, *bool, bool, bool) (printers.ResourcePrinterFunc, error)
	TemplateFlags      *genericclioptions.KubeTemplatePrintFlags
	// contains filtered or unexported fields
}

CommandPromoteOption holds all command options for promote

func (*CommandPromoteOption) AddFlags

func (o *CommandPromoteOption) AddFlags(flags *pflag.FlagSet)

AddFlags adds flags to the specified FlagSet.

func (*CommandPromoteOption) Complete

func (o *CommandPromoteOption) Complete(f util.Factory, args []string) error

Complete ensures that options are valid and marshals them if necessary

func (*CommandPromoteOption) Run

func (o *CommandPromoteOption) Run(f util.Factory, args []string) error

Run promote resources from legacy clusters

func (*CommandPromoteOption) Validate

func (o *CommandPromoteOption) Validate() error

Validate checks to the PromoteOptions to see if there is sufficient information run the command

Jump to

Keyboard shortcuts

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