Skip to content

Commit

Permalink
copy connection/variable warning message (#1208)
Browse files Browse the repository at this point in the history
* copy connection/variable warning message

* add dag deploy enabled column

* Update cmd/cloud/deployment_objects.go
  • Loading branch information
sunkickr authored and kushalmalani committed May 18, 2023
1 parent af54f72 commit e45a32f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cloud/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,9 @@ var SelectDeployment = func(deployments []astro.Deployment, message string) (ast
}

tab := printutil.Table{
Padding: []int{5, 30, 30, 50},
Padding: []int{5, 30, 30, 30, 50},
DynamicPadding: true,
Header: []string{"#", "DEPLOYMENT NAME", "RELEASE NAME", "DEPLOYMENT ID"},
Header: []string{"#", "DEPLOYMENT NAME", "RELEASE NAME", "DEPLOYMENT ID", "DAG DEPLOY ENABLED"},
}

fmt.Println(message)
Expand All @@ -800,7 +800,7 @@ var SelectDeployment = func(deployments []astro.Deployment, message string) (ast
deployMap := map[string]astro.Deployment{}
for i := range deployments {
index := i + 1
tab.AddRow([]string{strconv.Itoa(index), deployments[i].Label, deployments[i].ReleaseName, deployments[i].ID}, false)
tab.AddRow([]string{strconv.Itoa(index), deployments[i].Label, deployments[i].ReleaseName, deployments[i].ID, strconv.FormatBool(deployments[i].DagDeployEnabled)}, false)

deployMap[strconv.Itoa(index)] = deployments[i]
}
Expand Down
9 changes: 7 additions & 2 deletions cmd/cloud/deployment_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ var (
slots int
)

const requestString = "metadata.webserver_url"
const (
requestString = "metadata.webserver_url"
warningConnectionCopyCMD = "WARNING! The password and extra field are not copied over. You will need to manually add these values"
warningVariableCopyCMD = "WARNING! Secret values are not copied over. You will need to manually add these values"
)

func newDeploymentConnectionRootCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Expand Down Expand Up @@ -422,7 +426,7 @@ func deploymentConnectionCopy(cmd *cobra.Command, out io.Writer) error {
}

toAirlfowURL := fmt.Sprintf("%v", value)

fmt.Println(warningConnectionCopyCMD)
return deployment.CopyConnection(fromAirlfowURL, toAirlfowURL, airflowAPIClient, out)
}

Expand Down Expand Up @@ -534,6 +538,7 @@ func deploymentAirflowVariableCopy(cmd *cobra.Command, out io.Writer) error {

toAirlfowURL := fmt.Sprintf("%v", value)

fmt.Println(warningVariableCopyCMD)
return deployment.CopyVariable(fromAirlfowURL, toAirlfowURL, airflowAPIClient, out)
}

Expand Down

0 comments on commit e45a32f

Please sign in to comment.