Skip to content

Commit 315c2d7

Browse files
authored
Merge pull request #86 from fluxcd/reconcile-annotation
Rename syncAt annotation to reconcileAt
2 parents dd9563b + b3e58b4 commit 315c2d7

File tree

6 files changed

+11
-18
lines changed

6 files changed

+11
-18
lines changed

api/v1alpha1/source.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type Source interface {
1313
}
1414

1515
const (
16-
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
17-
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
16+
// ReconcileAtAnnotation is the annotation used for triggering a
17+
// reconciliation outside of the defined schedule.
18+
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
1819
)

config/samples/source_v1alpha1_gitrepository.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apiVersion: source.fluxcd.io/v1alpha1
22
kind: GitRepository
33
metadata:
44
name: gitrepository-sample
5-
annotations:
6-
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
75
spec:
86
interval: 1m
97
url: https://github.com/stefanprodan/podinfo

controllers/predicate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (SourceChangePredicate) Update(e event.UpdateEvent) bool {
4545
}
4646

4747
// handle force sync
48-
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.SyncAtAnnotation]; ok {
49-
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.SyncAtAnnotation]; okOld {
48+
if val, ok := e.MetaNew.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; ok {
49+
if valOld, okOld := e.MetaOld.GetAnnotations()[sourcev1.ReconcileAtAnnotation]; okOld {
5050
if val != valOld {
5151
return true
5252
}

docs/spec/v1alpha1/common.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Source interface {
1919
}
2020
````
2121

22-
### Source synchronization
22+
### Source reconciliation
2323

2424
Source objects should contain a `spec.interval` field that tells the controller at which interval to check for updates:
2525

@@ -37,15 +37,16 @@ The controller can be told to check for updates right away by setting an annotat
3737

3838
```go
3939
const (
40-
// SyncAtAnnotation is the timestamp corresponding to an on-demand source sync.
41-
SyncAtAnnotation string = "source.fluxcd.io/syncAt"
40+
// ReconcileAtAnnotation is the annotation used for triggering a
41+
// reconciliation outside of the defined schedule.
42+
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
4243
)
4344
```
4445

45-
Trigger source sync example:
46+
Trigger source reconciliation example:
4647

4748
```bash
48-
kubectl annotate --overwrite gitrepository/podinfo source.fluxcd.io/syncAt="$(date +%s)"
49+
kubectl annotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)"
4950
```
5051

5152
### Source status

docs/spec/v1alpha1/helmcharts.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ apiVersion: source.fluxcd.io/v1alpha1
7373
kind: HelmChart
7474
metadata:
7575
name: redis
76-
namespace: default
77-
annotations:
78-
# force sync trigger
79-
source.fluxcd.io/syncAt: "2020-04-06T15:39:52+03:00"
8076
spec:
8177
name: redis
8278
version: 10.5.7
@@ -92,7 +88,6 @@ apiVersion: source.fluxcd.io/v1alpha1
9288
kind: HelmChart
9389
metadata:
9490
name: redis
95-
namespace: default
9691
spec:
9792
name: redis
9893
version: ^10.0.0

docs/spec/v1alpha1/helmrepositories.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ apiVersion: source.fluxcd.io/v1alpha1
7171
kind: HelmRepository
7272
metadata:
7373
name: stable
74-
namespace: default
7574
spec:
7675
url: https://kubernetes-charts.storage.googleapis.com/
7776
interval: 10m
@@ -84,7 +83,6 @@ apiVersion: source.fluxcd.io/v1alpha1
8483
kind: HelmRepository
8584
metadata:
8685
name: private
87-
namespace: default
8886
spec:
8987
url: https://charts.example.com
9088
secretRef:

0 commit comments

Comments
 (0)