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

Upgrade controller-runtime to v0.7.0 #84

Merged
merged 1 commit into from
Jan 14, 2021
Merged

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Jan 12, 2021

This commit upgrades the controller-runtime dependency to v0.7.0,
including all changes required to make all wiring work again.

  • Upgrade runtime to v0.6.2 to include controller-runtime changes.
  • Logger has been removed from the reconciler, and is now retrieved
    from the context.Context passed to the Reconcile method and
    downwards functions.
  • Logger configuration flags are now bound to the flag set using
    BindFlags from runtime/logger, ensuring the same contract across
    GitOps Toolkit controllers, and the --log-json flag has been
    deprecated in favour of the --log-encoding=json default.
  • The ChangePredicate from runtime has changed to a
    ReconcileRequestedPredicate, and is now chained with the
    GenerationChangedPredicate from controller-runtime using
    predicate.Or.
  • Signatures that made use of runtime.Object have changed to
    client.Object, removing the requirement to e.g. call
    runtime.Object#Object.
  • The leader-election-role was changed, as leader election now works
    via the coordination/v1 API.

Other notable changes:

  • Upgrade of image-reflector-controller API package to include
    controller-runtime changes.
  • Upgrade of source-controller API package to v0.6.1.

Ref: fluxcd/flux2#613
Requires: fluxcd/image-reflector-controller#76

@hiddeco hiddeco force-pushed the controller-runtime-v0.7.0 branch from f481b57 to 5a93c15 Compare January 13, 2021 11:00
@hiddeco hiddeco force-pushed the controller-runtime-v0.7.0 branch 10 times, most recently from 66547cb to 734de9a Compare January 14, 2021 11:48
@hiddeco hiddeco marked this pull request as ready for review January 14, 2021 11:57
Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo thanks for this. It was easy to review because all the changes are carefully considered (and enumerated in the description).

Namespace: obj.Meta.GetNamespace(),
})
if err := r.List(ctx, &autoList, client.InNamespace(obj.GetNamespace()),
client.MatchingFields{repoRefKey: obj.GetName()}); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log message is removed here. I think it's ultimately OK (other GOTK controllers silently ignore errors in similar situations), I just want to flag it.

This commit upgrades the `controller-runtime` dependency to `v0.7.0`,
including all changes required to make all wiring work again.

- Upgrade `runtime` to v0.6.2 to include `controller-runtime` changes.
- Logger has been removed from the reconciler, and is now retrieved
  from the `context.Context` passed to the `Reconcile` method and
  downwards functions.
- Logger configuration flags are now bound to the flag set using
  `BindFlags` from `runtime/logger`, ensuring the same contract across
  GitOps Toolkit controllers, and the `--log-json` flag has been
  deprecated in favour of the `--log-encoding=json` default.
- The `ChangePredicate` from `runtime` has changed to a
  `ReconcileRequestedPredicate`, and is now chained with the
  `GenerationChangedPredicate` from `controller-runtime` using
  `predicate.Or`.
- Signatures that made use of `runtime.Object` have changed to
  `client.Object`, removing the requirement to e.g. call
  `runtime.Object#Object`.
- The `leader-election-role` was changed, as leader election now works
  via the `coordination/v1` API.

Other notable changes:

- Upgrade of `image-reflector-controller` API package to include
  controller-runtime changes.
- Upgrade of `source-controller` API package to v0.6.1.

Signed-off-by: Hidde Beydals <[email protected]>
@hiddeco hiddeco force-pushed the controller-runtime-v0.7.0 branch from 734de9a to 0531dea Compare January 14, 2021 12:49
@hiddeco hiddeco merged commit 0fc8d60 into main Jan 14, 2021
@hiddeco hiddeco deleted the controller-runtime-v0.7.0 branch January 14, 2021 12:58
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

Successfully merging this pull request may close these issues.

3 participants