Documentation
¶
Index ¶
- Variables
- func AutoscaleWindow(m *metav1.ObjectMeta) string
- func ConcurrencyTarget(m *metav1.ObjectMeta) *int
- func ConcurrencyTargetUtilization(m *metav1.ObjectMeta) *int
- func ContainerIndexOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) int
- func ContainerOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) *corev1.Container
- func ContainerStatus(r *servingv1.Revision) *servingv1.ContainerStatus
- func GenerateRevisionName(nameTempl string, service *servingv1.Service) (string, error)
- func PinImageToDigest(currentRevisionTemplate *servingv1.RevisionTemplateSpec, ...) error
- func Port(revisionSpec *servingv1.RevisionSpec) *int32
- func UnsetUserImageAnnotation(template *servingv1.RevisionTemplateSpec)
- func UpdateConcurrencyLimit(template *servingv1.RevisionTemplateSpec, limit int64) error
- func UpdateLabels(labelsMap map[string]string, add map[string]string, remove []string) map[string]string
- func UpdateMaxScale(template *servingv1.RevisionTemplateSpec, max int) error
- func UpdateMinScale(template *servingv1.RevisionTemplateSpec, min int) error
- func UpdateRevisionTemplateAnnotation(template *servingv1.RevisionTemplateSpec, annotation string, value string) error
- func UpdateRevisionTemplateAnnotations(template *servingv1.RevisionTemplateSpec, toUpdate map[string]string, ...) error
- func UpdateScaleActivation(template *servingv1.RevisionTemplateSpec, activation int) error
- func UpdateScaleMetric(template *servingv1.RevisionTemplateSpec, metric string)
- func UpdateScaleTarget(template *servingv1.RevisionTemplateSpec, target int) error
- func UpdateScaleUtilization(template *servingv1.RevisionTemplateSpec, target int) error
- func UpdateScaleWindow(template *servingv1.RevisionTemplateSpec, window string) error
- func UpdateServiceAnnotations(service *servingv1.Service, toUpdate map[string]string, toRemove []string) error
- func UpdateTimestampAnnotation(template *servingv1.RevisionTemplateSpec)
- func UpdateUserImageAnnotation(template *servingv1.RevisionTemplateSpec)
- func UserImage(m *metav1.ObjectMeta) string
- func VerifyThatContainersMatchInCurrentAndBaseRevision(template *servingv1.RevisionTemplateSpec, baseRevision *servingv1.Revision) error
- type Scaling
- type VolumeSourceType
Constants ¶
This section is empty.
Variables ¶
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 ¶ added in v0.12.0
func AutoscaleWindow(m *metav1.ObjectMeta) string
func ConcurrencyTarget ¶ added in v0.10.0
func ConcurrencyTarget(m *metav1.ObjectMeta) *int
func ConcurrencyTargetUtilization ¶ added in v0.13.2
func ConcurrencyTargetUtilization(m *metav1.ObjectMeta) *int
func ContainerIndexOfRevisionSpec ¶ added in v0.25.0
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 ¶ added in v0.25.0
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 GenerateRevisionName ¶
GenerateRevisionName returns an automatically-generated name suitable for the next revision of the given service.
func PinImageToDigest ¶ added in v0.25.0
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 ¶ added in v0.10.0
func Port(revisionSpec *servingv1.RevisionSpec) *int32
func UnsetUserImageAnnotation ¶ added in v0.25.0
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 ¶ added in v0.18.0
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 ¶ added in v0.35.0
func UpdateScaleActivation(template *servingv1.RevisionTemplateSpec, activation int) error
UpdateScaleActivation updates the scale activation annotation
func UpdateScaleMetric ¶ added in v0.31.0
func UpdateScaleMetric(template *servingv1.RevisionTemplateSpec, metric string)
UpdateScaleMetric updates the metric annotation for the given Revision Template
func UpdateScaleTarget ¶ added in v0.27.0
func UpdateScaleTarget(template *servingv1.RevisionTemplateSpec, target int) error
UpdateScaleTarget updates container concurrency annotation
func UpdateScaleUtilization ¶ added in v0.27.0
func UpdateScaleUtilization(template *servingv1.RevisionTemplateSpec, target int) error
UpdateScaleUtilization updates container target utilization percentage annotation
func UpdateScaleWindow ¶ added in v0.27.0
func UpdateScaleWindow(template *servingv1.RevisionTemplateSpec, window string) error
UpdateScaleWindow updates the autoscale window annotation
func UpdateServiceAnnotations ¶ added in v0.18.0
func UpdateServiceAnnotations(service *servingv1.Service, toUpdate map[string]string, toRemove []string) error
UpdateServiceAnnotations updates annotations for the given Service Metadata.
func UpdateTimestampAnnotation ¶ added in v0.25.0
func UpdateTimestampAnnotation(template *servingv1.RevisionTemplateSpec)
UpdateTimestampAnnotation update the annotation for the last update with the current timestamp
func UpdateUserImageAnnotation ¶ added in v0.25.0
func UpdateUserImageAnnotation(template *servingv1.RevisionTemplateSpec)
UpdateUserImageAnnotation sets the user image annotation if the image isn't by-digest already.
func UserImage ¶ added in v0.10.0
func UserImage(m *metav1.ObjectMeta) string
func VerifyThatContainersMatchInCurrentAndBaseRevision ¶ added in v0.25.0
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 ¶ added in v0.10.0
func ScalingInfo ¶ added in v0.10.0
func ScalingInfo(m *metav1.ObjectMeta) (*Scaling, error)
type VolumeSourceType ¶ added in v0.10.0
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 ¶ added in v0.10.0
func (vt VolumeSourceType) String() string