Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix namespace support in kubectl aging plugin #55258

Merged
merged 1 commit into from
Nov 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/kubectl/plugins/examples/aging/aging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def duration
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."
Expand Down
3 changes: 0 additions & 3 deletions pkg/kubectl/plugins/examples/aging/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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