Skip to content

Commit

Permalink
Set namespace on switching context (kubernetes-el#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
darth10 authored and noorul committed Nov 8, 2019
1 parent 3301293 commit fb77c4a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kubernetes-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,16 @@ CONTEXT is the name of a context as a string."
(with-current-buffer buf
(goto-char (point-min))))

(kubernetes-kubectl-config-use-context kubernetes-props
(kubernetes-state)
context
(lambda (_)
(kubernetes-state-trigger-redraw))))
(let ((state (kubernetes-state)))
(kubernetes-kubectl-config-use-context
kubernetes-props
state
context
(lambda (_)
(when kubernetes-default-overview-namespace
(kubernetes-set-namespace kubernetes-default-overview-namespace
state))
(kubernetes-state-trigger-redraw)))))

(defun kubernetes--context-names (state)
(-let* ((config (or (kubernetes-state-config state) (kubernetes-kubectl-await-on-async kubernetes-props state #'kubernetes-kubectl-config-view)))
Expand Down

0 comments on commit fb77c4a

Please sign in to comment.