support

package
v1.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package support is a library of code useful to any strategy.

Index

Constants

View Source
const HookContainerName = "lifecycle"

Variables

This section is empty.

Functions

func NewPodWatch added in v0.5.3

func NewPodWatch(client kclient.PodsNamespacer, namespace, name, resourceVersion string, stopChannel chan struct{}) func() *kapi.Pod

NewPodWatch creates a pod watching function which is backed by a FIFO/reflector pair. This avoids managing watches directly. A stop channel to close the watch's reflector is also returned. It is the caller's responsibility to defer closing the stop channel to prevent leaking resources.

Types

type AcceptNewlyObservedReadyPods added in v1.0.4

type AcceptNewlyObservedReadyPods struct {
	// contains filtered or unexported fields
}

AcceptNewlyObservedReadyPods is a kubectl.UpdateAcceptor which will accept a deployment if all the containers in all of the pods for the deployment are observed to be ready at least once.

AcceptNewlyObservedReadyPods keeps track of the pods it has accepted for a deployment so that the acceptor can be reused across multiple batches of updates to a single controller. For example, if during the first acceptance call the deployment has 3 pods, the acceptor will validate those 3 pods. If the same acceptor instance is used again for the same deployment which now has 6 pods, only the latest 3 pods will be considered for acceptance. The status of the original 3 pods becomes irrelevant.

Note that this struct is stateful and intended for use with a single deployment and should be discarded and recreated between deployments.

func NewAcceptNewlyObservedReadyPods added in v1.0.4

func NewAcceptNewlyObservedReadyPods(kclient kclient.PodsNamespacer, timeout time.Duration, interval time.Duration) *AcceptNewlyObservedReadyPods

NewAcceptNewlyObservedReadyPods makes a new AcceptNewlyObservedReadyPods from a real client.

func (*AcceptNewlyObservedReadyPods) Accept added in v1.0.4

Accept implements UpdateAcceptor.

type HookExecutor

type HookExecutor struct {
	// contains filtered or unexported fields
}

HookExecutor executes a deployment lifecycle hook.

func NewHookExecutor added in v1.0.8

func NewHookExecutor(client kclient.PodsNamespacer, tags client.ImageStreamTagsNamespacer, podLogDestination io.Writer, decoder runtime.Decoder) *HookExecutor

NewHookExecutor makes a HookExecutor from a client.

func (*HookExecutor) Execute

func (e *HookExecutor) Execute(hook *deployapi.LifecycleHook, deployment *kapi.ReplicationController, label string) error

Execute executes hook in the context of deployment. The label is used to distinguish the kind of hook (e.g. pre, post).

type HookExecutorPodClient

type HookExecutorPodClient interface {
	CreatePod(namespace string, pod *kapi.Pod) (*kapi.Pod, error)
	PodWatch(namespace, name, resourceVersion string, stopChannel chan struct{}) func() *kapi.Pod
}

HookExecutorPodClient abstracts access to pods.

type HookExecutorPodClientImpl

type HookExecutorPodClientImpl struct {
	CreatePodFunc func(namespace string, pod *kapi.Pod) (*kapi.Pod, error)
	PodWatchFunc  func(namespace, name, resourceVersion string, stopChannel chan struct{}) func() *kapi.Pod
}

HookExecutorPodClientImpl is a pluggable HookExecutorPodClient.

func (*HookExecutorPodClientImpl) CreatePod

func (i *HookExecutorPodClientImpl) CreatePod(namespace string, pod *kapi.Pod) (*kapi.Pod, error)

func (*HookExecutorPodClientImpl) PodWatch added in v0.5.3

func (i *HookExecutorPodClientImpl) PodWatch(namespace, name, resourceVersion string, stopChannel chan struct{}) func() *kapi.Pod

Jump to

Keyboard shortcuts

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