Skip to content

Commit

Permalink
Fallback to asking for handle in plural cd clusters reinstall (#552)
Browse files Browse the repository at this point in the history
The helpdoc also needed updating, but this should make the command more discoverable.
  • Loading branch information
michaeljguarino authored Sep 27, 2024
1 parent e490356 commit 5c91857
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cmd/command/cd/cd_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ func (p *Plural) cdClusterCommands() []cli.Command {
Flags: []cli.Flag{
cli.StringFlag{Name: "values", Usage: "values file to use for the deployment agent helm chart", Required: false},
},
Usage: "reinstalls the deployment operator into a cluster",
Usage: "reinstalls the deployment operator into a cluster",
ArgsUsage: "@{cluster-handle}",
},
}
}
Expand Down Expand Up @@ -396,7 +397,16 @@ func (p *Plural) handleClusterReinstall(c *cli.Context) error {
return err
}

id, name := common.GetIdAndName(c.Args().Get(0))
handle := c.Args().Get(0)
var err error
if handle == "" {
handle, err = utils.ReadLine("Enter the handle for the cluster you want to reinstall the agent in")
if err != nil {
return err
}
}

id, name := common.GetIdAndName(handle)
return p.ReinstallOperator(c, id, name)
}

Expand Down

0 comments on commit 5c91857

Please sign in to comment.