-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/cb-cluster-via-cao
- Loading branch information
Showing
21 changed files
with
395 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/data/ | ||
/cbdynclusterd | ||
cleanup_registry/.venv | ||
/cbdinocluster* | ||
cleanup_registry/.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"go.uber.org/zap" | ||
) | ||
|
||
var chaosPauseNodeCmd = &cobra.Command{ | ||
Use: "pause-node", | ||
Short: "Pauses a particular node in the cluster.", | ||
Args: cobra.MinimumNArgs(2), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
helper := CmdHelper{} | ||
logger := helper.GetLogger() | ||
ctx := helper.GetContext() | ||
|
||
_, deployer, cluster := helper.IdentifyCluster(ctx, args[0]) | ||
node := helper.IdentifyNode(ctx, cluster, args[1]) | ||
|
||
err := deployer.PauseNode(ctx, cluster.GetID(), node.GetID()) | ||
if err != nil { | ||
logger.Fatal("failed to pause node", zap.Error(err)) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
chaosCmd.AddCommand(chaosPauseNodeCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"go.uber.org/zap" | ||
) | ||
|
||
var chaosUnpauseNodeCmd = &cobra.Command{ | ||
Use: "unpause-node", | ||
Short: "Unpauses a particular node in the cluster.", | ||
Args: cobra.MinimumNArgs(2), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
helper := CmdHelper{} | ||
logger := helper.GetLogger() | ||
ctx := helper.GetContext() | ||
|
||
_, deployer, cluster := helper.IdentifyCluster(ctx, args[0]) | ||
node := helper.IdentifyNode(ctx, cluster, args[1]) | ||
|
||
err := deployer.UnpauseNode(ctx, cluster.GetID(), node.GetID()) | ||
if err != nil { | ||
logger.Fatal("failed to resume node", zap.Error(err)) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
chaosCmd.AddCommand(chaosUnpauseNodeCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/couchbaselabs/cbdinocluster/deployment" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ipCmd = &cobra.Command{ | ||
Use: "ip [flags] cluster [node]", | ||
Short: "Gets the IP of a node in the cluster", | ||
Args: cobra.MinimumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
helper := CmdHelper{} | ||
ctx := helper.GetContext() | ||
|
||
_, _, cluster := helper.IdentifyCluster(ctx, args[0]) | ||
|
||
var node deployment.ClusterNodeInfo | ||
if len(args) >= 2 { | ||
node = helper.IdentifyNode(ctx, cluster, args[1]) | ||
} else { | ||
node = cluster.GetNodes()[0] | ||
} | ||
|
||
fmt.Printf("%s\n", node.GetIPAddress()) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(ipCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.