validation

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MissingFieldMessage the message to indicate rollout is missing a field
	MissingFieldMessage = "Rollout has missing field '%s'"
	// InvalidSetWeightMessage indicates the setweight value needs to be between 0 and 100
	InvalidSetWeightMessage = "SetWeight needs to be between 0 and 100"
	// InvalidDurationMessage indicates the Duration value needs to be greater than 0
	InvalidDurationMessage = "Duration needs to be greater than 0"
	// InvalidMaxSurgeMaxUnavailable indicates both maxSurge and MaxUnavailable can not be set to zero
	InvalidMaxSurgeMaxUnavailable = "MaxSurge and MaxUnavailable both can not be zero"
	// InvalidStepMessage indicates that a step must have either setWeight or pause set
	InvalidStepMessage = "Step must have one of the following set: experiment, setWeight, or pause"
	// InvalidStrategyMessage indiciates that multiple strategies can not be listed
	InvalidStrategyMessage = "Multiple Strategies can not be listed"
	// DuplicatedServicesBlueGreenMessage the message to indicate that the rollout uses the same service for the active and preview services
	DuplicatedServicesBlueGreenMessage = "This rollout uses the same service for the active and preview services, but two different services are required."
	// DuplicatedServicesMessage the message to indicate that the rollout uses the same service for the active and preview services
	DuplicatedServicesCanaryMessage = "This rollout uses the same service for the stable and canary services, but two different services are required."
	// InvalidAntiAffinityStrategyMessage indicates that Anti-Affinity can only have one strategy listed
	InvalidAntiAffinityStrategyMessage = "AntiAffinity must have exactly one strategy listed"
	// InvalidAntiAffinityWeightMessage indicates that Anti-Affinity must have weight between 1-100
	InvalidAntiAffinityWeightMessage = "AntiAffinity weight must be between 1-100"
	// ScaleDownLimitLargerThanRevisionLimit the message to indicate that the rollout's revision history limit can not be smaller than the rollout's scale down limit
	ScaleDownLimitLargerThanRevisionLimit = "This rollout's revision history limit can not be smaller than the rollout's scale down limit"
	// InvalidTrafficRoutingMessage indicates that both canary and stable service must be set to use Traffic Routing
	InvalidTrafficRoutingMessage = "Canary service and Stable service must to be set to use Traffic Routing"
	// InvalidIstioRoutesMessage indicates that rollout does not have a route specified for the istio Traffic Routing
	InvalidIstioRoutesMessage = "Istio virtual service must have at least 1 route specified"
)

Variables

This section is empty.

Functions

func GetAnalysisTemplateWithTypeFieldPath

func GetAnalysisTemplateWithTypeFieldPath(templateType AnalysisTemplateType, analysisIndex int, canaryStepIndex int) *field.Path

func GetServiceWithTypeFieldPath

func GetServiceWithTypeFieldPath(serviceType ServiceType) *field.Path

func ValidateAnalysisTemplateWithType

func ValidateAnalysisTemplateWithType(template AnalysisTemplateWithType) field.ErrorList

func ValidateIngress

func ValidateIngress(rollout *v1alpha1.Rollout, ingress v1beta1.Ingress) field.ErrorList

func ValidateRollout

func ValidateRollout(rollout *v1alpha1.Rollout) field.ErrorList

func ValidateRolloutReferencedResources

func ValidateRolloutReferencedResources(rollout *v1alpha1.Rollout, referencedResources ReferencedResources) field.ErrorList

func ValidateRolloutSpec

func ValidateRolloutSpec(rollout *v1alpha1.Rollout, fldPath *field.Path) field.ErrorList

ValidateRolloutSpec checks for a valid spec otherwise returns a list of errors.

func ValidateRolloutStrategy

func ValidateRolloutStrategy(rollout *v1alpha1.Rollout, fldPath *field.Path) field.ErrorList

func ValidateRolloutStrategyAntiAffinity

func ValidateRolloutStrategyAntiAffinity(antiAffinity *v1alpha1.AntiAffinity, fldPath *field.Path) field.ErrorList

func ValidateRolloutStrategyBlueGreen

func ValidateRolloutStrategyBlueGreen(rollout *v1alpha1.Rollout, fldPath *field.Path) field.ErrorList

func ValidateRolloutStrategyCanary

func ValidateRolloutStrategyCanary(rollout *v1alpha1.Rollout, fldPath *field.Path) field.ErrorList

func ValidateService

func ValidateService(svc ServiceWithType, rollout *v1alpha1.Rollout) field.ErrorList

func ValidateVirtualService

func ValidateVirtualService(rollout *v1alpha1.Rollout, obj unstructured.Unstructured) field.ErrorList

Types

type AnalysisTemplateType

type AnalysisTemplateType string

RolloutConditionType defines the conditions of Rollout

const (
	PrePromotionAnalysis  AnalysisTemplateType = "PrePromotionAnalysis"
	PostPromotionAnalysis AnalysisTemplateType = "PostPromotionAnalysis"
	CanaryStep            AnalysisTemplateType = "CanaryStep"
)

type AnalysisTemplateWithType

type AnalysisTemplateWithType struct {
	AnalysisTemplate        *v1alpha1.AnalysisTemplate
	ClusterAnalysisTemplate *v1alpha1.ClusterAnalysisTemplate
	TemplateType            AnalysisTemplateType
	AnalysisIndex           int
	// Used only for CanaryStep
	CanaryStepIndex int
}

type ReferencedResources

type ReferencedResources struct {
	AnalysisTemplateWithType []AnalysisTemplateWithType
	Ingresses                []v1beta1.Ingress
	ServiceWithType          []ServiceWithType
	VirtualServices          []unstructured.Unstructured
}

type ServiceType

type ServiceType string
const (
	StableService  ServiceType = "StableService"
	CanaryService  ServiceType = "CanaryService"
	ActiveService  ServiceType = "ActiveService"
	PreviewService ServiceType = "PreviewService"
)

type ServiceWithType

type ServiceWithType struct {
	Service *corev1.Service
	Type    ServiceType
}

Jump to

Keyboard shortcuts

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