-
Notifications
You must be signed in to change notification settings - Fork 707
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
Update module sigs.k8s.io/controller-runtime to v0.15.0 #6847
Conversation
The package Also, func EnqueueRequestForOwner(scheme *runtime.Scheme, mapper meta.RESTMapper, ownerType client.Object, opts ...OwnerOption) EventHandler { Support to add dynamically watchers has been added:
But not to remove them:
Hence, we'll update our own custom implementation for now. |
5003f3b
to
e562b22
Compare
…y opts.Cache.Namespaces
e562b22
to
7053253
Compare
WithObjects(initObjs...). | ||
WithStatusSubresource(initObjs...). | ||
WithScheme(clientgoscheme.Scheme). | ||
Build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now important to call WithStatusSubresource()
explicitly in NewFakeClient()
.
Conditions: commonv1alpha1.Conditions{commonv1alpha1.Condition{Type: "ReconciliationComplete", Status: "True"}}, | ||
InProgressOperations: noInProgressOperations, | ||
}, | ||
).BuildAndCopy(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no more a 409/resource conflict
in this unit test and the status resource is well updated.
Need to spend a bit more time tomorrow but so far it looks really good and uncontroversial to me! |
log.Info("Polling for the webhook certificate to be available", "path", keyPath) | ||
err := wait.PollImmediate(interval, timeout, func() (bool, error) { | ||
//nolint:staticcheck | ||
err := wait.PollImmediateWithContext(ctx, interval, timeout, func(_ context.Context) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PollImmediate
is deprecated but there was a mistake and the new functions are also deprecated, hence the nolint:staticcheck
to prevent the go linter from complaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@elasticmachine run elasticsearch-ci/docs |
This PR updates
sigs.k8s.io/controller-runtime
fromv0.14.6
tov0.15.0
and ECK due to breaking changes brought by this new version.Release Notes
kubernetes-sigs/controller-runtime
v0.15.0
Compare Source
Controller Runtime v0.15
Changes since v0.14.5
*http.Client
configurable and use/share the same client by default (#2122)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
.config/v1alpha1
types (#2149, #2200)Manager.Options
directly.pkg/inject
has been removed, this package contained long deprecated injection functions (likeInjectScheme
,InjectLogger
,InjectConfig
,InjectClient
,InjectCache
, etc.).Manager
to structs or interfaces that need them.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.source.Source
, useWatchesRawSource
.builder.Builder.WatchesMetadata
has been added to simplify watchingPartialObjectMetadata
objects.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.[..]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.handler.EventHandler
andhandler.Funcs
interfaces requirecontext.Context
as the first parameter for every method.handler.MapFunc
signature has changed and now requires acontext.Context
.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.client.New
(#2150)client.NewDelegatingClient
constructor andclient.NewDelegatingClientInput
struct have been removed.client.New
and setclient.Options.Cache
to customize the client's caching behavior.cluster.NewClientFunc
has been moved toclient.NewClientFunc
.cluster.ClientOptions
has been removed.cluster.DefaultNewClient
has been removed.cluster.ClientBuilderWithOptions
has been removed.manager.Options.Cache
is now the preferred way to customize the cache options for the manager.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.manager.Options.NewClient
, which has now been marked as a low level primitive.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
.manager.WebhookServer
instead.manager.Options.Port
manager.Options.Host
manager.Options.CertDir
manager.Options.TLSOpts
cache.BuilderWithOptions
(#2300)webhook/conversion
, removewebhook/admission.GetDecoder()
(#2144)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
:Result.Message
instead ofResult.Reason
(#1539)Validator
andCustomValidator
interfaces have been modified to allow returning warnings (#2014)WithStatusSubresource
option and pre-populating it withall in-tree resources that have a status subresource
Update
andPatch
methods now don't change the status for any suchresource anymore
Update
andPatch
methods now only change the statusfor any such resource
rest_client_request_latency_seconds
rest_client_request_duration_seconds
rest_client_request_size_bytes
rest_client_response_size_bytes
webhook.Server
struct is now an interfacewebhook.NewServer
can be used to pass in and customize the default serverlog.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.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.WithCustomMapper
,WithExperimentalLazyMapper
,WithLazyDiscovery
,WithLimiter
.DynamicRESTMapperOption
type has been removed.✨ New Features
Manager.Options.PprofBindAddress
.reconcile.TerminalError(...)
(#2325)controller_runtime_terminal_reconcile_errors_total
metric is incremented.🐛 Bug Fixes
🌱 Others
NewDynamicRESTMapper
(#2178)🌱 Dependencies
📖 Additionally, there have been 4 contributions to our documentation and book. (#2203, #2201, #2162, #2170)
Thanks to all our contributors! 😊
Initially generated by Mend Renovate. View repository job log here.