Support GVR environment variables for plugin (#1213)
* Add resource name as plugin environment variable * Add support of RESOURCE_GROUP & RESOURCE_VERSION toomine
parent
274d841380
commit
b232dacf3c
|
|
@ -480,6 +480,9 @@ K9s allows you to extend your command line and tooling by defining your very own
|
|||
|
||||
K9s does provide additional environment variables for you to customize your plugins arguments. Currently, the available environment variables are as follows:
|
||||
|
||||
* `$RESOURCE_GROUP` -- the selected resource group
|
||||
* `$RESOURCE_VERSION` -- the selected resource api version
|
||||
* `$RESOURCE_NAME` -- the selected resource name
|
||||
* `$NAMESPACE` -- the selected resource namespace
|
||||
* `$NAME` -- the selected resource name
|
||||
* `$CONTAINER` -- the current container if applicable
|
||||
|
|
|
|||
|
|
@ -107,6 +107,10 @@ func (t *Table) defaultEnv() Env {
|
|||
env["NAMESPACE"], env["FILTER"] = client.Namespaced(path)
|
||||
}
|
||||
|
||||
env["RESOURCE_GROUP"] = t.GVR().G()
|
||||
env["RESOURCE_VERSION"] = t.GVR().V()
|
||||
env["RESOURCE_NAME"] = t.GVR().R()
|
||||
|
||||
return env
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue