util

package
v0.0.0-...-1614809 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string

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

func GetAnnotation(o meta.Object, key string) string

GetAnnotation returns a label or an empty strig if it doesn't exist

func GetLabel

func GetLabel(o meta.Object, key string) string

GetLabel 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.

Jump to

Keyboard shortcuts

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