v1alpha2

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// a sysctl segment regex, concatenated with dots to form a sysctl name
	SysctlSegmentFmt string = "[a-z0-9]([-_a-z0-9]*[a-z0-9])?"

	// a sysctl name regex
	SysctlFmt string = "(" + SysctlSegmentFmt + "\\.)*" + SysctlSegmentFmt

	// the maximal length of a sysctl name
	SysctlMaxLength int = 253
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: mesh.GroupName, Version: "v1alpha2"}

SchemeGroupVersion is group version used to register these objects

View Source
var Semantic = conversion.EqualitiesOrDie(
	func(a, b resource.Quantity) bool {

		return a.Cmp(b) == 0
	},
	func(a, b metav1.MicroTime) bool {
		return a.UTC() == b.UTC()
	},
	func(a, b metav1.Time) bool {
		return a.UTC() == b.UTC()
	},
	func(a, b labels.Selector) bool {
		return a.String() == b.String()
	},
	func(a, b fields.Selector) bool {
		return a.String() == b.String()
	},
)

Semantic can do semantic deep equality checks for core objects. Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true

// Validate resource names that can go in a resource quota // Refer to docs/design/resources.md for more details.

func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList {
	allErrs := validateResourceName(value, fldPath)

	if len(strings.Split(value, "/")) == 1 {
		if !helper.IsStandardQuotaResourceName(value) {
			return append(allErrs, field.Invalid(fldPath, value, isInvalidQuotaResource))
		}
	}
	return allErrs
}

// Validate limit range types

func validateLimitRangeTypeName(value string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for _, msg := range validation.IsQualifiedName(value) {
		allErrs = append(allErrs, field.Invalid(fldPath, value, msg))
	}
	if len(allErrs) != 0 {
		return allErrs
	}

	if len(strings.Split(value, "/")) == 1 {
		if !helper.IsStandardLimitRangeType(value) {
			return append(allErrs, field.Invalid(fldPath, value, "must be a standard limit type or fully qualified"))
		}
	}

	return allErrs
}

// Validate limit range resource name // limit types (other than Pod/Container) could contain storage not just cpu or memory

func validateLimitRangeResourceName(limitType corev1.LimitType, value string, fldPath *field.Path) field.ErrorList {
	switch limitType {
	case corev1.LimitTypePod, corev1.LimitTypeContainer:
		return validateContainerResourceName(value, fldPath)
	default:
		return validateResourceName(value, fldPath)
	}
}

// ValidateLimitRange tests if required fields in the LimitRange are set.

func ValidateLimitRange(limitRange *corev1.LimitRange) field.ErrorList {
	allErrs := ValidateObjectMeta(&limitRange.ObjectMeta, true, ValidateLimitRangeName, field.NewPath("metadata"))

	// ensure resource names are properly qualified per docs/design/resources.md
	limitTypeSet := map[corev1.LimitType]bool{}
	fldPath := field.NewPath("spec", "limits")
	for i := range limitRange.Spec.Limits {
		idxPath := fldPath.Index(i)
		limit := &limitRange.Spec.Limits[i]
		allErrs = append(allErrs, validateLimitRangeTypeName(string(limit.Type), idxPath.Child("type"))...)

		_, found := limitTypeSet[limit.Type]
		if found {
			allErrs = append(allErrs, field.Duplicate(idxPath.Child("type"), limit.Type))
		}
		limitTypeSet[limit.Type] = true

		keys := sets.String{}
		min := map[string]resource.Quantity{}
		max := map[string]resource.Quantity{}
		defaults := map[string]resource.Quantity{}
		defaultRequests := map[string]resource.Quantity{}
		maxLimitRequestRatios := map[string]resource.Quantity{}

		for k, q := range limit.Max {
			allErrs = append(allErrs, validateLimitRangeResourceName(limit.Type, string(k), idxPath.Child("max").Key(string(k)))...)
			keys.Insert(string(k))
			max[string(k)] = q
		}
		for k, q := range limit.Min {
			allErrs = append(allErrs, validateLimitRangeResourceName(limit.Type, string(k), idxPath.Child("min").Key(string(k)))...)
			keys.Insert(string(k))
			min[string(k)] = q
		}

		if limit.Type == corev1.LimitTypePod {
			if len(limit.Default) > 0 {
				allErrs = append(allErrs, field.Forbidden(idxPath.Child("default"), "may not be specified when `type` is 'Pod'"))
			}
			if len(limit.DefaultRequest) > 0 {
				allErrs = append(allErrs, field.Forbidden(idxPath.Child("defaultRequest"), "may not be specified when `type` is 'Pod'"))
			}
		} else {
			for k, q := range limit.Default {
				allErrs = append(allErrs, validateLimitRangeResourceName(limit.Type, string(k), idxPath.Child("default").Key(string(k)))...)
				keys.Insert(string(k))
				defaults[string(k)] = q
			}
			for k, q := range limit.DefaultRequest {
				allErrs = append(allErrs, validateLimitRangeResourceName(limit.Type, string(k), idxPath.Child("defaultRequest").Key(string(k)))...)
				keys.Insert(string(k))
				defaultRequests[string(k)] = q
			}
		}

		if limit.Type == corev1.LimitTypePersistentVolumeClaim {
			_, minQuantityFound := limit.Min[corev1.ResourceStorage]
			_, maxQuantityFound := limit.Max[corev1.ResourceStorage]
			if !minQuantityFound && !maxQuantityFound {
				allErrs = append(allErrs, field.Required(idxPath.Child("limits"), "either minimum or maximum storage value is required, but neither was provided"))
			}
		}

		for k, q := range limit.MaxLimitRequestRatio {
			allErrs = append(allErrs, validateLimitRangeResourceName(limit.Type, string(k), idxPath.Child("maxLimitRequestRatio").Key(string(k)))...)
			keys.Insert(string(k))
			maxLimitRequestRatios[string(k)] = q
		}

		for k := range keys {
			minQuantity, minQuantityFound := min[k]
			maxQuantity, maxQuantityFound := max[k]
			defaultQuantity, defaultQuantityFound := defaults[k]
			defaultRequestQuantity, defaultRequestQuantityFound := defaultRequests[k]
			maxRatio, maxRatioFound := maxLimitRequestRatios[k]

			if minQuantityFound && maxQuantityFound && minQuantity.Cmp(maxQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("min").Key(string(k)), minQuantity, fmt.Sprintf("min value %s is greater than max value %s", minQuantity.String(), maxQuantity.String())))
			}

			if defaultRequestQuantityFound && minQuantityFound && minQuantity.Cmp(defaultRequestQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("defaultRequest").Key(string(k)), defaultRequestQuantity, fmt.Sprintf("min value %s is greater than default request value %s", minQuantity.String(), defaultRequestQuantity.String())))
			}

			if defaultRequestQuantityFound && maxQuantityFound && defaultRequestQuantity.Cmp(maxQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("defaultRequest").Key(string(k)), defaultRequestQuantity, fmt.Sprintf("default request value %s is greater than max value %s", defaultRequestQuantity.String(), maxQuantity.String())))
			}

			if defaultRequestQuantityFound && defaultQuantityFound && defaultRequestQuantity.Cmp(defaultQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("defaultRequest").Key(string(k)), defaultRequestQuantity, fmt.Sprintf("default request value %s is greater than default limit value %s", defaultRequestQuantity.String(), defaultQuantity.String())))
			}

			if defaultQuantityFound && minQuantityFound && minQuantity.Cmp(defaultQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("default").Key(string(k)), minQuantity, fmt.Sprintf("min value %s is greater than default value %s", minQuantity.String(), defaultQuantity.String())))
			}

			if defaultQuantityFound && maxQuantityFound && defaultQuantity.Cmp(maxQuantity) > 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("default").Key(string(k)), maxQuantity, fmt.Sprintf("default value %s is greater than max value %s", defaultQuantity.String(), maxQuantity.String())))
			}
			if maxRatioFound && maxRatio.Cmp(*resource.NewQuantity(1, resource.DecimalSI)) < 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("maxLimitRequestRatio").Key(string(k)), maxRatio, fmt.Sprintf("ratio %s is less than 1", maxRatio.String())))
			}
			if maxRatioFound && minQuantityFound && maxQuantityFound {
				maxRatioValue := float64(maxRatio.Value())
				minQuantityValue := minQuantity.Value()
				maxQuantityValue := maxQuantity.Value()
				if maxRatio.Value() < resource.MaxMilliValue && minQuantityValue < resource.MaxMilliValue && maxQuantityValue < resource.MaxMilliValue {
					maxRatioValue = float64(maxRatio.MilliValue()) / 1000
					minQuantityValue = minQuantity.MilliValue()
					maxQuantityValue = maxQuantity.MilliValue()
				}
				maxRatioLimit := float64(maxQuantityValue) / float64(minQuantityValue)
				if maxRatioValue > maxRatioLimit {
					allErrs = append(allErrs, field.Invalid(idxPath.Child("maxLimitRequestRatio").Key(string(k)), maxRatio, fmt.Sprintf("ratio %s is greater than max/min = %f", maxRatio.String(), maxRatioLimit)))
				}
			}

			// for GPU, hugepages and other resources that are not allowed to overcommit,
			// the default value and defaultRequest value must match if both are specified
			if !helper.IsOvercommitAllowed(corev1.ResourceName(k)) && defaultQuantityFound && defaultRequestQuantityFound && defaultQuantity.Cmp(defaultRequestQuantity) != 0 {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("defaultRequest").Key(string(k)), defaultRequestQuantity, fmt.Sprintf("default value %s must equal to defaultRequest value %s in %s", defaultQuantity.String(), defaultRequestQuantity.String(), k)))
			}
		}
	}

	return allErrs
}

// ValidateServiceAccount tests if required fields in the ServiceAccount are set.

func ValidateServiceAccount(serviceAccount *corev1.ServiceAccount) field.ErrorList {
	allErrs := ValidateObjectMeta(&serviceAccount.ObjectMeta, true, ValidateServiceAccountName, field.NewPath("metadata"))
	return allErrs
}

// ValidateServiceAccountUpdate tests if required fields in the ServiceAccount are set.

func ValidateServiceAccountUpdate(newServiceAccount, oldServiceAccount *corev1.ServiceAccount) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newServiceAccount.ObjectMeta, &oldServiceAccount.ObjectMeta, field.NewPath("metadata"))
	allErrs = append(allErrs, ValidateServiceAccount(newServiceAccount)...)
	return allErrs
}

// ValidateSecret tests if required fields in the Secret are set.

func ValidateSecret(secret *corev1.Secret) field.ErrorList {
	allErrs := ValidateObjectMeta(&secret.ObjectMeta, true, ValidateSecretName, field.NewPath("metadata"))

	dataPath := field.NewPath("data")
	totalSize := 0
	for key, value := range secret.Data {
		for _, msg := range validation.IsConfigMapKey(key) {
			allErrs = append(allErrs, field.Invalid(dataPath.Key(key), key, msg))
		}
		totalSize += len(value)
	}
	if totalSize > corev1.MaxSecretSize {
		allErrs = append(allErrs, field.TooLong(dataPath, "", corev1.MaxSecretSize))
	}

	switch secret.Type {
	case corev1.SecretTypeServiceAccountToken:
		// Only require Annotations[kubernetes.io/service-account.name]
		// Additional fields (like Annotations[kubernetes.io/service-account.uid] and Data[token]) might be contributed later by a controller loop
		if value := secret.Annotations[corev1.ServiceAccountNameKey]; len(value) == 0 {
			allErrs = append(allErrs, field.Required(field.NewPath("metadata", "annotations").Key(corev1.ServiceAccountNameKey), ""))
		}
	case corev1.SecretTypeOpaque, "":
	// no-op
	case corev1.SecretTypeDockercfg:
		dockercfgBytes, exists := secret.Data[corev1.DockerConfigKey]
		if !exists {
			allErrs = append(allErrs, field.Required(dataPath.Key(corev1.DockerConfigKey), ""))
			break
		}

		// make sure that the content is well-formed json.
		if err := json.Unmarshal(dockercfgBytes, &map[string]interface{}{}); err != nil {
			allErrs = append(allErrs, field.Invalid(dataPath.Key(corev1.DockerConfigKey), "<secret contents redacted>", err.Error()))
		}
	case corev1.SecretTypeDockerConfigJson:
		dockerConfigJsonBytes, exists := secret.Data[corev1.DockerConfigJsonKey]
		if !exists {
			allErrs = append(allErrs, field.Required(dataPath.Key(corev1.DockerConfigJsonKey), ""))
			break
		}

		// make sure that the content is well-formed json.
		if err := json.Unmarshal(dockerConfigJsonBytes, &map[string]interface{}{}); err != nil {
			allErrs = append(allErrs, field.Invalid(dataPath.Key(corev1.DockerConfigJsonKey), "<secret contents redacted>", err.Error()))
		}
	case corev1.SecretTypeBasicAuth:
		_, usernameFieldExists := secret.Data[corev1.BasicAuthUsernameKey]
		_, passwordFieldExists := secret.Data[corev1.BasicAuthPasswordKey]

		// username or password might be empty, but the field must be present
		if !usernameFieldExists && !passwordFieldExists {
			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(corev1.BasicAuthUsernameKey), ""))
			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(corev1.BasicAuthPasswordKey), ""))
			break
		}
	case corev1.SecretTypeSSHAuth:
		if len(secret.Data[corev1.SSHAuthPrivateKey]) == 0 {
			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(corev1.SSHAuthPrivateKey), ""))
			break
		}

	case corev1.SecretTypeTLS:
		if _, exists := secret.Data[corev1.TLSCertKey]; !exists {
			allErrs = append(allErrs, field.Required(dataPath.Key(corev1.TLSCertKey), ""))
		}
		if _, exists := secret.Data[corev1.TLSPrivateKeyKey]; !exists {
			allErrs = append(allErrs, field.Required(dataPath.Key(corev1.TLSPrivateKeyKey), ""))
		}
	// TODO: Verify that the key matches the cert.
	default:
		// no-op
	}

	return allErrs
}

// ValidateSecretUpdate tests if required fields in the Secret are set.

func ValidateSecretUpdate(newSecret, oldSecret *corev1.Secret) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newSecret.ObjectMeta, &oldSecret.ObjectMeta, field.NewPath("metadata"))

	if len(newSecret.Type) == 0 {
		newSecret.Type = oldSecret.Type
	}

	allErrs = append(allErrs, ValidateImmutableField(newSecret.Type, oldSecret.Type, field.NewPath("type"))...)

	allErrs = append(allErrs, ValidateSecret(newSecret)...)
	return allErrs
}

ValidateConfigMapName can be used to check whether the given ConfigMap name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

ValidateNodeName can be used to check whether the given node name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

View Source
var ValidatePriorityClassName = apimachineryvalidation.NameIsDNSSubdomain

ValidatePiorityClassName can be used to check whether the given priority class name is valid.

// ValidateNamespaceName can be used to check whether the given namespace name is valid. // Prefix indicates this name will be used as part of generation, in which case // trailing dashes are allowed. var ValidateNamespaceName = apimachineryvalidation.ValidateNamespaceName

// ValidateLimitRangeName can be used to check whether the given limit range name is valid. // Prefix indicates this name will be used as part of generation, in which case // trailing dashes are allowed. var ValidateLimitRangeName = apimachineryvalidation.NameIsDNSSubdomain

// ValidateResourceQuotaName can be used to check whether the given // resource quota name is valid. // Prefix indicates this name will be used as part of generation, in which case // trailing dashes are allowed. var ValidateResourceQuotaName = apimachineryvalidation.NameIsDNSSubdomain

ValidateSecretName can be used to check whether the given secret name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

ValidateServiceAccountName can be used to check whether the given service account name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

Functions

func AccumulateUniqueHostPorts

func AccumulateUniqueHostPorts(containers []corev1.Container, accumulator *sets.String, fldPath *field.Path) field.ErrorList

AccumulateUniqueHostPorts extracts each HostPort of each Container, accumulating the results and returning an error if any ports conflict.

func AddOrUpdateTolerationInPod

func AddOrUpdateTolerationInPod(pod *corev1.Pod, toleration *corev1.Toleration) bool

AddOrUpdateTolerationInPod tries to add a toleration to the pod's toleration list. Returns true if something was updated, false otherwise.

func GetAccessModesAsString

func GetAccessModesAsString(modes []corev1.PersistentVolumeAccessMode) string

GetAccessModesAsString returns a string representation of an array of access modes. modes, when present, are always in the same order: RWO,ROX,RWX.

func GetAccessModesFromString

func GetAccessModesFromString(modes string) []corev1.PersistentVolumeAccessMode

GetAccessModesFromString returns an array of AccessModes from a string created by GetAccessModesAsString

func GetPersistentVolumeClaimClass

func GetPersistentVolumeClaimClass(claim *corev1.PersistentVolumeClaim) string

GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".

func GetPersistentVolumeClass

func GetPersistentVolumeClass(volume *corev1.PersistentVolume) string

GetPersistentVolumeClass returns StorageClassName.

func GetVolumeDeviceMap

func GetVolumeDeviceMap(devices []corev1.VolumeDevice) map[string]string

func GetVolumeMountMap

func GetVolumeMountMap(mounts []corev1.VolumeMount) map[string]string

func HugePageResourceName

func HugePageResourceName(pageSize resource.Quantity) corev1.ResourceName

HugePageResourceName returns a ResourceName with the canonical hugepage prefix prepended for the specified page size. The page size is converted to its canonical representation.

func HugePageSizeFromResourceName

func HugePageSizeFromResourceName(name corev1.ResourceName) (resource.Quantity, error)

HugePageSizeFromResourceName returns the page size for the specified huge page resource name. If the specified input is not a valid huge page resource name an error is returned.

func IsExtendedResourceName

func IsExtendedResourceName(name corev1.ResourceName) bool

IsExtendedResourceName returns true if: 1. the resource name is not in the default namespace; 2. resource name does not have "requests." prefix, to avoid confusion with the convention in quota 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name

func IsHugePageResourceName

func IsHugePageResourceName(name corev1.ResourceName) bool

IsHugePageResourceName returns true if the resource name has the huge page resource prefix.

func IsIntegerResourceName

func IsIntegerResourceName(str string) bool

IsIntegerResourceName returns true if the resource is measured in integer values

func IsMatchedVolume

func IsMatchedVolume(name string, volumes map[string]corev1.VolumeSource) bool

// ValidateObjectMetaUpdate validates an object's metadata when updated

func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList {
	allErrs := apimachineryvalidation.ValidateObjectMetaUpdate(newMeta, oldMeta, fldPath)
	// run additional checks for the finalizer name
	for i := range newMeta.Finalizers {
		allErrs = append(allErrs, validateKubeFinalizerName(string(newMeta.Finalizers[i]), fldPath.Child("finalizers").Index(i))...)
	}

	return allErrs
}

func IsNativeResource

func IsNativeResource(name corev1.ResourceName) bool

IsNativeResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.

func IsOvercommitAllowed

func IsOvercommitAllowed(name corev1.ResourceName) bool

IsOvercommitAllowed returns true if the resource is in the default namespace and is not hugepages.

func IsQuotaHugePageResourceName

func IsQuotaHugePageResourceName(name corev1.ResourceName) bool

IsQuotaHugePageResourceName returns true if the resource name has the quota related huge page resource prefix.

func IsResourceQuotaScopeValidForResource

func IsResourceQuotaScopeValidForResource(scope corev1.ResourceQuotaScope, resource string) bool

IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope

func IsServiceIPSet

func IsServiceIPSet(service *corev1.Service) bool

IsServiceIPSet aims to check if the service's ClusterIP is set or not the objective is not to perform validation here

func IsStandardContainerResourceName

func IsStandardContainerResourceName(str string) bool

IsStandardContainerResourceName returns true if the container can make a resource request for the specified resource

func IsStandardFinalizerName

func IsStandardFinalizerName(str string) bool

IsStandardFinalizerName checks if the input string is a standard finalizer name

func IsStandardLimitRangeType

func IsStandardLimitRangeType(str string) bool

IsStandardLimitRangeType returns true if the type is Pod or Container

func IsStandardQuotaResourceName

func IsStandardQuotaResourceName(str string) bool

IsStandardQuotaResourceName returns true if the resource is known to the quota tracking system

func IsStandardResourceName

func IsStandardResourceName(str string) bool

IsStandardResourceName returns true if the resource is known to the system

func IsStandardResourceQuotaScope

func IsStandardResourceQuotaScope(str string) bool

IsStandardResourceQuotaScope returns true if the scope is a standard value

func IsValidSysctlName

func IsValidSysctlName(name string) bool

IsValidSysctlName checks that the given string is a valid sysctl name, i.e. matches SysctlFmt.

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func LoadBalancerStatusEqual

func LoadBalancerStatusEqual(l, r *corev1.LoadBalancerStatus) bool

LoadBalancerStatusEqual checks if the status of the load balancer is equal to the target status TODO: make method on LoadBalancerStatus?

func NodeSelectorRequirementsAsFieldSelector

func NodeSelectorRequirementsAsFieldSelector(nsm []corev1.NodeSelectorRequirement) (fields.Selector, error)

NodeSelectorRequirementsAsFieldSelector converts the []NodeSelectorRequirement core type into a struct that implements fields.Selector.

func NodeSelectorRequirementsAsSelector

func NodeSelectorRequirementsAsSelector(nsm []corev1.NodeSelectorRequirement) (labels.Selector, error)

NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement core type into a struct that implements labels.Selector.

func NonConvertibleFields

func NonConvertibleFields(annotations map[string]string) map[string]string

NonConvertibleFields iterates over the provided map and filters out all but any keys with the "non-convertible.kubernetes.io" prefix.

func PersistentVolumeClaimHasClass

func PersistentVolumeClaimHasClass(claim *corev1.PersistentVolumeClaim) bool

PersistentVolumeClaimHasClass returns true if given claim has set StorageClassName field.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func ValidateConfigMap

func ValidateConfigMap(cfg *corev1.ConfigMap) field.ErrorList

ValidateConfigMap tests whether required fields in the ConfigMap are set.

func ValidateDNS1123Label

func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList

// BannedOwners is a black list of object that are not allowed to be owners. var BannedOwners = apimachineryvalidation.BannedOwners

var iscsiInitiatorIqnRegex = regexp.MustCompile(`iqn\.\d{4}-\d{2}\.([[:alnum:]-.]+)(:[^,;*&$|\s]+)$`) var iscsiInitiatorEuiRegex = regexp.MustCompile(`^eui.[[:alnum:]]{16}$`) var iscsiInitiatorNaaRegex = regexp.MustCompile(`^naa.[[:alnum:]]{32}$`)

// ValidateHasLabel requires that metav1.ObjectMeta has a Label with key and expectedValue

func ValidateHasLabel(meta metav1.ObjectMeta, fldPath *field.Path, key, expectedValue string) field.ErrorList {
	allErrs := field.ErrorList{}
	actualValue, found := meta.Labels[key]
	if !found {
		allErrs = append(allErrs, field.Required(fldPath.Child("labels").Key(key),
			fmt.Sprintf("must be '%s'", expectedValue)))
		return allErrs
	}
	if actualValue != expectedValue {
		allErrs = append(allErrs, field.Invalid(fldPath.Child("labels").Key(key), meta.Labels,
			fmt.Sprintf("must be '%s'", expectedValue)))
	}
	return allErrs
}

// ValidateAnnotations validates that a set of annotations are correctly defined.

func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
	return apimachineryvalidation.ValidateAnnotations(annotations, fldPath)
}

func ValidateDNS1123Subdomain

func ValidateDNS1123Subdomain(value string, fldPath *field.Path) field.ErrorList

ValidateDNS1123Subdomain validates that a name is a proper DNS subdomain.

func ValidateEnv

func ValidateEnv(vars []corev1.EnvVar, fldPath *field.Path) field.ErrorList

ValidateEnv validates env vars

func ValidateEnvFrom

func ValidateEnvFrom(vars []corev1.EnvFromSource, fldPath *field.Path) field.ErrorList

func ValidateHostAliases

func ValidateHostAliases(hostAliases []corev1.HostAlias, fldPath *field.Path) field.ErrorList

func ValidateNonnegativeField

func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList

Validates that given value is not negative.

func ValidateNonnegativeQuantity

func ValidateNonnegativeQuantity(value resource.Quantity, fldPath *field.Path) field.ErrorList

Validates that a Quantity is not negative

func ValidateObjectMeta

func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList

// Validates that a Quantity is positive

func ValidatePositiveQuantityValue(value resource.Quantity, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if value.Cmp(resource.Quantity{}) <= 0 {
		allErrs = append(allErrs, field.Invalid(fldPath, value.String(), isNotPositiveErrorMsg))
	}
	return allErrs
}
func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList {
	return apimachineryvalidation.ValidateImmutableField(newVal, oldVal, fldPath)
}
func ValidateImmutableAnnotation(newVal string, oldVal string, annotation string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	if oldVal != newVal {
		allErrs = append(allErrs, field.Invalid(fldPath.Child("annotations", annotation), newVal, fieldImmutableErrorMsg))
	}
	return allErrs
}

ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already been performed. It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. TODO: Remove calls to this method scattered in validations of specific resources, e.g., ValidatePodUpdate.

func ValidatePodSecurityContext

func ValidatePodSecurityContext(securityContext *corev1.PodSecurityContext, spec *corev1.PodSpec, specPath, fldPath *field.Path) field.ErrorList

ValidatePodSecurityContext test that the specified PodSecurityContext has valid data.

func ValidatePodSpec

func ValidatePodSpec(spec *corev1.PodSpec, fldPath *field.Path) field.ErrorList

func ValidatePortNumOrName

func ValidatePortNumOrName(port intstr.IntOrString, fldPath *field.Path) field.ErrorList

func ValidatePreemptionPolicy

func ValidatePreemptionPolicy(preemptionPolicy *corev1.PreemptionPolicy, fldPath *field.Path) field.ErrorList

func ValidateProcMountType

func ValidateProcMountType(fldPath *field.Path, procMountType corev1.ProcMountType) *field.Error

ValidateProcMountType tests that the argument is a valid ProcMountType.

func ValidateResourceQuantityValue

func ValidateResourceQuantityValue(resource string, value resource.Quantity, fldPath *field.Path) field.ErrorList

// validateResourceQuotaScopes ensures that each enumerated hard resource constraint is valid for set of scopes

func validateResourceQuotaScopes(resourceQuotaSpec *corev1.ResourceQuotaSpec, fld *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if len(resourceQuotaSpec.Scopes) == 0 {
		return allErrs
	}
	hardLimits := sets.NewString()
	for k := range resourceQuotaSpec.Hard {
		hardLimits.Insert(string(k))
	}
	fldPath := fld.Child("scopes")
	scopeSet := sets.NewString()
	for _, scope := range resourceQuotaSpec.Scopes {
		if !helper.IsStandardResourceQuotaScope(string(scope)) {
			allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope"))
		}
		for _, k := range hardLimits.List() {
			if helper.IsStandardQuotaResourceName(k) && !helper.IsResourceQuotaScopeValidForResource(scope, k) {
				allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "unsupported scope applied to resource"))
			}
		}
		scopeSet.Insert(string(scope))
	}
	invalidScopePairs := []sets.String{
		sets.NewString(string(corev1.ResourceQuotaScopeBestEffort), string(corev1.ResourceQuotaScopeNotBestEffort)),
		sets.NewString(string(corev1.ResourceQuotaScopeTerminating), string(corev1.ResourceQuotaScopeNotTerminating)),
	}
	for _, invalidScopePair := range invalidScopePairs {
		if scopeSet.HasAll(invalidScopePair.List()...) {
			allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "conflicting scopes"))
		}
	}
	return allErrs
}

// validateScopedResourceSelectorRequirement tests that the match expressions has valid data

func validateScopedResourceSelectorRequirement(resourceQuotaSpec *corev1.ResourceQuotaSpec, fld *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	hardLimits := sets.NewString()
	for k := range resourceQuotaSpec.Hard {
		hardLimits.Insert(string(k))
	}
	fldPath := fld.Child("matchExpressions")
	scopeSet := sets.NewString()
	for _, req := range resourceQuotaSpec.ScopeSelector.MatchExpressions {
		if !helper.IsStandardResourceQuotaScope(string(req.ScopeName)) {
			allErrs = append(allErrs, field.Invalid(fldPath.Child("scopeName"), req.ScopeName, "unsupported scope"))
		}
		for _, k := range hardLimits.List() {
			if helper.IsStandardQuotaResourceName(k) && !helper.IsResourceQuotaScopeValidForResource(req.ScopeName, k) {
				allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.ScopeSelector, "unsupported scope applied to resource"))
			}
		}
		switch req.ScopeName {
		case corev1.ResourceQuotaScopeBestEffort, corev1.ResourceQuotaScopeNotBestEffort, corev1.ResourceQuotaScopeTerminating, corev1.ResourceQuotaScopeNotTerminating:
			if req.Operator != corev1.ScopeSelectorOpExists {
				allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), req.Operator,
					"must be 'Exist' only operator when scope is any of ResourceQuotaScopeTerminating, ResourceQuotaScopeNotTerminating, ResourceQuotaScopeBestEffort and ResourceQuotaScopeNotBestEffort"))
			}
		}

		switch req.Operator {
		case corev1.ScopeSelectorOpIn, corev1.ScopeSelectorOpNotIn:
			if len(req.Values) == 0 {
				allErrs = append(allErrs, field.Required(fldPath.Child("values"),
					"must be at least one value when `operator` is 'In' or 'NotIn' for scope selector"))
			}
		case corev1.ScopeSelectorOpExists, corev1.ScopeSelectorOpDoesNotExist:
			if len(req.Values) != 0 {
				allErrs = append(allErrs, field.Invalid(fldPath.Child("values"), req.Values,
					"must be no value when `operator` is 'Exist' or 'DoesNotExist' for scope selector"))
			}
		default:
			allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), req.Operator, "not a valid selector operator"))
		}
		scopeSet.Insert(string(req.ScopeName))
	}
	invalidScopePairs := []sets.String{
		sets.NewString(string(corev1.ResourceQuotaScopeBestEffort), string(corev1.ResourceQuotaScopeNotBestEffort)),
		sets.NewString(string(corev1.ResourceQuotaScopeTerminating), string(corev1.ResourceQuotaScopeNotTerminating)),
	}
	for _, invalidScopePair := range invalidScopePairs {
		if scopeSet.HasAll(invalidScopePair.List()...) {
			allErrs = append(allErrs, field.Invalid(fldPath, resourceQuotaSpec.Scopes, "conflicting scopes"))
		}
	}

	return allErrs
}

// validateScopeSelector tests that the specified scope selector has valid data

func validateScopeSelector(resourceQuotaSpec *corev1.ResourceQuotaSpec, fld *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if resourceQuotaSpec.ScopeSelector == nil {
		return allErrs
	}
	allErrs = append(allErrs, validateScopedResourceSelectorRequirement(resourceQuotaSpec, fld.Child("scopeSelector"))...)
	return allErrs
}

// ValidateResourceQuota tests if required fields in the ResourceQuota are set.

func ValidateResourceQuota(resourceQuota *corev1.ResourceQuota) field.ErrorList {
	allErrs := ValidateObjectMeta(&resourceQuota.ObjectMeta, true, ValidateResourceQuotaName, field.NewPath("metadata"))

	allErrs = append(allErrs, ValidateResourceQuotaSpec(&resourceQuota.Spec, field.NewPath("spec"))...)
	allErrs = append(allErrs, ValidateResourceQuotaStatus(&resourceQuota.Status, field.NewPath("status"))...)

	return allErrs
}
func ValidateResourceQuotaStatus(status *corev1.ResourceQuotaStatus, fld *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	fldPath := fld.Child("hard")
	for k, v := range status.Hard {
		resPath := fldPath.Key(string(k))
		allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...)
		allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...)
	}
	fldPath = fld.Child("used")
	for k, v := range status.Used {
		resPath := fldPath.Key(string(k))
		allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...)
		allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...)
	}

	return allErrs
}
func ValidateResourceQuotaSpec(resourceQuotaSpec *corev1.ResourceQuotaSpec, fld *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	fldPath := fld.Child("hard")
	for k, v := range resourceQuotaSpec.Hard {
		resPath := fldPath.Key(string(k))
		allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...)
		allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...)
	}
	allErrs = append(allErrs, validateResourceQuotaScopes(resourceQuotaSpec, fld)...)
	allErrs = append(allErrs, validateScopeSelector(resourceQuotaSpec, fld)...)

	return allErrs
}

ValidateResourceQuantityValue enforces that specified quantity is valid for specified resource

func ValidateResourceRequirements

func ValidateResourceRequirements(requirements *corev1.ResourceRequirements, fldPath *field.Path) field.ErrorList

// ValidateConfigMapUpdate tests if required fields in the ConfigMap are set.

func ValidateConfigMapUpdate(newCfg, oldCfg *corev1.ConfigMap) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, ValidateObjectMetaUpdate(&newCfg.ObjectMeta, &oldCfg.ObjectMeta, field.NewPath("metadata"))...)
	allErrs = append(allErrs, ValidateConfigMap(newCfg)...)

	return allErrs
}
func validateBasicResource(quantity resource.Quantity, fldPath *field.Path) field.ErrorList {
	if quantity.Value() < 0 {
		return field.ErrorList{field.Invalid(fldPath, quantity.Value(), "must be a valid resource quantity")}
	}
	return field.ErrorList{}
}

Validates resource requirement spec.

func ValidateRuntimeClassName

func ValidateRuntimeClassName(name string, fldPath *field.Path) field.ErrorList

ValidateRuntimeClassName can be used to check whether the given RuntimeClass name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

func ValidateSecurityContext

func ValidateSecurityContext(sc *corev1.SecurityContext, fldPath *field.Path) field.ErrorList

// ValidateNamespaceUpdate tests to make sure a namespace update can be applied. // newNamespace is updated with fields that cannot be changed

func ValidateNamespaceUpdate(newNamespace *corev1.Namespace, oldNamespace *corev1.Namespace) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata"))
	newNamespace.Spec.Finalizers = oldNamespace.Spec.Finalizers
	newNamespace.Status = oldNamespace.Status
	return allErrs
}

// ValidateNamespaceStatusUpdate tests to see if the update is legal for an end user to make. newNamespace is updated with fields // that cannot be changed.

func ValidateNamespaceStatusUpdate(newNamespace, oldNamespace *corev1.Namespace) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata"))
	newNamespace.Spec = oldNamespace.Spec
	if newNamespace.DeletionTimestamp.IsZero() {
		if newNamespace.Status.Phase != corev1.NamespaceActive {
			allErrs = append(allErrs, field.Invalid(field.NewPath("status", "Phase"), newNamespace.Status.Phase, "may only be 'Active' if `deletionTimestamp` is empty"))
		}
	} else {
		if newNamespace.Status.Phase != corev1.NamespaceTerminating {
			allErrs = append(allErrs, field.Invalid(field.NewPath("status", "Phase"), newNamespace.Status.Phase, "may only be 'Terminating' if `deletionTimestamp` is not empty"))
		}
	}
	return allErrs
}

// ValidateNamespaceFinalizeUpdate tests to see if the update is legal for an end user to make. // newNamespace is updated with fields that cannot be changed.

func ValidateNamespaceFinalizeUpdate(newNamespace, oldNamespace *corev1.Namespace) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata"))

	fldPath := field.NewPath("spec", "finalizers")
	for i := range newNamespace.Spec.Finalizers {
		idxPath := fldPath.Index(i)
		allErrs = append(allErrs, validateFinalizerName(string(newNamespace.Spec.Finalizers[i]), idxPath)...)
	}
	newNamespace.Status = oldNamespace.Status
	return allErrs
}

// ValidateEndpoints tests if required fields are set.

func ValidateEndpoints(endpoints *corev1.Endpoints) field.ErrorList {
	allErrs := ValidateObjectMeta(&endpoints.ObjectMeta, true, ValidateEndpointsName, field.NewPath("metadata"))
	allErrs = append(allErrs, ValidateEndpointsSpecificAnnotations(endpoints.Annotations, field.NewPath("annotations"))...)
	allErrs = append(allErrs, validateEndpointSubsets(endpoints.Subsets, field.NewPath("subsets"))...)
	return allErrs
}
func validateEndpointSubsets(subsets []corev1.EndpointSubset, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for i := range subsets {
		ss := &subsets[i]
		idxPath := fldPath.Index(i)

		// EndpointSubsets must include endpoint address. For headless service, we allow its endpoints not to have ports.
		if len(ss.Addresses) == 0 && len(ss.NotReadyAddresses) == 0 {
			//TODO: consider adding a RequiredOneOf() error for this and similar cases
			allErrs = append(allErrs, field.Required(idxPath, "must specify `addresses` or `notReadyAddresses`"))
		}
		for addr := range ss.Addresses {
			allErrs = append(allErrs, validateEndpointAddress(&ss.Addresses[addr], idxPath.Child("addresses").Index(addr))...)
		}
		for addr := range ss.NotReadyAddresses {
			allErrs = append(allErrs, validateEndpointAddress(&ss.NotReadyAddresses[addr], idxPath.Child("notReadyAddresses").Index(addr))...)
		}
		for port := range ss.Ports {
			allErrs = append(allErrs, validateEndpointPort(&ss.Ports[port], len(ss.Ports) > 1, idxPath.Child("ports").Index(port))...)
		}
	}

	return allErrs
}
func validateEndpointAddress(address *corev1.EndpointAddress, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for _, msg := range validation.IsValidIP(address.IP) {
		allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), address.IP, msg))
	}
	if len(address.Hostname) > 0 {
		allErrs = append(allErrs, ValidateDNS1123Label(address.Hostname, fldPath.Child("hostname"))...)
	}
	// During endpoint update, verify that NodeName is a DNS subdomain and transition rules allow the update
	if address.NodeName != nil {
		for _, msg := range ValidateNodeName(*address.NodeName, false) {
			allErrs = append(allErrs, field.Invalid(fldPath.Child("nodeName"), *address.NodeName, msg))
		}
	}
	allErrs = append(allErrs, validateNonSpecialIP(address.IP, fldPath.Child("ip"))...)
	return allErrs
}
func validateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList {
	// We disallow some IPs as endpoints or external-ips.  Specifically,
	// unspecified and loopback addresses are nonsensical and link-local
	// addresses tend to be used for node-centric purposes (e.g. metadata
	// service).
	allErrs := field.ErrorList{}
	ip := net.ParseIP(ipAddress)
	if ip == nil {
		allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "must be a valid IP address"))
		return allErrs
	}
	if ip.IsUnspecified() {
		allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be unspecified (0.0.0.0)"))
	}
	if ip.IsLoopback() {
		allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the loopback range (127.0.0.0/8)"))
	}
	if ip.IsLinkLocalUnicast() {
		allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local range (169.254.0.0/16)"))
	}
	if ip.IsLinkLocalMulticast() {
		allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local multicast range (224.0.0.0/24)"))
	}
	return allErrs
}
func validateEndpointPort(port *corev1.EndpointPort, requireName bool, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if requireName && len(port.Name) == 0 {
		allErrs = append(allErrs, field.Required(fldPath.Child("name"), ""))
	} else if len(port.Name) != 0 {
		allErrs = append(allErrs, ValidateDNS1123Label(port.Name, fldPath.Child("name"))...)
	}
	for _, msg := range validation.IsValidPortNum(int(port.Port)) {
		allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), port.Port, msg))
	}
	if len(port.Protocol) == 0 {
		allErrs = append(allErrs, field.Required(fldPath.Child("protocol"), ""))
	} else if !supportedPortProtocols.Has(string(port.Protocol)) {
		allErrs = append(allErrs, field.NotSupported(fldPath.Child("protocol"), port.Protocol, supportedPortProtocols.List()))
	}
	return allErrs
}

// ValidateEndpointsUpdate tests to make sure an endpoints update can be applied. // NodeName changes are allowed during update to accommodate the case where nodeIP or PodCIDR is reused. // An existing endpoint ip will have a different nodeName if this happens.

func ValidateEndpointsUpdate(newEndpoints, oldEndpoints *corev1.Endpoints) field.ErrorList {
	allErrs := ValidateObjectMetaUpdate(&newEndpoints.ObjectMeta, &oldEndpoints.ObjectMeta, field.NewPath("metadata"))
	allErrs = append(allErrs, validateEndpointSubsets(newEndpoints.Subsets, field.NewPath("subsets"))...)
	allErrs = append(allErrs, ValidateEndpointsSpecificAnnotations(newEndpoints.Annotations, field.NewPath("annotations"))...)
	return allErrs
}

ValidateSecurityContext ensures the security context contains valid settings

func ValidateTolerations

func ValidateTolerations(tolerations []corev1.Toleration, fldPath *field.Path) field.ErrorList

ValidateTolerations tests if given tolerations have valid data.

func ValidateVolumeDevices

func ValidateVolumeDevices(devices []corev1.VolumeDevice, volmounts map[string]string, volumes map[string]corev1.VolumeSource, fldPath *field.Path) field.ErrorList

func ValidateVolumeMounts

func ValidateVolumeMounts(mounts []corev1.VolumeMount, voldevices map[string]string, volumes map[string]corev1.VolumeSource, container *corev1.Container, fldPath *field.Path) field.ErrorList

func ValidateVolumes

func ValidateVolumes(volumes []corev1.Volume, fldPath *field.Path) (map[string]corev1.VolumeSource, field.ErrorList)

Types

type APIDefinition

type APIDefinition struct {
	Path   string `json:"path"`
	Method string `json:"method"`
}

func (*APIDefinition) DeepCopy

func (in *APIDefinition) DeepCopy() *APIDefinition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIDefinition.

func (*APIDefinition) DeepCopyInto

func (in *APIDefinition) DeepCopyInto(out *APIDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ApiPublisherConfig

type ApiPublisherConfig struct {
	Authenticate bool   `json:"authenticate"`
	Backend      string `json:"backend"`
	Context      string `json:"context"`
	Version      string `json:"version"`
}

func (*ApiPublisherConfig) DeepCopy

func (in *ApiPublisherConfig) DeepCopy() *ApiPublisherConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApiPublisherConfig.

func (*ApiPublisherConfig) DeepCopyInto

func (in *ApiPublisherConfig) DeepCopyInto(out *ApiPublisherConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ApiPublisherConfig) HasVersion

func (ap *ApiPublisherConfig) HasVersion() bool

type Cell

type Cell struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CellSpec   `json:"spec"`
	Status CellStatus `json:"status"`
}

func (*Cell) DeepCopy

func (in *Cell) DeepCopy() *Cell

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cell.

func (*Cell) DeepCopyInto

func (in *Cell) DeepCopyInto(out *Cell)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Cell) DeepCopyObject

func (in *Cell) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Cell) Default

func (c *Cell) Default()

func (*Cell) Validate

func (c *Cell) Validate() field.ErrorList

type CellCondition

type CellCondition struct {
	Type   CellConditionType      `json:"type"`
	Status corev1.ConditionStatus `json:"status"`
}

func (*CellCondition) DeepCopy

func (in *CellCondition) DeepCopy() *CellCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellCondition.

func (*CellCondition) DeepCopyInto

func (in *CellCondition) DeepCopyInto(out *CellCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellConditionType

type CellConditionType string
const (
	CellReady CellConditionType = "Ready"
)

type CellCurrentStatus

type CellCurrentStatus string
const (
	CellCurrentStatusUnknown CellCurrentStatus = "Unknown"

	CellCurrentStatusReady CellCurrentStatus = "Ready"

	CellCurrentStatusNotReady CellCurrentStatus = "NotReady"
)

type CellList

type CellList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []Cell `json:"items"`
}

func (*CellList) DeepCopy

func (in *CellList) DeepCopy() *CellList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellList.

func (*CellList) DeepCopyInto

func (in *CellList) DeepCopyInto(out *CellList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellList) DeepCopyObject

func (in *CellList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CellSpec

type CellSpec struct {
	Gateway      Gateway      `json:"gateway"`
	Components   []Component  `json:"components"`
	TokenService TokenService `json:"sts"`
}

func (*CellSpec) DeepCopy

func (in *CellSpec) DeepCopy() *CellSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellSpec.

func (*CellSpec) DeepCopyInto

func (in *CellSpec) DeepCopyInto(out *CellSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellSpec) SetDefaults

func (cs *CellSpec) SetDefaults()

func (*CellSpec) Validate

func (cs *CellSpec) Validate(fldPath *field.Path) field.ErrorList

type CellStatus

type CellStatus struct {
	ComponentCount       int                               `json:"componentCount"`
	ActiveComponentCount int                               `json:"activeComponentCount"`
	GatewayServiceName   string                            `json:"gatewayServiceName"`
	Status               CellCurrentStatus                 `json:"status"`
	GatewayStatus        GatewayCurrentStatus              `json:"gatewayStatus"`
	TokenServiceStatus   TokenServiceCurrentStatus         `json:"tokenServiceStatus"`
	ComponentStatuses    map[string]ComponentCurrentStatus `json:"componentStatuses"`
	// Status                  string `json:"status"`
	ObservedGeneration      int64            `json:"observedGeneration,omitempty"`
	NetworkPolicyGeneration int64            `json:"networkPolicyGeneration,omitempty"`
	SecretGeneration        int64            `json:"secretGeneration,omitempty"`
	GatewayGeneration       int64            `json:"gatewayGeneration,omitempty"`
	TokenServiceGeneration  int64            `json:"tokenServiceGeneration,omitempty"`
	RoutingVsGeneration     int64            `json:"routingVsGeneration,omitempty"`
	ComponentGenerations    map[string]int64 `json:"componentGenerations,omitempty"`
	// Current conditions of the cell.
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []CellCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

func (*CellStatus) DeepCopy

func (in *CellStatus) DeepCopy() *CellStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellStatus.

func (*CellStatus) DeepCopyInto

func (in *CellStatus) DeepCopyInto(out *CellStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellStatus) SetDefaults

func (cstat *CellStatus) SetDefaults()

type ClusterIngressConfig

type ClusterIngressConfig struct {
	Host string    `json:"host,omitempty"`
	Tls  TlsConfig `json:"tls,omitempty"`
}

func (*ClusterIngressConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressConfig.

func (*ClusterIngressConfig) DeepCopyInto

func (in *ClusterIngressConfig) DeepCopyInto(out *ClusterIngressConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterIngressConfig) HasCertAndKey

func (ci *ClusterIngressConfig) HasCertAndKey() bool

func (*ClusterIngressConfig) HasSecret

func (ci *ClusterIngressConfig) HasSecret() bool

type Component

type Component struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ComponentSpec   `json:"spec"`
	Status ComponentStatus `json:"status,omitempty"`
}

func (*Component) DeepCopy

func (in *Component) DeepCopy() *Component

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Component.

func (*Component) DeepCopyInto

func (in *Component) DeepCopyInto(out *Component)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Component) DeepCopyObject

func (in *Component) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Component) Default

func (c *Component) Default()

func (*Component) Validate

func (c *Component) Validate() field.ErrorList

type ComponentCurrentStatus

type ComponentCurrentStatus string
const (
	ComponentCurrentStatusUnknown ComponentCurrentStatus = "Unknown"

	ComponentCurrentStatusReady ComponentCurrentStatus = "Ready"

	ComponentCurrentStatusNotReady ComponentCurrentStatus = "NotReady"

	ComponentCurrentStatusIdle ComponentCurrentStatus = "Idle"
)

type ComponentList

type ComponentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []Component `json:"items"`
}

func (*ComponentList) DeepCopy

func (in *ComponentList) DeepCopy() *ComponentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentList.

func (*ComponentList) DeepCopyInto

func (in *ComponentList) DeepCopyInto(out *ComponentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentList) DeepCopyObject

func (in *ComponentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ComponentScalingPolicy

type ComponentScalingPolicy struct {
	Replicas *int32                   `json:"replicas,omitempty"`
	Hpa      *HorizontalPodAutoscaler `json:"hpa,omitempty"`
	Kpa      *KnativePodAutoscaler    `json:"kpa,omitempty"`
}

func (*ComponentScalingPolicy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentScalingPolicy.

func (*ComponentScalingPolicy) DeepCopyInto

func (in *ComponentScalingPolicy) DeepCopyInto(out *ComponentScalingPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentScalingPolicy) Default

func (sp *ComponentScalingPolicy) Default()

func (*ComponentScalingPolicy) IsHpa

func (sp *ComponentScalingPolicy) IsHpa() bool

func (*ComponentScalingPolicy) IsKpa

func (sp *ComponentScalingPolicy) IsKpa() bool

func (*ComponentScalingPolicy) MinReplicas

func (sp *ComponentScalingPolicy) MinReplicas() int32

type ComponentSpec

type ComponentSpec struct {
	Type           ComponentType          `json:"type,omitempty"`
	ScalingPolicy  ComponentScalingPolicy `json:"scalingPolicy,omitempty"`
	Template       corev1.PodSpec         `json:"template,omitempty"`
	Ports          []PortMapping          `json:"ports,omitempty"`
	VolumeClaims   []VolumeClaim          `json:"volumeClaims,omitempty"`
	Configurations []corev1.ConfigMap     `json:"configurations,omitempty"`
	Secrets        []corev1.Secret        `json:"secrets,omitempty"`
}

func (*ComponentSpec) DeepCopy

func (in *ComponentSpec) DeepCopy() *ComponentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentSpec.

func (*ComponentSpec) DeepCopyInto

func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentSpec) Default

func (cs *ComponentSpec) Default()

func (*ComponentSpec) Validate

func (cs *ComponentSpec) Validate(fldPath *field.Path) field.ErrorList

type ComponentStatus

type ComponentStatus struct {
	Type                             ComponentType          `json:"componentType"`
	Status                           ComponentCurrentStatus `json:"status"`
	ServiceName                      string                 `json:"serviceName"`
	AvailableReplicas                int32                  `json:"availableReplicas"`
	ObservedGeneration               int64                  `json:"observedGeneration,omitempty"`
	DeploymentGeneration             int64                  `json:"deploymentGeneration,omitempty"`
	StatefulSetGeneration            int64                  `json:"statefulSetGeneration,omitempty"`
	JobGeneration                    int64                  `json:"jobGeneration,omitempty"`
	ServiceGeneration                int64                  `json:"serviceGeneration,omitempty"`
	HpaGeneration                    int64                  `json:"hpaGeneration,omitempty"`
	ServingConfigurationGeneration   int64                  `json:"servingConfigurationGeneration,omitempty"`
	ServingVirtualServiceGeneration  int64                  `json:"servingVirtualServiceGeneration,omitempty"`
	TlsPolicyGeneration              int64                  `json:"TlsPolicyGeneration,omitempty"`
	PersistantVolumeClaimGenerations map[string]int64       `json:"persistantVolumeClaimGenerations,omitempty"`
	ConfigMapGenerations             map[string]int64       `json:"configMapGenerations,omitempty"`
	SecretGenerations                map[string]int64       `json:"secretGenerations,omitempty"`
}

func (*ComponentStatus) DeepCopy

func (in *ComponentStatus) DeepCopy() *ComponentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatus.

func (*ComponentStatus) DeepCopyInto

func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentStatus) Default

func (cstat *ComponentStatus) Default()

func (*ComponentStatus) ResetServiceName

func (cs *ComponentStatus) ResetServiceName()

func (*ComponentStatus) SetType

func (cstat *ComponentStatus) SetType(t ComponentType)

type ComponentType

type ComponentType string
const (
	// ServiceTypeDeployment is the default type which run as services.
	ComponentTypeDeployment ComponentType = "Deployment"

	// ServiceTypeStatefulSet is the default type which runs for the stateful services.
	ComponentTypeStatefulSet ComponentType = "StatefulSet"

	// ServiceTypeJob is a job which run into completion.
	ComponentTypeJob ComponentType = "Job"
)

type Composite

type Composite struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CompositeSpec   `json:"spec"`
	Status CompositeStatus `json:"status"`
}

func (*Composite) DeepCopy

func (in *Composite) DeepCopy() *Composite

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Composite.

func (*Composite) DeepCopyInto

func (in *Composite) DeepCopyInto(out *Composite)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Composite) DeepCopyObject

func (in *Composite) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Composite) Default

func (c *Composite) Default()

func (*Composite) Validate

func (c *Composite) Validate() field.ErrorList

type CompositeCondition

type CompositeCondition struct {
	Type   CompositeConditionType `json:"type"`
	Status corev1.ConditionStatus `json:"status"`
}

func (*CompositeCondition) DeepCopy

func (in *CompositeCondition) DeepCopy() *CompositeCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeCondition.

func (*CompositeCondition) DeepCopyInto

func (in *CompositeCondition) DeepCopyInto(out *CompositeCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CompositeConditionType

type CompositeConditionType string
const (
	CompositeReady CompositeConditionType = "Ready"
)

type CompositeCurrentStatus

type CompositeCurrentStatus string
const (
	CompositeCurrentStatusUnknown CompositeCurrentStatus = "Unknown"

	CompositeCurrentStatusReady CompositeCurrentStatus = "Ready"

	CompositeCurrentStatusNotReady CompositeCurrentStatus = "NotReady"
)

type CompositeList

type CompositeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []Composite `json:"items"`
}

func (*CompositeList) DeepCopy

func (in *CompositeList) DeepCopy() *CompositeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeList.

func (*CompositeList) DeepCopyInto

func (in *CompositeList) DeepCopyInto(out *CompositeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CompositeList) DeepCopyObject

func (in *CompositeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CompositeSpec

type CompositeSpec struct {
	Components []Component `json:"components"`
}

func (*CompositeSpec) DeepCopy

func (in *CompositeSpec) DeepCopy() *CompositeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeSpec.

func (*CompositeSpec) DeepCopyInto

func (in *CompositeSpec) DeepCopyInto(out *CompositeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CompositeSpec) SetDefaults

func (cs *CompositeSpec) SetDefaults()

func (*CompositeSpec) Validate

func (cs *CompositeSpec) Validate(fldPath *field.Path) field.ErrorList

type CompositeStatus

type CompositeStatus struct {
	ComponentCount         int                               `json:"componentCount"`
	ActiveComponentCount   int                               `json:"activeComponentCount"`
	Status                 CompositeCurrentStatus            `json:"status"`
	TokenServiceStatus     TokenServiceCurrentStatus         `json:"tokenServiceStatus"`
	ComponentStatuses      map[string]ComponentCurrentStatus `json:"componentStatuses"`
	ObservedGeneration     int64                             `json:"observedGeneration,omitempty"`
	SecretGeneration       int64                             `json:"secretGeneration,omitempty"`
	TokenServiceGeneration int64                             `json:"tokenServiceGeneration,omitempty"`
	ComponentGenerations   map[string]int64                  `json:"componentGenerations,omitempty"`
	RoutingVsGeneration    int64                             `json:"routingVsGeneration,omitempty"`
	// Current conditions of the composite.
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []CompositeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

func (*CompositeStatus) DeepCopy

func (in *CompositeStatus) DeepCopy() *CompositeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeStatus.

func (*CompositeStatus) DeepCopyInto

func (in *CompositeStatus) DeepCopyInto(out *CompositeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CompositeStatus) SetDefaults

func (cstat *CompositeStatus) SetDefaults()

type Destination

type Destination struct {
	Host string `json:"host,omitempty"`
	Port uint32 `json:"port,omitempty"`
}

func (*Destination) DeepCopy

func (in *Destination) DeepCopy() *Destination

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination.

func (*Destination) DeepCopyInto

func (in *Destination) DeepCopyInto(out *Destination)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GRPCRoute

type GRPCRoute struct {
	Port        uint32      `json:"port"`
	Destination Destination `json:"destination,omitempty"`
	ZeroScale   bool        `json:"zeroScale,omitempty"`
}

func (*GRPCRoute) DeepCopy

func (in *GRPCRoute) DeepCopy() *GRPCRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRoute.

func (*GRPCRoute) DeepCopyInto

func (in *GRPCRoute) DeepCopyInto(out *GRPCRoute)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Gateway

type Gateway struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   GatewaySpec   `json:"spec"`
	Status GatewayStatus `json:"status,omitempty"`
}

func (*Gateway) DeepCopy

func (in *Gateway) DeepCopy() *Gateway

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway.

func (*Gateway) DeepCopyInto

func (in *Gateway) DeepCopyInto(out *Gateway)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Gateway) DeepCopyObject

func (in *Gateway) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Gateway) Default

func (g *Gateway) Default()

func (*Gateway) IsHpa

func (sp *Gateway) IsHpa() bool

func (*Gateway) MaxReplicas

func (sp *Gateway) MaxReplicas() int32

func (*Gateway) Metrics

func (sp *Gateway) Metrics() []v2beta1.MetricSpec

func (*Gateway) MinReplicas

func (sp *Gateway) MinReplicas() *int32

func (*Gateway) Validate

func (c *Gateway) Validate() field.ErrorList

type GatewayCurrentStatus

type GatewayCurrentStatus string
const (
	GatewayCurrentStatusUnknown GatewayCurrentStatus = "Unknown"

	GatewayCurrentStatusReady GatewayCurrentStatus = "Ready"

	GatewayCurrentStatusNotReady GatewayCurrentStatus = "NotReady"
)

type GatewayList

type GatewayList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []Gateway `json:"items"`
}

func (*GatewayList) DeepCopy

func (in *GatewayList) DeepCopy() *GatewayList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList.

func (*GatewayList) DeepCopyInto

func (in *GatewayList) DeepCopyInto(out *GatewayList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayList) DeepCopyObject

func (in *GatewayList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GatewaySpec

type GatewaySpec struct {
	Ingress       Ingress         `json:"ingress,omitempty"`
	ScalingPolicy GwScalingPolicy `json:"scalingPolicy,omitempty"`
}

func (*GatewaySpec) DeepCopy

func (in *GatewaySpec) DeepCopy() *GatewaySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec.

func (*GatewaySpec) DeepCopyInto

func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewaySpec) SetDefaults

func (gs *GatewaySpec) SetDefaults()

type GatewayStatus

type GatewayStatus struct {
	PublisherStatus                PublisherCurrentStatus `json:"gatewayType"`
	ServiceName                    string                 `json:"serviceName"`
	Status                         GatewayCurrentStatus   `json:"status"`
	AvailableReplicas              int32                  `json:"availableReplicas"`
	ObservedGeneration             int64                  `json:"observedGeneration,omitempty"`
	DeploymentGeneration           int64                  `json:"deploymentGeneration,omitempty"`
	JobGeneration                  int64                  `json:"jobGeneration,omitempty"`
	ServiceGeneration              int64                  `json:"serviceGeneration,omitempty"`
	VirtualServiceGeneration       int64                  `json:"virtualServiceGeneration,omitempty"`
	IstioGatewayGeneration         int64                  `json:"istioGatewayGeneration,omitempty"`
	ClusterIngressGeneration       int64                  `json:"clusterIngressGeneration,omitempty"`
	ClusterIngressSecretGeneration int64                  `json:"clusterIngressSecretGeneration,omitempty"`
	OidcEnvoyFilterGeneration      int64                  `json:"oidcEnvoyFilterGeneration,omitempty"`
	ConfigMapGeneration            int64                  `json:"configMapGeneration,omitempty"`
	HpaGeneration                  int64                  `json:"hpaGeneration,omitempty"`
}

func (*GatewayStatus) DeepCopy

func (in *GatewayStatus) DeepCopy() *GatewayStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayStatus.

func (*GatewayStatus) DeepCopyInto

func (in *GatewayStatus) DeepCopyInto(out *GatewayStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayStatus) ResetServiceName

func (gs *GatewayStatus) ResetServiceName()

func (*GatewayStatus) SetDefaults

func (gs *GatewayStatus) SetDefaults()

type GwScalingPolicy

type GwScalingPolicy struct {
	Replicas *int32                   `json:"replicas,omitempty"`
	Hpa      *HorizontalPodAutoscaler `json:"hpa,omitempty"`
}

func (*GwScalingPolicy) DeepCopy

func (in *GwScalingPolicy) DeepCopy() *GwScalingPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GwScalingPolicy.

func (*GwScalingPolicy) DeepCopyInto

func (in *GwScalingPolicy) DeepCopyInto(out *GwScalingPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GwScalingPolicy) SetDefaults

func (sp *GwScalingPolicy) SetDefaults()

type HTTPRoute

type HTTPRoute struct {
	Context      string          `json:"context"`
	Version      string          `json:"version"`
	Definitions  []APIDefinition `json:"definitions"`
	Global       bool            `json:"global"`
	Authenticate bool            `json:"authenticate"`
	Port         uint32          `json:"port"`
	Destination  Destination     `json:"destination,omitempty"`
	ZeroScale    bool            `json:"zeroScale,omitempty"`
}

func (*HTTPRoute) DeepCopy

func (in *HTTPRoute) DeepCopy() *HTTPRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute.

func (*HTTPRoute) DeepCopyInto

func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	Overridable  *bool `json:"overridable"`
	ReplicaRange `json:",inline"`
	Metrics      []autoscalingV2beta1.MetricSpec `json:"metrics,omitempty"`
}

func (*HorizontalPodAutoscaler) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscaler.

func (*HorizontalPodAutoscaler) DeepCopyInto

func (in *HorizontalPodAutoscaler) DeepCopyInto(out *HorizontalPodAutoscaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Ingress

type Ingress struct {
	IngressExtensions IngressExtensions `json:"extensions,omitempty"`
	HTTPRoutes        []HTTPRoute       `json:"http,omitempty"`
	GRPCRoutes        []GRPCRoute       `json:"grpc,omitempty"`
	TCPRoutes         []TCPRoute        `json:"tcp,omitempty"`
}

func (*Ingress) DeepCopy

func (in *Ingress) DeepCopy() *Ingress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ingress.

func (*Ingress) DeepCopyInto

func (in *Ingress) DeepCopyInto(out *Ingress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Ingress) HasRoutes

func (ing *Ingress) HasRoutes() bool

type IngressExtensions

type IngressExtensions struct {
	ApiPublisher   *ApiPublisherConfig   `json:"apiPublisher,omitempty"`
	ClusterIngress *ClusterIngressConfig `json:"clusterIngress,omitempty"`
	OidcConfig     *OidcConfig           `json:"oidc,omitempty"`
}

func (*IngressExtensions) DeepCopy

func (in *IngressExtensions) DeepCopy() *IngressExtensions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressExtensions.

func (*IngressExtensions) DeepCopyInto

func (in *IngressExtensions) DeepCopyInto(out *IngressExtensions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IngressExtensions) HasApiPublisher

func (ie *IngressExtensions) HasApiPublisher() bool

func (*IngressExtensions) HasClusterIngress

func (ie *IngressExtensions) HasClusterIngress() bool

func (*IngressExtensions) HasOidc

func (ie *IngressExtensions) HasOidc() bool

type InterceptMode

type InterceptMode string
const (
	// Intercept only the incoming traffic
	InterceptModeInbound InterceptMode = "Inbound"
	// Intercept only the outgoing traffic
	InterceptModeOutbound InterceptMode = "Outbound"
	// Intercept both incoming and outgoing traffic
	InterceptModeAny InterceptMode = "Any"
	// Do not intercept any traffic. This will disable the STS
	InterceptModeNone InterceptMode = "None"
)

type KnativePodAutoscaler

type KnativePodAutoscaler struct {
	ReplicaRange `json:",inline"`
	Concurrency  int64             `json:"concurrency"`
	Selector     map[string]string `json:"selector,omitempty"`
}

func (*KnativePodAutoscaler) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativePodAutoscaler.

func (*KnativePodAutoscaler) DeepCopyInto

func (in *KnativePodAutoscaler) DeepCopyInto(out *KnativePodAutoscaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OidcConfig

type OidcConfig struct {
	ProviderUrl    string   `json:"providerUrl"`
	ClientId       string   `json:"clientId"`
	ClientSecret   string   `json:"clientSecret"`
	DcrUrl         string   `json:"dcrUrl"`
	DcrUser        string   `json:"dcrUser"`
	DcrPassword    string   `json:"dcrPassword"`
	RedirectUrl    string   `json:"redirectUrl"`
	BaseUrl        string   `json:"baseUrl"`
	SubjectClaim   string   `json:"subjectClaim"`
	JwtIssuer      string   `json:"jwtIssuer"`
	JwtAudience    string   `json:"jwtAudience"`
	SecretName     string   `json:"secretName"`
	SecurePaths    []string `json:"securePaths,omitempty"`
	NonSecurePaths []string `json:"nonSecurePaths,omitempty"`
}

func (*OidcConfig) DeepCopy

func (in *OidcConfig) DeepCopy() *OidcConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OidcConfig.

func (*OidcConfig) DeepCopyInto

func (in *OidcConfig) DeepCopyInto(out *OidcConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpaPolicy

type OpaPolicy struct {
	Key    string `json:"key,omitempty"`
	Policy string `json:"regoPolicy,omitempty"`
}

func (*OpaPolicy) DeepCopy

func (in *OpaPolicy) DeepCopy() *OpaPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpaPolicy.

func (*OpaPolicy) DeepCopyInto

func (in *OpaPolicy) DeepCopyInto(out *OpaPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PortMapping

type PortMapping struct {
	Name            string   `json:"name"`
	Protocol        Protocol `json:"protocol"`
	Port            int32    `json:"port"`
	TargetContainer string   `json:"targetContainer"`
	TargetPort      int32    `json:"targetPort"`
}

func (*PortMapping) DeepCopy

func (in *PortMapping) DeepCopy() *PortMapping

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortMapping.

func (*PortMapping) DeepCopyInto

func (in *PortMapping) DeepCopyInto(out *PortMapping)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PortMapping) Default

func (pm *PortMapping) Default()

type Protocol

type Protocol string
const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"

	// ProtocolHTTP is the HTTP protocol.
	ProtocolHTTP Protocol = "HTTP"

	// ProtocolGRPC is the GRPC protocol.
	ProtocolGRPC Protocol = "GRPC"
)

type PublisherCurrentStatus

type PublisherCurrentStatus string
const (
	PublisherCurrentStatusUnknown PublisherCurrentStatus = "Unknown"

	PublisherCurrentStatusRunning PublisherCurrentStatus = "Running"

	PublisherCurrentStatusSucceeded PublisherCurrentStatus = "Succeeded"

	PublisherCurrentStatusFailed PublisherCurrentStatus = "Failed"
)

type ReplicaRange

type ReplicaRange struct {
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	MaxReplicas int32  `json:"maxReplicas,omitempty"`
}

func (*ReplicaRange) DeepCopy

func (in *ReplicaRange) DeepCopy() *ReplicaRange

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaRange.

func (*ReplicaRange) DeepCopyInto

func (in *ReplicaRange) DeepCopyInto(out *ReplicaRange)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TCPRoute

type TCPRoute struct {
	Port        uint32      `json:"port"`
	Destination Destination `json:"destination,omitempty"`
}

func (*TCPRoute) DeepCopy

func (in *TCPRoute) DeepCopy() *TCPRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPRoute.

func (*TCPRoute) DeepCopyInto

func (in *TCPRoute) DeepCopyInto(out *TCPRoute)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TlsConfig

type TlsConfig struct {
	Secret string `json:"secret,omitempty"`
	Key    string `json:"key,omitempty"`
	Cert   string `json:"cert,omitempty"`
}

func (*TlsConfig) DeepCopy

func (in *TlsConfig) DeepCopy() *TlsConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TlsConfig.

func (*TlsConfig) DeepCopyInto

func (in *TlsConfig) DeepCopyInto(out *TlsConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TokenService

type TokenService struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TokenServiceSpec   `json:"spec"`
	Status TokenServiceStatus `json:"status,omitempty"`
}

func (*TokenService) DeepCopy

func (in *TokenService) DeepCopy() *TokenService

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenService.

func (*TokenService) DeepCopyInto

func (in *TokenService) DeepCopyInto(out *TokenService)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TokenService) DeepCopyObject

func (in *TokenService) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TokenService) Default

func (t *TokenService) Default()

func (*TokenService) Validate

func (c *TokenService) Validate() field.ErrorList

type TokenServiceCurrentStatus

type TokenServiceCurrentStatus string
const (
	TokenServiceCurrentStatusUnknown TokenServiceCurrentStatus = "Unknown"

	TokenServiceCurrentStatusReady TokenServiceCurrentStatus = "Ready"

	TokenServiceCurrentStatusNotReady TokenServiceCurrentStatus = "NotReady"
)

type TokenServiceList

type TokenServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []TokenService `json:"items"`
}

func (*TokenServiceList) DeepCopy

func (in *TokenServiceList) DeepCopy() *TokenServiceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenServiceList.

func (*TokenServiceList) DeepCopyInto

func (in *TokenServiceList) DeepCopyInto(out *TokenServiceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TokenServiceList) DeepCopyObject

func (in *TokenServiceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TokenServiceSpec

type TokenServiceSpec struct {
	Selector       map[string]string `json:"selector,omitempty"`
	SecretName     string            `json:"secretName,omitempty"`
	InstanceName   string            `json:"instanceName,omitempty"`
	InterceptMode  InterceptMode     `json:"interceptMode,omitempty"`
	OpaPolicies    []OpaPolicy       `json:"opa,omitempty"`
	UnsecuredPaths []string          `json:"unsecuredPaths,omitempty"`
}

func (*TokenServiceSpec) DeepCopy

func (in *TokenServiceSpec) DeepCopy() *TokenServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenServiceSpec.

func (*TokenServiceSpec) DeepCopyInto

func (in *TokenServiceSpec) DeepCopyInto(out *TokenServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TokenServiceSpec) SetDefaults

func (ts *TokenServiceSpec) SetDefaults()

type TokenServiceStatus

type TokenServiceStatus struct {
	Status                 TokenServiceCurrentStatus `json:"status"`
	ObservedGeneration     int64                     `json:"observedGeneration,omitempty"`
	DeploymentGeneration   int64                     `json:"deploymentGeneration,omitempty"`
	ServiceGeneration      int64                     `json:"serviceGeneration,omitempty"`
	ConfigMapGeneration    int64                     `json:"configMapGeneration,omitempty"`
	OpaConfigMapGeneration int64                     `json:"opaConfigMapGeneration,omitempty"`
	EnvoyFilterGeneration  int64                     `json:"envoyFilterGeneration,omitempty"`
}

func (*TokenServiceStatus) DeepCopy

func (in *TokenServiceStatus) DeepCopy() *TokenServiceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenServiceStatus.

func (*TokenServiceStatus) DeepCopyInto

func (in *TokenServiceStatus) DeepCopyInto(out *TokenServiceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TokenServiceStatus) SetDefaults

func (ts *TokenServiceStatus) SetDefaults()

type TokenServiceTemplateSpec

type TokenServiceTemplateSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec TokenServiceSpec `json:"spec,omitempty"`
}

func (*TokenServiceTemplateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenServiceTemplateSpec.

func (*TokenServiceTemplateSpec) DeepCopyInto

func (in *TokenServiceTemplateSpec) DeepCopyInto(out *TokenServiceTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ValidateNameFunc

ValidateNameFunc validates that the provided name is valid for a given resource type. Not all resources have the same validation rules for names. Prefix is true if the name will have a value appended to it. If the name is not valid, this returns a list of descriptions of individual characteristics of the value that were not valid. Otherwise this returns an empty list or nil.

type VolumeClaim

type VolumeClaim struct {
	Shared   bool                         `json:"shared"`
	Template corev1.PersistentVolumeClaim `json:"template"`
}

func (*VolumeClaim) DeepCopy

func (in *VolumeClaim) DeepCopy() *VolumeClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeClaim.

func (*VolumeClaim) DeepCopyInto

func (in *VolumeClaim) DeepCopyInto(out *VolumeClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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