command

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CoreReleaseURI holds the URI for the release yaml to install.
	// This will generally hold a path to config/core, which is infused
	// via linker flags at build time.  For development, this will
	// typically hold a local file path, but for releases will point to
	// a URL.  See ./hack/build-flags.sh for the linker magic.
	CoreReleaseURI = ""

	// InMemoryReleaseURI is the analog of CoreReleaseURI for config/in-memory.
	InMemoryReleaseURI = ""
)
View Source
var (
	// Version is the version string at which the CLI is built.
	Version string
	// BuildDate is the date on which this CLI binary was built
	BuildDate string
	// GitRevision is the git commit from which this CLI binary was built.
	GitRevision string
)

These are populated at link time, see ./hack/build-flags.sh

Functions

func BinaryName

func BinaryName() string

BinaryName of how we are being used.

func ExamplePrefix

func ExamplePrefix() string

ExamplePrefix is the prefix to use in our examples.

func Kubeconfig

func Kubeconfig() string

Kubeconfig establishes the appropriate kubernetes configuration file to use.

func Namespace

func Namespace() string

Namespace establishes the appropriate default namespace.

func NewApplyCommand added in v0.19.0

func NewApplyCommand(ctx context.Context) *cobra.Command

NewApplyCommand implements 'kn-im apply' command

func NewBuildCommand

func NewBuildCommand(ctx context.Context) *cobra.Command

NewBuildCommand implements 'kn-im build' command

func NewBuildpackCommand

func NewBuildpackCommand(ctx context.Context) *cobra.Command

NewBuildpackCommand implements 'kn-im build' command

func NewBundleCommand

func NewBundleCommand(ctx context.Context) *cobra.Command

NewBundleCommand implements 'kn-im bundle' command

func NewInstallCommand added in v0.19.0

func NewInstallCommand(ctx context.Context) *cobra.Command

NewInstallCommand implements 'kn-im install' command

func NewResolveCommand added in v0.19.0

func NewResolveCommand(ctx context.Context) *cobra.Command

NewResolveCommand implements 'kn-im resolve' command

func NewRunCommand added in v0.20.0

func NewRunCommand(ctx context.Context) *cobra.Command

NewRunCommand implements 'kn-im run' command

func NewRunPipelineCommand added in v0.20.0

func NewRunPipelineCommand(ctx context.Context) *cobra.Command

NewRunPipelineCommand implements 'kn-im run pipeline' command

func NewRunTaskCommand added in v0.20.0

func NewRunTaskCommand(ctx context.Context) *cobra.Command

NewRunTaskCommand implements 'kn-im run task' command

func NewVersionCommand

func NewVersionCommand() *cobra.Command

NewVersionCommand implements 'kn-im version' command

Types

type ApplyOptions added in v0.19.0

type ApplyOptions struct {
	// Inherit all of the base build options.
	ResolveOptions
}

ApplyOptions implements Interface for the `kn im apply` command.

func (*ApplyOptions) Execute added in v0.19.0

func (opts *ApplyOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

type BaseBuildOptions added in v0.19.0

type BaseBuildOptions struct {
	// Inherit all of the bundle options.
	BundleOptions

	// ImageName is the string name of the bundle image to which we should publish things.
	ImageName string

	// ServiceAccount is the name of the service account *as* which to run the build.
	ServiceAccount string
	// contains filtered or unexported fields
}

BaseBuildOptions implements Interface for the `kn im build` command.

func (*BaseBuildOptions) AddFlags added in v0.19.0

func (opts *BaseBuildOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*BaseBuildOptions) Validate added in v0.19.0

func (opts *BaseBuildOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type BuildOptions added in v0.19.0

type BuildOptions struct {
	// Inherit all of the base build options.
	BaseBuildOptions
	// contains filtered or unexported fields
}

BuildOptions implements Interface for the `kn im build` command.

func (*BuildOptions) AddFlags added in v0.19.0

func (opts *BuildOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*BuildOptions) Execute added in v0.19.0

func (opts *BuildOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*BuildOptions) Validate added in v0.19.0

func (opts *BuildOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type BuildpackOptions added in v0.19.0

type BuildpackOptions struct {
	// Inherit all of the base build options.
	BaseBuildOptions
	// contains filtered or unexported fields
}

BuildpackOptions implements Interface for the `kn im build` command.

func (*BuildpackOptions) AddFlags added in v0.19.0

func (opts *BuildpackOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*BuildpackOptions) Execute added in v0.19.0

func (opts *BuildpackOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*BuildpackOptions) Validate added in v0.19.0

func (opts *BuildpackOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type BundleMode added in v0.20.0

type BundleMode int

BundleMode indicates the type of bundling mode that this bundle command is performing.

const (
	UnknownMode BundleMode = iota
	KontextMode
	GitMode
)

These constants define the different bundle "modes".

func (BundleMode) String added in v0.20.0

func (m BundleMode) String() string

String implements fmt.Stringer

type BundleOptions added in v0.19.0

type BundleOptions struct {

	// ImageName is the string name of the bundle image to which we should publish things.
	ImageName string

	// Directory is the string containing the directory to bundle.
	// This option signals "kontext mode".
	Directory string

	// GitURL is the URL of the git repository to clone.
	// This option signals "git mode".
	GitURL string
	// GitRef is the ref to check out within the above repository.
	GitRef plumbing.ReferenceName
	// contains filtered or unexported fields
}

BundleOptions implements Interface for the `kn im bundle` command.

func (*BundleOptions) AddFlags added in v0.19.0

func (opts *BundleOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*BundleOptions) Execute added in v0.19.0

func (opts *BundleOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*BundleOptions) GetContext added in v0.20.0

func (opts *BundleOptions) GetContext(cmd *cobra.Command) context.Context

GetContext implements Interface

func (*BundleOptions) Validate added in v0.19.0

func (opts *BundleOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type InstallOptions added in v0.20.0

type InstallOptions struct {
	Domain   string
	InMemory bool
	Replicas int
	// contains filtered or unexported fields
}

InstallOptions implements Interface for the `kn im install` command.

func (*InstallOptions) AddFlags added in v0.20.0

func (opts *InstallOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*InstallOptions) Execute added in v0.20.0

func (opts *InstallOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*InstallOptions) GetContext added in v0.20.0

func (opts *InstallOptions) GetContext(cmd *cobra.Command) context.Context

GetContext implements Interface

func (*InstallOptions) Validate added in v0.20.0

func (opts *InstallOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type Interface added in v0.19.0

type Interface interface {
	// GetContext fetches the context for the given command.
	GetContext(cmd *cobra.Command) context.Context

	// AddFlags populates the flags needed by this command.
	AddFlags(cmd *cobra.Command)

	// Validate checks the command line arguments and configuration
	// prior to executing the command.
	Validate(cmd *cobra.Command, args []string) error

	// Execute runs the command.
	Execute(cmd *cobra.Command, args []string) error
}

Interface defines the interface that various options types are expected to adhere to.

type Processor added in v0.20.0

type Processor interface {
	PreRun(params []v1beta1.ParamSpec) ([]v1beta1.Param, error)
	PostRun(results []v1beta1.TaskRunResult) error
}

Processor is an interface for augmenting a vanilla run execution with additional pre/post functionality "mixed in".

func ValidationErrorProcessor added in v0.20.0

func ValidationErrorProcessor(f string, args ...interface{}) Processor

ValidationErrorProcessor constructs a Processor that surfaces a validation error.

type ProcessorFuncs added in v0.20.0

type ProcessorFuncs struct {
	PreRunFunc  func([]v1beta1.ParamSpec) ([]v1beta1.Param, error)
	PostRunFunc func([]v1beta1.TaskRunResult) error
}

ProcessorFuncs is a helper for implementing Processor

func (*ProcessorFuncs) PostRun added in v0.20.0

func (pf *ProcessorFuncs) PostRun(results []v1beta1.TaskRunResult) error

PostRun implements Processor

func (*ProcessorFuncs) PreRun added in v0.20.0

func (pf *ProcessorFuncs) PreRun(params []v1beta1.ParamSpec) ([]v1beta1.Param, error)

PreRun implements Processor

type ResolveOptions added in v0.19.0

type ResolveOptions struct {
	// Inherit all of the base build options.
	BaseBuildOptions

	Filenames []string
	Recursive bool

	Parallelism int
	// contains filtered or unexported fields
}

ResolveOptions implements Interface for the `kn im resolve` command.

func (*ResolveOptions) AddFlags added in v0.19.0

func (opts *ResolveOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*ResolveOptions) EnumerateFiles added in v0.19.0

func (opts *ResolveOptions) EnumerateFiles() (files []string)

EnumerateFiles is based heavily on pkg/kubectl

func (*ResolveOptions) Execute added in v0.19.0

func (opts *ResolveOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*ResolveOptions) ResolveFile added in v0.19.0

func (opts *ResolveOptions) ResolveFile(ctx context.Context, f string) (blocks []*yaml.Node, err error)

ResolveFile is based heavily on ko's resolveFile

func (*ResolveOptions) ResolveReferences added in v0.19.0

func (opts *ResolveOptions) ResolveReferences(ctx context.Context, docs []*yaml.Node, source name.Digest) error

ResolveReferences is based heavily on ko's ImageReferences

func (*ResolveOptions) Validate added in v0.19.0

func (opts *ResolveOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type RunOptions added in v0.20.0

type RunOptions struct {
	// Inherit all of the base build options.
	BaseBuildOptions
	// contains filtered or unexported fields
}

RunOptions is a base for the RunFooOptions commands.

type RunPipelineOptions added in v0.20.0

type RunPipelineOptions struct {
	// Inherit all of the base run options.
	RunOptions
}

RunPipelineOptions implements Interface for the `kn im run pipeline` command.

func (*RunPipelineOptions) AddFlags added in v0.20.0

func (opts *RunPipelineOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*RunPipelineOptions) Execute added in v0.20.0

func (opts *RunPipelineOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*RunPipelineOptions) Validate added in v0.20.0

func (opts *RunPipelineOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

type RunTaskOptions added in v0.20.0

type RunTaskOptions struct {
	// Inherit all of the base run options.
	RunOptions
}

RunTaskOptions implements Interface for the `kn im run task` command.

func (*RunTaskOptions) AddFlags added in v0.20.0

func (opts *RunTaskOptions) AddFlags(cmd *cobra.Command)

AddFlags implements Interface

func (*RunTaskOptions) Execute added in v0.20.0

func (opts *RunTaskOptions) Execute(cmd *cobra.Command, args []string) error

Execute implements Interface

func (*RunTaskOptions) Validate added in v0.20.0

func (opts *RunTaskOptions) Validate(cmd *cobra.Command, args []string) error

Validate implements Interface

Jump to

Keyboard shortcuts

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