Rename syncAt annotation to reconcileAt

Use `fluxcd.io/reconcileAt` annotation across all controllers.
This commit is contained in:
stefanprodan 2020-07-13 15:45:13 +03:00
parent dd9563ba98
commit b3e58b48dd
6 changed files with 11 additions and 18 deletions

View File

@ -13,6 +13,7 @@ type Source interface {
}
const (
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
// ReconcileAtAnnotation is the annotation used for triggering a
// reconciliation outside of the defined schedule.
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
)

View File

@ -2,8 +2,6 @@ apiVersion: source.fluxcd.io/v1alpha1
kind: GitRepository
metadata:
name: gitrepository-sample
annotations:
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
spec:
interval: 1m
url: https://github.com/stefanprodan/podinfo

View File

@ -45,8 +45,8 @@ func (SourceChangePredicate) Update(e event.UpdateEvent) bool {
}
// handle force sync
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.SyncAtAnnotation]; ok {
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.SyncAtAnnotation]; okOld {
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; ok {
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; okOld {
if val != valOld {
return true
}

View File

@ -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:
@ -37,15 +37,16 @@ The controller can be told to check for updates right away by setting an annotat
```go
const (
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
// ReconcileAtAnnotation is the annotation used for triggering a
// reconciliation outside of the defined schedule.
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
)
```
Trigger source sync example:
Trigger source reconciliation example:
```bash
kubectl annotate --overwrite gitrepository/podinfo source.fluxcd.io/syncAt="$(date +%s)"
kubectl annotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)"
```
### Source status

View File

@ -73,10 +73,6 @@ apiVersion: source.fluxcd.io/v1alpha1
kind: HelmChart
metadata:
name: redis
namespace: default
annotations:
# force sync trigger
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
spec:
name: redis
version: 10.5.7
@ -92,7 +88,6 @@ apiVersion: source.fluxcd.io/v1alpha1
kind: HelmChart
metadata:
name: redis
namespace: default
spec:
name: redis
version: ^10.0.0

View File

@ -71,7 +71,6 @@ apiVersion: source.fluxcd.io/v1alpha1
kind: HelmRepository
metadata:
name: stable
namespace: default
spec:
url: https://kubernetes-charts.storage.googleapis.com/
interval: 10m
@ -84,7 +83,6 @@ apiVersion: source.fluxcd.io/v1alpha1
kind: HelmRepository
metadata:
name: private
namespace: default
spec:
url: https://charts.example.com
secretRef: