Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDependency ¶
type CreateOptions ¶
type CreateOptions struct {
Factory cmdutil.Factory
Namespace string
// Name Resource name of the command line operation
Name string
Args []string
Dynamic dynamic.Interface
Client kubernetes.Interface
Format printer.Format
ToPrinter func(*meta.RESTMapping, bool) (printers.ResourcePrinterFunc, error)
DryRun string
EditBeforeCreate bool
// CueTemplateName cue template file name to render the resource
CueTemplateName string
// Options a command options object which extends CreateOptions that will be used
// to render the cue template
Options interface{}
// GVR is the GroupVersionResource of the resource to be created
GVR schema.GroupVersionResource
// CustomOutPut will be executed after creating successfully.
CustomOutPut func(options *CreateOptions)
// PreCreate optional, make changes on yaml before create
PreCreate func(*unstructured.Unstructured) error
// CleanUpFn will be executed after creating failed.
CleanUpFn func() error
// CreateDependencies will be executed before creating.
CreateDependencies CreateDependency
// Quiet minimize unnecessary output
Quiet bool
genericiooptions.IOStreams
}
CreateOptions the options of creation command should inherit baseOptions
func (*CreateOptions) CleanUp ¶
func (o *CreateOptions) CleanUp() error
func (*CreateOptions) Complete ¶
func (o *CreateOptions) Complete() error
func (*CreateOptions) GetDryRunStrategy ¶
func (o *CreateOptions) GetDryRunStrategy() (DryRunStrategy, error)
func (*CreateOptions) Run ¶
func (o *CreateOptions) Run() error
Run execute command. the options of parameter contain the command flags and args.
type CustomEditOptions ¶
type CustomEditOptions struct {
Factory cmdutil.Factory
PrintFlags *genericclioptions.PrintFlags
Method string
TestEnv bool
genericiooptions.IOStreams
}
CustomEditOptions is used to edit the resource manifest when creating or updating the resource, instead of using -o yaml to output the yaml file before editing the manifest.
func NewCustomEditOptions ¶
func NewCustomEditOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, method string) *CustomEditOptions
type DeleteHook ¶
type DeleteHook func(options *DeleteOptions, object runtime.Object) error
type DeleteOptions ¶
type DeleteOptions struct {
Factory cmdutil.Factory
Namespace string
LabelSelector string
AllNamespaces bool
Force bool
GracePeriod int
Now bool
AutoApprove bool
// Names are the resource names
Names []string
// ConfirmedNames used to double-check the resource names to delete, sometimes Names are used to build
// label selector and be set to nil, ConfirmedNames should be used to record the names to be confirmed.
ConfirmedNames []string
GVR schema.GroupVersionResource
Result *resource.Result
PreDeleteHook DeleteHook
PostDeleteHook DeleteHook
genericiooptions.IOStreams
}
func NewDeleteOptions ¶
func NewDeleteOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *DeleteOptions
func (*DeleteOptions) AddFlags ¶
func (o *DeleteOptions) AddFlags(cmd *cobra.Command)
func (*DeleteOptions) Run ¶
func (o *DeleteOptions) Run() error
type DryRunStrategy ¶
type DryRunStrategy int
const ( DryRunNone DryRunStrategy = iota DryRunClient DryRunServer )
type EditOptions ¶
type EditOptions struct {
editor.EditOptions
Factory cmdutil.Factory
// Name is the resource name
Name string
GVR schema.GroupVersionResource
}
func NewEditOptions ¶
func NewEditOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *EditOptions
func (*EditOptions) AddFlags ¶
func (o *EditOptions) AddFlags(cmd *cobra.Command)
type ExecOptions ¶
type ExecOptions struct {
cmdexec.StreamOptions
Factory cmdutil.Factory
Executor cmdexec.RemoteExecutor
Config *restclient.Config
Client *kubernetes.Clientset
Dynamic dynamic.Interface
// Pod target pod to execute command
Pod *corev1.Pod
// Command is the command to execute
Command []string
}
func NewExecOptions ¶
func NewExecOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *ExecOptions
func (*ExecOptions) Complete ¶
func (o *ExecOptions) Complete() error
Complete receives exec parameters
func (*ExecOptions) Run ¶
func (o *ExecOptions) Run() error
func (*ExecOptions) RunWithRedirect ¶
type ListOptions ¶
type ListOptions struct {
Factory cmdutil.Factory
Namespace string
AllNamespaces bool
LabelSelector string
FieldSelector string
ShowLabels bool
ToPrinter func(*meta.RESTMapping, bool) (printers.ResourcePrinterFunc, error)
// Names are the resource names
Names []string
GVR schema.GroupVersionResource
Format printer.Format
// print the result or not, if true, use default printer to print, otherwise,
// only return the result to caller.
Print bool
SortBy string
genericiooptions.IOStreams
}
func NewListOptions ¶
func NewListOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *ListOptions
func (*ListOptions) AddFlags ¶
func (o *ListOptions) AddFlags(cmd *cobra.Command, isClusterScope ...bool)
func (*ListOptions) Complete ¶
func (o *ListOptions) Complete() error
func (*ListOptions) PrintNotFoundResources ¶
func (o *ListOptions) PrintNotFoundResources()
type OutputOperation ¶
type PatchOptions ¶
type PatchOptions struct {
Factory cmdutil.Factory
// resource names
Names []string
GVR schema.GroupVersionResource
OutputOperation OutputOperation
// following fields are similar to kubectl patch
PrintFlags *genericclioptions.PrintFlags
ToPrinter func(string) (printers.ResourcePrinter, error)
Patch string
Subresource string
EditBeforeUpdate bool
genericiooptions.IOStreams
// contains filtered or unexported fields
}
func NewPatchOptions ¶
func NewPatchOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *PatchOptions
func (*PatchOptions) AddFlags ¶
func (o *PatchOptions) AddFlags(cmd *cobra.Command)
Click to show internal directories.
Click to hide internal directories.