Add suspend field to Source API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
32d4e77612
commit
07d09e2c2e
|
@ -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 (
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue