Documentation
¶
Overview ¶
Copyright 2021 The Operator-SDK Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 The Operator-SDK Authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func EnqueueRequestForOwnerWithLogging(scheme *runtime.Scheme, mapper meta.RESTMapper, ownerType client.Object, ...) handler.EventHandler
- type LoggingEnqueueRequestForAnnotation
- func (h LoggingEnqueueRequestForAnnotation) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForAnnotation) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForAnnotation) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForAnnotation) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface)
- type LoggingEnqueueRequestForObject
- func (h LoggingEnqueueRequestForObject) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForObject) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForObject) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface)
- func (h LoggingEnqueueRequestForObject) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface)
- type OwnerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueRequestForOwnerWithLogging ¶ added in v1.33.0
func EnqueueRequestForOwnerWithLogging(scheme *runtime.Scheme, mapper meta.RESTMapper, ownerType client.Object, opts ...OwnerOption) handler.EventHandler
EnqueueRequestForOwnerWithLogging enqueues Requests for the Owners of an object. E.g. the object that created the object that was the source of the Event. It also logs the event with the owner of the object.
If a ReplicaSet creates Pods, users may reconcile the ReplicaSet in response to Pod Events using:
- a source.Kind Source with Type of Pod.
- a handler.enqueueRequestForOwner EventHandler with an OwnerType of ReplicaSet and OnlyControllerOwner set to true.
Types ¶
type LoggingEnqueueRequestForAnnotation ¶
type LoggingEnqueueRequestForAnnotation struct {
handler.EnqueueRequestForAnnotation
}
LoggingEnqueueRequestForAnnotation wraps operator-lib handler for "InstrumentedEnqueueRequestForObject", and logs the events as they occur
&handler.LoggingEnqueueRequestForAnnotation{}
func (LoggingEnqueueRequestForAnnotation) Create ¶
func (h LoggingEnqueueRequestForAnnotation) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface)
Create implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForAnnotation) Delete ¶
func (h LoggingEnqueueRequestForAnnotation) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForAnnotation) Generic ¶
func (h LoggingEnqueueRequestForAnnotation) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface)
Generic implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForAnnotation) Update ¶
func (h LoggingEnqueueRequestForAnnotation) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface)
Update implements EventHandler, and emits a log message.
type LoggingEnqueueRequestForObject ¶
type LoggingEnqueueRequestForObject struct {
handler.InstrumentedEnqueueRequestForObject
}
LoggingEnqueueRequestForObject wraps operator-lib handler for "InstrumentedEnqueueRequestForObject", and logs the events as they occur
&handler.LoggingEnqueueRequestForObject{}
func (LoggingEnqueueRequestForObject) Create ¶
func (h LoggingEnqueueRequestForObject) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface)
Create implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForObject) Delete ¶
func (h LoggingEnqueueRequestForObject) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForObject) Generic ¶
func (h LoggingEnqueueRequestForObject) Generic(ctx context.Context, e event.GenericEvent, q workqueue.RateLimitingInterface)
Generic implements EventHandler, and emits a log message.
func (LoggingEnqueueRequestForObject) Update ¶
func (h LoggingEnqueueRequestForObject) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface)
Update implements EventHandler, and emits a log message.
type OwnerOption ¶ added in v1.33.0
type OwnerOption func(e *enqueueRequestForOwner)
OwnerOption modifies an EnqueueRequestForOwner EventHandler.
func OnlyControllerOwner ¶ added in v1.33.0
func OnlyControllerOwner() OwnerOption
OnlyControllerOwner if provided will only look at the first OwnerReference with Controller: true.