k8s

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KubeClient = getKubeClient
	StokClient = getStokClient
)

For testing purposes

View Source
var (
	Attach = attachToPod
)
View Source
var (
	GetLogs = getLogs
)

Functions

func AttachFallbackToLogs added in v0.2.9

func AttachFallbackToLogs(pod *corev1.Pod, logstream io.ReadCloser) error

Attach to pod, falling back to streaming logs on error

func DeleteWaitAnnotationKey added in v0.2.10

func DeleteWaitAnnotationKey(obj metav1.Object)

Delete annotation WaitAnnotationKey, giving the runner the signal to start

func GetNamespacedName added in v0.2.8

func GetNamespacedName(obj metav1.Object) types.NamespacedName

func PodConnect added in v0.2.10

func PodConnect(ctx context.Context, kc kubernetes.Interface, namespace, name string, release func() error) error

PodConnect does the following: 1. Gets log stream of stdout of pod 2. Attaches to TTY of pod, failing that it falls back to copying log stream to user stdout 3. Releases the 'hold' on the pod, i.e. deletes an annotation, informing the pod runner that it can invoke the terraform process, safe in the knowledge that the user is at the very least streaming logs

Types

type PodListWatcher added in v0.2.10

type PodListWatcher struct {
	Client    kubernetes.Interface
	Namespace string
	Name      string
}

func (*PodListWatcher) List added in v0.2.10

func (plw *PodListWatcher) List(options metav1.ListOptions) (runtime.Object, error)

func (*PodListWatcher) Watch added in v0.2.10

func (plw *PodListWatcher) Watch(options metav1.ListOptions) (watch.Interface, error)

type RunListWatcher added in v0.2.10

type RunListWatcher struct {
	Client    stokclient.Interface
	Namespace string
	Name      string
}

func (*RunListWatcher) List added in v0.2.10

func (lw *RunListWatcher) List(options metav1.ListOptions) (runtime.Object, error)

func (*RunListWatcher) Watch added in v0.2.10

func (lw *RunListWatcher) Watch(options metav1.ListOptions) (watch.Interface, error)

type WorkspaceListWatcher added in v0.2.10

type WorkspaceListWatcher struct {
	Client    stokclient.Interface
	Namespace string
	Name      string
}

func (*WorkspaceListWatcher) List added in v0.2.10

func (*WorkspaceListWatcher) Watch added in v0.2.10

Directories

Path Synopsis
This package has the automatically generated clientset.
This package has the automatically generated clientset.
fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
typed/stok.goalspike.com/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
typed/stok.goalspike.com/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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