Skip to content

Commit 07d09e2

Browse files
committed
Add suspend field to Source API
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 32d4e77 commit 07d09e2

13 files changed

+52
-2
lines changed

api/v1beta1/bucket_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ type BucketSpec struct {
7171
// consult the documentation for your version to find out what those are.
7272
// +optional
7373
Ignore *string `json:"ignore,omitempty"`
74+
75+
// This flag tells the controller to suspend the reconciliation of this source.
76+
// +optional
77+
Suspend bool `json:"suspend,omitempty"`
7478
}
7579

7680
const (

api/v1beta1/gitrepository_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ type GitRepositorySpec struct {
6666
// consult the documentation for your version to find out what those are.
6767
// +optional
6868
Ignore *string `json:"ignore,omitempty"`
69+
70+
// This flag tells the controller to suspend the reconciliation of this source.
71+
// +optional
72+
Suspend bool `json:"suspend,omitempty"`
6973
}
7074

7175
// GitRepositoryRef defines the Git ref used for pull and checkout operations.

api/v1beta1/helmchart_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ type HelmChartSpec struct {
4949
// relative path in the SourceRef. Ignored when omitted.
5050
// +optional
5151
ValuesFile string `json:"valuesFile,omitempty"`
52+
53+
// This flag tells the controller to suspend the reconciliation of this source.
54+
// +optional
55+
Suspend bool `json:"suspend,omitempty"`
5256
}
5357

5458
// LocalHelmChartSourceReference contains enough information to let you locate

api/v1beta1/helmrepository_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ type HelmRepositorySpec struct {
5454
// +kubebuilder:default:="60s"
5555
// +optional
5656
Timeout *metav1.Duration `json:"timeout,omitempty"`
57+
58+
// This flag tells the controller to suspend the reconciliation of this source.
59+
// +optional
60+
Suspend bool `json:"suspend,omitempty"`
5761
}
5862

5963
// HelmRepositoryStatus defines the observed state of the HelmRepository.

config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ spec:
8787
TODO: Add other useful fields. apiVersion, kind, uid?'
8888
type: string
8989
type: object
90+
suspend:
91+
description: This flag tells the controller to suspend the reconciliation
92+
of this source.
93+
type: boolean
9094
timeout:
9195
default: 20s
9296
description: The timeout for download operations, defaults to 20s.

config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ spec:
8989
TODO: Add other useful fields. apiVersion, kind, uid?'
9090
type: string
9191
type: object
92+
suspend:
93+
description: This flag tells the controller to suspend the reconciliation
94+
of this source.
95+
type: boolean
9296
timeout:
9397
default: 20s
9498
description: The timeout for remote Git operations like cloning, defaults

config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ spec:
8686
- kind
8787
- name
8888
type: object
89+
suspend:
90+
description: This flag tells the controller to suspend the reconciliation
91+
of this source.
92+
type: boolean
8993
valuesFile:
9094
description: Alternative values file to use as the default chart values,
9195
expected to be a relative path in the SourceRef. Ignored when omitted.

config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
TODO: Add other useful fields. apiVersion, kind, uid?'
6464
type: string
6565
type: object
66+
suspend:
67+
description: This flag tells the controller to suspend the reconciliation
68+
of this source.
69+
type: boolean
6670
timeout:
6771
default: 60s
6872
description: The timeout of index downloading, defaults to 60s.

docs/spec/v1beta1/buckets.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ type BucketSpec struct {
4949
// consult the documentation for your version to find out what those are.
5050
// +optional
5151
Ignore *string `json:"ignore,omitempty"`
52+
53+
// This flag tells the controller to suspend the reconciliation of this source.
54+
// +optional
55+
Suspend bool `json:"suspend,omitempty"`
5256
}
5357
```
5458

docs/spec/v1beta1/common.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Common defines resources used across all source types.
66

77
### Source interface
88

9-
Source objects should adhere to the `Source` interface. This interface exposes the [interval](#source-synchronization)
9+
Source objects adhere to the `Source` interface. This interface exposes the [interval](#source-reconciliation)
1010
and [artifact](#source-status) of the source to clients without the prerequisite of knowing the source kind:
1111

1212
````go
@@ -21,7 +21,7 @@ type Source interface {
2121

2222
### Source reconciliation
2323

24-
Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates:
24+
Source objects contain a `spec.interval` field that tells the controller at which interval to check for updates:
2525

2626
```go
2727
type SourceSpec struct {
@@ -39,6 +39,8 @@ The controller can be told to check for updates right away by setting an annotat
3939
kubectl annotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)"
4040
```
4141

42+
The source objects reconciliation can be suspended by setting `spec.suspend` to `true`.
43+
4244
### Source status
4345

4446
Source objects should contain a status sub-resource that embeds an artifact object:

0 commit comments

Comments
 (0)