Releases: kubernetes-sigs/controller-runtime
v0.15.1
What's Changed
- [release-0.15] ✨Fix logs in unstructured client by @k8s-infra-cherrypick-robot in #2344
- [release-0.15] 🐛 fix unspecified KindsFor version by @k8s-infra-cherrypick-robot in #2347
- [release-0.15] 🐛 fakeClient.Status().Update(...) cannot recognize resource version conflicts by @k8s-infra-cherrypick-robot in #2372
- [release-0.15] 🐛 hasLabels and matchingLabels step on each other by @k8s-infra-cherrypick-robot in #2373
- [release-0.15] 🐛 Fix Defaulting of the User Agent by @alvaroaleman in #2436
Full Changelog: v0.15.0...v0.15.1
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
⚠️ Breaking Changes
- Make
*http.Client
configurable and use/share the same client by default (#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 requiresGetHTTPClient()
method which must return an already configured, non-nil,*http.Client
for the Cluster. When usingcluster.New
to create Clusters, the client is created internally if not specified as anOptions
field.cluster.Options.MapperProvider
field now requires a*rest.Config
and*http.Client
.
- Deprecate Component Configuration
config/v1alpha1
types (#2149, #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.
- Remove dependency injection functions (#2134, #2120)
- The package
pkg/inject
has been removed, this package contained long deprecated injection functions (likeInjectScheme
,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.
- The package
- Improve
builder
package capabilities and general UX (#2135)builder.Builder.Watches
signature has changed, it now takes aclient.Object
instead of asource.Source
as first argument.- For
source.Source
, useWatchesRawSource
.
- For
builder.Builder.WatchesMetadata
has been added to simplify watchingPartialObjectMetadata
objects.
- Refactor cache.Options, deprecate MultiNamespacedCacheBuilder (#2157, #2166)
cache.Options.Namespace
has been removed in favor ofcache.Options.Namespaces
, a slice.cache.Options.Resync
has been renamed toSyncPeriod
.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, usecache.Options.ByObject[Object].Field
andcache.Options.ByObject[Object].Label
cache.Options.UnsafeDisableDeepCopyByObject
has been removed, usecache.Options.ByObject[Object].UnsafeDisableDeepCopy
.cache.Options.TransformByObject
has been removed, usecache.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)
handler.EventHandler
andhandler.Funcs
interfaces requirecontext.Context
as the first parameter for every method.handler.MapFunc
signature has changed and now requires acontext.Context
.
- Add client.{GroupVersionKindFor, IsObjectNamespaced} (#2136)
- The
client.Client
interface now requires and exposes these helper functions:GroupVersionKindFor(Object)
which returns theschema.GroupVersionKind
for the object.IsObjectNamespaced(Object)
which returnstrue
if the object's GroupVersionKind is namespaced, orfalse
for global ones.
- The
- Remove DelegatedClient, move all related options in
client.New
(#2150)client.NewDelegatingClient
constructor andclient.NewDelegatingClientInput
struct have been removed.- The DelegatingClient created a Client backed by a cache, use
client.New
and setclient.Options.Cache
to customize the client's caching behavior.
- The DelegatingClient created a Client backed by a cache, use
cluster.NewClientFunc
has been moved toclient.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, #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.
- Users can also keep using
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.
- Users can also keep using
manager.Options.SyncPeriod
has been deprecated in favor ofmanager.Options.Cache.SyncPeriod
.manager.Options.Namespace
has been deprecated in favor ofmanager.Options.Cache.Namespaces
.manager.Options.DryRunClient
has been deprecated in favor ofmanager.Options.Client.DryRun
.manager.Options.ClientDisableCacheFor
has been deprecated in favor ofmanager.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) - Add constructors for
webhook/conversion
, removewebhook/admission.GetDecoder()
(#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 usewebhook/conversion.NewWebhookHandler
instead.
pkg/webhook/admission
:- Testing: Fake client status handling (#2259)
- Added a new
WithStatusSubresource
option and pre-populating it with
all in-tree resources that have a status subresource Update
andPatch
methods now don't change the status for any such
resource anymore- The status clients
Update
andPatch
methods now only change the status
for any such resource
- Added a new
- Remove high cardinality metrics (#2217, #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, #2329)
- The
webhook.Server
struct is now an interface webhook.NewServer
can be used to pass in and customize the default server
- The
- Flatten fields in controller.Options (#2307)
- Update fake client deletionTimestamp behavior (#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)
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 aninit
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)
- Use and offer a single dynamic lazy RESTMapper (#2116, #2296)
- The following options have been removed:
WithCustomMapper
,WithExperimentalLazyMapper
,WithLazyDiscovery
,WithLimiter
. - The
DynamicRESTMapperOption
type has been removed.
- The following options have been removed:
✨ New Features
- Add cross-version compatibility with client-go 1.27 (#2223)
- Introduce pprof server to manager (#1943)
- To enable, use
Manager.Options.PprofBindAddress
.
- To enable, use
- Added interceptor client to intercept calls to a client (#2248 #2306)
- Add
reconcile.TerminalError(...)
(#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 Fixes
v0.14.6
What's Changed
- 🐛 Preserve unstructured object GVKs when using *ByObject cache options by @joelanford in #2249
Full Changelog: v0.14.5...v0.14.6
v0.14.5
What's Changed
- 🐛 Allow to set GracefulShutdownTimeout to -1, disabling timeouts in #2198
- 🌱 GVKForObject should handle multiple GVKs in Scheme gracefully in #2202
- ✨ Add rest client request duration and size metrics in #2218
- 🐛 Allow lazy restmapper to work with CRDs created at runtime in #2219
Full Changelog: v0.14.4...v0.14.5
v0.14.4
What's Changed
- ✨ Provide a truly lazy restmapper by @k8s-infra-cherrypick-robot in #2179
Full Changelog: v0.14.3...v0.14.4
v0.14.3
What's Changed
- ✨ Add additional SubResource* functions for FieldOwner by @k8s-infra-cherrypick-robot in #2153
- 🐛 Update golanci-lint script by @k8s-infra-cherrypick-robot in #2152
- 🌱 Bump kubebuilder-release-tools to v0.3.0 by @k8s-infra-cherrypick-robot in #2154
- 🌱 [0.14] Deprecate component configuration package by @vincepri in #2165
Full Changelog: v0.14.2...v0.14.3
v0.14.2
What's Changed
- [release-0.14] 🌱 Bump k8s.io/* to v0.26.1 by @sbueringer in #2146
Full Changelog: v0.14.1...v0.14.2
v0.14.1
Changes since v0.14.0
🐛 Bug Fixes
- 🐛 controllers without For() fail to start by @k8s-infra-cherrypick-robot in #2108
Full Changelog: v0.14.0...v0.14.1
v0.14.0
Changes since v0.13.1
⚠️ Breaking Changes
- Add Get functionality to SubResourceClient (#2094)
- Allow configuring RecoverPanic for controllers globally (#2093)
- Add client.SubResourceWriter (#2072)
- Support registration and removal of event handler (#2046)
- Update Kubernetes dependencies to v0.26 (#2043, #2087)
- Zap log: Default to RFC3339 time encoding (#2029)
- cache.BuilderWithOptions inherit options from caller (#1980)
- Migrate to ginkgo v2 (#1977), this removes the
pkg/envtest/printer
package
✨ New Features
- Builder: Do not require For (#2091)
- support disable deepcopy on list funcion (#2076)
- Add cluster.NewClientFunc with options (#2054)
- Tidy up startup logging of kindWithCache source (#2057)
- Add function to get reconcileID from context (#2056)
- feat: add NOT predicate (#2031)
- Allow to provide a custom lock interface to manager (#2027)
- Add tls options to manager.Options (#2023)
- Update Go version to 1.19 (#1986)
🐛 Bug Fixes
- Prevent manager from getting started a second time (#2090)
- Missing error log for in-cluster config (#2051)
- Skip custom mutation handler when delete a CR (#2049)
- fix: improve semantics of combining cache selectorsByObject (#2039)
- Conversion webhook should not panic when conversion request is nil (#1970)
🌱 Others
- Prepare for release 0.14 (#2100)
- Generate files and update modules (#2096)
- Bump github.com/onsi/ginkgo/v2 from 2.5.1 to 2.6.0 (#2097)
- Bump golang.org/x/time (#2089)
- Update OWNERS: remove inactive members, promote fillzpp sbueringer (#2088, #2092)
- Default ENVTEST version to a working one (1.24.2) (#2081)
- Update golangci-lint to v1.50.1 (#2080)
- Bump go.uber.org/zap from 1.23.0 to 1.24.0 (#2077)
- Bump golang.org/x/sys from 0.2.0 to 0.3.0 (#2078)
- Ignore Kubernetes Dependencies in Dependabot (#2071)
- Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0 (#2070)
- Bump github.com/onsi/ginkgo/v2 from 2.5.0 to 2.5.1 (#2066)
- seedling to dependabot (#2065)
- Bump github.com/onsi/gomega from 1.23.0 to 1.24.1 (#2062)
- Bump go.uber.org/zap from 1.21.0 to 1.23.0 (#2060)
- Bump actions/checkout from 2 to 3 (#2059)
- Bump golangci/golangci-lint-action from 2 to 3 (#2058)
- Add Dependabot for dependency management (#2050)
- Deprecate Webhook Server TLSMinVersion (#2041)
- Bump kubebuilder-release-tools to v0.2.0 (#2012)
- grammar: removed doubles of the word "the" (#2006)
- Refactor typed_client and unstructured_client to be consistent (#1795)
📖 Additionally, there have been 4 contributions to our documentation and book. (#2034, #2030, #2017, #1992)
Thanks to all our contributors! 😊
New Contributors
- @laxmikantbpandhare made their first contribution in #1986
- @Icarus9913 made their first contribution in #1992
- @Tomy2e made their first contribution in #1970
- @hyschumi made their first contribution in #1795
- @oscr made their first contribution in #2006
- @matteoolivi made their first contribution in #2017
- @johscheuer made their first contribution in #2027
- @larsks made their first contribution in #2030
- @johannesfrey made their first contribution in #1999
- @Eileen-Yu made their first contribution in #2034
- @iiiceoo made their first contribution in #2049
- @kannon92 made their first contribution in #2050
- @zbindenren made their first contribution in #2056
- @dependabot made their first contribution in #2058
- @Miciah made their first contribution in #2057
- @maciej-karas-form3 made their first contribution in #2051
- @qiankunli made their first contribution in #2076
- @lucacome made their first contribution in #2087
Full Changelog: v0.13.1...v0.14.0