Skip to content

Commit

Permalink
[Automated] Merged refs/heads/k8s-sync-2024-11-07-1145-3cc488db2bdd2e…
Browse files Browse the repository at this point in the history
…f4fb17a2dcff29bba4c554b92d into target main
  • Loading branch information
github-actions[bot] authored Nov 7, 2024
2 parents 21e8256 + c5cb4a6 commit 9c10874
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commands/cmd_list_all_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/spf13/cobra"
"github.com/vertica/vcluster/vclusterops"
"github.com/vertica/vcluster/vclusterops/util"
"github.com/vertica/vcluster/vclusterops/vlog"
)

Expand Down Expand Up @@ -101,6 +102,18 @@ func (c *CmdListAllNodes) validateParse(logger vlog.Printer) error {

func (c *CmdListAllNodes) Run(vcc vclusterops.ClusterCommands) error {
vcc.V(1).Info("Called method Run()")
c.fetchNodeStateOptions.SandboxedNodesOnly = true
dbConfig, configErr := readConfig()
if configErr != nil {
c.fetchNodeStateOptions.SandboxedNodesOnly = false
vcc.DisplayWarning("Failed to read the configuration file", "error", configErr)
} else {
for _, n := range dbConfig.Nodes {
if n.Sandbox == util.MainClusterSandbox {
c.fetchNodeStateOptions.SandboxedNodesOnly = false
}
}
}

nodeStates, err := vcc.VFetchNodeState(c.fetchNodeStateOptions)
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions commands/cmd_revive_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ func (c *CmdReviveDB) validateParse(logger vlog.Printer) error {
}
}

if c.reviveDBOptions.Sandbox != "" && c.reviveDBOptions.MainCluster {
return fmt.Errorf("sandbox and main_cluster_only are mutually exclusive")
}

if c.reviveDBOptions.Sandbox == "" && !c.reviveDBOptions.MainCluster {
logger.DisplayWarning("neither --sandbox nor --main_cluster_only option is specified, proceeding to revive to main cluster")
}

// when --display-only is provided, we do not need to parse some base options like hostListStr
if c.reviveDBOptions.DisplayOnly {
return nil
Expand Down

0 comments on commit 9c10874

Please sign in to comment.