Skip to content

Commit

Permalink
should switching ctx before ns (derailed#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjiec authored and uozalp committed Sep 2, 2024
1 parent cb4a84e commit c73b97c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/view/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ func (c *Command) run(p *cmd.Interpreter, fqn string, clearStack bool) error {
return err
}

ns := c.app.Config.ActiveNamespace()
if cns, ok := p.NSArg(); ok {
ns = cns
}
if err := c.app.switchNS(ns); err != nil {
return err
}

if context, ok := p.HasContext(); ok {
if context != c.app.Config.ActiveContextName() {
if err := c.app.Config.Save(true); err != nil {
Expand All @@ -193,6 +185,14 @@ func (c *Command) run(p *cmd.Interpreter, fqn string, clearStack bool) error {
}
}

ns := c.app.Config.ActiveNamespace()
if cns, ok := p.NSArg(); ok {
ns = cns
}
if err := c.app.switchNS(ns); err != nil {
return err
}

co := c.componentFor(gvr, fqn, v)
co.SetFilter("")
co.SetLabelFilter(nil)
Expand Down

0 comments on commit c73b97c

Please sign in to comment.