Documentation ¶
Overview ¶
Package config holds the typed objects that define the schemas for ConfigMap objects that pertain to our API objects.
Index ¶
Constants ¶
const ( // ChannelDefaultsConfigName is the name of config map for the default // configs that channels should use. ChannelDefaultsConfigName = "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 ¶
Types ¶
type ChannelDefaults ¶
type ChannelDefaults struct { // NamespaceDefaults are the default Channels CRDs for each namespace. namespace is the // key, the value is the default ChannelTemplate to use. NamespaceDefaults map[string]*ChannelTemplateSpec `json:"namespaceDefaults,omitempty"` // ClusterDefaultChannel is the default Channel CRD for all namespaces that are not in // NamespaceDefaultChannels. ClusterDefault *ChannelTemplateSpec `json:"clusterDefault,omitempty"` }
ChannelDefaults includes the default values to be populated by the webhook.
func NewChannelDefaultsConfigFromConfigMap ¶
func NewChannelDefaultsConfigFromConfigMap(config *corev1.ConfigMap) (*ChannelDefaults, error)
NewChannelDefaultsConfigFromConfigMap creates a ChannelDefaults from the supplied configMap
func NewChannelDefaultsConfigFromMap ¶
func NewChannelDefaultsConfigFromMap(data map[string]string) (*ChannelDefaults, error)
NewChannelDefaultsConfigFromMap creates a Defaults from the supplied Map
func (*ChannelDefaults) DeepCopy ¶
func (in *ChannelDefaults) DeepCopy() *ChannelDefaults
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChannelDefaults.
func (*ChannelDefaults) DeepCopyInto ¶
func (in *ChannelDefaults) DeepCopyInto(out *ChannelDefaults)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ChannelDefaults) GetChannelConfig ¶
func (d *ChannelDefaults) GetChannelConfig(ns string) (*ChannelTemplateSpec, error)
GetChannelConfig returns a namespace specific Channel Configuration, and if that doesn't exist, return a Cluster Default and if that doesn't exist return an error.
type ChannelTemplateSpec ¶
type ChannelTemplateSpec struct { metav1.TypeMeta `json:",inline"` // Spec defines the Spec to use for each channel created. Passed // in verbatim to the Channel CRD as Spec section. // +optional Spec *runtime.RawExtension `json:"spec,omitempty"` }
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ChannelTemplateSpec) DeepCopy ¶
func (in *ChannelTemplateSpec) DeepCopy() *ChannelTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChannelTemplateSpec.
func (*ChannelTemplateSpec) DeepCopyInto ¶
func (in *ChannelTemplateSpec) DeepCopyInto(out *ChannelTemplateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ChannelTemplateSpec) DeepCopyObject ¶
func (in *ChannelTemplateSpec) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type Config ¶
type Config struct {
ChannelDefaults *ChannelDefaults
}
Config holds the collection of configurations that we attach to contexts. +k8s:deepcopy-gen=false
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.
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.