Documentation ¶
Index ¶
- type Cli
- func (c *Cli) Apply(ctx context.Context, content []byte, extraArgs ...string) error
- func (c *Cli) ApplyFile(ctx context.Context, fileName string, extraArgs ...string) error
- func (c *Cli) Command(ctx context.Context, args ...string) cmdutils.Cmd
- func (c *Cli) Copy(ctx context.Context, from, to string) error
- func (c *Cli) Delete(ctx context.Context, content []byte, extraArgs ...string) error
- func (c *Cli) DeleteFile(ctx context.Context, fileName string, extraArgs ...string) error
- func (c *Cli) RunCommand(ctx context.Context, args ...string) error
- func (c *Cli) StartPortForward(ctx context.Context, options ...portforward.Option) (portforward.PortForwarder, error)
- func (c *Cli) WithKubeContext(kubeContext string) *Cli
- func (c *Cli) WithReceiver(receiver io.Writer) *Cli
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
Cli is a utility for executing `kubectl` commands
func (*Cli) Apply ¶
Apply applies the resources defined in the bytes, and returns an error if one occurred
func (*Cli) ApplyFile ¶
ApplyFile applies the resources defined in a file, and returns an error if one occurred
func (*Cli) Command ¶
Command returns a Cmd that executes kubectl command, including the --context if it is defined The Cmd sets the Stdout and Stderr to the receiver of the Cli
func (*Cli) Delete ¶
Delete deletes the resources defined in the bytes, and returns an error if one occurred
func (*Cli) DeleteFile ¶
DeleteFile deletes the resources defined in a file, and returns an error if one occurred
func (*Cli) RunCommand ¶
RunCommand creates a Cmd and then runs it
func (*Cli) StartPortForward ¶
func (c *Cli) StartPortForward(ctx context.Context, options ...portforward.Option) (portforward.PortForwarder, error)
StartPortForward creates a PortForwarder based on the provides options, starts it, and returns the PortForwarder If an error was encountered while starting the PortForwarder, it is returned as well NOTE: It is the callers responsibility to close this port-forward
func (*Cli) WithKubeContext ¶
WithKubeContext sets the --context for the kubectl command invoked by the Cli