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 controller runtime to v0.17.5 and k8s api to v0.29.5 #4160

Merged
merged 9 commits into from
Jul 31, 2024

Conversation

xliuqq
Copy link
Collaborator

@xliuqq xliuqq commented Jun 12, 2024

Ⅰ. Describe what this PR does

Upgrade controller runtime to v0.17.5 and k8s api to v0.29.5.

Ⅱ. Does this pull request fix one issue?

fixes #XXXX

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@cheyang
Copy link
Collaborator

cheyang commented Jun 13, 2024

@xliuqq Please fix the code conflict. Thanks.

@cheyang
Copy link
Collaborator

cheyang commented Jun 14, 2024

/test fluid-e2e

Copy link

sonarcloud bot commented Jun 17, 2024

Quality Gate Passed Quality Gate passed

Issues
12 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.3% Duplication on New Code

See analysis details on SonarCloud

@xliuqq
Copy link
Collaborator Author

xliuqq commented Jun 18, 2024

/test fluid-e2e

@xliuqq
Copy link
Collaborator Author

xliuqq commented Jun 18, 2024

@cheyang the e2e-test was passed.

@xliuqq xliuqq force-pushed the upgrade branch 2 times, most recently from dac7f8a to 4935c99 Compare June 22, 2024 06:42
@xliuqq
Copy link
Collaborator Author

xliuqq commented Jun 22, 2024

/test fluid-e2e

@xliuqq
Copy link
Collaborator Author

xliuqq commented Jun 26, 2024

/test fluid-e2e

@xliuqq xliuqq requested a review from cheyang June 27, 2024 03:05
@xliuqq xliuqq force-pushed the upgrade branch 2 times, most recently from c34002f to b99d1ef Compare July 2, 2024 04:45
@xliuqq
Copy link
Collaborator Author

xliuqq commented Jul 16, 2024

/test fluid-e2e

@cheyang
Copy link
Collaborator

cheyang commented Jul 23, 2024

/retest

cmd/efc/app/efc.go Outdated Show resolved Hide resolved
Signed-off-by: xliuqq <[email protected]>
LeaderElection: enableLeaderElection,
LeaderElectionNamespace: leaderElectionNamespace,
LeaderElectionID: "juicefs.data.fluid.io",
Port: 9443,
NewCache: juicefsctl.NewCache(scheme),
Cache: juicefsctl.NewCache(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about using juicefsctl.NewCacheOption()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

SelectorsByObject: selectors,
})
return cache.Options{
ByObject: map[client.Object]cache.ByObject{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add scheme?

return cache.Options{
		Scheme: scheme,
		ByObject: map[client.Object]cache.ByObject{
			cronJobKey: {
				Label: labels.SelectorFromSet(labels.Set{
					common.JobPolicy: common.CronPolicy,
				}),
			},
		},
	}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no need to, as the Scheme field in ctrl.Options will used to create the default Client and Cache.

Copy link
Collaborator

Choose a reason for hiding this comment

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

How about setting scheme in cache option to keep consistency with previous version? My thought is to make it easy for maintenance. WDYT?

@@ -18,6 +18,7 @@ package app

import (
"os"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -36,7 +36,7 @@ func (b *BitMapAllocator) needResetReservedPorts() bool {
}

func newBitMapAllocator(pr *net.PortRange, log logr.Logger) (BatchAllocatorInterface, error) {
alloc, err := portallocator.New(*pr, func(max int, rangeSpec string) (allocator.Interface, error) {
alloc, err := portallocator.New(*pr, func(max int, rangeSpec string, offset int) (allocator.Interface, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add TODO for passing offset value. Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Copy link

sonarcloud bot commented Jul 29, 2024

@zwwhdls
Copy link
Member

zwwhdls commented Jul 30, 2024

/lgtm

Comment on lines +180 to +183
TypeMeta: metav1.TypeMeta{
Kind: "StatefulSet",
APIVersion: "apps/v1",
},
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary in new version of controller-runtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems related to kubernetes-sigs/controller-runtime#2633. If removed, test cases will fail.

@TrafalgarZZZ
Copy link
Member

/lgtm
/test fluid-e2e

Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link

fluid-e2e-bot bot commented Jul 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

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:

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

@fluid-e2e-bot fluid-e2e-bot bot merged commit 6a65a9e into fluid-cloudnative:master Jul 31, 2024
14 checks passed
@cheyang
Copy link
Collaborator

cheyang commented Jul 31, 2024

@xliuqq Thanks for your great contribution!

@xliuqq xliuqq deleted the upgrade branch August 9, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants