Closed Electronic-Waste closed 3 months ago
Also, the code above provides a example for operating CRDs with RESTClient
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
@Electronic-Waste Thank you for this. You were the only drop of sanity that actually showed a way out of the completely non-intuitive way how things have been implemented (and not documented) on how to operate with RESTClient on CRDs.
This was exactly what I needed. And while bashing my head against what (would seem to be a sensible working implementation) would return me the most generic and unhelpful forbidden: User "system:serviceaccount:xxx:yyy" cannot patch path "zzz"
(despite the fact the ServiceAccount/CRB had full privileges).
/remove-lifecycle rotten
/reopen
@nmindz: You can't reopen an issue/PR unless you authored it or you are a collaborator.
As is shown in k8s official doc, we can't access a CRD with clientset generated by client-go library.
So I decided to fetch my CRD by RESTClient.
I spent a lot of hours working it out, finding that there are so limited examples on Internet that developers often get confused about various error messages produced by their code, for example
no kind "xxx" is registered for the internal version of group "xxx" in scheme "pkg/runtime/scheme.go:100"
in #193 .I also encountered with this problem. My former code:
Some code in package
sdnv1
:In
/pkg/util/client.go
When I use this RESTClient to create CRD:
The error
no kind "xxx" is registered for the internal version of group "xxx" in scheme "pkg/runtime/scheme.go:100"
occurred.But after I changed
/pkg/util/client.go
to
The program runs correctly.
I don't know why this program can run correctly, but I think more developers can prevent themselves from getting confused by such bugs if there were more examples.