1 /* 2 Copyright 2018 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 /* 18 Package handler defines EventHandlers that enqueue reconcile.Requests in response to Create, Update, Deletion Events 19 observed from Watching Kubernetes APIs. Users should provide a source.Source and handler.EventHandler to 20 Controller.Watch in order to generate and enqueue reconcile.Request work items. 21 22 Generally, following premade event handlers should be sufficient for most use cases: 23 24 EventHandlers: 25 26 EnqueueRequestForObject - Enqueues a reconcile.Request containing the Name and Namespace of the object in the Event. This will 27 cause the object that was the source of the Event (e.g. the created / deleted / updated object) to be 28 reconciled. 29 30 EnqueueRequestForOwner - Enqueues a reconcile.Request containing the Name and Namespace of the Owner of the object in the Event. 31 This will cause owner of the object that was the source of the Event (e.g. the owner object that created the object) 32 to be reconciled. 33 34 EnqueueRequestsFromMapFunc - Enqueues reconcile.Requests resulting from a user provided transformation function run against the 35 object in the Event. This will cause an arbitrary collection of objects (defined from a transformation of the 36 source object) to be reconciled. 37 */ 38 package handler 39