-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ERRO[0000] VirtulMachine.infra.sealyun.com "virtulmachine-test" not foundunable #947
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
Comments
my yaml:
source file:
|
Code looks fine to me. Can you ensure you ran the Also, Can you share the output for |
I don't know why controller Reconcile work fine but I new a client in an other project main failed. CRD name changed: |
How to specified the CRD name in client? |
The resource name is pulled from discovery. Can you post the exact error message that you're seeing? Seeing the exact error might tell us where it's coming from (there are a couple from client-go that look similar, but come from different places). |
➜ client git:(master) ✗ kubectl get crd |
Everything is ok when I useing client-go:
|
Is |
aaah, sorry, I completely missed something before, and seeing the full line number info drove it home. In the provided example, you're using the manger's client, which operates off the caches, but you haven't started the manager, so there's nothing in the cache. I think we have a footgun where we don't wait for cache sync if the manager hasn't even been started yet, that's probably your issue. See kubernetes-sigs/controller-runtime#595 (comment), and let me know if that doesn't help you . |
(closing for bookkeeping, but we can re-open if the above doesn't help) |
I got it, but some times we don't want to run a long live process. For example query CRD in CNI command or create a command line to create CRD(like:
does not meet our needs... |
If you don't want to read from the cache, use a "live" client by calling |
I got it, tks a lot. |
I am using
If you agree with me, I will PR those codes. It is useful for command line or CNI and so on.. |
You generally don't need to be using a manager (and shouldn't be) unless you're managing long-running processes, so it doesn't make much sense, IMO, to have that. |
Yes, I agree with you. But I think add a apiClient is reasonable. For if we need write status to apiserver (not through cache)... |
as you can see, options = setOptionsDefaults(options) this is private function, so client.New is complex.
|
writes never go through the cache anyway. What you're looking for is cl, err := client.New(config.GetConfigOrDie(), client.Options{Scheme: scheme}) There's an example in the godocs for the client: https://godoc.org/sigs.k8s.io/controller-runtime/pkg/client#New |
things like mappers are automatically defaulted |
Greate, I will close the PR |
But my CRD name is:
virtulmachines.infra.sealyun.com
notVirtulMachine.infra.sealyun.com
, How can I specifie CRD name?The text was updated successfully, but these errors were encountered: