Documentation ¶
Overview ¶
Package configuration implements the reflection logic for configmaps and secrets.
Index ¶
- Constants
- func NewConfigMapReflector(workers uint) manager.Reflector
- func NewNamespacedConfigMapReflector(opts *options.NamespacedOpts) manager.NamespacedReflector
- func NewNamespacedSecretReflector(enableSAReflection bool) func(*options.NamespacedOpts) manager.NamespacedReflector
- func NewSecretReflector(enableSAReflection bool, workers uint) manager.Reflector
- func NewServiceAccountReflector(enableSAReflection bool, workers uint) manager.Reflector
- func RemoteConfigMapNamespacedKeyer(namespace string) func(metadata metav1.Object) []types.NamespacedName
- func RemoteSASecretNamespacedKeyer(namespace, nodename string) func(metadata metav1.Object) []types.NamespacedName
- type FallbackServiceAccountReflector
- func (fsar *FallbackServiceAccountReflector) Handle(ctx context.Context, key types.NamespacedName) error
- func (fsar *FallbackServiceAccountReflector) Keys(local, _ string) []types.NamespacedName
- func (fsar *FallbackServiceAccountReflector) List() ([]interface{}, error)
- func (fsar *FallbackServiceAccountReflector) Ready() bool
- type NamespacedConfigMapReflector
- type NamespacedSecretReflector
- type NamespacedServiceAccountReflector
- type ServiceAccountReflector
- func (sar *ServiceAccountReflector) NewFallback(opts *options.ReflectorOpts) manager.FallbackReflector
- func (sar *ServiceAccountReflector) NewNamespaced(opts *options.NamespacedOpts) manager.NamespacedReflector
- func (sar *ServiceAccountReflector) Start(ctx context.Context, opts *options.ReflectorOpts)
Constants ¶
const (
// ConfigMapReflectorName is the name associated with the ConfigMap reflector.
ConfigMapReflectorName = "ConfigMap"
)
const (
// SecretReflectorName is the name associated with the Secret reflector.
SecretReflectorName = "Secret"
)
const (
// ServiceAccountReflectorName is the name associated with the ServiceAccount reflector.
ServiceAccountReflectorName = "ServiceAccount"
)
Variables ¶
This section is empty.
Functions ¶
func NewConfigMapReflector ¶
NewConfigMapReflector builds a ConfigMapReflector.
func NewNamespacedConfigMapReflector ¶
func NewNamespacedConfigMapReflector(opts *options.NamespacedOpts) manager.NamespacedReflector
NewNamespacedConfigMapReflector returns a function generating NamespacedConfigMapReflector instances.
func NewNamespacedSecretReflector ¶
func NewNamespacedSecretReflector(enableSAReflection bool) func(*options.NamespacedOpts) manager.NamespacedReflector
NewNamespacedSecretReflector returns a function generating NamespacedSecretReflector instances.
func NewSecretReflector ¶
NewSecretReflector builds a SecretReflector.
func NewServiceAccountReflector ¶ added in v0.7.0
NewServiceAccountReflector builds a ServiceAccountReflector.
func RemoteConfigMapNamespacedKeyer ¶ added in v0.5.0
func RemoteConfigMapNamespacedKeyer(namespace string) func(metadata metav1.Object) []types.NamespacedName
RemoteConfigMapNamespacedKeyer returns a keyer associated with the given namespace, which accounts for the root CA configmap name remapping.
func RemoteSASecretNamespacedKeyer ¶ added in v0.7.0
func RemoteSASecretNamespacedKeyer(namespace, nodename string) func(metadata metav1.Object) []types.NamespacedName
RemoteSASecretNamespacedKeyer returns a keyer associated with the given namespace, which accounts for enqueuing only the secrets associated with a service account (enqueuing the owner pod name).
Types ¶
type FallbackServiceAccountReflector ¶ added in v0.7.0
type FallbackServiceAccountReflector struct {
// contains filtered or unexported fields
}
FallbackServiceAccountReflector handles the "orphan" pods outside the managed namespaces. It ensures that the events for already existing pods are correctly emitted if the corresponding namespace gets offloaded afterwards.
func (*FallbackServiceAccountReflector) Handle ¶ added in v0.7.0
func (fsar *FallbackServiceAccountReflector) Handle(ctx context.Context, key types.NamespacedName) error
Handle operates as fallback to reconcile pod objects not managed by namespaced handlers.
func (*FallbackServiceAccountReflector) Keys ¶ added in v0.7.0
func (fsar *FallbackServiceAccountReflector) Keys(local, _ string) []types.NamespacedName
Keys returns a set of keys to be enqueued for fallback processing for the given namespace pair.
func (*FallbackServiceAccountReflector) List ¶ added in v0.9.0
func (fsar *FallbackServiceAccountReflector) List() ([]interface{}, error)
List returns a list of all service account tokens managed by the reflector.
func (*FallbackServiceAccountReflector) Ready ¶ added in v0.7.0
func (fsar *FallbackServiceAccountReflector) Ready() bool
Ready returns whether the FallbackReflector is completely initialized.
type NamespacedConfigMapReflector ¶
type NamespacedConfigMapReflector struct { generic.NamespacedReflector // contains filtered or unexported fields }
NamespacedConfigMapReflector manages the ConfigMap reflection.
func (*NamespacedConfigMapReflector) Handle ¶
func (ncr *NamespacedConfigMapReflector) Handle(ctx context.Context, name string) error
Handle is responsible for reconciling the given object and ensuring it is correctly reflected.
func (*NamespacedConfigMapReflector) List ¶ added in v0.9.0
func (ncr *NamespacedConfigMapReflector) List() ([]interface{}, error)
List returns the list of objects.
func (*NamespacedConfigMapReflector) RemoteRef ¶ added in v0.5.0
func (ncr *NamespacedConfigMapReflector) RemoteRef(name string) klog.ObjectRef
RemoteRef returns the ObjectRef associated with the remote namespace.
type NamespacedSecretReflector ¶
type NamespacedSecretReflector struct { generic.NamespacedReflector // contains filtered or unexported fields }
NamespacedSecretReflector manages the Secret reflection.
func (*NamespacedSecretReflector) Handle ¶
func (nsr *NamespacedSecretReflector) Handle(ctx context.Context, name string) error
Handle is responsible for reconciling the given object and ensuring it is correctly reflected.
func (*NamespacedSecretReflector) List ¶ added in v0.9.0
func (nsr *NamespacedSecretReflector) List() ([]interface{}, error)
List returns the list of objects to be reflected.
type NamespacedServiceAccountReflector ¶ added in v0.7.0
type NamespacedServiceAccountReflector struct { generic.NamespacedReflector // contains filtered or unexported fields }
NamespacedServiceAccountReflector manages the reflection of tokens associated with ServiceAccounts.
func (*NamespacedServiceAccountReflector) Handle ¶ added in v0.7.0
func (nsar *NamespacedServiceAccountReflector) Handle(ctx context.Context, name string) error
Handle is responsible for reconciling the given object and ensuring it is correctly reflected.
func (*NamespacedServiceAccountReflector) List ¶ added in v0.9.0
func (nsar *NamespacedServiceAccountReflector) List() ([]interface{}, error)
List returns a list of all service account tokens managed by the reflector.
type ServiceAccountReflector ¶ added in v0.7.0
ServiceAccountReflector manages the reflection of tokens associated with ServiceAccounts.
func (*ServiceAccountReflector) NewFallback ¶ added in v0.7.0
func (sar *ServiceAccountReflector) NewFallback(opts *options.ReflectorOpts) manager.FallbackReflector
NewFallback returns a new FallbackReflector instance.
func (*ServiceAccountReflector) NewNamespaced ¶ added in v0.7.0
func (sar *ServiceAccountReflector) NewNamespaced(opts *options.NamespacedOpts) manager.NamespacedReflector
NewNamespaced returns a new NamespacedServiceAccountReflector instance.
func (*ServiceAccountReflector) Start ¶ added in v0.7.0
func (sar *ServiceAccountReflector) Start(ctx context.Context, opts *options.ReflectorOpts)
Start starts the reflector.