Get allowed kubectl
builder verbs and resources dynamically
#981
Labels
enhancement
New feature or request
kubectl
builder verbs and resources dynamically
#981
Overview
The
kubectl
plugins requires manual configuration for interactive builder.This can be removed and we should take the allowed
verbs
andresources
(kinds
) based on the configured RBAC rules.There is a
SelfSubjectRulesReviews().
that we can use for that purpose.Based on your perms it will return a list of resource rules:
However, if you have a cluster admin it will return
*
so we need to probably use discovery client and take the API Resources as we do here.The next thing is to remove the not supported verbs/resources by interactive builder. For example,
exec
,apply
etc. We don't support them as they require adjusted flow. For example,exec
should be constructed only without interactivity, only with inlined commands likekubectl exec mypod -- date
. Forapply
we should print additional input field to specify the external URL or paste K8s object.Reason
Simplify the
kubecl
builder configuration.The text was updated successfully, but these errors were encountered: