Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommand ¶
BuildCommand build create command
Types ¶
type BaseOptions ¶
type BaseOptions struct {
// Namespace k8s namespace
Namespace string `json:"namespace"`
// Name Resource name of the command line operation
Name string `json:"name"`
Dynamic dynamic.Interface `json:"-"`
Client kubernetes.Interface `json:"-"`
// Quiet minimize unnecessary output
Quiet bool
genericclioptions.IOStreams
}
BaseOptions the options of creation command should inherit baseOptions
func (*BaseOptions) CleanUp ¶
func (o *BaseOptions) CleanUp(inputs Inputs) error
func (*BaseOptions) Run ¶
func (o *BaseOptions) Run(inputs Inputs) error
Run execute command. the options of parameter contain the command flags and args.
func (*BaseOptions) RunAsApply ¶
func (o *BaseOptions) RunAsApply(inputs Inputs) error
RunAsApply execute command. the options of parameter contain the command flags and args. if the resource exists, run as "kubectl apply".
func (*BaseOptions) Validate ¶
func (o *BaseOptions) Validate(inputs Inputs) error
type CreateDependency ¶
type Inputs ¶
type Inputs struct {
// Use cobra command use
Use string
// Short is the short description shown in the 'help' output.
Short string
// Example is examples of how to use the command.
Example string
// BaseOptionsObj
BaseOptionsObj *BaseOptions
// Options a command options object which extends BaseOptions
Options interface{}
// CueTemplateName cue template file name
CueTemplateName string
// ResourceName k8s resource name
ResourceName string
// Group of API, default is apps
Group string
// Group of Version, default is v1alpha1
Version string
// Factory
Factory cmdutil.Factory
// ValidateFunc optional, custom validate func
Validate func() error
// Complete optional, do custom complete options
Complete func() error
BuildFlags func(*cobra.Command)
// PreCreate optional, make changes on yaml before create
PreCreate func(*unstructured.Unstructured) error
// CustomOutPut will be executed after creating successfully.
CustomOutPut func(options *BaseOptions)
// CleanUpFn will be executed after creating failed.
CleanUpFn func() error
// CreateDependencies will be executed before creating.
CreateDependencies CreateDependency
// ResourceNameGVRForCompletion resource name for completion.
ResourceNameGVRForCompletion schema.GroupVersionResource
}
Click to show internal directories.
Click to hide internal directories.