Documentation
¶
Index ¶
- Variables
- func ConcurrencyTarget(m *metav1.ObjectMeta) *int
- func ContainerOfRevisionSpec(revisionSpec *servingv1alpha1.RevisionSpec) (*corev1.Container, error)
- func ContainerOfRevisionTemplate(template *servingv1alpha1.RevisionTemplateSpec) (*corev1.Container, error)
- func EnvToMap(vars []corev1.EnvVar) (map[string]string, error)
- func FreezeImageToDigest(template *servingv1alpha1.RevisionTemplateSpec, ...) error
- func GenerateRevisionName(nameTempl string, service *servingv1alpha1.Service) (string, error)
- func GenerateVolumeName(path string) string
- func Port(revisionSpec *servingv1alpha1.RevisionSpec) *int32
- func RevisionTemplateOfService(service *servingv1alpha1.Service) (*servingv1alpha1.RevisionTemplateSpec, error)
- func SetUserImageAnnot(template *servingv1alpha1.RevisionTemplateSpec)
- func UnsetUserImageAnnot(template *servingv1alpha1.RevisionTemplateSpec)
- func UpdateAnnotations(service *servingv1alpha1.Service, ...) error
- func UpdateConcurrencyLimit(template *servingv1alpha1.RevisionTemplateSpec, limit int64) error
- func UpdateConcurrencyTarget(template *servingv1alpha1.RevisionTemplateSpec, target int) error
- func UpdateContainerPort(template *servingv1alpha1.RevisionTemplateSpec, port int32) error
- func UpdateEnvFrom(template *servingv1alpha1.RevisionTemplateSpec, toUpdate []string, ...) error
- func UpdateEnvVars(template *servingv1alpha1.RevisionTemplateSpec, toUpdate map[string]string, ...) error
- func UpdateImage(template *servingv1alpha1.RevisionTemplateSpec, image string) error
- func UpdateLabels(service *servingv1alpha1.Service, ...) error
- func UpdateMaxScale(template *servingv1alpha1.RevisionTemplateSpec, max int) error
- func UpdateMinScale(template *servingv1alpha1.RevisionTemplateSpec, min int) error
- func UpdateName(template *servingv1alpha1.RevisionTemplateSpec, name string) error
- func UpdateResources(template *servingv1alpha1.RevisionTemplateSpec, ...) error
- func UpdateRevisionTemplateAnnotation(template *servingv1alpha1.RevisionTemplateSpec, annotation string, ...) error
- func UpdateServiceAccountName(template *servingv1alpha1.RevisionTemplateSpec, serviceAccountName string) error
- func UpdateVolumeMountsAndVolumes(template *servingv1alpha1.RevisionTemplateSpec, ...) error
- func UserImage(m *metav1.ObjectMeta) string
- type Scaling
- type VolumeSourceType
Constants ¶
This section is empty.
Variables ¶
var ApiTooOldError = errors.New("the service is using too old of an API format for the operation")
var UserImageAnnotationKey = "client.knative.dev/user-image"
Functions ¶
func ConcurrencyTarget ¶ added in v0.10.0
func ConcurrencyTarget(m *metav1.ObjectMeta) *int
func ContainerOfRevisionSpec ¶
func ContainerOfRevisionSpec(revisionSpec *servingv1alpha1.RevisionSpec) (*corev1.Container, error)
func ContainerOfRevisionTemplate ¶
func ContainerOfRevisionTemplate(template *servingv1alpha1.RevisionTemplateSpec) (*corev1.Container, error)
func EnvToMap ¶
EnvToMap is an utility function to translate between the API list form of env vars, and the more convenient map form.
func FreezeImageToDigest ¶
func FreezeImageToDigest(template *servingv1alpha1.RevisionTemplateSpec, baseRevision *servingv1alpha1.Revision) error
FreezeImageToDigest sets the image on the template to the image digest of the base revision.
func GenerateRevisionName ¶
func GenerateRevisionName(nameTempl string, service *servingv1alpha1.Service) (string, error)
GenerateRevisionName returns an automatically-generated name suitable for the next revision of the given service.
func GenerateVolumeName ¶ added in v0.10.0
GenerateVolumeName generates a volume name with respect to a given path string. Current implementation basically sanitizes the path string by changing "/" into "." To reduce any chance of duplication, a checksum part generated from the path string is appended to the sanitized string.
func Port ¶ added in v0.10.0
func Port(revisionSpec *servingv1alpha1.RevisionSpec) *int32
func RevisionTemplateOfService ¶
func RevisionTemplateOfService(service *servingv1alpha1.Service) (*servingv1alpha1.RevisionTemplateSpec, error)
Get the revision template associated with a service. Depending on the structure returned either the new v1beta1 fields or the 'old' v1alpha1 fields are looked up. The returned revision template can be updated in place. An error is returned if no revision template could be extracted
func SetUserImageAnnot ¶
func SetUserImageAnnot(template *servingv1alpha1.RevisionTemplateSpec)
SetUserImageAnnot sets the user image annotation if the image isn't by-digest already.
func UnsetUserImageAnnot ¶
func UnsetUserImageAnnot(template *servingv1alpha1.RevisionTemplateSpec)
UnsetUserImageAnnot removes the user image annotation
func UpdateAnnotations ¶
func UpdateAnnotations( service *servingv1alpha1.Service, template *servingv1alpha1.RevisionTemplateSpec, toUpdate map[string]string, toRemove []string) error
UpdateAnnotations updates the annotations identically on a service and template. Does not overwrite the entire Annotations field, only makes the requested updates.
func UpdateConcurrencyLimit ¶
func UpdateConcurrencyLimit(template *servingv1alpha1.RevisionTemplateSpec, limit int64) error
UpdateConcurrencyLimit updates container concurrency limit
func UpdateConcurrencyTarget ¶
func UpdateConcurrencyTarget(template *servingv1alpha1.RevisionTemplateSpec, target int) error
UpdateConcurrencyTarget updates container concurrency annotation
func UpdateContainerPort ¶
func UpdateContainerPort(template *servingv1alpha1.RevisionTemplateSpec, port int32) error
UpdateContainerPort updates container with a give port
func UpdateEnvFrom ¶ added in v0.10.0
func UpdateEnvFrom(template *servingv1alpha1.RevisionTemplateSpec, toUpdate []string, toRemove []string) error
UpdateEnvFrom updates envFrom
func UpdateEnvVars ¶
func UpdateEnvVars(template *servingv1alpha1.RevisionTemplateSpec, toUpdate map[string]string, toRemove []string) error
UpdateEnvVars gives the configuration all the env var values listed in the given map of vars. Does not touch any environment variables not mentioned, but it can add new env vars and change the values of existing ones, then sort by env key name.
func UpdateImage ¶
func UpdateImage(template *servingv1alpha1.RevisionTemplateSpec, image string) error
UpdateImage a given image
func UpdateLabels ¶
func UpdateLabels(service *servingv1alpha1.Service, template *servingv1alpha1.RevisionTemplateSpec, toUpdate map[string]string, toRemove []string) error
UpdateLabels updates the labels identically on a service and template. Does not overwrite the entire Labels field, only makes the requested updates
func UpdateMaxScale ¶
func UpdateMaxScale(template *servingv1alpha1.RevisionTemplateSpec, max int) error
UpdateMaxScale updates max scale annotation
func UpdateMinScale ¶
func UpdateMinScale(template *servingv1alpha1.RevisionTemplateSpec, min int) error
UpdateMinScale updates min scale annotation
func UpdateName ¶
func UpdateName(template *servingv1alpha1.RevisionTemplateSpec, name string) error
UpdateName updates the revision name.
func UpdateResources ¶
func UpdateResources(template *servingv1alpha1.RevisionTemplateSpec, requestsResourceList corev1.ResourceList, limitsResourceList corev1.ResourceList) error
UpdateResources updates resources as requested
func UpdateRevisionTemplateAnnotation ¶
func UpdateRevisionTemplateAnnotation(template *servingv1alpha1.RevisionTemplateSpec, annotation string, value string) error
UpdateRevisionTemplateAnnotation updates an annotation for the given Revision Template. Also validates the autoscaling annotation values
func UpdateServiceAccountName ¶
func UpdateServiceAccountName(template *servingv1alpha1.RevisionTemplateSpec, serviceAccountName string) error
UpdateServiceAccountName updates the service account name used for the corresponding knative service
func UpdateVolumeMountsAndVolumes ¶ added in v0.10.0
func UpdateVolumeMountsAndVolumes(template *servingv1alpha1.RevisionTemplateSpec, mountsToUpdate *util.OrderedMap, mountsToRemove []string, volumesToUpdate *util.OrderedMap, volumesToRemove []string) error
UpdateVolumeMountsAndVolumes updates the configuration for volume mounts and volumes.
func UserImage ¶ added in v0.10.0
func UserImage(m *metav1.ObjectMeta) string
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 )
Enumeration of volume source types: ConfigMap or Secret
func (VolumeSourceType) String ¶ added in v0.10.0
func (vt VolumeSourceType) String() string