Skip to content

Commit ab086bd

Browse files
authored
Modified the CLI for assess-migration command to only mention about PostgreSQL db type (#1469)
1 parent 7a13ac1 commit ab086bd

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

yb-voyager/cmd/assessMigrationCommand.go

+45-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030
"text/template"
3131

3232
"github.com/samber/lo"
33-
3433
log "github.com/sirupsen/logrus"
3534
"github.com/spf13/cobra"
35+
3636
"github.com/yugabyte/yb-voyager/yb-voyager/src/cp"
3737
"github.com/yugabyte/yb-voyager/yb-voyager/src/metadb"
3838
"github.com/yugabyte/yb-voyager/yb-voyager/src/migassessment"
@@ -54,8 +54,8 @@ type UnsupportedFeature struct {
5454

5555
var assessMigrationCmd = &cobra.Command{
5656
Use: "assess-migration",
57-
Short: "Assess the migration from source database to YugabyteDB.",
58-
Long: `Assess the migration from source database to YugabyteDB.`,
57+
Short: "Assess the migration from source (PostgreSQL) database to YugabyteDB.",
58+
Long: `Assess the migration from source (PostgreSQL) database to YugabyteDB.`,
5959

6060
PreRun: func(cmd *cobra.Command, args []string) {
6161
validateSourceDBTypeForAssessMigration()
@@ -74,10 +74,51 @@ var assessMigrationCmd = &cobra.Command{
7474
},
7575
}
7676

77+
func registerSourceDBConnFlagsForAM(cmd *cobra.Command) {
78+
cmd.Flags().StringVar(&source.DBType, "source-db-type", "",
79+
"source database type: (postgresql)\n")
80+
81+
cmd.Flags().StringVar(&source.Host, "source-db-host", "localhost",
82+
"source database server host")
83+
84+
cmd.Flags().IntVar(&source.Port, "source-db-port", 0,
85+
"source database server port number. Default: PostgreSQL(5432)")
86+
87+
cmd.Flags().StringVar(&source.User, "source-db-user", "",
88+
"connect to source database as the specified user")
89+
90+
// TODO: All sensitive parameters can be taken from the environment variable
91+
cmd.Flags().StringVar(&source.Password, "source-db-password", "",
92+
"source password to connect as the specified user. Alternatively, you can also specify the password by setting the environment variable SOURCE_DB_PASSWORD. If you don't provide a password via the CLI, yb-voyager will prompt you at runtime for a password. If the password contains special characters that are interpreted by the shell (for example, # and $), enclose the password in single quotes.")
93+
94+
cmd.Flags().StringVar(&source.DBName, "source-db-name", "",
95+
"source database name to be migrated to YugabyteDB")
96+
97+
cmd.Flags().StringVar(&source.Schema, "source-db-schema", "",
98+
"source schema name(s) to export\n"+
99+
`Note: in case of multiple schemas, use a comma separated list of schemas: "schema1,schema2,schema3"`)
100+
101+
// TODO SSL related more args will come. Explore them later.
102+
cmd.Flags().StringVar(&source.SSLCertPath, "source-ssl-cert", "",
103+
"Path of the file containing source SSL Certificate")
104+
105+
cmd.Flags().StringVar(&source.SSLMode, "source-ssl-mode", "prefer",
106+
"specify the source SSL mode out of: (disable, allow, prefer, require, verify-ca, verify-full)")
107+
108+
cmd.Flags().StringVar(&source.SSLKey, "source-ssl-key", "",
109+
"Path of the file containing source SSL Key")
110+
111+
cmd.Flags().StringVar(&source.SSLRootCert, "source-ssl-root-cert", "",
112+
"Path of the file containing source SSL Root Certificate")
113+
114+
cmd.Flags().StringVar(&source.SSLCRL, "source-ssl-crl", "",
115+
"Path of the file containing source SSL Root Certificate Revocation List (CRL)")
116+
}
117+
77118
func init() {
78119
rootCmd.AddCommand(assessMigrationCmd)
79120
registerCommonGlobalFlags(assessMigrationCmd)
80-
registerSourceDBConnFlags(assessMigrationCmd, false, false)
121+
registerSourceDBConnFlagsForAM(assessMigrationCmd)
81122

82123
BoolVar(assessMigrationCmd.Flags(), &startClean, "start-clean", false,
83124
"cleans up the project directory for schema or data files depending on the export command (default false)")

0 commit comments

Comments
 (0)