Documentation ¶
Index ¶
Constants ¶
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 ¶
func (cd *ChannelDefaulter) GetDefault(c *eventingv1alpha1.Channel) (*corev1.ObjectReference, *runtime.RawExtension)
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.