serving

package
v0.13.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DeploymentConditionReady means the underlying deployment is ready.
	DeploymentConditionReady = apis.ConditionReady
	// DeploymentConditionReplicaSetready inverts the underlying deployment's
	// ReplicaSetFailure condition.
	DeploymentConditionReplicaSetReady apis.ConditionType = "ReplicaSetReady"
	// DeploymentConditionProgressing reflects the underlying deployment's
	// Progressing condition.
	DeploymentConditionProgressing apis.ConditionType = "Progressing"
)
View Source
const (
	// GroupName is the group name for knative labels and annotations
	GroupName = "serving.knative.dev"

	// GroupNamePrefix is the prefix for label key and annotation key
	GroupNamePrefix = GroupName + "/"

	// ConfigurationLabelKey is the label key attached to a Revision indicating by
	// which Configuration it is created.
	ConfigurationLabelKey = GroupName + "/configuration"

	// RevisionLastPinnedAnnotationKey is the annotation key used for determining when a route has
	// pinned a revision
	RevisionLastPinnedAnnotationKey = GroupName + "/lastPinned"

	// RouteLabelKey is the label key attached to a Configuration indicating by
	// which Route it is configured as traffic target.
	// The key can also be attached to Ingress resources to indicate
	// which Route triggered their creation.
	// The key is also attached to k8s Service resources to indicate which Route
	// triggered their creation.
	RouteLabelKey = GroupName + "/route"

	// RouteNamespaceLabelKey is the label key attached to a Ingress
	// by a Route to indicate which namespace the Route was created in.
	RouteNamespaceLabelKey = GroupName + "/routeNamespace"

	// RevisionLabelKey is the label key attached to k8s resources to indicate
	// which Revision triggered their creation.
	RevisionLabelKey = GroupName + "/revision"

	// RevisionUID is the label key attached to a revision to indicate
	// its unique identifier
	RevisionUID = GroupName + "/revisionUID"

	// ServiceLabelKey is the label key attached to a Route and Configuration indicating by
	// which Service they are created.
	ServiceLabelKey = GroupName + "/service"

	// ConfigurationGenerationLabelKey is the label key attached to a Revision indicating the
	// metadata generation of the Configuration that created this revision
	ConfigurationGenerationLabelKey = GroupName + "/configurationGeneration"

	// CreatorAnnotation is the annotation key to describe the user that
	// created the resource.
	CreatorAnnotation = GroupName + "/creator"
	// UpdaterAnnotation is the annotation key to describe the user that
	// last updated the resource.
	UpdaterAnnotation = GroupName + "/lastModifier"

	// QueueSideCarResourcePercentageAnnotation is the percentage of user container resources to be used for queue-proxy
	// It has to be in [0.1,100]
	QueueSideCarResourcePercentageAnnotation = "queue.sidecar." + GroupName + "/resourcePercentage"

	// VisibilityLabelKey is the label to indicate visibility of Route
	// and KServices.  It can be an annotation too but since users are
	// already using labels for domain, it probably best to keep this
	// consistent.
	VisibilityLabelKey = "serving.knative.dev/visibility"
	// VisibilityClusterLocal is the label value for VisibilityLabelKey
	// that will result to the Route/KService getting a cluster local
	// domain suffix.
	VisibilityClusterLocal = "cluster-local"
)

Variables

View Source
var (
	// ServicesResource represents a Knative Service
	ServicesResource = schema.GroupResource{
		Group:    GroupName,
		Resource: "services",
	}

	// ConfigurationsResource represents a Knative Configuration
	ConfigurationsResource = schema.GroupResource{
		Group:    GroupName,
		Resource: "configurations",
	}

	// RevisionsResource represents a Knative Revision
	RevisionsResource = schema.GroupResource{
		Group:    GroupName,
		Resource: "revisions",
	}

	// RoutesResource represents a Knative Route
	RoutesResource = schema.GroupResource{
		Group:    GroupName,
		Resource: "routes",
	}
)

Functions

func ConfigMapEnvSourceMask added in v0.6.0

func ConfigMapEnvSourceMask(in *corev1.ConfigMapEnvSource) *corev1.ConfigMapEnvSource

ConfigMapEnvSourceMask performs a _shallow_ copy of the Kubernetes ConfigMapEnvSource object to a new Kubernetes ConfigMapEnvSource object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ConfigMapKeySelectorMask added in v0.6.0

func ConfigMapKeySelectorMask(in *corev1.ConfigMapKeySelector) *corev1.ConfigMapKeySelector

ConfigMapKeySelectorMask performs a _shallow_ copy of the Kubernetes ConfigMapKeySelector object to a new Kubernetes ConfigMapKeySelector object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ConfigMapProjectionMask added in v0.7.0

func ConfigMapProjectionMask(in *corev1.ConfigMapProjection) *corev1.ConfigMapProjection

ConfigMapProjectionMask performs a _shallow_ copy of the Kubernetes ConfigMapProjection object to a new Kubernetes ConfigMapProjection object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ContainerMask added in v0.6.0

func ContainerMask(in *corev1.Container) *corev1.Container

ContainerMask performs a _shallow_ copy of the Kubernetes Container object to a new Kubernetes Container object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ContainerPortMask added in v0.6.0

func ContainerPortMask(in *corev1.ContainerPort) *corev1.ContainerPort

ContainerPortMask performs a _shallow_ copy of the Kubernetes ContainerPort object to a new Kubernetes ContainerPort object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func EnvFromSourceMask added in v0.6.0

func EnvFromSourceMask(in *corev1.EnvFromSource) *corev1.EnvFromSource

EnvFromSourceMask performs a _shallow_ copy of the Kubernetes EnvFromSource object to a new Kubernetes EnvFromSource object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func EnvVarMask added in v0.6.0

func EnvVarMask(in *corev1.EnvVar) *corev1.EnvVar

EnvVarMask performs a _shallow_ copy of the Kubernetes EnvVar object to a new Kubernetes EnvVar object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func EnvVarSourceMask added in v0.6.0

func EnvVarSourceMask(in *corev1.EnvVarSource) *corev1.EnvVarSource

EnvVarSourceMask performs a _shallow_ copy of the Kubernetes EnvVarSource object to a new Kubernetes EnvVarSource object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ExecActionMask added in v0.6.0

func ExecActionMask(in *corev1.ExecAction) *corev1.ExecAction

ExecActionMask performs a _shallow_ copy of the Kubernetes ExecAction object to a new Kubernetes ExecAction object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func HTTPGetActionMask added in v0.6.0

func HTTPGetActionMask(in *corev1.HTTPGetAction) *corev1.HTTPGetAction

HTTPGetActionMask performs a _shallow_ copy of the Kubernetes HTTPGetAction object to a new Kubernetes HTTPGetAction object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func HandlerMask added in v0.6.0

func HandlerMask(in *corev1.Handler) *corev1.Handler

HandlerMask performs a _shallow_ copy of the Kubernetes Handler object to a new Kubernetes Handler object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func KeyToPathMask added in v0.7.0

func KeyToPathMask(in *corev1.KeyToPath) *corev1.KeyToPath

KeyToPathMask performs a _shallow_ copy of the Kubernetes KeyToPath object to a new Kubernetes KeyToPath object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func LocalObjectReferenceMask added in v0.6.0

func LocalObjectReferenceMask(in *corev1.LocalObjectReference) *corev1.LocalObjectReference

LocalObjectReferenceMask performs a _shallow_ copy of the Kubernetes LocalObjectReference object to a new Kubernetes LocalObjectReference object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func NamespacedObjectReferenceMask added in v0.6.0

func NamespacedObjectReferenceMask(in *corev1.ObjectReference) *corev1.ObjectReference

NamespacedObjectReferenceMask performs a _shallow_ copy of the Kubernetes ObjectReference object to a new Kubernetes ObjectReference object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func PodSpecMask added in v0.6.0

func PodSpecMask(in *corev1.PodSpec) *corev1.PodSpec

PodSpecMask performs a _shallow_ copy of the Kubernetes PodSpec object to a new Kubernetes PodSpec object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ProbeMask added in v0.6.0

func ProbeMask(in *corev1.Probe) *corev1.Probe

ProbeMask performs a _shallow_ copy of the Kubernetes Probe object to a new Kubernetes Probe object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func ResourceRequirementsMask added in v0.6.0

func ResourceRequirementsMask(in *corev1.ResourceRequirements) *corev1.ResourceRequirements

ResourceRequirementsMask performs a _shallow_ copy of the Kubernetes ResourceRequirements object to a new Kubernetes ResourceRequirements object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func SecretEnvSourceMask added in v0.6.0

func SecretEnvSourceMask(in *corev1.SecretEnvSource) *corev1.SecretEnvSource

SecretEnvSourceMask performs a _shallow_ copy of the Kubernetes SecretEnvSource object to a new Kubernetes SecretEnvSource object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func SecretKeySelectorMask added in v0.6.0

func SecretKeySelectorMask(in *corev1.SecretKeySelector) *corev1.SecretKeySelector

SecretKeySelectorMask performs a _shallow_ copy of the Kubernetes SecretKeySelector object to a new Kubernetes SecretKeySelector object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func SecretProjectionMask added in v0.7.0

func SecretProjectionMask(in *corev1.SecretProjection) *corev1.SecretProjection

SecretProjectionMask performs a _shallow_ copy of the Kubernetes SecretProjection object to a new Kubernetes SecretProjection object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func SecurityContextMask added in v0.6.0

func SecurityContextMask(in *corev1.SecurityContext) *corev1.SecurityContext

SecurityContextMask performs a _shallow_ copy of the Kubernetes SecurityContext object to a new Kubernetes SecurityContext object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func SetUserInfo added in v0.10.0

func SetUserInfo(ctx context.Context, oldSpec, newSpec, resource interface{})

SetUserInfo sets creator and updater annotations

func TCPSocketActionMask added in v0.6.0

func TCPSocketActionMask(in *corev1.TCPSocketAction) *corev1.TCPSocketAction

TCPSocketActionMask performs a _shallow_ copy of the Kubernetes TCPSocketAction object to a new Kubernetes TCPSocketAction object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func TransformDeploymentStatus added in v0.9.0

func TransformDeploymentStatus(ds *appsv1.DeploymentStatus) *duckv1.Status

transformDeploymentStatus transforms the kubernetes DeploymentStatus into a duckv1.Status that uses ConditionSets to propagate failures and expose a top-level happy state, per our condition conventions.

func ValidateClusterVisibilityLabel added in v0.9.0

func ValidateClusterVisibilityLabel(label string) (errs *apis.FieldError)

ValidateClusterVisibilityLabel function validates the visibility label on a Route

func ValidateContainer added in v0.6.0

func ValidateContainer(container corev1.Container, volumes sets.String) *apis.FieldError

func ValidateContainerConcurrency added in v0.9.0

func ValidateContainerConcurrency(containerConcurrency *int64) *apis.FieldError

ValidateContainerConcurrency function validates the ContainerConcurrency field TODO(#5007): Move this to autoscaling.

func ValidateNamespacedObjectReference added in v0.6.0

func ValidateNamespacedObjectReference(p *corev1.ObjectReference) *apis.FieldError

func ValidateObjectMetadata added in v0.6.0

func ValidateObjectMetadata(meta metav1.Object) *apis.FieldError

ValidateObjectMetadata validates that `metadata` stanza of the resources is correct.

func ValidatePodSpec added in v0.6.0

func ValidatePodSpec(ps corev1.PodSpec) *apis.FieldError

func ValidateQueueSidecarAnnotation added in v0.8.0

func ValidateQueueSidecarAnnotation(annotations map[string]string) *apis.FieldError

ValidateQueueSidecarAnnotation validates QueueSideCarResourcePercentageAnnotation

func ValidateRevisionName added in v0.11.0

func ValidateRevisionName(ctx context.Context, name, generateName string) *apis.FieldError

ValidateRevisionName validates name and generateName for the revisionTemplate

func ValidateTimeoutSeconds added in v0.8.0

func ValidateTimeoutSeconds(ctx context.Context, timeoutSeconds int64) *apis.FieldError

ValidateTimeoutSeconds validates timeout by comparing MaxRevisionTimeoutSeconds

func ValidateVolumes added in v0.6.0

func ValidateVolumes(vs []corev1.Volume) (sets.String, *apis.FieldError)

func VolumeMask added in v0.6.0

func VolumeMask(in *corev1.Volume) *corev1.Volume

VolumeMask performs a _shallow_ copy of the Kubernetes Volume object to a new Kubernetes Volume object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func VolumeMountMask added in v0.6.0

func VolumeMountMask(in *corev1.VolumeMount) *corev1.VolumeMount

VolumeMountMask performs a _shallow_ copy of the Kubernetes VolumeMount object to a new Kubernetes VolumeMount object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func VolumeProjectionMask added in v0.7.0

func VolumeProjectionMask(in *corev1.VolumeProjection) *corev1.VolumeProjection

VolumeProjectionMask performs a _shallow_ copy of the Kubernetes VolumeProjection object to a new Kubernetes VolumeProjection object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

func VolumeSourceMask added in v0.6.0

func VolumeSourceMask(in *corev1.VolumeSource) *corev1.VolumeSource

VolumeSourceMask performs a _shallow_ copy of the Kubernetes VolumeSource object to a new Kubernetes VolumeSource object bringing over only the fields allowed in the Knative API. This does not validate the contents or the bounds of the provided fields.

Types

This section is empty.

Directories

Path Synopsis
+k8s:deepcopy-gen=package +groupName=serving.knative.dev Copyright 2020 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+k8s:deepcopy-gen=package +groupName=serving.knative.dev Copyright 2020 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
+k8s:deepcopy-gen=package +groupName=serving.knative.dev

Jump to

Keyboard shortcuts

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