Documentation ¶
Overview ¶
Package config holds the typed objects that define the schemas for ConfigMap objects that pertain to our API objects.
Index ¶
Constants ¶
const ( // DefaultsConfigName is the name of config map for the defaults. DefaultsConfigName = "config-defaults" // DefaultRevisionTimeoutSeconds will be set if timeoutSeconds not specified. DefaultRevisionTimeoutSeconds = 5 * 60 // DefaultMaxRevisionTimeoutSeconds will be set if MaxRevisionTimeoutSeconds is not specified. DefaultMaxRevisionTimeoutSeconds = 10 * 60 // DefaultInitContainerName is the default name we give to the init containers // specified by the user, if `name:` is omitted. DefaultInitContainerName = "init-container" // DefaultUserContainerName is the default name we give to the container // specified by the user, if `name:` is omitted. DefaultUserContainerName = "user-container" // DefaultContainerConcurrency is the default container concurrency. It will be set if ContainerConcurrency is not specified. DefaultContainerConcurrency = 0 // DefaultMaxRevisionContainerConcurrency is the maximum configurable // container concurrency. DefaultMaxRevisionContainerConcurrency = 1000 // DefaultAllowContainerConcurrencyZero is whether, by default, // containerConcurrency can be set to zero (i.e. unbounded) by users. DefaultAllowContainerConcurrencyZero = true )
Variables ¶
var ( DefaultInitContainerNameTemplate = mustParseTemplate(DefaultInitContainerName) DefaultUserContainerNameTemplate = mustParseTemplate(DefaultUserContainerName) )
Functions ¶
Types ¶
type Config ¶
type Config struct { Defaults *Defaults Features *Features Autoscaler *autoscalerconfig.Config }
Config holds the collection of configurations that we attach to contexts.
func FromContext ¶
FromContext extracts a Config from the provided context.
func FromContextOrDefaults ¶
FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.
func (*Config) DeepCopy ¶ added in v0.19.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.
func (*Config) DeepCopyInto ¶ added in v0.19.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Defaults ¶
type Defaults struct { RevisionTimeoutSeconds int64 // This is the timeout set for ingress. // RevisionTimeoutSeconds must be less than this value. MaxRevisionTimeoutSeconds int64 InitContainerNameTemplate *ObjectMetaTemplate UserContainerNameTemplate *ObjectMetaTemplate ContainerConcurrency int64 // ContainerConcurrencyMaxLimit is the maximum permitted container concurrency // or target value in the system. ContainerConcurrencyMaxLimit int64 // AllowContainerConcurrencyZero determines whether users are permitted to specify // a containerConcurrency of 0 (i.e. unbounded). AllowContainerConcurrencyZero bool // Permits defaulting of `enableServiceLinks` pod spec field. // See: https://github.com/knative/serving/issues/8498 for details. EnableServiceLinks *bool RevisionCPURequest *resource.Quantity RevisionCPULimit *resource.Quantity RevisionMemoryRequest *resource.Quantity RevisionMemoryLimit *resource.Quantity RevisionEphemeralStorageRequest *resource.Quantity RevisionEphemeralStorageLimit *resource.Quantity }
Defaults includes the default values to be populated by the webhook.
func NewDefaultsConfigFromConfigMap ¶
NewDefaultsConfigFromConfigMap creates a Defaults from the supplied configMap.
func NewDefaultsConfigFromMap ¶
NewDefaultsConfigFromMap creates a Defaults from the supplied Map.
func (*Defaults) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Defaults.
func (*Defaults) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Defaults) InitContainerName ¶ added in v0.28.0
InitContainerName returns the name of the init container based on the context.
type Features ¶ added in v0.16.0
type Features struct { MultiContainer Flag PodSpecAffinity Flag PodSpecDryRun Flag PodSpecFieldRef Flag PodSpecHostAliases Flag PodSpecNodeSelector Flag PodSpecRuntimeClassName Flag PodSpecSecurityContext Flag PodSpecPriorityClassName Flag PodSpecSchedulerName Flag ContainerSpecAddCapabilities Flag PodSpecTolerations Flag PodSpecVolumesEmptyDir Flag PodSpecInitContainers Flag PodSpecPersistentVolumeClaim Flag PodSpecPersistentVolumeWrite Flag TagHeaderBasedRouting Flag AutoDetectHTTP2 Flag }
Features specifies which features are allowed by the webhook.
func NewFeaturesConfigFromConfigMap ¶ added in v0.16.0
NewFeaturesConfigFromConfigMap creates a Features from the supplied ConfigMap
func NewFeaturesConfigFromMap ¶ added in v0.16.0
NewFeaturesConfigFromMap creates a Features from the supplied Map
func (*Features) DeepCopy ¶ added in v0.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Features.
func (*Features) DeepCopyInto ¶ added in v0.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Flag ¶ added in v0.16.0
type Flag string
Flag is a string value which can be either Enabled, Disabled, or Allowed.
const ( // FeaturesConfigName is the name of the ConfigMap for the features. FeaturesConfigName = "config-features" // Enabled turns on an optional behavior. Enabled Flag = "Enabled" // Disabled turns off an optional behavior. Disabled Flag = "Disabled" // Allowed neither explicitly disables or enables a behavior. // eg. allow a client to control behavior with an annotation or allow a new value through validation. Allowed Flag = "Allowed" )
type ObjectMetaTemplate ¶ added in v0.28.0
ObjectMetaTemplate is a template.Template wrapper for templates which can be applied to ObjectMeta. It implements DeepCopy and Equal so it can be used in Config structs and with go-cmp in tests.
func (ObjectMetaTemplate) DeepCopy ¶ added in v0.28.0
func (t ObjectMetaTemplate) DeepCopy() ObjectMetaTemplate
func (*ObjectMetaTemplate) DeepCopyInto ¶ added in v0.28.0
func (in *ObjectMetaTemplate) DeepCopyInto(out *ObjectMetaTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ObjectMetaTemplate) Equal ¶ added in v0.28.0
func (t ObjectMetaTemplate) Equal(t2 ObjectMetaTemplate) bool
Equal compares two ObjectMetaTemplates for equality, it is implemented so that tests using go-cmp work nicely. Equality is defined to mean that applying the template results in the same value given the same ObjectMeta.Name.
type Store ¶
type Store struct {
*configmap.UntypedStore
}
Store is a typed wrapper around configmap.Untyped store to handle our configmaps. +k8s:deepcopy-gen=false
func NewStore ¶
NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated.