File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 - name : golangci-lint
3434 uses : golangci/golangci-lint-action@v9.2.0
3535 with :
36- version : latest
3736 skip-cache : true
37+ version : v2.11.4
3838
3939 contract-validation :
4040 name : Validate PR Contracts
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
1818 "github.com/pluralsh/plural-cli/pkg/common"
1919 "github.com/pluralsh/plural-cli/pkg/console"
2020 "github.com/pluralsh/plural-cli/pkg/console/errors"
21+ "github.com/pluralsh/plural-cli/pkg/kubernetes"
2122 "github.com/pluralsh/plural-cli/pkg/kubernetes/config"
2223 "github.com/pluralsh/plural-cli/pkg/utils"
2324)
@@ -113,6 +114,10 @@ func (p *Plural) cdClusterCommands() []cli.Command {
113114 Name : "metadata" ,
114115 Usage : "Path to metadata file, or '-' to read from stdin" ,
115116 },
117+ cli.BoolFlag {
118+ Name : "confirm" ,
119+ Usage : "print the current kubeconfig API server and prompt before creating the cluster and installing the agent" ,
120+ },
116121 },
117122 },
118123 {
@@ -472,6 +477,18 @@ func (p *Plural) handleClusterBootstrap(c *cli.Context) error {
472477 return err
473478 }
474479
480+ restConf , err := kubernetes .KubeConfig ()
481+ if err != nil {
482+ return err
483+ }
484+ utils .Highlight ("Current Kubernetes API server to install the agent on: %s\n " , restConf .Host )
485+
486+ if c .Bool ("confirm" ) {
487+ if ! common .Affirm ("Do you want to deploy the agent to this cluster?" , "PLURAL_CD_BOOTSTRAP_AFFIRM_CLUSTER" ) {
488+ return nil
489+ }
490+ }
491+
475492 attrs := gqlclient.ClusterAttributes {Name : c .String ("name" )}
476493 if c .String ("handle" ) != "" {
477494 attrs .Handle = lo .ToPtr (c .String ("handle" ))
You can’t perform that action at this time.
0 commit comments