tortoise icon indicating copy to clipboard operation
tortoise copied to clipboard

upgrade kubebuilder to plugin/v4

Open randytqwjp opened this issue 1 year ago • 1 comments

What this PR does / why we need it:

In place upgrade for kubebuilder to plugin v4

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

randytqwjp avatar Oct 10 '24 04:10 randytqwjp

Tests currently failing will take a look

randytqwjp avatar Oct 10 '24 04:10 randytqwjp

@sanposhiho After upgrading kubebuilder, controller with name tortoise already exists. Controller names must be unique to avoid multiple controllers reporting to the same metric. This error appears for every controller test after the first test. The way the controller tests are written for tortoise is very different from the documentation so i'm not sure how to fix this.. do you know if its possible to delete this controller in the cleanup?

randytqwjp avatar Oct 21 '24 18:10 randytqwjp

What if you move startController() like this?

	runTest := func(path string) {
		initializeResourcesFromFiles(ctx, k8sClient, filepath.Join(path, "before"))
-		stopFunc = startController(ctx)
		if os.Getenv("UPDATE_TESTCASES") == "true" {
			generateTestCases(path)
		} else {
			checkWithWantedResources(path)
		}
		cleanUp()
	}
+	BeforeEach(func() {
+		stopFunc = startController(ctx)
+	})

sanposhiho avatar Oct 22 '24 00:10 sanposhiho

@sanposhiho I fixed it with this m, err := manager.New(cfg, manager.Options{ Controller: config.Controller{ SkipNameValidation: ptr.To(true), }, }) apparently theres a new option to skip name validation. Maybe this was not present in previous controller-runtime version

randytqwjp avatar Oct 22 '24 19:10 randytqwjp

@sanposhiho Not sure what this exec error is for the tortoisectl test would you have any clue?

randytqwjp avatar Oct 22 '24 19:10 randytqwjp

@sanposhiho all the tests are passing but somehow lint is getting killed on the runner.. likely to be OOM? seems like the linter is using a lot of memory on the runner compared to my local

randytqwjp avatar Oct 23 '24 09:10 randytqwjp

@sanposhiho all the tests are passing but somehow lint is getting killed on the runner.. likely to be OOM? seems like the linter is using a lot of memory on the runner compared to my local

Looks like go version issue. Specified go1.22.6 and it works now

randytqwjp avatar Oct 23 '24 10:10 randytqwjp