Skip to content

Commit

Permalink
Rename syncAt annotation to reconcileAt
Browse files Browse the repository at this point in the history
Use `fluxcd.io/reconcileAt` annotation across all controllers.
  • Loading branch information
stefanprodan committed Jul 13, 2020
1 parent 47d2393 commit f79ac6d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ kubectl -n gitops-system wait gitrepository/podinfo --for=condition=ready
The source controller will check for new commits in the master branch every minute. You can force a git sync with:

```bash
kubectl -n gitops-system nnotate --overwrite gitrepository/podinfo source.fluxcd.io/syncAt="$(date +%s)"
kubectl -n gitops-system nnotate --overwrite gitrepository/podinfo fluxcd.io/reconcileAt="$(date +%s)"
```

### Define a kustomization
Expand Down Expand Up @@ -159,7 +159,7 @@ You can trigger a kustomization reconciliation any time with:

```bash
kubectl -n gitops-system annotate --overwrite kustomization/podinfo-dev \
kustomize.fluxcd.io/syncAt="$(date +%s)"
fluxcd.io/reconcileAt="$(date +%s)"
```

When the source controller pulls a new Git revision, the kustomize controller will detect that the
Expand Down
6 changes: 3 additions & 3 deletions api/v1alpha1/kustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ func (in *Kustomization) GetTimeout() time.Duration {
}

const (
// SyncAtAnnotation is the annotation used for triggering a
// sync outside of the specified schedule.
SyncAtAnnotation string = "kustomize.fluxcd.io/syncAt"
// ReconcileAtAnnotation is the annotation used for triggering a
// reconciliation outside of the defined schedule.
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"

// SourceIndexKey is the key used for indexing kustomizations
// based on their sources.
Expand Down
6 changes: 3 additions & 3 deletions controllers/kustomization_predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func (KustomizationSyncAtPredicate) Update(e event.UpdateEvent) bool {
return true
}

// handle syncAt annotation
if val, ok := e.MetaNew.GetAnnotations()[kustomizev1.SyncAtAnnotation]; ok {
if valOld, okOld := e.MetaOld.GetAnnotations()[kustomizev1.SyncAtAnnotation]; okOld {
// handle reconcileAt annotation
if val, ok := e.MetaNew.GetAnnotations()[kustomizev1.ReconcileAtAnnotation]; ok {
if valOld, okOld := e.MetaOld.GetAnnotations()[kustomizev1.ReconcileAtAnnotation]; okOld {
if val != valOld {
return true
}
Expand Down
10 changes: 5 additions & 5 deletions docs/spec/v1alpha1/kustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ The interval time units are `s`, `m` and `h` e.g. `interval: 5m`, the minimum va

The kustomization execution can be suspended by setting `spec.susped` to `true`.

The controller can be told to execute the kustomization outside of the specified interval
The controller can be told to reconcile the kustomization outside of the specified interval
by annotating the kustomization object with:

```go
const (
// SyncAtAnnotation is the annotation used for triggering a
// sync outside of the specified schedule.
SyncAtAnnotation string = "kustomize.fluxcd.io/syncAt"
// ReconcileAtAnnotation is the annotation used for triggering a
// reconciliation outside of the defined schedule.
ReconcileAtAnnotation string = "fluxcd.io/reconcileAt"
)
```

On-demand execution example:

```bash
kubectl annotate --overwrite kustomization/podinfo kustomize.fluxcd.io/syncAt="$(date +%s)"
kubectl annotate --overwrite kustomization/podinfo fluxcd.io/reconcileAt="$(date +%s)"
```

## Garbage collection
Expand Down

0 comments on commit f79ac6d

Please sign in to comment.