kubernetes-sigs/controller-runtime (sigs.k8s.io/controller-runtime)
### [`v0.15.0`](https://togithub.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0)
[Compare Source](https://togithub.com/kubernetes-sigs/controller-runtime/compare/v0.14.6...v0.15.0)
##### Controller Runtime v0.15
> *A note from the maintainers*
>
> The following release is probably the largest in the history of the project. Controller Runtime is a foundational piece for almost all controllers and operators and we're aware that breaking changes are never an ask for our users, especially while running production services.
>
> We take breaking changes very seriously and carefully reviewed each one of these changes to improve the codebase, user experience, and future maintainability of the project.
>
> The v0.15 release is a stepping stone towards maturity.
>
> As always, please reach out in Slack in #controller-runtime.
## Changes since v0.14.5
##### :warning: Breaking Changes
- Make `*http.Client` configurable and use/share the same client by default ([#2122](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2122))
- When using the default Manager configuration, no immediate changes are needed.
- `client/apiutil.NewDynamicRESTMapper` signature has changed and now requires an `*http.Client` as parameter.
- `cluster.Cluster` interface requires `GetHTTPClient()` method which must return an already configured, non-nil, `*http.Client` for the Cluster. When using `cluster.New` to create Clusters, the client is created internally if not specified as an `Options` field.
- `cluster.Options.MapperProvider` field now requires a `*rest.Config` and `*http.Client`.
- Deprecate Component Configuration `config/v1alpha1` types ([#2149](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2149), [#2200](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2200))
- The Component Configuration package has been unmaintained for over a year and is no longer actively developed. There are (currently) no plans to revive the package, or provide an alternative.
- Users should migrate to a custom implementation that sets `Manager.Options` directly.
- 👉 Feedback requested: removal of the deprecated types and code is tracked in [#895](https://togithub.com/kubernetes-sigs/controller-runtime/issues/895).
- Remove dependency injection functions ([#2134](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2134), [#2120](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2120))
- The package `pkg/inject` has been removed, this package contained long deprecated injection functions (like `InjectScheme`, `InjectLogger`, `InjectConfig`, `InjectClient`, `InjectCache`, etc.).
- The runtime injection functionality has been deprecated since Controller Runtime 0.10; all of the above fields can be passed from the `Manager` to structs or interfaces that need them.
- Improve `builder` package capabilities and general UX ([#2135](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2135))
- `builder.Builder.Watches` signature has changed, it now takes a `client.Object` instead of a `source.Source` as first argument.
- For `source.Source`, use `WatchesRawSource`.
- `builder.Builder.WatchesMetadata` has been added to simplify watching `PartialObjectMetadata` objects.
- Refactor cache.Options, deprecate MultiNamespacedCacheBuilder ([#2157](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2157), [#2166](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2166))
- `cache.Options.Namespace` has been removed in favor of `cache.Options.Namespaces`, a slice.
- `cache.Options.Resync` has been renamed to `SyncPeriod`.
- `cache.Options.DefaultSelector` has been removed and split in two fields:
- `cache.Options.DefaultLabelSelector`
- `cache.Options.DefaultFieldSelector`
- `cache.Options.DefaultTransform` was added to provide a global transform function.
- `cache.Options.UnsafeDisableDeepCopy` was added to provide a global toggle to disable DeepCopy of the objects from the cache before returning them to clients.
- The following `[..]ByObject` field have been refactored:
- `cache.Options.SelectorsByObject` has been removed, use `cache.Options.ByObject[Object].Field` and `cache.Options.ByObject[Object].Label`
- `cache.Options.UnsafeDisableDeepCopyByObject` has been removed, use `cache.Options.ByObject[Object].UnsafeDisableDeepCopy`.
- `cache.Options.TransformByObject` has been removed, use `cache.Options.ByObject[Object].Transform`.
- `cache.ObjectAll` has been removed. This type was previously used to set selectors or transformation functions for every object, use the newly introduced default global options instead.
- Add context to EventHandler(s) ([#2139](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2139))
- `handler.EventHandler` and `handler.Funcs` interfaces require `context.Context` as the first parameter for every method.
- `handler.MapFunc` signature has changed and now requires a `context.Context`.
- Add client.{GroupVersionKindFor, IsObjectNamespaced} ([#2136](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2136))
- The `client.Client` interface now requires and exposes these helper functions:
- `GroupVersionKindFor(Object)` which returns the `schema.GroupVersionKind` for the object.
- `IsObjectNamespaced(Object)` which returns `true` if the object's GroupVersionKind is namespaced, or `false` for global ones.
- Remove DelegatedClient, move all related options in `client.New` ([#2150](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2150))
- `client.NewDelegatingClient` constructor and `client.NewDelegatingClientInput` struct have been removed.
- The DelegatingClient created a Client backed by a cache, use `client.New` and set `client.Options.Cache` to customize the client's caching behavior.
- `cluster.NewClientFunc` has been moved to `client.NewClientFunc`.
- `cluster.ClientOptions` has been removed.
- `cluster.DefaultNewClient` has been removed.
- `cluster.ClientBuilderWithOptions` has been removed.
- Expose Manager.Cache/Client options, deprecate older options ([#2199](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2199), [#2177](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2177))
- `manager.Options.Cache` is now the preferred way to customize the cache options for the manager.
- Users can also keep using `manager.Options.NewCache`, which has now been marked as a low level primitive.
- `manager.Options.Client` is now the preferred way to customize the client options for the manager.
- Users can also keep using `manager.Options.NewClient`, which has now been marked as a low level primitive.
- `manager.Options.SyncPeriod` has been deprecated in favor of `manager.Options.Cache.SyncPeriod`.
- `manager.Options.Namespace` has been deprecated in favor of `manager.Options.Cache.Namespaces`.
- `manager.Options.DryRunClient` has been deprecated in favor of `manager.Options.Client.DryRun`.
- `manager.Options.ClientDisableCacheFor` has been deprecated in favor of `manager.Options.Client.Cache.DisableCacheFor`.
- The following webhook server options have been deprecated, use `manager.WebhookServer` instead.
- `manager.Options.Port`
- `manager.Options.Host`
- `manager.Options.CertDir`
- `manager.Options.TLSOpts`
- Remove `cache.BuilderWithOptions` ([#2300](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2300))
- Add constructors for `webhook/conversion`, remove `webhook/admission.GetDecoder()` ([#2144](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2144))
- There are two set of changes related to the webhooks and how they're exposed. For users using the Manager, there should be minimal to no required changes.
- `webhook/admission/Webhook.GetDecoder()` method has been removed, it was unused before and relied on runtime dependency injection.
- `webhook/conversion.Webhook` struct has been un-exported. Users should use `webhook/conversion.NewWebhookHandler` instead.
- `pkg/webhook/admission`:
- Use `Result.Message` instead of `Result.Reason` ([#1539](https://togithub.com/kubernetes-sigs/controller-runtime/issues/1539))
- `Validator` and `CustomValidator` interfaces have been modified to allow returning warnings ([#2014](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2014))
- Testing: Fake client status handling ([#2259](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2259))
- Added a new `WithStatusSubresource` option and pre-populating it with
all in-tree resources that have a status subresource
- `Update` and `Patch` methods now don't change the status for any such
resource anymore
- The status clients `Update` and `Patch` methods now only change the status
for any such resource
- Remove high cardinality metrics ([#2217](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2217), [#2298](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2298))
- `rest_client_request_latency_seconds`
- `rest_client_request_duration_seconds`
- `rest_client_request_size_bytes`
- `rest_client_response_size_bytes`
- Allow passing a custom webhook server ([#2293](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2293), [#2329](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2329))
- The `webhook.Server` struct is now an interface
- `webhook.NewServer` can be used to pass in and customize the default server
- Flatten fields in controller.Options ([#2307](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2307))
- Update fake client deletionTimestamp behavior ([#2316](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2316))
- The fake client will panic if initialized with an object that has a DeletionTimestamp and no finalizer
- The fake client will silently ignore a DeletionTimestamp on an object in a Create request, matching the behavior of the kube-apiserver
- Unexport delegating logger, remove async init ([#2317](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2317))
- `log.DelegatingLogSink` has been unexported, this logger should never be used on its own, and it's only meant to be used within controller-runtime initialization process.
- Previously, when the `pkg/log` package was imported, there was an `init` function that spawned a goroutine, which set a null logger after 30 seconds. Now this logic has been removed, and instead incorporated into the delegating logger private implementation.
- Change webhook request received / response written logs to log level 4 ([#2334](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2334))
- Use and offer a single dynamic lazy RESTMapper ([#2116](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2116), [#2296](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2296))
- The following options have been removed: `WithCustomMapper`, `WithExperimentalLazyMapper`, `WithLazyDiscovery`, `WithLimiter`.
- The `DynamicRESTMapperOption` type has been removed.
##### :sparkles: New Features
- Add cross-version compatibility with client-go 1.27 ([#2223](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2223))
- Introduce pprof server to manager ([#1943](https://togithub.com/kubernetes-sigs/controller-runtime/issues/1943))
- To enable, use `Manager.Options.PprofBindAddress`.
- Added interceptor client to intercept calls to a client ([#2248](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2248) [#2306](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2306))
- Add `reconcile.TerminalError(...)` ([#2325](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2325))
- By wrapping an error with the above package-level function, the controller won't retry the request again in an exponential backoff loop.
- The error is logged, and the `controller_runtime_terminal_reconcile_errors_total` metric is incremented.
##### :bug: Bug Fixes
- Use correct context to cancel "list and watch" & wait for all informers to complete ([#2121](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2121))
- Client: use passed in Cache.DisableFor option ([#2303](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2303))
- Fix race condition in channel source ([#2286](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2286))
- ForceOwnership should work with subresources ([#2257](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2257))
- Fix error string in CacheReader.List ([#2256](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2256))
- Fix a bug in multinamespaced cache implementation ([#2252](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2252))
- Allow lazy restmapper to work with CRDs created at runtime ([#2208](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2208))
- Set DeleteStateUnknown in DeleteEvent when obj is DeletedFinalStateUnknown ([#2212](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2212))
- Allow to set GracefulShutdownTimeout to -1, disabling timeouts ([#2169](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2169))
- pkg/certwatcher: Start should retry for 10s when adding files ([#2160](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2160))
- Don't share error concurrently in test ([#2158](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2158))
##### :seedling: Others
- Improve unstructured serialisation ([#2147](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2147))
- Handle TLSOpts.GetCertificate in webhook ([#2291](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2291))
- Kind source should expose type information on timeout ([#2290](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2290))
- Fakeclient: Add support for evictions ([#2305](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2305))
- envtest: set default webhook options for polling ([#2289](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2289))
- Add client.InNamespace("xyz").AsSelector() ([#2282](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2282))
- Update golanci-lint script ([#2151](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2151))
- Preserve unstructured object GVKs in cache.Options.ByObject ([#2246](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2246))
- Don't call defaultOpts for MultiNamespaceCache twice ([#2234](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2234))
- GVKForObject should handle multiple GVKs in Scheme gracefully ([#2192](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2192))
- verify.sh: verify generate & modules (in CI) ([#2186](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2186))
- code clean for pkg/envtest/server.go ([#2180](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2180))
- Return an error if no httpClient is provided for `NewDynamicRESTMapper` ([#2178](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2178))
- Use runtime.Unstructured interface instead of Unstructured struct ([#2168](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2168))
- Return an error if no httpClient is provided ([#2164](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2164))
- Return the error from rest.HTTPClientFor instead of hiding it ([#2161](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2161))
- fix default value for cfg.Burst ([#2142](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2142))
- Add more linters ([#2133](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2133))
- Remove pkg/patterns ([#2132](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2132))
- Further cleanup internal/informers ([#2130](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2130))
- Simplify cache.objectTypeForListObject ([#2131](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2131))
- Refactor internal cache/informers map impl ([#2103](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2103))
- client/cache/client_cache.go should be called resources ([#2111](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2111))
- Remove reviewers which are also approvers ([#2109](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2109))
- Use HTTPClient to create the API Reader ([#2163](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2163))
- Update SECURITY_CONTACTS and maintainer list ([#2318](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2318))
- Update builtin webhook paths ([#2319](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2319))
- Make metrics and health probe servers be Runnables ([#2275](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2275))
- Revert: move health probes to runnable ([#2321](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2321))
- Fix comment on MultiNamespaceCache ([#2323](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2323))
- Cleanup webhook logging ([#2326](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2326))
- Add certwatcher callback ([#2301](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2301))
- Fix a bug in multinamespaced cache implementation ([#2288](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2288))
##### :seedling: Dependencies
- Bump Go to 1.20 ([#2279](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2279))
- Bump github.com/go-logr/logr from v1.2.3 to v1.2.4 ([#2262](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2262))
- Bump github.com/go-logr/zapr from v1.2.3 to v1.2.4 ([#2320](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2320))
- Bump github.com/onsi/ginkgo/v2 from v2.6.1 to v2.9.5 ([#2123](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2123) [#2155](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2155) [#2194](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2194) [#2205](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2205) [#2224](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2224) [#2233](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2233) [#2251](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2251) [#2311](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2311) [#2328](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2328))
- Bump github.com/onsi/gomega from v1.24.1 to v1.27.7 ([#2106](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2106) [#2137](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2137) [#2156](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2156) [#2206](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2206) [#2227](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2227) [#2232](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2232) [#2260](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2260) [#2340](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2340))
- Bump github.com/prometheus/client_golang from v1.14.0 to v1.15.1 ([#2280](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2280) [#2310](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2310))
- Bump github.com/prometheus/client_model from v0.3.0 to v0.4.0 ([#2312](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2312))
- Bump go.uber.org/goleak from v1.2.0 to v1.2.1 ([#2195](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2195))
- Bump golang.org/x/sys from v0.3.0 to v0.8.0 ([#2124](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2124) [#2225](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2225) [#2270](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2270) [#2309](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2309))
- Bump k8s.io dependencies to 0.27.2 ([#2145](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2145) [#2330](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2330) [#2333](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2333))
- Bump k8s.io/klog/v2 from v2.80.1 to v2.90.1 ([#2138](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2138) [#2226](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2226))
- Bump sigs.k8s.io/controller-tools to v0.11.3 and apidiff to v0.5.0 ([#2187](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2187))
- Use Go 1.19 in golangci-lint action ([#2272](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2272))
- Bump golangci-lint to v1.52.1 ([#2188](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2188) [#2284](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2284))
- Bump kubebuilder-release-tools to v0.3.0 ([#2126](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2126))
:book: Additionally, there have been 4 contributions to our documentation and book. ([#2203](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2203), [#2201](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2201), [#2162](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2162), [#2170](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2170))
*Thanks to all our contributors!* 😊
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
v0.14.6
->v0.15.0
Release Notes
kubernetes-sigs/controller-runtime (sigs.k8s.io/controller-runtime)
### [`v0.15.0`](https://togithub.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0) [Compare Source](https://togithub.com/kubernetes-sigs/controller-runtime/compare/v0.14.6...v0.15.0) ##### Controller Runtime v0.15 > *A note from the maintainers* > > The following release is probably the largest in the history of the project. Controller Runtime is a foundational piece for almost all controllers and operators and we're aware that breaking changes are never an ask for our users, especially while running production services. > > We take breaking changes very seriously and carefully reviewed each one of these changes to improve the codebase, user experience, and future maintainability of the project. > > The v0.15 release is a stepping stone towards maturity. > > As always, please reach out in Slack in #controller-runtime. ## Changes since v0.14.5 ##### :warning: Breaking Changes - Make `*http.Client` configurable and use/share the same client by default ([#2122](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2122)) - When using the default Manager configuration, no immediate changes are needed. - `client/apiutil.NewDynamicRESTMapper` signature has changed and now requires an `*http.Client` as parameter. - `cluster.Cluster` interface requires `GetHTTPClient()` method which must return an already configured, non-nil, `*http.Client` for the Cluster. When using `cluster.New` to create Clusters, the client is created internally if not specified as an `Options` field. - `cluster.Options.MapperProvider` field now requires a `*rest.Config` and `*http.Client`. - Deprecate Component Configuration `config/v1alpha1` types ([#2149](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2149), [#2200](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2200)) - The Component Configuration package has been unmaintained for over a year and is no longer actively developed. There are (currently) no plans to revive the package, or provide an alternative. - Users should migrate to a custom implementation that sets `Manager.Options` directly. - 👉 Feedback requested: removal of the deprecated types and code is tracked in [#895](https://togithub.com/kubernetes-sigs/controller-runtime/issues/895). - Remove dependency injection functions ([#2134](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2134), [#2120](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2120)) - The package `pkg/inject` has been removed, this package contained long deprecated injection functions (like `InjectScheme`, `InjectLogger`, `InjectConfig`, `InjectClient`, `InjectCache`, etc.). - The runtime injection functionality has been deprecated since Controller Runtime 0.10; all of the above fields can be passed from the `Manager` to structs or interfaces that need them. - Improve `builder` package capabilities and general UX ([#2135](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2135)) - `builder.Builder.Watches` signature has changed, it now takes a `client.Object` instead of a `source.Source` as first argument. - For `source.Source`, use `WatchesRawSource`. - `builder.Builder.WatchesMetadata` has been added to simplify watching `PartialObjectMetadata` objects. - Refactor cache.Options, deprecate MultiNamespacedCacheBuilder ([#2157](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2157), [#2166](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2166)) - `cache.Options.Namespace` has been removed in favor of `cache.Options.Namespaces`, a slice. - `cache.Options.Resync` has been renamed to `SyncPeriod`. - `cache.Options.DefaultSelector` has been removed and split in two fields: - `cache.Options.DefaultLabelSelector` - `cache.Options.DefaultFieldSelector` - `cache.Options.DefaultTransform` was added to provide a global transform function. - `cache.Options.UnsafeDisableDeepCopy` was added to provide a global toggle to disable DeepCopy of the objects from the cache before returning them to clients. - The following `[..]ByObject` field have been refactored: - `cache.Options.SelectorsByObject` has been removed, use `cache.Options.ByObject[Object].Field` and `cache.Options.ByObject[Object].Label` - `cache.Options.UnsafeDisableDeepCopyByObject` has been removed, use `cache.Options.ByObject[Object].UnsafeDisableDeepCopy`. - `cache.Options.TransformByObject` has been removed, use `cache.Options.ByObject[Object].Transform`. - `cache.ObjectAll` has been removed. This type was previously used to set selectors or transformation functions for every object, use the newly introduced default global options instead. - Add context to EventHandler(s) ([#2139](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2139)) - `handler.EventHandler` and `handler.Funcs` interfaces require `context.Context` as the first parameter for every method. - `handler.MapFunc` signature has changed and now requires a `context.Context`. - Add client.{GroupVersionKindFor, IsObjectNamespaced} ([#2136](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2136)) - The `client.Client` interface now requires and exposes these helper functions: - `GroupVersionKindFor(Object)` which returns the `schema.GroupVersionKind` for the object. - `IsObjectNamespaced(Object)` which returns `true` if the object's GroupVersionKind is namespaced, or `false` for global ones. - Remove DelegatedClient, move all related options in `client.New` ([#2150](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2150)) - `client.NewDelegatingClient` constructor and `client.NewDelegatingClientInput` struct have been removed. - The DelegatingClient created a Client backed by a cache, use `client.New` and set `client.Options.Cache` to customize the client's caching behavior. - `cluster.NewClientFunc` has been moved to `client.NewClientFunc`. - `cluster.ClientOptions` has been removed. - `cluster.DefaultNewClient` has been removed. - `cluster.ClientBuilderWithOptions` has been removed. - Expose Manager.Cache/Client options, deprecate older options ([#2199](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2199), [#2177](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2177)) - `manager.Options.Cache` is now the preferred way to customize the cache options for the manager. - Users can also keep using `manager.Options.NewCache`, which has now been marked as a low level primitive. - `manager.Options.Client` is now the preferred way to customize the client options for the manager. - Users can also keep using `manager.Options.NewClient`, which has now been marked as a low level primitive. - `manager.Options.SyncPeriod` has been deprecated in favor of `manager.Options.Cache.SyncPeriod`. - `manager.Options.Namespace` has been deprecated in favor of `manager.Options.Cache.Namespaces`. - `manager.Options.DryRunClient` has been deprecated in favor of `manager.Options.Client.DryRun`. - `manager.Options.ClientDisableCacheFor` has been deprecated in favor of `manager.Options.Client.Cache.DisableCacheFor`. - The following webhook server options have been deprecated, use `manager.WebhookServer` instead. - `manager.Options.Port` - `manager.Options.Host` - `manager.Options.CertDir` - `manager.Options.TLSOpts` - Remove `cache.BuilderWithOptions` ([#2300](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2300)) - Add constructors for `webhook/conversion`, remove `webhook/admission.GetDecoder()` ([#2144](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2144)) - There are two set of changes related to the webhooks and how they're exposed. For users using the Manager, there should be minimal to no required changes. - `webhook/admission/Webhook.GetDecoder()` method has been removed, it was unused before and relied on runtime dependency injection. - `webhook/conversion.Webhook` struct has been un-exported. Users should use `webhook/conversion.NewWebhookHandler` instead. - `pkg/webhook/admission`: - Use `Result.Message` instead of `Result.Reason` ([#1539](https://togithub.com/kubernetes-sigs/controller-runtime/issues/1539)) - `Validator` and `CustomValidator` interfaces have been modified to allow returning warnings ([#2014](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2014)) - Testing: Fake client status handling ([#2259](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2259)) - Added a new `WithStatusSubresource` option and pre-populating it with all in-tree resources that have a status subresource - `Update` and `Patch` methods now don't change the status for any such resource anymore - The status clients `Update` and `Patch` methods now only change the status for any such resource - Remove high cardinality metrics ([#2217](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2217), [#2298](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2298)) - `rest_client_request_latency_seconds` - `rest_client_request_duration_seconds` - `rest_client_request_size_bytes` - `rest_client_response_size_bytes` - Allow passing a custom webhook server ([#2293](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2293), [#2329](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2329)) - The `webhook.Server` struct is now an interface - `webhook.NewServer` can be used to pass in and customize the default server - Flatten fields in controller.Options ([#2307](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2307)) - Update fake client deletionTimestamp behavior ([#2316](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2316)) - The fake client will panic if initialized with an object that has a DeletionTimestamp and no finalizer - The fake client will silently ignore a DeletionTimestamp on an object in a Create request, matching the behavior of the kube-apiserver - Unexport delegating logger, remove async init ([#2317](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2317)) - `log.DelegatingLogSink` has been unexported, this logger should never be used on its own, and it's only meant to be used within controller-runtime initialization process. - Previously, when the `pkg/log` package was imported, there was an `init` function that spawned a goroutine, which set a null logger after 30 seconds. Now this logic has been removed, and instead incorporated into the delegating logger private implementation. - Change webhook request received / response written logs to log level 4 ([#2334](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2334)) - Use and offer a single dynamic lazy RESTMapper ([#2116](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2116), [#2296](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2296)) - The following options have been removed: `WithCustomMapper`, `WithExperimentalLazyMapper`, `WithLazyDiscovery`, `WithLimiter`. - The `DynamicRESTMapperOption` type has been removed. ##### :sparkles: New Features - Add cross-version compatibility with client-go 1.27 ([#2223](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2223)) - Introduce pprof server to manager ([#1943](https://togithub.com/kubernetes-sigs/controller-runtime/issues/1943)) - To enable, use `Manager.Options.PprofBindAddress`. - Added interceptor client to intercept calls to a client ([#2248](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2248) [#2306](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2306)) - Add `reconcile.TerminalError(...)` ([#2325](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2325)) - By wrapping an error with the above package-level function, the controller won't retry the request again in an exponential backoff loop. - The error is logged, and the `controller_runtime_terminal_reconcile_errors_total` metric is incremented. ##### :bug: Bug Fixes - Use correct context to cancel "list and watch" & wait for all informers to complete ([#2121](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2121)) - Client: use passed in Cache.DisableFor option ([#2303](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2303)) - Fix race condition in channel source ([#2286](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2286)) - ForceOwnership should work with subresources ([#2257](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2257)) - Fix error string in CacheReader.List ([#2256](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2256)) - Fix a bug in multinamespaced cache implementation ([#2252](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2252)) - Allow lazy restmapper to work with CRDs created at runtime ([#2208](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2208)) - Set DeleteStateUnknown in DeleteEvent when obj is DeletedFinalStateUnknown ([#2212](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2212)) - Allow to set GracefulShutdownTimeout to -1, disabling timeouts ([#2169](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2169)) - pkg/certwatcher: Start should retry for 10s when adding files ([#2160](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2160)) - Don't share error concurrently in test ([#2158](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2158)) ##### :seedling: Others - Improve unstructured serialisation ([#2147](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2147)) - Handle TLSOpts.GetCertificate in webhook ([#2291](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2291)) - Kind source should expose type information on timeout ([#2290](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2290)) - Fakeclient: Add support for evictions ([#2305](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2305)) - envtest: set default webhook options for polling ([#2289](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2289)) - Add client.InNamespace("xyz").AsSelector() ([#2282](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2282)) - Update golanci-lint script ([#2151](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2151)) - Preserve unstructured object GVKs in cache.Options.ByObject ([#2246](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2246)) - Don't call defaultOpts for MultiNamespaceCache twice ([#2234](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2234)) - GVKForObject should handle multiple GVKs in Scheme gracefully ([#2192](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2192)) - verify.sh: verify generate & modules (in CI) ([#2186](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2186)) - code clean for pkg/envtest/server.go ([#2180](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2180)) - Return an error if no httpClient is provided for `NewDynamicRESTMapper` ([#2178](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2178)) - Use runtime.Unstructured interface instead of Unstructured struct ([#2168](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2168)) - Return an error if no httpClient is provided ([#2164](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2164)) - Return the error from rest.HTTPClientFor instead of hiding it ([#2161](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2161)) - fix default value for cfg.Burst ([#2142](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2142)) - Add more linters ([#2133](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2133)) - Remove pkg/patterns ([#2132](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2132)) - Further cleanup internal/informers ([#2130](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2130)) - Simplify cache.objectTypeForListObject ([#2131](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2131)) - Refactor internal cache/informers map impl ([#2103](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2103)) - client/cache/client_cache.go should be called resources ([#2111](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2111)) - Remove reviewers which are also approvers ([#2109](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2109)) - Use HTTPClient to create the API Reader ([#2163](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2163)) - Update SECURITY_CONTACTS and maintainer list ([#2318](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2318)) - Update builtin webhook paths ([#2319](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2319)) - Make metrics and health probe servers be Runnables ([#2275](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2275)) - Revert: move health probes to runnable ([#2321](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2321)) - Fix comment on MultiNamespaceCache ([#2323](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2323)) - Cleanup webhook logging ([#2326](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2326)) - Add certwatcher callback ([#2301](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2301)) - Fix a bug in multinamespaced cache implementation ([#2288](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2288)) ##### :seedling: Dependencies - Bump Go to 1.20 ([#2279](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2279)) - Bump github.com/go-logr/logr from v1.2.3 to v1.2.4 ([#2262](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2262)) - Bump github.com/go-logr/zapr from v1.2.3 to v1.2.4 ([#2320](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2320)) - Bump github.com/onsi/ginkgo/v2 from v2.6.1 to v2.9.5 ([#2123](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2123) [#2155](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2155) [#2194](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2194) [#2205](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2205) [#2224](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2224) [#2233](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2233) [#2251](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2251) [#2311](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2311) [#2328](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2328)) - Bump github.com/onsi/gomega from v1.24.1 to v1.27.7 ([#2106](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2106) [#2137](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2137) [#2156](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2156) [#2206](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2206) [#2227](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2227) [#2232](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2232) [#2260](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2260) [#2340](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2340)) - Bump github.com/prometheus/client_golang from v1.14.0 to v1.15.1 ([#2280](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2280) [#2310](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2310)) - Bump github.com/prometheus/client_model from v0.3.0 to v0.4.0 ([#2312](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2312)) - Bump go.uber.org/goleak from v1.2.0 to v1.2.1 ([#2195](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2195)) - Bump golang.org/x/sys from v0.3.0 to v0.8.0 ([#2124](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2124) [#2225](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2225) [#2270](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2270) [#2309](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2309)) - Bump k8s.io dependencies to 0.27.2 ([#2145](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2145) [#2330](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2330) [#2333](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2333)) - Bump k8s.io/klog/v2 from v2.80.1 to v2.90.1 ([#2138](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2138) [#2226](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2226)) - Bump sigs.k8s.io/controller-tools to v0.11.3 and apidiff to v0.5.0 ([#2187](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2187)) - Use Go 1.19 in golangci-lint action ([#2272](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2272)) - Bump golangci-lint to v1.52.1 ([#2188](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2188) [#2284](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2284)) - Bump kubebuilder-release-tools to v0.3.0 ([#2126](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2126)) :book: Additionally, there have been 4 contributions to our documentation and book. ([#2203](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2203), [#2201](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2201), [#2162](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2162), [#2170](https://togithub.com/kubernetes-sigs/controller-runtime/issues/2170)) *Thanks to all our contributors!* 😊Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.