Skip to content

Commit e72b0e7

Browse files
authored
Merge pull request #434 from luksa/fix_docs
📖 Fix docs & comments referring to "Reconciler" instead of "reconcile"
2 parents e381b18 + 52f4a7c commit e72b0e7

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

examples/builtins/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func main() {
5353
os.Exit(1)
5454
}
5555

56-
// Setup a new controller to Reconciler ReplicaSets
56+
// Setup a new controller to reconcile ReplicaSets
5757
entryLog.Info("Setting up controller")
5858
c, err := controller.New("foo-controller", mgr, controller.Options{
5959
Reconciler: &reconcileReplicaSet{client: mgr.GetClient(), log: log.WithName("reconciler")},

pkg/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Options struct {
4242
// Work typically is reads and writes Kubernetes objects to make the system state match the state specified
4343
// in the object Spec.
4444
type Controller interface {
45-
// Reconciler is called to Reconciler an object by Namespace/Name
45+
// Reconciler is called to reconcile an object by Namespace/Name
4646
reconcile.Reconciler
4747

4848
// Watch takes events provided by a Source and uses the EventHandler to

pkg/doc.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ clients, caches, schemes, etc. Controllers should be Started through the Manage
3535
Controller
3636
3737
Controller implements a Kubernetes API by responding to events (object Create, Update, Delete) and ensuring that
38-
the state specified in the Spec of the object matches the state of the system. This is called a Reconciler.
38+
the state specified in the Spec of the object matches the state of the system. This is called a reconcile.
3939
If they do not match, the Controller will create / update / delete objects as needed to make them match.
4040
41-
Controllers are implemented as worker queues that process reconcile.Requests (requests to Reconciler the
41+
Controllers are implemented as worker queues that process reconcile.Requests (requests to reconcile the
4242
state for a specific object).
4343
44-
Unlike http handlers, Controllers DO NOT handle events directly, but enqueue Requests to eventually Reconciler
44+
Unlike http handlers, Controllers DO NOT handle events directly, but enqueue Requests to eventually reconcile
4545
the object. This means the handling of multiple events may be batched together and the full state of the
46-
system must be read for each Reconciler.
46+
system must be read for each reconcile.
4747
4848
* Controllers require a Reconciler to be provided to perform the work pulled from the work queue.
4949
@@ -65,11 +65,11 @@ Validating webhook is used to validate if an object meets certain requirements.
6565
Reconciler
6666
6767
Reconciler is a function provided to a Controller that may be called at anytime with the Name and Namespace of an object.
68-
When called, Reconciler will ensure that the state of the system matches what is specified in the object at the
69-
time Reconciler is called.
68+
When called, the Reconciler will ensure that the state of the system matches what is specified in the object at the
69+
time the Reconciler is called.
7070
7171
Example: Reconciler invoked for a ReplicaSet object. The ReplicaSet specifies 5 replicas but only
72-
3 Pods exist in the system. Reconciler creates 2 more Pods and sets their OwnerReference to point at the
72+
3 Pods exist in the system. The Reconciler creates 2 more Pods and sets their OwnerReference to point at the
7373
ReplicaSet with controller=true.
7474
7575
* Reconciler contains all of the business logic of a Controller.
@@ -80,7 +80,7 @@ a mapping (e.g. owner references) that maps the object that triggers the reconci
8080
8181
* Reconciler is provided the Name / Namespace of the object to reconcile.
8282
83-
* Reconciler does not care about the event contents or event type responsible for triggering the Reconciler.
83+
* Reconciler does not care about the event contents or event type responsible for triggering the reconcile.
8484
- e.g. it doesn't matter whether a ReplicaSet was created or updated, Reconciler will always compare the number of
8585
Pods in the system against what is specified in the object at the time it is called.
8686
@@ -159,7 +159,7 @@ Controller Example
159159
1.2 Pod (created by ReplicaSet) -> handler.EnqueueRequestForOwnerHandler - enqueue a Request with the
160160
Owning ReplicaSet Namespace and Name.
161161
162-
2. Reconciler ReplicaSet in response to an event
162+
2. reconcile ReplicaSet in response to an event
163163
164164
2.1 ReplicaSet object created -> Read ReplicaSet, try to read Pods -> if is missing create Pods.
165165
@@ -169,7 +169,7 @@ Owning ReplicaSet Namespace and Name.
169169
170170
Watching and EventHandling
171171
172-
Controllers may Watch multiple Kinds of objects (e.g. Pods, ReplicaSets and Deployments), but they Reconciler
172+
Controllers may Watch multiple Kinds of objects (e.g. Pods, ReplicaSets and Deployments), but they reconcile
173173
only a single Type. When one Type of object must be updated in response to changes in another Type of object,
174174
an EnqueueRequestFromMapFunc may be used to map events from one type to another. e.g. Respond to a cluster resize
175175
event (add / delete Node) by re-reconciling all instances of some API.
@@ -189,10 +189,10 @@ Controller Writing Tips
189189
190190
Reconciler Runtime Complexity:
191191
192-
* It is better to write Controllers to perform an O(1) Reconciler N times (e.g. on N different objects) instead of
193-
performing an O(N) Reconciler 1 time (e.g. on a single object which manages N other objects).
192+
* It is better to write Controllers to perform an O(1) reconcile N times (e.g. on N different objects) instead of
193+
performing an O(N) reconcile 1 time (e.g. on a single object which manages N other objects).
194194
195-
* Example: If you need to update all Services in response to a Node being added - Reconciler Services but Watch
195+
* Example: If you need to update all Services in response to a Node being added - reconcile Services but Watch
196196
Nodes (transformed to Service object name / Namespaces) instead of Reconciling Nodes and updating Services
197197
198198
Event Multiplexing:

pkg/handler/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ EnqueueRequestForOwner - Enqueues a reconcile.Request containing the Name and Na
3131
This will cause owner of the object that was the source of the Event (e.g. the owner object that created the object)
3232
to be reconciled.
3333
34-
EnqueueRequestsFromMapFunc - Enqueues Reconciler.Requests resulting from a user provided transformation function run against the
34+
EnqueueRequestsFromMapFunc - Enqueues reconcile.Requests resulting from a user provided transformation function run against the
3535
object in the Event. This will cause an arbitrary collection of objects (defined from a transformation of the
3636
source object) to be reconciled.
3737
*/

0 commit comments

Comments
 (0)