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.
|
// consult the documentation for your version to find out what those are.
|
||||||
// +optional
|
// +optional
|
||||||
Ignore *string `json:"ignore,omitempty"`
|
Ignore *string `json:"ignore,omitempty"`
|
||||||
|
|
||||||
|
// This flag tells the controller to suspend the reconciliation of this source.
|
||||||
|
// +optional
|
||||||
|
Suspend bool `json:"suspend,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -66,6 +66,10 @@ type GitRepositorySpec struct {
|
||||||
// consult the documentation for your version to find out what those are.
|
// consult the documentation for your version to find out what those are.
|
||||||
// +optional
|
// +optional
|
||||||
Ignore *string `json:"ignore,omitempty"`
|
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.
|
// 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.
|
// relative path in the SourceRef. Ignored when omitted.
|
||||||
// +optional
|
// +optional
|
||||||
ValuesFile string `json:"valuesFile,omitempty"`
|
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
|
// LocalHelmChartSourceReference contains enough information to let you locate
|
||||||
|
|
|
@ -54,6 +54,10 @@ type HelmRepositorySpec struct {
|
||||||
// +kubebuilder:default:="60s"
|
// +kubebuilder:default:="60s"
|
||||||
// +optional
|
// +optional
|
||||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
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.
|
// HelmRepositoryStatus defines the observed state of the HelmRepository.
|
||||||
|
|
|
@ -87,6 +87,10 @@ spec:
|
||||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
suspend:
|
||||||
|
description: This flag tells the controller to suspend the reconciliation
|
||||||
|
of this source.
|
||||||
|
type: boolean
|
||||||
timeout:
|
timeout:
|
||||||
default: 20s
|
default: 20s
|
||||||
description: The timeout for download operations, defaults to 20s.
|
description: The timeout for download operations, defaults to 20s.
|
||||||
|
|
|
@ -89,6 +89,10 @@ spec:
|
||||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
suspend:
|
||||||
|
description: This flag tells the controller to suspend the reconciliation
|
||||||
|
of this source.
|
||||||
|
type: boolean
|
||||||
timeout:
|
timeout:
|
||||||
default: 20s
|
default: 20s
|
||||||
description: The timeout for remote Git operations like cloning, defaults
|
description: The timeout for remote Git operations like cloning, defaults
|
||||||
|
|
|
@ -86,6 +86,10 @@ spec:
|
||||||
- kind
|
- kind
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
|
suspend:
|
||||||
|
description: This flag tells the controller to suspend the reconciliation
|
||||||
|
of this source.
|
||||||
|
type: boolean
|
||||||
valuesFile:
|
valuesFile:
|
||||||
description: Alternative values file to use as the default chart values,
|
description: Alternative values file to use as the default chart values,
|
||||||
expected to be a relative path in the SourceRef. Ignored when omitted.
|
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?'
|
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
suspend:
|
||||||
|
description: This flag tells the controller to suspend the reconciliation
|
||||||
|
of this source.
|
||||||
|
type: boolean
|
||||||
timeout:
|
timeout:
|
||||||
default: 60s
|
default: 60s
|
||||||
description: The timeout of index downloading, defaults to 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.
|
// consult the documentation for your version to find out what those are.
|
||||||
// +optional
|
// +optional
|
||||||
Ignore *string `json:"ignore,omitempty"`
|
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 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:
|
and [artifact](#source-status) of the source to clients without the prerequisite of knowing the source kind:
|
||||||
|
|
||||||
````go
|
````go
|
||||||
|
@ -21,7 +21,7 @@ type Source interface {
|
||||||
|
|
||||||
### Source reconciliation
|
### 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
|
```go
|
||||||
type SourceSpec struct {
|
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)"
|
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 status
|
||||||
|
|
||||||
Source objects should contain a status sub-resource that embeds an artifact object:
|
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.
|
// consult the documentation for your version to find out what those are.
|
||||||
// +optional
|
// +optional
|
||||||
Ignore *string `json:"ignore,omitempty"`
|
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.
|
// relative path in the SourceRef. Ignored when omitted.
|
||||||
// +optional
|
// +optional
|
||||||
ValuesFile string `json:"valuesFile,omitempty"`
|
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.
|
// The timeout of index downloading, defaults to 60s.
|
||||||
// +optional
|
// +optional
|
||||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
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