-
Notifications
You must be signed in to change notification settings - Fork 47
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
bump k8s dependencies #98
bump k8s dependencies #98
Conversation
fee53ec
to
4692cf8
Compare
/lgtm |
Pull Request Test Coverage Report for Build 1117514105
💛 - Coveralls |
This commit bumps: 1. k8s dependencies to 1.21+ 2. Controller runtime to 0.9.2 3. Kubebuilder to the latest version at the time of this commit Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
dcee0ee
to
544f7c9
Compare
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
/cc @joelanford the apidiff breakage is due to the c-r bump, do we need to find a way to maintain that or are we good dropping it?
internal/cmd/run/cmd.go
Outdated
NewClient: func(cache cache.Cache, config *rest.Config, options client.Options, uncachedObjects ...client.Object) (client.Client, error) { | ||
// Create the client for Write operation | ||
c, err := client.New(config, options) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return client.NewDelegatingClient(client.NewDelegatingClientInput{ | ||
CacheReader: cache, | ||
Client: c, | ||
UncachedObjects: uncachedObjects, | ||
CacheUnstructured: true, | ||
}) | ||
}, |
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.
To make this re-usable and to de-clutter this file, what do you think about keeping pkg/manager/delegatingclient.go
around and defining a function there that returns a function with the NewClientFunc
signature.
It may even be possible (though maybe not necessary) to keep the existing code around (maybe deprecate it) and have this new function just wrap the existing code.
Something like:
func NewCachingClientFunc() cluster.NewClientFunc {
return func(cache cache.Cache, config *rest.Config, options client.Options, uncachedObjects ...client.Object) (client.Client, error) {
return NewCachingClientBuilder().WithUncached(uncachedObjects...).Build(cache, config, options)
}
}
This approach would let you keep the tests for this around in an easier-to-maintain way as well.
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.
@joelanford the previous implementation returned manager.ClientBuilder
which has been removed from controller-runtime, so we can't keep the existing code.
On creating a wrapper after removing existing code, do you mean having this ?
func NewCachingClientFunc() cluster.NewClientFunc {
return func(cache cache.Cache, config *rest.Config, options client.Options, uncachedObjects ...client.Object) (client.Client, error) {
c, err := client.New(config, options)
if err != nil {
return nil, err
}
return client.NewDelegatingClient(client.NewDelegatingClientInput{
CacheReader: cache,
Client: c,
UncachedObjects: uncachedObjects,
CacheUnstructured: true,
})
}
}
Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
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
This commit bumps:
This is to make the plugin compatible with the recent bump of dependencies in Operator SDK.