You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introducing migrationProjectId and decoupling Spanner projectId (#802)
* Introducing migrationProjectId and decoupling Spanner projectId
* Test file changes
* Addressing comments and adding UI side changes
* Fixing cleanup command
* reverting whitespace changes
* Not using project id from target profile
* documentation changes
* Addressing comments and correcting LaunchDataflowJob method
err=fmt.Errorf("error while preparing prerequisites for migration: %v", err)
115
117
returnsubcommands.ExitUsageError
116
118
}
119
+
ifcmd.project=="" {
120
+
getInfo:=&utils.GetUtilInfoImpl{}
121
+
cmd.project, err=getInfo.GetProject()
122
+
iferr!=nil {
123
+
logger.Log.Error("Could not get project id from gcloud environment or --project flag. Either pass the projectId in the --project flag or configure in gcloud CLI using gcloud config set", zap.Error(err))
err=fmt.Errorf("error while preparing prerequisites for migration: %v", err)
101
103
returnsubcommands.ExitUsageError
102
104
}
105
+
ifcmd.project=="" {
106
+
getInfo:=&utils.GetUtilInfoImpl{}
107
+
cmd.project, err=getInfo.GetProject()
108
+
iferr!=nil {
109
+
logger.Log.Error("Could not get project id from gcloud environment or --project flag. Either pass the projectId in the --project flag or configure in gcloud CLI using gcloud config set", zap.Error(err))
f.StringVar(&cmd.targetProfile, "target-profile", "", "Flag for specifying connection profile for target database e.g., \"dialect=postgresql\"")
80
81
f.BoolVar(&cmd.SkipForeignKeys, "skip-foreign-keys", false, "Skip creating foreign keys after data migration is complete (ddl statements for foreign keys can still be found in the downloaded schema.ddl.txt file and the same can be applied separately)")
81
82
f.StringVar(&cmd.filePrefix, "prefix", "", "File prefix for generated files")
83
+
f.StringVar(&cmd.project, "project", "", "Flag spcifying default project id for all the generated resources for the migration")
82
84
f.Int64Var(&cmd.WriteLimit, "write-limit", DefaultWritersLimit, "Write limit for writes to spanner")
83
85
f.BoolVar(&cmd.dryRun, "dry-run", false, "Flag for generating DDL and schema conversion report without creating a spanner database")
84
86
f.StringVar(&cmd.logLevel, "log-level", "DEBUG", "Configure the logging level for the command (INFO, DEBUG), defaults to DEBUG")
err=fmt.Errorf("error while preparing prerequisites for migration: %v", err)
107
109
returnsubcommands.ExitUsageError
108
110
}
111
+
ifcmd.project=="" {
112
+
getInfo:=&utils.GetUtilInfoImpl{}
113
+
cmd.project, err=getInfo.GetProject()
114
+
iferr!=nil {
115
+
logger.Log.Error("Could not get project id from gcloud environment or --project flag. Either pass the projectId in the --project flag or configure in gcloud CLI using gcloud config set", zap.Error(err))
0 commit comments