ks-devops icon indicating copy to clipboard operation
ks-devops copied to clipboard

Consider Update the version of controller-runtime

Open chengleqi opened this issue 3 years ago • 1 comments

I encountered a strange problem when I wrote unit test due to the version of controller-runtime.

I use code like this r.Client.List(..., &unstructured.UnstructuredList{}, ...), It run correctly when the Client is RestClient, but It'll run into error when the client is fake client in the unit test scenario.

I found the root cause is this issue, but the PR which fix this issue was merged only in the 0.9.x version of controller-runtime, I tried to update the controller-runtime v0.6.3 => v0.9.7 but It caused too many changes.

So I Added code manually like this in the unit test:

schema.AddKnownTypeWithName(apischema.GroupVersionKind{
        Group:   "helm.toolkit.fluxcd.io",
        Version: "v2beta1",
        Kind:    "HelmReleaseList",
}, &unstructured.UnstructuredList{})

And the fluxcd project actually provide the module which include the HelmRelease type for convenience. But It also need higher version of controller-runtime.

Is it possible to update the controller-runtime version when it arrive version 1.0 or LTS ?

chengleqi avatar Jul 25 '22 08:07 chengleqi

We'd better upgrade controller-runtime at some point. We already talked about this in https://github.com/kubesphere/ks-devops/issues/353

But as you mentioned, it requires a lot of work on this. I'd like to do it once I got enough time. But please feel free to help on this if there is anyone willing to do it.

LinuxSuRen avatar Jul 25 '22 08:07 LinuxSuRen