cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPodCompleted = fmt.Errorf("pod ran to completion")

ErrPodCompleted is returned by PodRunning or PodContainerRunning to indicate that the pod has already reached completed state.

Functions

func CreateTar

func CreateTar() (*bytes.Buffer, error)

TODO: unit test

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type App

type App struct {
	Workspace string
	Namespace string
	Tarball   *bytes.Buffer
	Command   []string
	Args      []string
	Resources []runtime.Object
	// embed?
	Client client.Client
	// embed?
	KubeClient     kubernetes.Interface
	Clientset      v1alpha1clientset.StokV1alpha1Interface
	PodWaitTimeout time.Duration
}

func (*App) AddToCleanup

func (app *App) AddToCleanup(resource runtime.Object)

func (*App) Cleanup

func (app *App) Cleanup()

func (*App) CreateCommand

func (app *App) CreateCommand(name string) (*v1alpha1.Command, error)

func (*App) CreateConfigMap

func (app *App) CreateConfigMap(tarball *bytes.Buffer) (string, error)

func (*App) CreateRole

func (app *App) CreateRole(name string) (string, error)

func (*App) CreateRoleBinding

func (app *App) CreateRoleBinding(name string) (string, error)

func (*App) CreateServiceAccount

func (app *App) CreateServiceAccount(name string) (string, error)

func (*App) Run

func (app *App) Run() error

func (*App) WaitForPod

func (app *App) WaitForPod(name string, exitCondition watchtools.ConditionFunc, timeout time.Duration) (*corev1.Pod, error)

waitForPod watches the given pod until the exitCondition is true

func (*App) WaitForWorkspaceReady

func (app *App) WaitForWorkspaceReady(name string, timeout time.Duration) (*v1alpha1.Command, error)

waitForWorkspace watches the given workspace until the exitCondition is true

func (*App) Write

func (app *App) Write(in []byte) (int, error)

permit app to be passed as a writer for the above handleAttachPod method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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