Skip to content

Commit

Permalink
Sync from server repo (78637c2fe6a)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchen-vertica committed Jun 25, 2024
1 parent d83e09f commit 76b66d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
8 changes: 7 additions & 1 deletion commands/cmd_create_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ func (c *CmdCreateDB) setHiddenFlags(cmd *cobra.Command) {
false,
"",
)
hideLocalFlags(cmd, []string{"policy", "sql", "client-port", "skip-startup-polling"})
cmd.Flags().BoolVar(
&c.createDBOptions.GenerateHTTPCerts,
"generate-http-certs",
false,
"",
)
hideLocalFlags(cmd, []string{"policy", "sql", "client-port", "skip-startup-polling", "generate-http-certs"})
}

func (c *CmdCreateDB) Parse(inputArgv []string, logger vlog.Printer) error {
Expand Down
15 changes: 9 additions & 6 deletions vclusterops/promote_sandbox_to_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ func (vcc VClusterCommands) VPromoteSandboxToMain(options *VPromoteSandboxToMain

// The generated instructions will later perform the following operations necessary
// for a successful promote sandbox operation:
// - promote sandbox to main using one of the up nodes in the sandboxed subcluster
// - clean communal storage using one of the up nodes in the sandboxed subcluster
// - pick one of the up nodes in the sandboxed subcluster as the initiator
// - check nma health on the initiator
// - promote sandbox to main on the initiator
// - clean communal storage on the initiator
func (vcc VClusterCommands) promoteSandboxToMainInstructions(options *VPromoteSandboxToMainOptions,
vdb *VCoordinationDatabase) ([]clusterOp, error) {
var instructions []clusterOp
Expand All @@ -150,18 +152,19 @@ func (vcc VClusterCommands) promoteSandboxToMainInstructions(options *VPromoteSa
break
}
}
sandboxHost := []string{upHost}
httpsConvertSandboxToMainOp, err := makeHTTPSConvertSandboxToMainOp(sandboxHost,
initiator := []string{upHost}
nmaHealthOp := makeNMAHealthOp(initiator)
httpsConvertSandboxToMainOp, err := makeHTTPSConvertSandboxToMainOp(initiator,
options.UserName, options.Password, options.usePassword, options.SandboxName)
if err != nil {
return nil, err
}
nmaCleanCommunalStorageOp, err := makeNMACleanCommunalStorageOp(sandboxHost,
nmaCleanCommunalStorageOp, err := makeNMACleanCommunalStorageOp(initiator,
options.UserName, options.DBName, options.Password, options.usePassword,
false /* not only print invalid files in communal storage, but also delete them */)
if err != nil {
return nil, err
}
instructions = append(instructions, &httpsConvertSandboxToMainOp, &nmaCleanCommunalStorageOp)
instructions = append(instructions, &nmaHealthOp, &httpsConvertSandboxToMainOp, &nmaCleanCommunalStorageOp)
return instructions, nil
}

0 comments on commit 76b66d0

Please sign in to comment.