Open Diaphteiros opened 4 months ago
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
I'm trying to write a
kubectl
-style CLI tool for improving my ops activities. I'm working with a k8s cluster that runs the Gardener extension apiserver, which - among others - provides theshoots
resource (api groupcore.gardener.cloud
, versionv1beta1
).I create a new shortcut expander by using
NewShortcutExpander
and then callKindFor(schema.GroupVersionResource{Resource: myResource})
to resolve the shortcut inmyResource
. For resources provided by CRDs, the shortcut resolution works fine, but if I try to resolveshoot
, I eventually end up here.At this point, the
resource
variable contains what I initially put into theKindFor
method, which looks like this:The content of the
apiRes
variable in the loop looks like thiswhile the
gv
variable of the loop holds the correct group/version information:However, in the linked code line,
resource
is returned, which contains only the resource name and no group or version. This is then fed into the rest mapper, which will never succeed with an empty group.What I'm confused about is that in the mentioned code line, all required information is there. Shouldn't this part look like this instead?
Is it ever correct/useful to return the unmodified value of
resource
?Or am I using the shortcut expander wrongly here?
What I'm effectively trying to do is to resolve
shoot
from a CLI likemyCLI get shoot foo -n bar
toGroup: core.gardener.cloud, Version: v1beta1, Kind: Shoot
.