Documentation
¶
Index ¶
- Variables
- 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 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 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
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 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 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 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
UpdatMaxScale 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
Types ¶
This section is empty.