Documentation ¶
Index ¶
- Constants
- func AddController[I InstanceType](name string, typeInstance I, mgr manager.Manager, r reconcile.Reconciler, ...) error
- func BuildCacheDefaultNamespaces(namespaces string) map[string]cache.Config
- func ControllerTestSuite[I InstanceType](t **envtest.Environment, cfg **rest.Config, mRef *utils.Matcher, ...)
- func EnqueueRequestForWatcher(watcherList WatcherList) handler.EventHandler
- func GetNamespacedName(name string, namespace string) types.NamespacedName
- func GetNamespacedNameFromObject(obj ObjectWithNameAndNamespace) types.NamespacedName
- func GetPodTemplate[I InstanceType](instance I) *corev1.PodTemplateSpec
- func Run(ctx context.Context, k8sManager ctrl.Manager) error
- func SetPodTemplate[I InstanceType](instance I, template *corev1.PodTemplateSpec)
- func SetupControllerTestReconcile(inner reconcile.Reconciler) (reconcile.Reconciler, chan reconcile.Request, chan reconcile.Request)
- type DeplyomentInterface
- type Handler
- func (h *Handler[I]) GetWatchedConfigmaps() WatcherList
- func (h *Handler[I]) GetWatchedSecrets() WatcherList
- func (h *Handler[I]) Handle(ctx context.Context, namespacesName types.NamespacedName, instance I) (reconcile.Result, error)
- func (h *Handler[I]) HandleWebhook(instance I, dryRun *bool, isCreate bool) error
- func (h *Handler[I]) RemoveWatches(instanceName types.NamespacedName)
- type InstanceType
- type Object
- type ObjectWithNameAndNamespace
- type WatcherList
Constants ¶
View Source
const ( // ConfigHashAnnotation is the key of the annotation on the PodTemplate that // holds the configuration hash ConfigHashAnnotation = "wave.pusher.com/config-hash" // FinalizerString is the finalizer added to deployments to allow Wave to // perform advanced deletion logic FinalizerString = "wave.pusher.com/finalizer" // SchedulingDisabledAnnotation is set on a deployment if scheduling has been disabled // due to missing children and contains the original scheduler SchedulingDisabledAnnotation = "wave.pusher.com/scheduling-disabled" // SchedulingDisabledSchedulerName is the dummy scheduler to disable scheduling of pods SchedulingDisabledSchedulerName = "wave.pusher.com/invalid" // ExtraConfigMapsAnnotation is the key of the annotation that contains additional // ConfigMaps which Wave should watch ExtraConfigMapsAnnotation = "wave.pusher.com/extra-configmaps" // ExtraSecretsAnnotation is the key of the annotation that contains additional // Secrets which Wave should watch ExtraSecretsAnnotation = "wave.pusher.com/extra-secrets" // RequiredAnnotation is the key of the annotation on the Deployment that Wave // checks for before processing the deployment RequiredAnnotation = "wave.pusher.com/update-on-config-change" )
Variables ¶
This section is empty.
Functions ¶
func AddController ¶ added in v0.9.0
func AddController[I InstanceType](name string, typeInstance I, mgr manager.Manager, r reconcile.Reconciler, h *Handler[I]) error
add adds a new Controller to mgr with r as the reconcile.Reconciler
func BuildCacheDefaultNamespaces ¶ added in v0.9.0
BuildCacheDefaultNamespaces builds a cache config to watch namespaces
func ControllerTestSuite ¶ added in v0.9.0
func EnqueueRequestForWatcher ¶ added in v0.7.0
func EnqueueRequestForWatcher(watcherList WatcherList) handler.EventHandler
func GetNamespacedName ¶ added in v0.7.0
func GetNamespacedName(name string, namespace string) types.NamespacedName
func GetNamespacedNameFromObject ¶ added in v0.7.0
func GetNamespacedNameFromObject(obj ObjectWithNameAndNamespace) types.NamespacedName
func GetPodTemplate ¶ added in v0.9.0
func GetPodTemplate[I InstanceType](instance I) *corev1.PodTemplateSpec
func SetPodTemplate ¶ added in v0.9.0
func SetPodTemplate[I InstanceType](instance I, template *corev1.PodTemplateSpec)
func SetupControllerTestReconcile ¶ added in v0.9.0
func SetupControllerTestReconcile(inner reconcile.Reconciler) (reconcile.Reconciler, chan reconcile.Request, chan reconcile.Request)
SetupControllerTestReconcile returns a reconcile.Reconcile implementation that delegates to inner and writes the request to requests after Reconcile is finished.
Types ¶
type DeplyomentInterface ¶ added in v0.9.0
type DeplyomentInterface interface { metav1.TypeMeta metav1.ObjectMeta }
type Handler ¶
type Handler[I InstanceType] struct { client.Client // contains filtered or unexported fields }
Handler performs the main business logic of the Wave controller
func NewHandler ¶
func NewHandler[I InstanceType](c client.Client, r record.EventRecorder) *Handler[I]
NewHandler constructs a new instance of Handler
func (*Handler[I]) GetWatchedConfigmaps ¶ added in v0.7.0
func (h *Handler[I]) GetWatchedConfigmaps() WatcherList
func (*Handler[I]) GetWatchedSecrets ¶ added in v0.7.0
func (h *Handler[I]) GetWatchedSecrets() WatcherList
func (*Handler[I]) Handle ¶ added in v0.9.0
func (h *Handler[I]) Handle(ctx context.Context, namespacesName types.NamespacedName, instance I) (reconcile.Result, error)
Handle is called by the controller to reconcile its object
func (*Handler[I]) HandleWebhook ¶ added in v0.9.0
HandleWebhook is called by the webhook
func (*Handler[I]) RemoveWatches ¶ added in v0.7.0
func (h *Handler[I]) RemoveWatches(instanceName types.NamespacedName)
type InstanceType ¶ added in v0.9.0
type Object ¶
Object is used as a helper interface when passing Kubernetes resources between methods. Adjusted to satisfy client.Object directly.
type ObjectWithNameAndNamespace ¶ added in v0.7.0
type WatcherList ¶ added in v0.8.0
type WatcherList struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.