Documentation ¶
Index ¶
Constants ¶
const ( // ConfigMapName is the name of the ConfigMap that contains the configuration for the default // channel CRD. ConfigMapName = "default-ch-webhook" // ChannelDefaulterKey is the key in the ConfigMap to get the name of the default // Channel CRD. ChannelDefaulterKey = "default-ch-config" )
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 Channel CRD to Channels that do not have any CRD 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) messagingv1alpha1.ChannelDefaulterSingleton = channelDefaulter configMapWatcher.Watch(channelDefaulter.ConfigMapName, channelDefaulter.UpdateConfigMap)
func (*ChannelDefaulter) GetDefault ¶
func (cd *ChannelDefaulter) GetDefault(namespace string) *eventingduckv1alpha1.ChannelTemplateSpec
GetDefault determines the default Channel CRD and arguments for the provided namespace. If there is no default for the provided namespace, then use the cluster default.
func (*ChannelDefaulter) UpdateConfigMap ¶
func (cd *ChannelDefaulter) UpdateConfigMap(cm *corev1.ConfigMap)
UpdateConfigMap reads in a ConfigMap and updates the internal default Channel CRD to use.
type Config ¶
type Config struct { // NamespaceDefaultChannels are the default Channels CRDs for each namespace. namespace is the // key, the value is the default ChannelTemplate to use. NamespaceDefaults map[string]*eventingduckv1alpha1.ChannelTemplateSpec `json:"namespaceDefaults,omitempty"` // ClusterDefaultChannel is the default Channel CRD for all namespaces that are not in // NamespaceDefaultChannels. ClusterDefault *eventingduckv1alpha1.ChannelTemplateSpec `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.