Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reconcile annotation helpers in controllers #39

Closed
5 tasks done
squaremo opened this issue Oct 22, 2020 · 1 comment
Closed
5 tasks done

Use reconcile annotation helpers in controllers #39

squaremo opened this issue Oct 22, 2020 · 1 comment
Assignees

Comments

@squaremo
Copy link
Member

squaremo commented Oct 22, 2020

For each project that uses the reconcileAt annotation:

  • bump its version of pkg/runtime to 0.1.2 (this picks up the new Changed predicate):
go get github.com/fluxcd/pkg/runtime@v0.1.2
  • ensure api/go.mod also has pkg/apis/meta v0.1.0 (this means you can use the status struct embed), with a similar go get
  • remove the LastHandledReconcileAt field from status and embed meta.ReconcileRequestStatus inline, instead:
type ThingStatus struct {
    // ...
    meta.ReconcileRequestStatus `json:",inline"`
}
  • run make manifests to update the CRD; it should not alter the schema, only a doc string
  • run make api-docs (if there is one) to update docs. This does make a material change.
  • if there's anywhere that refers to something.GetAnnotation()[meta.ReconcileAtAnnotation], change it to use meta.ReconcileAnnotationValue(something.GetAnnotations())
  • change something.Status.LastHandledReconcileAt to something.Status.GetLastHandledReconcileRequest(), and something.Status.LastHandledReconcileAt = now to something.Status.SetLastHandledReconcileRequest(now)

Projects:

Finally:

Once all of those have been updated and a minor version released, think about changing the annotation used by the command-line tool and the notification-controller, which both write the annotation. (EDIT: I think updating the CLI should wait for a minor version release, since it's a minor breaking change in the sense that the new CLI won't work with older controllers.)

@stefanprodan
Copy link
Member

This was solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants