Documentation ¶
Index ¶
- Constants
- func ActiveDeployment(input []*v1.ReplicationController) *v1.ReplicationController
- func AnnotationFor(obj runtime.Object, key string) string
- func ConfigSelector(name string) labels.Selector
- func DecodeDeploymentConfig(controller metav1.ObjectMetaAccessor) (*appsv1.DeploymentConfig, error)
- func DeployerPodNameFor(obj runtime.Object) string
- func DeployerPodNameForDeployment(deployment string) string
- func DeployerPodSelector(name string) labels.Selector
- func DeploymentConfigNameFor(obj runtime.Object) string
- func DeploymentDesiredReplicas(obj runtime.Object) (int32, bool)
- func DeploymentVersionFor(obj runtime.Object) int64
- func HasSynced(dc *appsv1.DeploymentConfig, generation int64) bool
- func IsCompleteDeployment(deployment runtime.Object) bool
- func IsRollingConfig(config *appsv1.DeploymentConfig) bool
- func LabelForDeployment(deployment *v1.ReplicationController) string
- func LatestDeploymentNameForConfigV1(config *appsv1.DeploymentConfig) string
- func MaxSurge(config appsv1.DeploymentConfig) int32
- func MaxUnavailable(config *appsv1.DeploymentConfig) int32
- func NewReplicationControllerScaleClient(client kubernetes.Interface) scaleclient.ScalesGetter
- func NewReplicationControllerScaler(client kubernetes.Interface) kubectl.Scaler
- func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
- type ByLatestVersionAsc
- type ByLatestVersionDesc
- type DeploymentStatus
Constants ¶
const ( // DeploymentStatusAnnotation is an annotation name used to retrieve the DeploymentPhase of // a deployment. // Used by CLI and utils: // TODO: Should move to library-go? DeploymentStatusAnnotation = "openshift.io/deployment.phase" // DeployerPodForDeploymentLabel is a label which groups pods related to a // Used by utils and lifecycle hooks: DeployerPodForDeploymentLabel = "openshift.io/deployer-pod-for.name" // MaxDeploymentDurationSeconds represents the maximum duration that a deployment is allowed to run. // This is set as the default value for ActiveDeadlineSeconds for the deployer pod. // Currently set to 6 hours. MaxDeploymentDurationSeconds int64 = 21600 // DefaultRecreateTimeoutSeconds is the default TimeoutSeconds for RecreateDeploymentStrategyParams. // Used by strategies: DefaultRecreateTimeoutSeconds int64 = 10 * 60 // PreHookPodSuffix is the suffix added to all pre hook pods PreHookPodSuffix = "hook-pre" // MidHookPodSuffix is the suffix added to all mid hook pods MidHookPodSuffix = "hook-mid" // PostHookPodSuffix is the suffix added to all post hook pods PostHookPodSuffix = "hook-post" )
Variables ¶
This section is empty.
Functions ¶
func ActiveDeployment ¶
func ActiveDeployment(input []*v1.ReplicationController) *v1.ReplicationController
ActiveDeployment returns the latest complete deployment, or nil if there is no such deployment. The active deployment is not always the same as the latest deployment.
func AnnotationFor ¶
AnnotationFor returns the annotation with key for obj.
func ConfigSelector ¶
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 metav1.ObjectMetaAccessor) (*appsv1.DeploymentConfig, error)
DecodeDeploymentConfig decodes a DeploymentConfig from controller using annotation codec. An error is returned if the controller doesn't contain an encoded config or decoding fail.
func DeployerPodNameFor ¶
func DeployerPodNameForDeployment ¶
DeployerPodNameForDeployment returns the name of a pod for a given deployment
func DeployerPodSelector ¶
DeployerPodSelector returns a label Selector which can be used to find all deployer pods associated with a deployment with name.
func DeploymentConfigNameFor ¶
func DeploymentDesiredReplicas ¶
DeploymentDesiredReplicas returns number of desired replica for the given replication controller
func DeploymentVersionFor ¶
func HasSynced ¶
func HasSynced(dc *appsv1.DeploymentConfig, generation int64) bool
HasSynced checks if the provided deployment config has been noticed by the deployment config controller.
func IsCompleteDeployment ¶
IsCompleteDeployment returns true if the passed deployment is in state complete.
func IsRollingConfig ¶
func IsRollingConfig(config *appsv1.DeploymentConfig) bool
IsRollingConfig returns true if the strategy type is a rolling update.
func LabelForDeployment ¶
func LabelForDeployment(deployment *v1.ReplicationController) string
LabelForDeployment builds a string identifier for a Deployment.
func LatestDeploymentNameForConfigV1 ¶
func LatestDeploymentNameForConfigV1(config *appsv1.DeploymentConfig) string
LatestDeploymentNameForConfigV1 returns a stable identifier for config based on its version.
func MaxSurge ¶
func MaxSurge(config appsv1.DeploymentConfig) int32
MaxSurge returns the maximum surge pods a rolling deployment config can take.
func MaxUnavailable ¶
func MaxUnavailable(config *appsv1.DeploymentConfig) int32
MaxUnavailable returns the maximum unavailable pods a rolling deployment config can take.
func NewReplicationControllerScaleClient ¶
func NewReplicationControllerScaleClient(client kubernetes.Interface) scaleclient.ScalesGetter
func NewReplicationControllerScaler ¶
func NewReplicationControllerScaler(client kubernetes.Interface) kubectl.Scaler
func ResolveFenceposts ¶
func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
ResolveFenceposts is copy from k8s deployment_utils to avoid unnecessary imports
Types ¶
type ByLatestVersionAsc ¶
type ByLatestVersionAsc []*v1.ReplicationController
func (ByLatestVersionAsc) Len ¶
func (d ByLatestVersionAsc) Len() int
func (ByLatestVersionAsc) Less ¶
func (d ByLatestVersionAsc) Less(i, j int) bool
func (ByLatestVersionAsc) Swap ¶
func (d ByLatestVersionAsc) Swap(i, j int)
type ByLatestVersionDesc ¶
type ByLatestVersionDesc []*v1.ReplicationController
ByLatestVersionDesc sorts deployments by LatestVersion descending.
func (ByLatestVersionDesc) Len ¶
func (d ByLatestVersionDesc) Len() int
func (ByLatestVersionDesc) Less ¶
func (d ByLatestVersionDesc) Less(i, j int) bool
func (ByLatestVersionDesc) Swap ¶
func (d ByLatestVersionDesc) Swap(i, j int)
type DeploymentStatus ¶
type DeploymentStatus string
DeploymentStatus describes the possible states a deployment can be in.