You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the shoots resource (api group core.gardener.cloud, version v1beta1).
I create a new shortcut expander by using NewShortcutExpander and then call KindFor(schema.GroupVersionResource{Resource: myResource}) to resolve the shortcut in myResource.
For resources provided by CRDs, the shortcut resolution works fine, but if I try to resolve shoot, I eventually end up here.
At this point, the resource variable contains what I initially put into the KindFor method, which looks like this:
{
Group: ""
Version: ""
Resource: "shoot"
}
The content of the apiRes variable in the loop looks like this
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 like myCLI get shoot foo -n bar to Group: core.gardener.cloud, Version: v1beta1, Kind: Shoot.
The text was updated successfully, but these errors were encountered:
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 resolve
shoot
, 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
.The text was updated successfully, but these errors were encountered: