support

package
v0.0.0-...-ea77a8b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: Apache-2.0 Imports: 19 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

func NewPodWatch(client kclient.Interface, 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

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

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

NewAcceptNewlyObservedReadyPods makes a new AcceptNewlyObservedReadyPods from a real client.

func (*AcceptNewlyObservedReadyPods) Accept

Accept implements UpdateAcceptor.

type HookExecutor

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

HookExecutor executes a deployment lifecycle hook.

func NewHookExecutor

func NewHookExecutor(client kclient.Interface, podLogDestination io.Writer, codec runtime.Codec) *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

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