Replies: 2 comments
-
I think you're right. The code generated by "create api" does seem to have a nil cfg. The simples thing is to replace the Before:
After:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems sorted out in the latest versions I am closing this one |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my view, maybe the maintainer think that the behavior is ok. So, I'm not sure open this issue as a type of bug.
As we can see that variable
cfg
not as a global variable due to the code renew:=
it. So, the global cfg alwaysnil
.We can easily test it.
In my situation, I need to use
cfg
directly, in the sub test cases.So, if you guys think this is an issue, please fix this.
And I saw that some template may cover this, just like https://github.com/kubernetes-sigs/kubebuilder/blob/72f7c2ef3fd42d21756bc04029ecc499daee2533/pkg/plugins/golang/v2/scaffolds/internal/templates/controllers/controller_suitetest.go , and the others don't.
And I can help on this issue, if you guys confirm that need to be fix.
Beta Was this translation helpful? Give feedback.
All reactions