channeldefaulter

package
v0.0.0-...-157142f Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigMapName is the name of the ConfigMap that contains the configuration for the default
	// ClusterChannelProvisioner.
	ConfigMapName = "default-channel-webhook"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelDefaulter

type ChannelDefaulter struct {
	// contains filtered or unexported fields
}

ChannelDefaulter adds a default ClusterChannelProvisioner to Channels that do not have any provisioner specified. The default is stored in a ConfigMap and can be updated at runtime.

func New

func New(logger *zap.Logger) *ChannelDefaulter

New creates a new ChannelDefaulter. The caller is expected to set this as the global singleton.

channelDefaulter := channeldefaulter.New(logger) eventingv1alpha1.ChannelDefaulterSingleton = channelDefaulter configMapWatcher.Watch(channeldefaulter.ConfigMapName, channelDefaulter.UpdateConfigMap)

func (*ChannelDefaulter) GetDefault

GetDefault determines the default provisioner and arguments for the provided channel.

func (*ChannelDefaulter) UpdateConfigMap

func (cd *ChannelDefaulter) UpdateConfigMap(cm *corev1.ConfigMap)

UpdateConfigMap reads in a ConfigMap and updates the internal default ClusterChannelProvisioner to use.

type Config

type Config struct {
	// NamespaceDefaults are the default Channel provisioner for each namespace. namespace is the
	// key, the value is the default provisioner to use.
	NamespaceDefaults map[string]*corev1.ObjectReference `json:"namespaceDefaults,omitempty"`
	// ClusterDefault is the default Channel provisioner for all namespaces that are not in
	// NamespaceDefaults.
	ClusterDefault *corev1.ObjectReference `json:"clusterDefault,omitempty"`
}

Config is the data structure serialized to YAML in the config map. When a Channel needs to be defaulted, the Channel's namespace will be used as a key into NamespaceDefaults, if there is something present, then that is used. If not, then the ClusterDefault is used.

Jump to

Keyboard shortcuts

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