types

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKubernetesClusterCommand

func NewKubernetesClusterCommand(ctx context.Context, superOpts *TargetCreateOpts) *cobra.Command

func NewTargetCreateSubcommand added in v0.20.0

func NewTargetCreateSubcommand(ctx context.Context, cmd *cobra.Command, run TypedTargetCreator, opts *TargetCreateOpts) *cobra.Command

NewTargetCreateSubcommand wraps target-type-specific code with generic functionality for target creation. It overwrites the given command's Run field with a function that

  • uses the given TypedTargetCreator function to generate the target's content
  • generates the Target yaml and potentially secret yaml, depending on the options
  • either prints the yaml file(s) to stdout or the given path, depending on the options

Types

type TargetCreateOpts added in v0.20.0

type TargetCreateOpts struct {
	// Name is the name of the target. It is required.
	Name string
	// Namespace is the namespace of the target.
	Namespace string
	// OutputPath defines where to write the generated target to.
	// If it is empty, the generated target will be printed to stdout,
	// otherwise it will be put into a file at the specified path.
	OutputPath string
	// SecretName defines the name of the secret which should be used to store the target's content.
	// If empty, the content will be put into the target's spec directly.
	SecretName string
}

TargetCreateOpts contains the options which all target creation subcommands have in common.

func (*TargetCreateOpts) AddFlags added in v0.20.0

func (o *TargetCreateOpts) AddFlags(fs *pflag.FlagSet)

type TypedTargetCreator added in v0.20.0

type TypedTargetCreator func(context.Context, *TargetCreateOpts) ([]byte, lsv1alpha1.TargetType, error)

TypedTargetCreator is a function which takes a context and the common target creation options and returns the content which should be put into the target, as well as the target's type.

Jump to

Keyboard shortcuts

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