You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update provider contract to account for the paused condition
This change updates the provider contract to account for a new paused
condition.
It is intended to start as an optional condition, but then become
required at a later date.
Copy file name to clipboardExpand all lines: docs/book/src/developer/architecture/controllers/control-plane.md
+12
Original file line number
Diff line number
Diff line change
@@ -264,6 +264,18 @@ The `status` object **may** define several fields:
264
264
* `externalManagedControlPlane` - is a bool that should be set to true if the Node objects do not
265
265
exist in the cluster. For example, managed control plane providers for AKS, EKS, GKE, etc, should
266
266
set this to `true`. Leaving the field undefined is equivalent to setting the value to `false`.
267
+
* `.Conditions[Paused]` - is a condition that reports if the cluster or control plane resource is paused. It should check if 'spec.paused' is set on the cluster, and for the paused annotation on the resource. This is currently optional, but will become required in future.
268
+
```go
269
+
// Return early and set the paused condition to True if the object or Cluster
270
+
// is paused.
271
+
if annotations.IsPaused(cluster, m) {
272
+
log.Info("Reconciliation is paused for this object")
273
+
conditions.MarkTrue(m, clusterv1.PausedCondition)
274
+
return ctrl.Result{}, nil
275
+
}
276
+
277
+
conditions.MarkFalse(m, clusterv1.PausedCondition, clusterv1.ResourceNotPausedReason, clusterv1.ConditionSeverityInfo, "Resource is operating as expected")
278
+
```
267
279
268
280
Note: once any of `failureReason` or `failureMessage` surface on the cluster who is referencing the control plane object,
269
281
they cannot be restored anymore (it is considered a terminal error; the only way to recover is to delete and recreate the cluster).
Copy file name to clipboardExpand all lines: docs/book/src/developer/providers/bootstrap.md
+16
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,22 @@ A bootstrap provider must define an API type for bootstrap resources. The type:
26
26
meant to be suitable for programmatic interpretation
27
27
2.`failureMessage` (string): indicates there is a fatal problem reconciling the bootstrap data;
28
28
meant to be a more descriptive value than `failureReason`
29
+
7. Should have `Status.Conditions` with the following:
30
+
1. A `Status.Conditions[Paused]` to report if the cluster or bootstrap resource is paused. It should check if 'spec.paused' is set on the cluster, and for the paused annotation on the resource. This is currently optional, but will be required in the future.
31
+
```go
32
+
// Return early and set the paused condition to True if the object or Cluster
33
+
// is paused.
34
+
// We assume that the change to the object has to be written, e.g. via the
35
+
// patchHelper in defer.
36
+
if annotations.IsPaused(cluster, m) {
37
+
log.Info("Reconciliation is paused for this object")
38
+
conditions.MarkTrue(m, clusterv1.PausedCondition)
39
+
return ctrl.Result{}, nil
40
+
}
41
+
42
+
conditions.MarkFalse(m, clusterv1.PausedCondition, clusterv1.ResourceNotPausedReason, clusterv1.ConditionSeverityInfo, "Resource is operating as expected")
43
+
```
44
+
29
45
30
46
Note: once any of `failureReason` or `failureMessage` surface on the machine/machine pool who is referencing the bootstrap config object,
31
47
they cannot be restored anymore (it is considered a terminal error; the only way to recover is to delete and recreate the machine/machine pool).
Copy file name to clipboardExpand all lines: docs/book/src/developer/providers/cluster-infrastructure.md
+14
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,20 @@ A cluster infrastructure provider must define an API type for "infrastructure cl
35
35
`FailureDomainSpec` is defined as:
36
36
-`controlPlane` (bool): indicates if failure domain is appropriate for running control plane instances.
37
37
-`attributes` (`map[string]string`): arbitrary attributes for users to apply to a failure domain.
38
+
7. Should have a `Status.Conditions` with the following:
39
+
1. A `Paused` condition to report if the cluster or cluster infrastructure is paused. It should check if 'spec.paused' is set on the cluster, and for the paused annotation on the infrastructure. This is currently optional, but will be required in the future.
40
+
```go
41
+
// Return early and set the paused condition to True if the object or Cluster
42
+
// is paused.
43
+
// We assume that the change to the object has to be written, e.g. via the
44
+
// patchHelper in defer.
45
+
if annotations.IsPaused(cluster, m) {
46
+
log.Info("Reconciliation is paused for this object")
47
+
conditions.MarkTrue(m, clusterv1.PausedCondition)
48
+
return ctrl.Result{}, nil
49
+
}
50
+
51
+
conditions.MarkFalse(m, clusterv1.PausedCondition, clusterv1.ResourceNotPausedReason, clusterv1.ConditionSeverityInfo, "Resource is operating as expected")
38
52
39
53
Note: once any of `failureReason` or `failureMessage` surface on the cluster who is referencing the infrastructureCluster object,
40
54
they cannot be restored anymore (it is considered a terminal error; the only way to recover is to delete and recreate the cluster).
Copy file name to clipboardExpand all lines: docs/book/src/developer/providers/machine-infrastructure.md
+17-2
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,23 @@ A machine infrastructure provider must define an API type for "infrastructure ma
42
42
defined as:
43
43
-`type` (string): one of `Hostname`, `ExternalIP`, `InternalIP`, `ExternalDNS`, `InternalDNS`
44
44
-`address` (string)
45
-
7. Should have a conditions field with the following:
46
-
1. A Ready condition to represent the overall operational state of the component. It can be based on the summary of more detailed conditions existing on the same object, e.g. instanceReady, SecurityGroupsReady conditions.
45
+
7. Should have a `Status.Conditions` field with the following:
46
+
1. A `Ready` condition to represent the overall operational state of the component. It can be based on the summary of more detailed conditions existing on the same object, e.g. instanceReady, SecurityGroupsReady conditions.
47
+
2. A `Paused` condition to report if the cluster or infrastructure machine is paused. It should check if 'spec.paused' is set on the cluster, and for the paused annotation on the infrastructure. This is currently optional, but will be required in the future.
48
+
```go
49
+
// Return early and set the paused condition to True if the object or Cluster
50
+
// is paused.
51
+
// We assume that the change to the object has to be written, e.g. via the
52
+
// patchHelper in defer.
53
+
if annotations.IsPaused(cluster, m) {
54
+
log.Info("Reconciliation is paused for this object")
55
+
conditions.MarkTrue(m, clusterv1.PausedCondition)
56
+
return ctrl.Result{}, nil
57
+
}
58
+
59
+
conditions.MarkFalse(m, clusterv1.PausedCondition, clusterv1.ResourceNotPausedReason, clusterv1.ConditionSeverityInfo, "Resource is operating as expected")
60
+
```
61
+
47
62
48
63
Note: once any of `failureReason` or `failureMessage` surface on the machine who is referencing the infrastructureMachine object,
49
64
they cannot be restored anymore (it is considered a terminal error; the only way to recover is to delete and recreate the machine).
0 commit comments