github kubernetes-sigs/controller-runtime v0.7.0

latest releases: v0.19.1, v0.19.0, v0.18.5...
3 years ago

Changes since v0.6.4

⚠️ Breaking Changes

Use client.Object & client.ObjectList

A number of methods that previously took runtime.Object & internally type-asserted them to metav1.Object now take client.Object (for non-list objects) or client.ObjectList (for lists). The practical upshot of this is more type-safety and clarity around what's required for particular methods.

All concrete API types (anything that implements runtime.Object & has a metadata field) already implement client.Object or client.ObjectList, so practical impact should be limited to folks who pass around runtime.Object values instead of concrete types.

  • Introduce and use client.Object and client.ObjectList (#1195)
  • Use client.Object for event handlers (#1118)
  • Fakeclient: Allow to pass ObjectLists to constructors (#1259)
  • client.ObjectKeyFromObject now uses client.Object (#1224)
  • Handler: Remove MapObject type and use client.Object directly (#1207)
  • Use client.Object interface in envtest (#1200)

High-Impact

  • pkg/webhook/admission: upgrade v1beta1 admission types to v1 (#1284)

    Impact: construct v1 Go types instead of v1beta1. Both versions are
    supported on the wire.

  • Change leaderlock from ConfigMap to ConfigMapsLeasesResourceLock (#1144)

    Impact: New RBAC permissions are needed by default for leaderelection (for
    the coordination/v1 API). The new lock will automatically deal with
    existing configmap locks (e.g. during upgrades). The can be set to its
    previous value ("configmaps") in manager.Options.

  • Propagate context.Context throughout the codebase (#1116)

    Impact: update various methods to accept a context.Context object, which
    can be used to structure timeouts and stopping loops/operations in lieu of
    channels

  • Change default webhook port to 9443 (#1076)

    Impact: update your deployment configuration to use port 9443, or manually
    configure the webhook port in manager Options.

  • Remove logs from internal controller (#1096)

    Impact: automatic logs for "succesful reconcile" no longer exist
    (it tended to duplicate manual logs that folks had in place).

  • Remove deprecated "--master" flag (#1039)

    Impact: update your controller client.Client's CLI configuration "--
    master" flag to "--kubeconfig"

  • Add a context w/ logger to Reconciler interface (#1054)

    Impact: add a context.Context parameter to your controller's
    Reconcile() method signature, which you can use throughout your
    Reconcile() function.

Others

  • Add ability for the delegating client to avoid caching objects (#1249) -- Impact: client.NewDelegatingClient() returns an error, and can accept GVKs to avoid caching

  • Use application/vnd.kubernetes.protobuf as content-type if possible (#1149) -- Impact: REST configs use a protobuf content-type when possible (object is not unstructured), minor changes to low-level function signatures

  • ComponentConfig Implementation (#891) -- Impact: a Manager can be configured by a ControllerManagerConfiguration or a custom defined configuration file. See the examples for usage details

  • DynamicRestMapper: return NoMatchError when resource doesn't exist (#1151) -- Impact: handle meta.NoKindMatchError/meta.NoResourceMatchError instead of apiutil.ErrRateLimited, which has been removed

  • admission responses with raw Status (#1129) -- Impact: APIStatus errors returned from high-level admission webhooks will now populate an admission response status (status codes, etc). If this is unintended, use a different error type.

  • Add support to read webhook configurations from files for WebhookInstallOptions (#1080) -- Impact: update envtest.WebhookInstallOptions.{DirectoryPaths -> Paths}

  • Expose RESTMapper on Client interface (#1109)

  • Expose Client runtime.Scheme (#1058)

  • Simplify usage of EnqueueRequestsFromMapFunc (#1119)

Removed Deprecated Items

  • Remove deprecated pkg/runtime/signals package (#1108) -- Impact: migrate to pkg/manager/signals

  • Remove deprecated pkg/runtime/scheme (#1107) -- Impact: migrate to pkg/scheme

  • Remove deprecated For/WithConfig from controller builder (#1102) -- Impact: update Builder.ForType() to Builder.For() and use builder.ControllerManagedBy() to pass a Manager's rest.Config to a Builder

  • Remove deprecated client.ConstantPatch function (#1103) -- Impact: update client.ConstantPatch to client.RawPatch

  • Remove deprecated pkg/client options (#1112) -- Impact: update client.{Create,Update,Path}DryRunAll to client.DryRunAll and client.MatchingField to client.MatchingFields

  • Remove reconciletest deprecated package (#1106) -- Impact: update your FakeReconciler controller tests to envtest-based tests

  • Remove deprecated pkg/runtime/log package and utils (#1105) -- Impact: migrate to pkg/log

  • Remove {Add,Remove}FinalizerWithError utils (#1104) -- Impact: use controllerutil.{Add,Remove}Finalizer() directly

✨ New Features

  • Add fake.NewClientBuilder to build new fake clients (#1281)
  • Allow passing the assets path bin via the env config (#1214)
  • Update k8s version in envtest (#1269)
  • Add predicate for annotations change on update event (#1254)
  • Updating Component Config error messages (#1251)
  • ComponentConfig alias for cfg.File() (#1244)
  • Allow to use builder.OnlyMetadata option with Watches (#1242)
  • metadata-only watches (#1174)
  • Zap: Add JSONEncoder and ConsoleEncoder opts (#1206)
  • envtest utility, defaultable flags (#972)
  • CreateOrPatch (#850)
  • Add error check for multiple apiTypes as reconciliation object (#1176)
  • Allow admission responses to send warnings (#1157)
  • Make leader election resourcelock configurable (#1147)
  • Update k8s.io dependencies to v0.19.0 (#1145)
  • Added Encoder Config Options field. (#915)
  • Add metrics for total workers and active workers (#1125)
  • Allow configuring LeaderElectionReleaseOnCancel (#1126)
  • Added the LabelSelectorPredicate function for filtering events (#1121)

🐛 Bug Fixes

  • Inject manager's logger instead of internal one (#1289)
  • Wait for metadata cache to sync (#1276)
  • Fix use of UnstructuredList with unregistered typed (#1238)
  • Fix the unserved version CRD install timeout in envtest (#1189)
  • Tracker upgrade should use gvk from scheme (#1213)
  • Controller reconcileHandler shouldn't stop a worker on error (#1196)
  • add error check when no apiType is provided for reconciliation (#1182)
  • Ensure that webhook server is thread/start-safe (#1155)
  • Controller.Watch() should not store watches if already started (#1163)
  • Source.Channel: Cope with pre-existing events in the channel (#1146)
  • Handle empty contexts in log.FromContext (#1141)
  • Controller: Return error when started more than once (#1139)
  • Avoid the redirection to /healthz/ when calling /healthz (#1134)
  • Fakeclient: Honor AllowUnconditionalUpdate and AllowCreateOnUpdate for resources that support it (#926)
  • Try to avoid event handling leaks (#1089)

📖 Documentation

  • fix minor typo for the GracefulShutdownTimeout field comments (#1239)
  • Improve docs for client.Object (#1231)
  • Add more details for what's included in a logger (#1203)
  • Be more specific about compat in VERSIONING (#1199)
  • Update versioning to reference common guidelines (#1198)
  • Fix typo (#1153)

🌱 Others

  • Add test that checks List works on UnstructuredList not in Scheme (#1288)
  • AddToProtobufScheme: Take AddToScheme, not Schemebulilder (#1279)
  • Use go-logr context functions (#1277)
  • Specify buckets for "controller_runtime_reconcile_time_seconds" histogram metrics (#1273)
  • Add back error logging for Reconcile implementation (#1245)
  • Use lowercase space separated keys (#1241)
  • Remove duplicate lines in controller.go (#1240)
  • Add controller.GetLogger (#1204)
  • Add ctrl.{LoggerFrom, LoggerInto} (#1202)
  • Use kubebuilder-release-tools (#1197)
  • Expose handler.MapFunc to allow implementers to test mappers (#1194)
  • Update Go mod version to 1.15 (#1187)
  • Un-deprecate NewFakeClient (#1101)
  • Proposal to extract cluster-specifics out of the Manager (#1075)
  • Update dependencies to v0.19.2 (#1170)
  • Update json-patch to v4.9.0 (#1136)
  • Fix typo in pull_request_template.md (#1133)
  • Propagate context on Manager.Start(...) (#1205) (intermediate change to #1116)
  • rename GetControllerManagerConfiguration to Complete (#1253) (intermediate change)

Thanks to all our contributors! 😊

Don't miss a new controller-runtime release

NewReleases is sending notifications on new releases.