Documentation ¶
Overview ¶
Package reconciler defines implementations of the Reconciler interface defined at github.com/knative/pkg/controller.Reconciler. These implement the basic workhorse functionality of controllers, while leaving the shared controller implementation to manage things like the workqueue.
Despite defining a Reconciler, each of the packages here are expected to expose a controller constructor like:
func NewController(...) *controller.Impl { ... }
These constructors will:
- Construct the Reconciler,
- Construct a controller.Impl with that Reconciler,
- Wire the assorted informers this Reconciler watches to call appropriate enqueue methods on the controller.
Copyright 2018 The Knative 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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitEvent ¶
func EmitEvent(c record.EventRecorder, beforeCondition *duckv1alpha1.Condition, afterCondition *duckv1alpha1.Condition, object runtime.Object)
EmitEvent emits success or failed event for object if afterCondition is different from beforeCondition
Types ¶
type Base ¶
type Base struct { // KubeClientSet allows us to talk to the k8s for core APIs KubeClientSet kubernetes.Interface SharedClientSet sharedclientset.Interface // PipelineClientSet allows us to configure pipeline objects PipelineClientSet clientset.Interface // PipelineClientSet allows us to configure pipeline objects BuildClientSet buildclientset.Interface // CachingClientSet allows us to instantiate Image objects CachingClientSet cachingclientset.Interface // ConfigMapWatcher allows us to watch for ConfigMap changes. ConfigMapWatcher configmap.Watcher // Recorder is an event recorder for recording Event resources to the // Kubernetes API. Recorder record.EventRecorder // Sugared logger is easier to use but is not as performant as the // raw logger. In performance critical paths, call logger.Desugar() // and use the returned raw logger instead. In addition to the // performance benefits, raw logger also preserves type-safety at // the expense of slightly greater verbosity. Logger *zap.SugaredLogger }
Base implements the core controller logic, given a Reconciler.
type Options ¶
type Options struct { KubeClientSet kubernetes.Interface PipelineClientSet clientset.Interface BuildClientSet buildclientset.Interface CachingClientSet cachingclientset.Interface ConfigMapWatcher configmap.Watcher Logger *zap.SugaredLogger ResyncPeriod time.Duration }
Options defines the common reconciler options. We define this to reduce the boilerplate argument list when creating our controllers.
func (Options) GetTrackerLease ¶
GetTrackerLease returns a multiple of the resync period to use as the duration for tracker leases. This attempts to ensure that resyncs happen to refresh leases frequently enough that we don't miss updates to tracked objects.