Skip to content

Commit 14d929f

Browse files
committed
fix typos in controllers docs
Signed-off-by: Burak Sekili <[email protected]>
1 parent 21de504 commit 14d929f

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

docs/controllers/gc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ This is explained in more detail in [Kubernetes.io :: Finalizers](https://kubern
4848

4949
You should mark objects with a finalizer if it needs external cleanup to run in the event it is deleted.
5050

51-
The main way to use finalizers with controllers is to define a unique finalizer name (many controllers can finalize an object) and make the [finalizer] helper manage it. The finalizer helper is desingned to be used within a reconciler and split the work depending on the state we are in:
51+
The main way to use finalizers with controllers is to define a unique finalizer name (many controllers can finalize an object) and make the [finalizer] helper manage it. The finalizer helper is designed to be used within a reconciler and split the work depending on the state we are in:
5252

53-
- have a deletion happened, and we need to cleanup? we are in the `Event::Cleanup` arm
54-
- no deletion has been recorded? we are in the normal `Event::Apply` arm
53+
- Has a deletion occurred, and do we need to clean up? If so, we are in the `Event::Cleanup` arm
54+
- Has no deletion been recorded? Then we are in the normal `Event::Apply` arm
5555

5656
!!! warning "Finalizers can prevent objects from being deleted"
5757

@@ -61,7 +61,7 @@ The main way to use finalizers with controllers is to define a unique finalizer
6161

6262
In the [secret_syncer example](https://github.com/kube-rs/kube/blob/main/examples/secret_syncer.rs), the controller manages an artificially external secret resource (in reality the example puts it in Kubernetes, but please ignore that) on changes to a `ConfigMap`.
6363

64-
Because we cannot normally watch external resources through Kubernetes watches, we have not setup any [[relations]] for the secret. Instead we use the [finalizer] helper in a reconciler (here as a lambda), and delegate to two more specific reconcilers:
64+
Because we cannot normally watch external resources through Kubernetes watches, we have not setup any [[relations]] for the secret. Instead, we use the [finalizer] helper in a reconciler (here as a lambda), and delegate to two more specific reconcilers:
6565

6666
```rust
6767
|cm, _| {

docs/controllers/intro.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Writing a controller requires **three** pieces:
2929

3030
The main object is the source of truth for what the world should be like, and it takes the form of a Kubernetes object like a:
3131

32-
- [Pod](https://arnavion.github.io/k8s-openapi/v0.14.x/k8s_openapi/api/core/v1/struct.Pod.html)
33-
- [Deployment](https://arnavion.github.io/k8s-openapi/v0.14.x/k8s_openapi/api/apps/v1/struct.Deployment.html)
34-
- ..[any native Kubernetes Resource](https://arnavion.github.io/k8s-openapi/v0.14.x/k8s_openapi/trait.Resource.html#implementors)
32+
- [Pod](https://docs.rs/k8s-openapi/latest/k8s_openapi/api/core/v1/struct.Pod.html)
33+
- [Deployment](https://docs.rs/k8s-openapi/latest/k8s_openapi/api/apps/v1/struct.Deployment.html)
34+
- ..[any native Kubernetes Resource](https://docs.rs/k8s-openapi/latest/k8s_openapi/trait.Resource.html#implementors)
3535
- a partially typed or dynamically typed Kubernetes Resource
3636
- an object from [api discovery](https://docs.rs/kube/latest/kube/discovery/index.html)
3737
- a [Custom Resource](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)
@@ -46,9 +46,9 @@ See the [[object]] document for how to use the various types.
4646

4747
## The Reconciler
4848

49-
The reconconciler is the part of the controller that ensures the world is up to date.
49+
The reconciler is the part of the controller that ensures the world is up to date.
5050

51-
It takes the form of an `async fn` taking the object along with some context, and performs the alignment between the state of world and the `object`.
51+
It takes the form of an `async fn` taking the object along with some context, and performs the alignment between the state of the world and the `object`.
5252

5353
In its simplest form, this is what a reconciler (that does nothing) looks like:
5454

@@ -81,7 +81,7 @@ The core features inside the application are:
8181

8282
The system must be **fault-tolerant**, and thus must be able to recover from **crashes**, **downtime**, and resuming even having **missed messages**.
8383

84-
Setting up a blank controller in rust satisfying these constraints is fairly simple, and can be done with minimal boilerplate (no generated files need be inlined in your project).
84+
Setting up a blank controller in rust satisfying these constraints is fairly simple, and can be done with minimal boilerplate (no generated files need to be inlined in your project).
8585

8686
See the [[application]] document for the high-level details.
8787

@@ -99,7 +99,7 @@ The terminology between **controllers** and **operators** are quite similar:
9999
100100
Which is further reworded now under their new [agglomerate banner](https://cloud.redhat.com/learn/topics/operators).
101101

102-
They key **differences** between the two is that **operators** generally a specific type of controller, sometimes more than one in a single application. To be classified as an operator, a controller would at the very least need to:
102+
The key **difference** between the two is that **operators** are generally a specific type of controller, sometimes more than one in a single application. To be classified as an operator, a controller would at the very least need to:
103103

104104
- manage custom resource definition(s)
105105
- maintain single app focus

docs/controllers/relations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Related Objects
33

4-
A [Controller] needs to specify related resources if changes to them is meant to trigger the [[reconciler]].
4+
A [Controller] needs to specify related resources if changes to them are meant to trigger the [[reconciler]].
55

66
These relations are generally set up with [Controller::owns], but we will go through the different variants below.
77

@@ -47,7 +47,7 @@ Controller::new(main, watcher::Config::default())
4747
```
4848
<!-- TODO: ReconcileRequest::from sets reason to Unknow, needs a method to set reason, ReconcileReason -> controller::Reason -->
4949

50-
In this case we are extracing an object reference from the spec of our object. Regardless of how you get the information, your mapper must return an iterator of [ObjectRef] for the root object(s) that must be reconciled as a result of the change.
50+
In this case, we are extracting an object reference from the spec of our object. Regardless of how you get the information, your mapper must return an iterator of [ObjectRef] for the root object(s) that must be reconciled as a result of the change.
5151

5252
As a theoretical example; every [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) object bundles a scale ref to the workload, so you could use this to build a Controller for `Deployment` using HPA as a watched object.
5353

@@ -62,7 +62,7 @@ Free-form relations to external apis often serve to lift an external resource in
6262
### External Watches
6363
If you want changes on an external API to cause changes in the cluster, you will need to a way to stream changes from the external api.
6464

65-
The _change events_ must be be provided as a `Stream<Item = ObjectRef>` and passed to [Controller::reconcile_on]. As an example:
65+
The _change events_ must be provided as a `Stream<Item = ObjectRef>` and passed to [Controller::reconcile_on]. As an example:
6666

6767
```rust
6868
struct ExternalObject {
@@ -76,7 +76,7 @@ Controller::new(Api::<MyCr>::namespaced(client, &ns), Config::default())
7676
.reconcile_on(external_stream)
7777
```
7878

79-
In this case we have some opaque `fn watch_external_objects()` which here returns `-> impl Stream<Item = ExternalObject>`. It is meant to return changes from the external API. Whenever a new item is found on the stream, the controller will reconcile the matching cluster object.
79+
In this case, we have some opaque `fn watch_external_objects()` which here returns `-> impl Stream<Item = ExternalObject>`. It is meant to return changes from the external API. Whenever a new item is found on the stream, the controller will reconcile the matching cluster object.
8080

8181
(The example assumes __matching names__ between the external resource and cluster resource, and a __fixed namespace__ for the cluster resources.)
8282

@@ -85,7 +85,7 @@ In this case we have some opaque `fn watch_external_objects()` which here return
8585
If you do not have a streaming interface (like if you are doing periodic HTTP GETs), you can wrap your data in a `Stream` via either [async_stream](https://docs.rs/async-stream/latest/async_stream/) or by using channels (say [tokio::sync::mpsc](https://docs.rs/tokio/latest/tokio/sync/mpsc/index.html), using the [Receiver](https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Receiver.html) side as a stream).
8686

8787
### External Writes
88-
If you want to populate an external API from a cluster resource, the you must update the external api from your [[reconciler]] (using the necessary client libraries for that API).
88+
If you want to populate an external API from a cluster resource, you must update the external api from your [[reconciler]] (using the necessary client libraries for that API).
8989

9090
To avoid build-up of generated objects on the external side, you will want to use [[gc#finalizers]], to ensure the external resource gets _safely_ cleaned up on `kubectl delete`.
9191

docs/controllers/schemas.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ See [examples/crd_derive_custom_schema](https://github.com/kube-rs/kube/blob/823
100100

101101
### Overriding Members
102102

103-
When you are implementing or deriving `JsonSchema`, you can overriding specific parts of a `JsonSchema` schema using [`#[schemars(schema_with)]`](https://graham.cool/schemars/examples/7-custom_serialization/). Some specific examples:
103+
When you are implementing or deriving `JsonSchema`, you can override specific parts of a `JsonSchema` schema using [`#[schemars(schema_with)]`](https://graham.cool/schemars/examples/7-custom_serialization/). Some specific examples:
104104

105105
- [overriding merge strategy on a vec](https://github.com/kube-rs/kube/blob/823f4b8db3852e6bdd271e72c56b8c40d6f962a8/examples/crd_derive_schema.rs#L85-L102)
106106
- [overriding x-kubernetes properties on a condition](https://github.com/kube-rs/kube/blob/823f4b8db3852e6bdd271e72c56b8c40d6f962a8/examples/crd_derive.rs#L60-L85)
@@ -114,9 +114,9 @@ When using `#[kube(schema = "disabled)]`, you are telling [[kube-derive]] not to
114114

115115
Setting this option means the [CustomResourceDefinition] provided by [CustomResourceExt] will require modification.
116116

117-
Any manual schemas must be attached on the generated [CustomResourceDefinition] before use. An example of this can be found in [examples/crd_derive_no_schema](https://github.com/kube-rs/kube/blob/main/examples/crd_derive_no_schema.rs).
117+
Any manual schemas must be attached to the generated [CustomResourceDefinition] before use. An example of this can be found in [examples/crd_derive_no_schema](https://github.com/kube-rs/kube/blob/main/examples/crd_derive_no_schema.rs).
118118

119-
The main reason for going down this approach is if you are porting a controller with a CRD from another language and you want to 100% conformance to the existing schema out of the gate.
119+
The main reason for going down this approach is if you are porting a controller with a CRD from another language and you want 100% conformance to the existing schema out of the gate.
120120

121121
This method allows eliding the `#[derive(JsonSchema)]` instruction, and possibly also `schemars` from the dependency tree if you are careful with features.
122122

@@ -138,7 +138,7 @@ This approach will let you use the [1.25 Common Expression Language feature](htt
138138
There are currently no recommended ways of doing client-side validation with this approach, but there are new [cel parser/interpreter crates](https://crates.io/search?q=cel) and a [cel expression playground](https://playcel.undistro.io/) that might be useful here.
139139

140140
### Deriving via Garde
141-
Using [garde] is a nice for the simple case because it allows doing both client-side validation, and server-side validation, with the caveat that it only works on both sides for **basic validation rules** as [schemars can only pick up on some of them](https://graham.cool/schemars/deriving/attributes/#supported-validator-attributes).
141+
Using [garde] is nice for the simple case because it allows doing both client-side validation, and server-side validation, with the caveat that it only works on both sides for **basic validation rules** as [schemars can only pick up on some of them](https://graham.cool/schemars/deriving/attributes/#supported-validator-attributes).
142142

143143
See [CustomResource#schema-validation](https://docs.rs/kube/latest/kube/derive.CustomResource.html#schema-validation).
144144

0 commit comments

Comments
 (0)