Skip to content
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

fix(deps): Upgrade sigs.k8s.io/controller-runtime to 0.17.4 #5562

Merged
merged 8 commits into from
May 3, 2024

Conversation

sakoush
Copy link
Member

@sakoush sakoush commented May 2, 2024

What this PR does / why we need it:

This PR upgrades controller-runtime from v0.11.2 to v0.17.4 (~2 years difference). Note that there is a newer version of this package v0.18.1 but it requires go 1.22 and we are currently at go 1.21.

It required changes as the api has moved since then:

  • ctrl.NewManager
  • reconcilers (included dummy context parameter)
  • watcher signatures
  • secrets handlers return

Which issue(s) this PR fixes:

Fixes INFRA-680 (internal)

TODO:

  • Integration test with and without clusterwide installation

@sakoush sakoush requested a review from lc525 as a code owner May 2, 2024 16:41
@sakoush sakoush added the v2 label May 2, 2024
@sakoush sakoush marked this pull request as draft May 2, 2024 16:42
@sakoush sakoush marked this pull request as ready for review May 3, 2024 10:40
@@ -46,7 +45,7 @@ func TestAPIs(t *testing.T) {
RunSpecsWithDefaultAndCustomReporters(
t,
"Controller Suite",
[]Reporter{printer.NewlineReporter{}},
Copy link
Member Author

@sakoush sakoush May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this library printer doesnt exist anymore in controller-runtime and I dont think it is required for testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appreciate the comment, helpful to know why the change was needed!

@@ -63,16 +66,16 @@ func main() {
logger := zap.New(zap.UseFlagOptions(&opts))
ctrl.SetLogger(logger)

watchNamespace := namespace
watchNamespaceConfig := map[string]cache.Config{namespace: {}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description of the new api is here

@@ -213,7 +212,7 @@ func (r *SeldonRuntimeReconciler) updateStatus(seldonRuntime *mlopsv1alpha1.Seld
}

// Find SeldonRuntimes that reference the changes SeldonConfig
func (r *SeldonRuntimeReconciler) mapSeldonRuntimesFromSeldonConfig(obj client.Object) []reconcile.Request {
func (r *SeldonRuntimeReconciler) mapSeldonRuntimesFromSeldonConfig(_ context.Context, obj client.Object) []reconcile.Request {
logger := log.FromContext(context.Background()).WithName("mapSeldonRuntimesFromSeldonConfig")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to pass the (currently unnamed) Context function argument here?

Copy link
Member Author

@sakoush sakoush May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caller doesnt have a Context though as far as I can tell, I will add a TODO in the code to look at it more deeply.

@@ -184,7 +183,7 @@ func (r *ServerReconciler) updateStatus(server *mlopsv1alpha1.Server) error {
}

// Find Servers that need reconcilliation from a change to a given ServerConfig
func (r *ServerReconciler) mapServerFromServerConfig(obj client.Object) []reconcile.Request {
func (r *ServerReconciler) mapServerFromServerConfig(_ context.Context, obj client.Object) []reconcile.Request {
logger := log.FromContext(context.Background()).WithName("mapServerFromServerConfig")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar context question as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a TODO in the code as per the answer in the previous review comment.

Copy link
Member

@lc525 lc525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, with just one comment/question

@sakoush sakoush merged commit eae02a8 into SeldonIO:v2 May 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants