Rename syncAt annotation to reconcileAt
Use `fluxcd.io/reconcileAt` annotation across all controllers.
This commit is contained in:
parent
dd9563ba98
commit
b3e58b48dd
|
@ -13,6 +13,7 @@ type Source interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
|
// ReconcileAtAnnotation is the annotation used for triggering a
|
||||||
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
|
// reconciliation outside of the defined schedule.
|
||||||
|
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,8 +2,6 @@ apiVersion: source.fluxcd.io/v1alpha1
|
||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: gitrepository-sample
|
name: gitrepository-sample
|
||||||
annotations:
|
|
||||||
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
|
|
||||||
spec:
|
spec:
|
||||||
interval: 1m
|
interval: 1m
|
||||||
url: https://github.com/stefanprodan/podinfo
|
url: https://github.com/stefanprodan/podinfo
|
||||||
|
|
|
@ -45,8 +45,8 @@ func (SourceChangePredicate) Update(e event.UpdateEvent) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle force sync
|
// handle force sync
|
||||||
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.SyncAtAnnotation]; ok {
|
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; ok {
|
||||||
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.SyncAtAnnotation]; okOld {
|
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; okOld {
|
||||||
if val != valOld {
|
if val != valOld {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ type Source interface {
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
### Source synchronization
|
### Source reconciliation
|
||||||
|
|
||||||
Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates:
|
Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates:
|
||||||
|
|
||||||
|
@ -37,15 +37,16 @@ The controller can be told to check for updates right away by setting an annotat
|
||||||
|
|
||||||
```go
|
```go
|
||||||
const (
|
const (
|
||||||
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
|
// ReconcileAtAnnotation is the annotation used for triggering a
|
||||||
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
|
// reconciliation outside of the defined schedule.
|
||||||
|
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Trigger source sync example:
|
Trigger source reconciliation example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl annotate --overwrite gitrepository/podinfo source.fluxcd.io/syncAt="$(date +%s)"
|
kubectl annotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Source status
|
### Source status
|
||||||
|
|
|
@ -73,10 +73,6 @@ apiVersion: source.fluxcd.io/v1alpha1
|
||||||
kind: HelmChart
|
kind: HelmChart
|
||||||
metadata:
|
metadata:
|
||||||
name: redis
|
name: redis
|
||||||
namespace: default
|
|
||||||
annotations:
|
|
||||||
# force sync trigger
|
|
||||||
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
|
|
||||||
spec:
|
spec:
|
||||||
name: redis
|
name: redis
|
||||||
version: 10.5.7
|
version: 10.5.7
|
||||||
|
@ -92,7 +88,6 @@ apiVersion: source.fluxcd.io/v1alpha1
|
||||||
kind: HelmChart
|
kind: HelmChart
|
||||||
metadata:
|
metadata:
|
||||||
name: redis
|
name: redis
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
name: redis
|
name: redis
|
||||||
version: ^10.0.0
|
version: ^10.0.0
|
||||||
|
|
|
@ -71,7 +71,6 @@ apiVersion: source.fluxcd.io/v1alpha1
|
||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: stable
|
name: stable
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
url: https://kubernetes-charts.storage.googleapis.com/
|
url: https://kubernetes-charts.storage.googleapis.com/
|
||||||
interval: 10m
|
interval: 10m
|
||||||
|
@ -84,7 +83,6 @@ apiVersion: source.fluxcd.io/v1alpha1
|
||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: private
|
name: private
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
url: https://charts.example.com
|
url: https://charts.example.com
|
||||||
secretRef:
|
secretRef:
|
||||||
|
|
Loading…
Reference in New Issue