diff --git a/api/v1beta1/bucket_types.go b/api/v1beta1/bucket_types.go index 2c10960c..32d19640 100644 --- a/api/v1beta1/bucket_types.go +++ b/api/v1beta1/bucket_types.go @@ -71,6 +71,10 @@ type BucketSpec struct { // consult the documentation for your version to find out what those are. // +optional Ignore *string `json:"ignore,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } const ( diff --git a/api/v1beta1/gitrepository_types.go b/api/v1beta1/gitrepository_types.go index ce2ea8d9..205667d0 100644 --- a/api/v1beta1/gitrepository_types.go +++ b/api/v1beta1/gitrepository_types.go @@ -66,6 +66,10 @@ type GitRepositorySpec struct { // consult the documentation for your version to find out what those are. // +optional Ignore *string `json:"ignore,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } // GitRepositoryRef defines the Git ref used for pull and checkout operations. diff --git a/api/v1beta1/helmchart_types.go b/api/v1beta1/helmchart_types.go index 6a7e6af5..aa19edfe 100644 --- a/api/v1beta1/helmchart_types.go +++ b/api/v1beta1/helmchart_types.go @@ -49,6 +49,10 @@ type HelmChartSpec struct { // relative path in the SourceRef. Ignored when omitted. // +optional ValuesFile string `json:"valuesFile,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } // LocalHelmChartSourceReference contains enough information to let you locate diff --git a/api/v1beta1/helmrepository_types.go b/api/v1beta1/helmrepository_types.go index c8f7a76d..655f1e57 100644 --- a/api/v1beta1/helmrepository_types.go +++ b/api/v1beta1/helmrepository_types.go @@ -54,6 +54,10 @@ type HelmRepositorySpec struct { // +kubebuilder:default:="60s" // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } // HelmRepositoryStatus defines the observed state of the HelmRepository. diff --git a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml index 5665a6a5..6e95950f 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml @@ -87,6 +87,10 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + suspend: + description: This flag tells the controller to suspend the reconciliation + of this source. + type: boolean timeout: default: 20s description: The timeout for download operations, defaults to 20s. diff --git a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml index 48c16056..8478e39f 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml @@ -89,6 +89,10 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + suspend: + description: This flag tells the controller to suspend the reconciliation + of this source. + type: boolean timeout: default: 20s description: The timeout for remote Git operations like cloning, defaults diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml index 39af34b5..c7da4899 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml @@ -86,6 +86,10 @@ spec: - kind - name type: object + suspend: + description: This flag tells the controller to suspend the reconciliation + of this source. + type: boolean valuesFile: description: Alternative values file to use as the default chart values, expected to be a relative path in the SourceRef. Ignored when omitted. diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml index 8cae509a..00868c6a 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml @@ -63,6 +63,10 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + suspend: + description: This flag tells the controller to suspend the reconciliation + of this source. + type: boolean timeout: default: 60s description: The timeout of index downloading, defaults to 60s. diff --git a/docs/spec/v1beta1/buckets.md b/docs/spec/v1beta1/buckets.md index 1d1954f2..fc9f566c 100644 --- a/docs/spec/v1beta1/buckets.md +++ b/docs/spec/v1beta1/buckets.md @@ -49,6 +49,10 @@ type BucketSpec struct { // consult the documentation for your version to find out what those are. // +optional Ignore *string `json:"ignore,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } ``` diff --git a/docs/spec/v1beta1/common.md b/docs/spec/v1beta1/common.md index ce05795b..25104687 100644 --- a/docs/spec/v1beta1/common.md +++ b/docs/spec/v1beta1/common.md @@ -6,7 +6,7 @@ Common defines resources used across all source types. ### Source interface -Source objects should adhere to the `Source` interface. This interface exposes the [interval](#source-synchronization) +Source objects adhere to the `Source` interface. This interface exposes the [interval](#source-reconciliation) and [artifact](#source-status) of the source to clients without the prerequisite of knowing the source kind: ````go @@ -21,7 +21,7 @@ type Source interface { ### Source reconciliation -Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates: +Source objects contain a `spec.interval` field that tells the controller at which interval to check for updates: ```go type SourceSpec struct { @@ -39,6 +39,8 @@ The controller can be told to check for updates right away by setting an annotat kubectl annotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)" ``` +The source objects reconciliation can be suspended by setting `spec.suspend` to `true`. + ### Source status Source objects should contain a status sub-resource that embeds an artifact object: diff --git a/docs/spec/v1beta1/gitrepositories.md b/docs/spec/v1beta1/gitrepositories.md index d106e9e4..4dde7b62 100644 --- a/docs/spec/v1beta1/gitrepositories.md +++ b/docs/spec/v1beta1/gitrepositories.md @@ -46,6 +46,10 @@ type GitRepositorySpec struct { // consult the documentation for your version to find out what those are. // +optional Ignore *string `json:"ignore,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } ``` diff --git a/docs/spec/v1beta1/helmcharts.md b/docs/spec/v1beta1/helmcharts.md index cfb31107..3a96c08f 100644 --- a/docs/spec/v1beta1/helmcharts.md +++ b/docs/spec/v1beta1/helmcharts.md @@ -32,6 +32,10 @@ type HelmChartSpec struct { // relative path in the SourceRef. Ignored when omitted. // +optional ValuesFile string `json:"valuesFile,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } ``` diff --git a/docs/spec/v1beta1/helmrepositories.md b/docs/spec/v1beta1/helmrepositories.md index 0cc3e22c..f82f6196 100644 --- a/docs/spec/v1beta1/helmrepositories.md +++ b/docs/spec/v1beta1/helmrepositories.md @@ -31,6 +31,10 @@ type HelmRepositorySpec struct { // The timeout of index downloading, defaults to 60s. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` + + // This flag tells the controller to suspend the reconciliation of this source. + // +optional + Suspend bool `json:"suspend,omitempty"` } ```