support

package
v1.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2016 License: Apache-2.0 Imports: 25 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.PodInterface, 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(
	out io.Writer,
	kclient kclient.PodsNamespacer,
	timeout time.Duration,
	interval time.Duration,
	minReadySeconds int32,
) *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

NewHookExecutor makes a HookExecutor from a client.

func (*HookExecutor) Execute

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

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

Jump to

Keyboard shortcuts

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