Documentation ¶
Index ¶
- Variables
- func BinaryName() string
- func ExamplePrefix() string
- func Kubeconfig() string
- func Namespace() string
- func NewApplyCommand(ctx context.Context) *cobra.Command
- func NewBuildCommand(ctx context.Context) *cobra.Command
- func NewBuildpackCommand(ctx context.Context) *cobra.Command
- func NewBundleCommand(ctx context.Context) *cobra.Command
- func NewInstallCommand(ctx context.Context) *cobra.Command
- func NewResolveCommand(ctx context.Context) *cobra.Command
- func NewRunCommand(ctx context.Context) *cobra.Command
- func NewRunPipelineCommand(ctx context.Context) *cobra.Command
- func NewRunTaskCommand(ctx context.Context) *cobra.Command
- func NewVersionCommand() *cobra.Command
- type ApplyOptions
- type BaseBuildOptions
- type BuildOptions
- type BuildpackOptions
- type BundleMode
- type BundleOptions
- type InstallOptions
- type Interface
- type Processor
- type ProcessorFuncs
- type ResolveOptions
- func (opts *ResolveOptions) AddFlags(cmd *cobra.Command)
- func (opts *ResolveOptions) EnumerateFiles() (files []string)
- func (opts *ResolveOptions) Execute(cmd *cobra.Command, args []string) error
- func (opts *ResolveOptions) ResolveFile(ctx context.Context, f string) (blocks []*yaml.Node, err error)
- func (opts *ResolveOptions) ResolveReferences(ctx context.Context, docs []*yaml.Node, source name.Digest) error
- func (opts *ResolveOptions) Validate(cmd *cobra.Command, args []string) error
- type RunOptions
- type RunPipelineOptions
- type RunTaskOptions
Constants ¶
This section is empty.
Variables ¶
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 = "" )
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 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 NewApplyCommand ¶ added in v0.19.0
NewApplyCommand implements 'kn-im apply' command
func NewBuildCommand ¶
NewBuildCommand implements 'kn-im build' command
func NewBuildpackCommand ¶
NewBuildpackCommand implements 'kn-im build' command
func NewBundleCommand ¶
NewBundleCommand implements 'kn-im bundle' command
func NewInstallCommand ¶ added in v0.19.0
NewInstallCommand implements 'kn-im install' command
func NewResolveCommand ¶ added in v0.19.0
NewResolveCommand implements 'kn-im resolve' command
func NewRunCommand ¶ added in v0.20.0
NewRunCommand implements 'kn-im run' command
func NewRunPipelineCommand ¶ added in v0.20.0
NewRunPipelineCommand implements 'kn-im run pipeline' command
func NewRunTaskCommand ¶ added in v0.20.0
NewRunTaskCommand implements 'kn-im run task' command
func NewVersionCommand ¶
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.
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
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
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
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
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
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
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
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
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
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