Commit f130ed98 authored by Jonas Tingeborn's avatar Jonas Tingeborn

Fix namespace support in kubectl aging plugin

The example plugin's comments mentioned the namespace support limitation, awaiting kubectl to implement environment variable propagation. Now that 1.8 is out, the requirement is satisfied. This commit adds use of the conveyed namespace information to the plugin example. Fixes #55255
parent 45bdf707
......@@ -22,7 +22,8 @@ class Numeric
end
end
pods_json = `kubectl get pods -o json`
namespace = ENV['KUBECTL_PLUGINS_CURRENT_NAMESPACE'] || 'default'
pods_json = `kubectl --namespace #{namespace} get pods -o json`
pods_parsed = JSON.parse(pods_json)
puts "The Magnificent Aging Plugin."
......
......@@ -2,7 +2,4 @@ name: "aging"
shortDesc: "Aging shows pods by age"
longDesc: >
Aging shows pods from the current namespace by age.
Once we have plugin support for global flags through
env vars (planned for V1) we'll be able to switch
between namespaces using the --namespace flag.
command: ./aging.rb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment