config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Revision controller depends.

Index

Constants

View Source
const (
	// ControllerConfigName is the name of config map for the controller.
	ControllerConfigName = "config-controller"
)
View Source
const (
	ObservabilityConfigName = "config-observability"
)

Variables

This section is empty.

Functions

func ToContext

func ToContext(ctx context.Context, c *Config) context.Context

Types

type Config

type Config struct {
	Controller    *Controller
	Network       *network.Config
	Observability *Observability
	Logging       *pkglogging.Config
	Autoscaler    *autoscaler.Config
}

+k8s:deepcopy-gen=false

func FromContext

func FromContext(ctx context.Context) *Config

type Controller

type Controller struct {
	// QueueSidecarImage is the name of the image used for the queue sidecar
	// injected into the revision pod
	QueueSidecarImage string

	// Repositories for which tag to digest resolving should be skipped
	RegistriesSkippingTagResolving sets.String
}

Controller includes the configurations for the controller.

func NewControllerConfigFromConfigMap

func NewControllerConfigFromConfigMap(config *corev1.ConfigMap) (*Controller, error)

NewControllerConfigFromConfigMap creates a Controller from the supplied configMap

func NewControllerConfigFromMap

func NewControllerConfigFromMap(configMap map[string]string) (*Controller, error)

NewControllerConfigFromMap creates a Controller from the supplied Map

func (*Controller) DeepCopy

func (in *Controller) DeepCopy() *Controller

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Controller.

func (*Controller) DeepCopyInto

func (in *Controller) DeepCopyInto(out *Controller)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Observability

type Observability struct {
	// EnableVarLogCollection dedicates whether to set up a fluentd sidecar to
	// collect logs under /var/log/.
	EnableVarLogCollection bool

	// TODO(#818): Use the fluentd daemon set to collect /var/log.
	// FluentdSidecarImage is the name of the image used for the fluentd sidecar
	// injected into the revision pod. It is used only when enableVarLogCollection
	// is true.
	FluentdSidecarImage string

	// FluentdSidecarOutputConfig is the config for fluentd sidecar to specify
	// logging output destination.
	FluentdSidecarOutputConfig string

	// LoggingURLTemplate is a string containing the logging url template where
	// the variable REVISION_UID will be replaced with the created revision's UID.
	LoggingURLTemplate string
}

Observability contains the configuration defined in the observability ConfigMap.

func NewObservabilityFromConfigMap

func NewObservabilityFromConfigMap(configMap *corev1.ConfigMap) (*Observability, error)

NewObservabilityFromConfigMap creates a Observability from the supplied ConfigMap

func (*Observability) DeepCopy

func (in *Observability) DeepCopy() *Observability

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Observability.

func (*Observability) DeepCopyInto

func (in *Observability) DeepCopyInto(out *Observability)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Store

type Store struct {
	*configmap.UntypedStore
}

+k8s:deepcopy-gen=false

func NewStore

func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value interface{})) *Store

NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated for Revisions

func (*Store) Load

func (s *Store) Load() *Config

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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