util

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DeployerPodSuffix = "deploy"

DeployerPodSuffix is the suffix added to pods created from a deployment

Variables

This section is empty.

Functions

func AnyDeployerPodSelector

func AnyDeployerPodSelector() labels.Selector

AnyDeployerPodSelector returns a label Selector which can be used to find all deployer pods across all deployments, including hook and custom deployer pods.

func ConfigSelector

func ConfigSelector(name string) labels.Selector

ConfigSelector returns a label Selector which can be used to find all deployments for a DeploymentConfig.

TODO: Using the annotation constant for now since the value is correct but we could consider adding a new constant to the public types.

func DecodeDeploymentConfig

func DecodeDeploymentConfig(controller *api.ReplicationController, codec runtime.Codec) (*deployapi.DeploymentConfig, error)

DecodeDeploymentConfig decodes a DeploymentConfig from controller using codec. An error is returned if the controller doesn't contain an encoded config.

func DeployerPodNameFor

func DeployerPodNameFor(obj runtime.Object) string

func DeployerPodNameForDeployment

func DeployerPodNameForDeployment(deployment string) string

DeployerPodNameForDeployment returns the name of a pod for a given deployment

func DeployerPodSelector

func DeployerPodSelector(name string) labels.Selector

DeployerPodSelector returns a label Selector which can be used to find all deployer pods associated with a deployment with name.

func DeploymentConfigNameFor

func DeploymentConfigNameFor(obj runtime.Object) string

func DeploymentDesiredReplicas

func DeploymentDesiredReplicas(obj runtime.Object) (int, bool)

func DeploymentNameFor

func DeploymentNameFor(obj runtime.Object) string

func DeploymentNameForConfigVersion added in v1.0.7

func DeploymentNameForConfigVersion(name string, version int) string

DeploymentNameForConfigVersion returns the name of the version-th deployment for the config that has the provided name

func DeploymentStatusFor

func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus

func DeploymentStatusReasonFor

func DeploymentStatusReasonFor(obj runtime.Object) string

func DeploymentVersionFor

func DeploymentVersionFor(obj runtime.Object) int

func EncodeDeploymentConfig

func EncodeDeploymentConfig(config *deployapi.DeploymentConfig, codec runtime.Codec) (string, error)

EncodeDeploymentConfig encodes config as a string using codec.

func EncodedDeploymentConfigFor

func EncodedDeploymentConfigFor(obj runtime.Object) string

func HasChangeTrigger added in v1.0.7

func HasChangeTrigger(config *deployapi.DeploymentConfig) bool

HasChangeTrigger returns whether the provided deployment configuration has a config change trigger or not

func IsDeploymentCancelled

func IsDeploymentCancelled(deployment *api.ReplicationController) bool

func IsTerminatedDeployment added in v1.0.7

func IsTerminatedDeployment(deployment *api.ReplicationController) bool

IsTerminatedDeployment returns true if the passed deployment has terminated (either complete or failed).

func LabelForDeployment

func LabelForDeployment(deployment *api.ReplicationController) string

LabelForDeployment builds a string identifier for a Deployment.

func LabelForDeploymentConfig

func LabelForDeploymentConfig(config *deployapi.DeploymentConfig) string

LabelForDeploymentConfig builds a string identifier for a DeploymentConfig.

func LatestDeploymentInfo added in v1.0.7

func LatestDeploymentInfo(config *deployapi.DeploymentConfig, deployments *api.ReplicationControllerList) (bool, deployapi.DeploymentStatus)

LatestDeploymentInfo returns info about the latest deployment for a config, if it exists and its current status

func LatestDeploymentNameForConfig

func LatestDeploymentNameForConfig(config *deployapi.DeploymentConfig) string

LatestDeploymentNameForConfig returns a stable identifier for config based on its version.

func MakeDeployment

func MakeDeployment(config *deployapi.DeploymentConfig, codec runtime.Codec) (*api.ReplicationController, error)

MakeDeployment creates a deployment represented as a ReplicationController and based on the given DeploymentConfig. The controller replica count will be zero.

Types

type ByLatestVersionAsc added in v1.0.7

type ByLatestVersionAsc []api.ReplicationController

ByLatestVersionAsc sorts deployments by LatestVersion ascending.

func (ByLatestVersionAsc) Len added in v1.0.7

func (d ByLatestVersionAsc) Len() int

func (ByLatestVersionAsc) Less added in v1.0.7

func (d ByLatestVersionAsc) Less(i, j int) bool

func (ByLatestVersionAsc) Swap added in v1.0.7

func (d ByLatestVersionAsc) Swap(i, j int)

type ByLatestVersionDesc added in v1.0.7

type ByLatestVersionDesc []api.ReplicationController

ByLatestVersionDesc sorts deployments by LatestVersion descending.

func (ByLatestVersionDesc) Len added in v1.0.7

func (d ByLatestVersionDesc) Len() int

func (ByLatestVersionDesc) Less added in v1.0.7

func (d ByLatestVersionDesc) Less(i, j int) bool

func (ByLatestVersionDesc) Swap added in v1.0.7

func (d ByLatestVersionDesc) Swap(i, j int)

type ListWatcherImpl

type ListWatcherImpl struct {
	ListFunc  func() (runtime.Object, error)
	WatchFunc func(resourceVersion string) (watch.Interface, error)
}

ListWatcherImpl is a pluggable ListWatcher. TODO: This has been incorporated upstream; replace during a future rebase.

func (*ListWatcherImpl) List

func (lw *ListWatcherImpl) List() (runtime.Object, error)

func (*ListWatcherImpl) Watch

func (lw *ListWatcherImpl) Watch(resourceVersion string) (watch.Interface, error)

Jump to

Keyboard shortcuts

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