serving

package
v0.0.0-...-8478498 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserImageAnnotationKey       = "client.knative.dev/user-image"
	UpdateTimestampAnnotationKey = "client.knative.dev/updateTimestamp"
	APITooOldError               = errors.New("the service is using too old of an API format for the operation")
)

Functions

func AutoscaleWindow

func AutoscaleWindow(m *metav1.ObjectMeta) string

func ConcurrencyTarget

func ConcurrencyTarget(m *metav1.ObjectMeta) *int

func ConcurrencyTargetUtilization

func ConcurrencyTargetUtilization(m *metav1.ObjectMeta) *int

func ContainerIndexOfRevisionSpec

func ContainerIndexOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) int

ContainerIndexOfRevisionSpec returns the index of the "main" container if multiple containers are present. The main container is either the single container when there is only ony container in the list or the first container which has a ports declaration (validation guarantees that there is only one such container) If no container could be found (list is empty or no container has a port declaration) then -1 is returned This method's logic is taken from RevisionSpec.GetContainer()

func ContainerOfRevisionSpec

func ContainerOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) *corev1.Container

ContainerOfRevisionSpec returns the 'main' container of a revision specification and use GetServingContainerIndex to identify the container. Nil is returned if no such container could be found

func ContainerStatus

func ContainerStatus(r *servingv1.Revision) *servingv1.ContainerStatus

ContainerStatus returns the status of the main container or nil of no such status could be found

func PinImageToDigest

func PinImageToDigest(currentRevisionTemplate *servingv1.RevisionTemplateSpec, baseRevision *servingv1.Revision) error

PinImageToDigest sets the image on the template to the image digest of the base revision.

func Port

func Port(revisionSpec *servingv1.RevisionSpec) *int32

func UnsetUserImageAnnotation

func UnsetUserImageAnnotation(template *servingv1.RevisionTemplateSpec)

UnsetUserImageAnnotation removes the user image annotation

func UpdateConcurrencyLimit

func UpdateConcurrencyLimit(template *servingv1.RevisionTemplateSpec, limit int64) error

UpdateConcurrencyLimit updates container concurrency limit

func UpdateLabels

func UpdateLabels(labelsMap map[string]string, add map[string]string, remove []string) map[string]string

UpdateLabels updates the labels by adding items from `add` then removing any items from `remove`

func UpdateMaxScale

func UpdateMaxScale(template *servingv1.RevisionTemplateSpec, max int) error

UpdateMaxScale updates max scale annotation

func UpdateMinScale

func UpdateMinScale(template *servingv1.RevisionTemplateSpec, min int) error

UpdateMinScale updates min scale annotation

func UpdateRevisionTemplateAnnotation

func UpdateRevisionTemplateAnnotation(template *servingv1.RevisionTemplateSpec, annotation string, value string) error

UpdateRevisionTemplateAnnotation updates an annotation for the given Revision Template. Also validates the autoscaling annotation values

func UpdateRevisionTemplateAnnotations

func UpdateRevisionTemplateAnnotations(template *servingv1.RevisionTemplateSpec, toUpdate map[string]string, toRemove []string) error

UpdateRevisionTemplateAnnotations updates annotations for the given Revision Template. Also validates the autoscaling annotation values

func UpdateScaleActivation

func UpdateScaleActivation(template *servingv1.RevisionTemplateSpec, activation int) error

UpdateScaleActivation updates the scale activation annotation

func UpdateScaleMetric

func UpdateScaleMetric(template *servingv1.RevisionTemplateSpec, metric string)

UpdateScaleMetric updates the metric annotation for the given Revision Template

func UpdateScaleTarget

func UpdateScaleTarget(template *servingv1.RevisionTemplateSpec, target int) error

UpdateScaleTarget updates container concurrency annotation

func UpdateScaleUtilization

func UpdateScaleUtilization(template *servingv1.RevisionTemplateSpec, target int) error

UpdateScaleUtilization updates container target utilization percentage annotation

func UpdateScaleWindow

func UpdateScaleWindow(template *servingv1.RevisionTemplateSpec, window string) error

UpdateScaleWindow updates the autoscale window annotation

func UpdateServiceAnnotations

func UpdateServiceAnnotations(service *servingv1.Service, toUpdate map[string]string, toRemove []string) error

UpdateServiceAnnotations updates annotations for the given Service Metadata.

func UpdateTimestampAnnotation

func UpdateTimestampAnnotation(template *servingv1.RevisionTemplateSpec)

UpdateTimestampAnnotation update the annotation for the last update with the current timestamp

func UpdateUserImageAnnotation

func UpdateUserImageAnnotation(template *servingv1.RevisionTemplateSpec)

UpdateUserImageAnnotation sets the user image annotation if the image isn't by-digest already.

func UserImage

func UserImage(m *metav1.ObjectMeta) string

func VerifyThatContainersMatchInCurrentAndBaseRevision

func VerifyThatContainersMatchInCurrentAndBaseRevision(template *servingv1.RevisionTemplateSpec, baseRevision *servingv1.Revision) error

VerifyThatContainersMatchInCurrentAndBaseRevision checks if the image in the current revision matches matches the one in a given base revision

Types

type Scaling

type Scaling struct {
	Min *int
	Max *int
}

func ScalingInfo

func ScalingInfo(m *metav1.ObjectMeta) (*Scaling, error)

type VolumeSourceType

type VolumeSourceType int

VolumeSourceType is a type standing for enumeration of ConfigMap and Secret

const (
	ConfigMapVolumeSourceType VolumeSourceType = iota
	SecretVolumeSourceType
	PortFormatErr = "" /* 154-byte string literal not displayed */
)

Enumeration of volume source types: ConfigMap or Secret

func (VolumeSourceType) String

func (vt VolumeSourceType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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