Documentation ¶
Index ¶
- Constants
- func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string
- func GetAnnotation(o meta.Object, key string) string
- func GetLabel(o meta.Object, key string) string
- func SetDeploymentAnnotationsTo(deployment *apps.Deployment, rollbackToRS *apps.ReplicaSet)
- func SetFromReplicaSetTemplate(deployment *apps.Deployment, template v1.PodTemplateSpec) *apps.Deployment
Constants ¶
View Source
const ( // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" // RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment. RevisionHistoryAnnotation = "deployment.kubernetes.io/revision-history" // DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation // in its replica sets. Helps in separating scaling events from the rollout process and for // determining if the new replica set for a deployment is really saturated. DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas" // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which // is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their // proportions in case the deployment has surge replicas. MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas" )
Variables ¶
This section is empty.
Functions ¶
func CloneAndRemoveLabel ¶
CloneAndRemoveLabel clones the given map and returns a new map with the given key removed. Returns the given map, if labelKey is empty.
func GetAnnotation ¶
GetAnnotation returns a label or an empty strig if it doesn't exist
func SetDeploymentAnnotationsTo ¶
func SetDeploymentAnnotationsTo(deployment *apps.Deployment, rollbackToRS *apps.ReplicaSet)
SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations. This action should be done if and only if the deployment is rolling back to this rs. Note that apply and revision annotations are not changed.
func SetFromReplicaSetTemplate ¶
func SetFromReplicaSetTemplate(deployment *apps.Deployment, template v1.PodTemplateSpec) *apps.Deployment
SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.