upgrade kubebuilder to plugin/v4
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:
Tests currently failing will take a look
@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?
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 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
@sanposhiho Not sure what this exec error is for the tortoisectl test would you have any clue?
@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
@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