Skip to content

Commit

Permalink
Sync from server repo (efeb056c184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Spilchen committed Apr 25, 2024
1 parent fa19124 commit 06053a0
Show file tree
Hide file tree
Showing 138 changed files with 258 additions and 151 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2023] Open Text.
Copyright [2023-2024] Open Text.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion commands/cluster_command_launcher.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cluster_command_launcher_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_add_node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_add_subcluster.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_base.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_create_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_drop_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_install_packages.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
40 changes: 37 additions & 3 deletions commands/cmd_list_all_nodes.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -107,9 +107,9 @@ func (c *CmdListAllNodes) Run(vcc vclusterops.ClusterCommands) error {
}
}

bytes, err := json.MarshalIndent(nodeStates, "", " ")
bytes, err := c.marshalNoteStates(nodeStates)
if err != nil {
return fmt.Errorf("fail to marshal the node state result, details %w", err)
return err
}

c.writeCmdOutputToFile(globals.file, bytes, vcc.GetLog())
Expand All @@ -121,3 +121,37 @@ func (c *CmdListAllNodes) Run(vcc vclusterops.ClusterCommands) error {
func (c *CmdListAllNodes) SetDatabaseOptions(opt *vclusterops.DatabaseOptions) {
c.fetchNodeStateOptions.DatabaseOptions = *opt
}

func (c *CmdListAllNodes) marshalNoteStates(nodeStates []vclusterops.NodeInfo) (bytes []byte, err error) {
var isEon bool
if len(nodeStates) > 0 {
// node in Eon database should not have an empty sc name
if nodeStates[0].Subcluster != "" {
isEon = true
}
}

if isEon {
bytes, err = json.MarshalIndent(nodeStates, "", " ")
if err != nil {
return bytes, fmt.Errorf("fail to marshal the node state result, details %w", err)
}
} else {
var nodeStatesEnterprise []vclusterops.NodeInfoEnterprise
for _, n := range nodeStates {
var nEnterprise vclusterops.NodeInfoEnterprise
nEnterprise.Address = n.Address
nEnterprise.Name = n.Name
nEnterprise.State = n.State
nEnterprise.CatalogPath = n.CatalogPath
nEnterprise.Version = n.Version
nodeStatesEnterprise = append(nodeStatesEnterprise, nEnterprise)
}
bytes, err = json.MarshalIndent(nodeStatesEnterprise, "", " ")
if err != nil {
return bytes, fmt.Errorf("fail to marshal the node state result, details %w", err)
}
}

return bytes, nil
}
2 changes: 1 addition & 1 deletion commands/cmd_re_ip.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_remove_node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_remove_subcluster.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_restart_node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_revive_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_sandbox.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_scrutinize.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_show_restore_points.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_start_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_stop_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_unsandbox.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/helpers.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/init.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion commands/scrutinize_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion logging-utils.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# (c) Copyright [2023] Open Text.
# (c) Copyright [2023-2024] Open Text.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion rfc7807/errors.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion rfc7807/rfc7807.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion rfc7807/rfc7807_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion sync-to-github.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# (c) Copyright [2023] Open Text.
# (c) Copyright [2023-2024] Open Text.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/adapter_pool.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/add_node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/add_subcluster.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/cluster_op.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/cluster_op_engine.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
5 changes: 4 additions & 1 deletion vclusterops/cluster_op_engine_context.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -36,6 +36,9 @@ type opEngineExecContext struct {
dbInfo string // store the db info that retrieved from communal storage
restorePoints []RestorePoint // store list existing restore points that queried from an archive
systemTableList systemTableListInfo // used for staging system tables

// hosts on which the wrong authentication occurred
hostsWithWrongAuth []string
}

func makeOpEngineExecContext(logger vlog.Printer) opEngineExecContext {
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/cluster_op_engine_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/cluster_op_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
3 changes: 2 additions & 1 deletion vclusterops/coordinator_database.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -332,6 +332,7 @@ type VCoordinationNode struct {
Subcluster string
// empty string if it is not in a sandbox
Sandbox string
Version string
}

func makeVCoordinationNode() VCoordinationNode {
Expand Down
4 changes: 2 additions & 2 deletions vclusterops/create_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -376,7 +376,7 @@ func (vcc VClusterCommands) produceCreateDBBootstrapInstructions(
nmaHealthOp := makeNMAHealthOp(hosts)

// require to have the same vertica version
nmaVerticaVersionOp := makeNMAVerticaVersionOp(hosts, true, vdb.IsEon)
nmaVerticaVersionOp := makeNMACheckVerticaVersionOp(hosts, true, vdb.IsEon)

// need username for https operations
err := options.validateUserName(vcc.Log)
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/create_db_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion vclusterops/drop_db.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
(c) Copyright [2023] Open Text.
(c) Copyright [2023-2024] Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
5 changes: 5 additions & 0 deletions vclusterops/fetch_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,23 @@ func (vcc VClusterCommands) produceRecoverConfigInstructions(
var instructions []clusterOp

nmaHealthOp := makeNMAHealthOp(options.Hosts)

nmaGetNodesInfoOp := makeNMAGetNodesInfoOp(options.Hosts, options.DBName, options.CatalogPrefix,
true /* ignore internal errors */, vdb)

nmaReadCatalogEditorOp, err := makeNMAReadCatalogEditorOp(vdb)
if err != nil {
return instructions, err
}

nmaReadVerticaVersionOp := makeNMAReadVerticaVersionOp(vdb)

instructions = append(
instructions,
&nmaHealthOp,
&nmaGetNodesInfoOp,
&nmaReadCatalogEditorOp,
&nmaReadVerticaVersionOp,
)

return instructions, nil
Expand Down
Loading

0 comments on commit 06053a0

Please sign in to comment.