diff --git a/api/v1alpha1/source.go b/api/v1alpha1/source.go index f82254a4..6b13b49b 100644 --- a/api/v1alpha1/source.go +++ b/api/v1alpha1/source.go @@ -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" ) diff --git a/config/samples/source_v1alpha1_gitrepository.yaml b/config/samples/source_v1alpha1_gitrepository.yaml index e7f3ce95..77011092 100644 --- a/config/samples/source_v1alpha1_gitrepository.yaml +++ b/config/samples/source_v1alpha1_gitrepository.yaml @@ -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 diff --git a/controllers/predicate.go b/controllers/predicate.go index 4f6ce208..2d1358dc 100644 --- a/controllers/predicate.go +++ b/controllers/predicate.go @@ -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 } diff --git a/docs/spec/v1alpha1/common.md b/docs/spec/v1alpha1/common.md index 26e5e10a..ae8910d9 100644 --- a/docs/spec/v1alpha1/common.md +++ b/docs/spec/v1alpha1/common.md @@ -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 diff --git a/docs/spec/v1alpha1/helmcharts.md b/docs/spec/v1alpha1/helmcharts.md index dbb5ca05..0daa7dd7 100644 --- a/docs/spec/v1alpha1/helmcharts.md +++ b/docs/spec/v1alpha1/helmcharts.md @@ -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 diff --git a/docs/spec/v1alpha1/helmrepositories.md b/docs/spec/v1alpha1/helmrepositories.md index a010c548..085f2006 100644 --- a/docs/spec/v1alpha1/helmrepositories.md +++ b/docs/spec/v1alpha1/helmrepositories.md @@ -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: