Open jinnovation opened 1 year ago
Intermediate step: "list r
eplicasets for this deployment"
To do this, we'll need a way to obtain all the resources of a given type owned by a given resource.
We might be able to do this by extending kele--list-resources
with a :owned-by
parameter that's expected to specify the full group-version-kind-name of the owner to filter for.
Honestly, kele-resource
prefix could just have all of these suffixes defined on it and then we selectively enable/disable them using the :if
slot. Seems easier than trying to dynamically inject suffixes or whatever.
This ticket is too broad to be actionable.
Let's replace it with a concrete feature that we can implement.
It doesn't look like there's a generic solution for "find all resources owned by this resource" (kubernetes/client-go#1085), so this is probably something we'll have to hard-code some resource-specific behavior for.
The "get/list all ReplicaSets owned by this Deployment" story seems reasonable as starting use case for conditional resource suffixes.
See also: https://github.com/kubernetes/kubectl/issues/1292
For inspiration: https://github.com/ahmetb/kubectl-tree
Given that instances of the
kele-resource
prefix are scoped to specific resource types, we have an opportunity to introduce resource-specific suffixes that we dynamically inject into the prefix.Concrete example: when
kele-resource
is invoked ondeployments
, inject a suffix forkele-list
-ing all the corresponding pods for that deployment.