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

Upgrade k8s depencencies in host for Openshift 4.16 #1125

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

ranakan19
Copy link
Contributor

Upgrades:

Tool/Library Current Version Updates to Version
Golang 1.20 1.21
Operator SDK 1.25 1.36
k8s.io/* v0.27.0 v0.29.2
controller-runtime v0.15 v0.17.3
controller-gen v0.12.0 v0.14.0

Changes in code wrt to controller-runtime upgrade (introduced in controller-runtime v0.16.0:

wrt: https://issues.redhat.com/browse/SANDBOX-686

main.go Outdated
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
WebhookServer: webhookServer,
Copy link
Contributor

Choose a reason for hiding this comment

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

the same question as in the member-operator PR - do we need the webhookServer configured?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its because port is deprecated and webhookServer replaces it.
from the documentation:

        // Port is the port that the webhook server serves at.
	// It is used to set webhook.Server.Port if WebhookServer is not set.
	//
	// Deprecated: Use WebhookServer instead. A WebhookServer can be created via webhook.NewServer.
	Port int

HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "dc07038f.toolchain.host.operator",
Namespace: namespace,
Cache: cache.Options{DefaultNamespaces: map[string]cache.Config{namespace: {}}},
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember we discussed it and you explained how this new Cache configuration works but I already forgot :)
This configuration looks confusing (why there is default namespace as a map with a key but no value) so maybe you can try to add some comments explaining how it works? Or maybe a link to docs where it's explained. But feel free to leave it as is if it's not trivial.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough, added the design doc link above in the comments in here - b70c114

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also removed webhook server, see comment

Copy link
Contributor

@rsoaresd rsoaresd left a comment

Choose a reason for hiding this comment

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

Nice work 🚀 Just on question:

go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
@@ -51,7 +51,7 @@ func TestNotificationSuccess(t *testing.T) {
notification, err := notify.NewNotificationBuilder(cl, test.HostOperatorNs).Create(context.TODO(), "[email protected]")
require.NoError(t, err)
notification.Status.Conditions = []toolchainv1alpha1.Condition{sentCond()}
require.NoError(t, cl.Update(context.TODO(), notification))
require.NoError(t, cl.Status().Update(context.TODO(), notification))
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my understanding, this change is related to dependency update ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good question. These changes are from the previous update of controller-runtime to v0.15 (see here) but missed it last time. This test didn't fail before so this change slipped by, but unit tests were failing now.

Copy link

openshift-ci bot commented Jan 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, ranakan19, rsoaresd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,ranakan19,rsoaresd]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@rsoaresd rsoaresd left a comment

Choose a reason for hiding this comment

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

@ranakan19 ranakan19 requested a review from metlos as a code owner January 24, 2025 19:10
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.64%. Comparing base (f35e54f) to head (c15d543).

Files with missing lines Patch % Lines
main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1125   +/-   ##
=======================================
  Coverage   79.64%   79.64%           
=======================================
  Files          79       79           
  Lines        8046     8047    +1     
=======================================
+ Hits         6408     6409    +1     
  Misses       1453     1453           
  Partials      185      185           
Files with missing lines Coverage Δ
main.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

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.

6 participants