utils

package
v0.0.0-...-9afe088 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCanaryDeploymentName

func GetCanaryDeploymentName(kd *kanaryv1alpha1.KanaryDeployment) string

GetCanaryDeploymentName returns the Canary Deployment name from the KanaryDeployment instance

func GetCanaryReplicasValue

func GetCanaryReplicasValue(kd *kanaryv1alpha1.KanaryDeployment) *int32

GetCanaryReplicasValue returns the replicas value of the Canary Deployment

func GetCanaryServiceName

func GetCanaryServiceName(kd *kanaryv1alpha1.KanaryDeployment) string

GetCanaryServiceName returns the canary service name depending of the spec

func GetDeploymentName

func GetDeploymentName(kd *kanaryv1alpha1.KanaryDeployment) string

GetDeploymentName returns the Deployment name from the KanaryDeployment instance

func GetLabelsForKanaryDeploymentd

func GetLabelsForKanaryDeploymentd(name string) map[string]string

GetLabelsForKanaryDeploymentd return labels belonging to the given KanaryDeployment CR name.

func GetLabelsForKanaryPod

func GetLabelsForKanaryPod(kdname string) map[string]string

GetLabelsForKanaryPod return labels of a canary pod associated to a kanarydeployment.

func IsKanaryDeploymentDeploymentUpdated

func IsKanaryDeploymentDeploymentUpdated(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentDeploymentUpdated returns true if the KanaryDeployment has lead to deployment update

func IsKanaryDeploymentErrored

func IsKanaryDeploymentErrored(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentErrored returns true if the KanaryDeployment has failed, else returns false

func IsKanaryDeploymentFailed

func IsKanaryDeploymentFailed(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentFailed returns true if the KanaryDeployment has failed, else returns false

func IsKanaryDeploymentScheduled

func IsKanaryDeploymentScheduled(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentScheduled returns true if the KanaryDeployment is scheduled, else return false

func IsKanaryDeploymentSucceeded

func IsKanaryDeploymentSucceeded(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentSucceeded returns true if the KanaryDeployment has succeeded, else return false

func IsKanaryDeploymentValidationCompleted

func IsKanaryDeploymentValidationCompleted(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentValidationCompleted returns true if the KanaryDeployment is runnning

func IsKanaryDeploymentValidationRunning

func IsKanaryDeploymentValidationRunning(status *kanaryv1alpha1.KanaryDeploymentStatus) bool

IsKanaryDeploymentValidationRunning returns true if the KanaryDeployment is runnning

func NewCanaryDeploymentFromKanaryDeploymentTemplate

func NewCanaryDeploymentFromKanaryDeploymentTemplate(kclient client.Client, kd *kanaryv1alpha1.KanaryDeployment, scheme *runtime.Scheme, setOwnerRef bool) (*appsv1beta1.Deployment, error)

NewCanaryDeploymentFromKanaryDeploymentTemplate returns a Deployment object

func NewCanaryServiceForKanaryDeployment

func NewCanaryServiceForKanaryDeployment(kd *kanaryv1alpha1.KanaryDeployment, service *corev1.Service, overwriteLabel bool, scheme *runtime.Scheme, setOwnerRef bool) (*corev1.Service, error)

NewCanaryServiceForKanaryDeployment returns a Service object

func NewDeploymentFromKanaryDeploymentTemplate

func NewDeploymentFromKanaryDeploymentTemplate(kdold *kanaryv1alpha1.KanaryDeployment, scheme *runtime.Scheme, setOwnerRef bool) (*appsv1beta1.Deployment, error)

NewDeploymentFromKanaryDeploymentTemplate returns a Deployment object

func NewKanaryDeploymentStatusCondition

func NewKanaryDeploymentStatusCondition(conditionType kanaryv1alpha1.KanaryDeploymentConditionType, conditionStatus corev1.ConditionStatus, now metav1.Time, reason, message string) kanaryv1alpha1.KanaryDeploymentCondition

NewKanaryDeploymentStatusCondition returns new KanaryDeploymentCondition instance

func PrepareSchemeForOwnerRef

func PrepareSchemeForOwnerRef() *runtime.Scheme

PrepareSchemeForOwnerRef return the scheme required to write the kanary ownerreference

func UpdateDeploymentWithKanaryDeploymentTemplate

func UpdateDeploymentWithKanaryDeploymentTemplate(kd *kanaryv1alpha1.KanaryDeployment, oldDep *appsv1beta1.Deployment) (*appsv1beta1.Deployment, error)

UpdateDeploymentWithKanaryDeploymentTemplate returns a Deployment object updated

func UpdateKanaryDeploymentStatus

func UpdateKanaryDeploymentStatus(kclient client.Client, subResourceDisabled bool, reqLogger logr.Logger, kd *kanaryv1alpha1.KanaryDeployment, newStatus *kanaryv1alpha1.KanaryDeploymentStatus, result reconcile.Result, err error) (reconcile.Result, error)

UpdateKanaryDeploymentStatus used to update the KanaryDeployment.Status if it has changed.

func UpdateKanaryDeploymentStatusCondition

func UpdateKanaryDeploymentStatusCondition(status *kanaryv1alpha1.KanaryDeploymentStatus, now metav1.Time, t kanaryv1alpha1.KanaryDeploymentConditionType, conditionStatus corev1.ConditionStatus, desc string, writeFalseIfNotExist bool)

UpdateKanaryDeploymentStatusCondition used to update a specific KanaryDeploymentConditionType

func UpdateKanaryDeploymentStatusConditionsFailure

func UpdateKanaryDeploymentStatusConditionsFailure(status *kanaryv1alpha1.KanaryDeploymentStatus, now metav1.Time, err error)

UpdateKanaryDeploymentStatusConditionsFailure used to update the failre StatusConditions

func ValidateKanaryDeployment

func ValidateKanaryDeployment(kd *v1alpha1.KanaryDeployment) []error

ValidateKanaryDeployment used to validate a KanaryDeployment return a list of errors in case of unvalid fields.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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