INNER CODE UNIT · Go

newObserveCmd

rabbitmq/cluster-operator · kubectl-rabbitmq/commands.go:179

func newObserveCmd(getExecutor func() *kubectlExecutor) *cobra.Command {
	return &cobra.Command{
		Use:   "observe INSTANCE NODE",
		Short: "Run 'rabbitmq-diagnostics observer' on a specific node",
		Args:  cobra.ExactArgs(2),
		RunE: func(cmd *cobra.Command, args []string) error {
			executor := getExecutor()
			instance := args[0]
			node := args[1]
			podName := fmt.Sprintf("%s-server-%s", instance, node)
			return executor.Execute("exec", "-it", podName, "-c", "rabbitmq", "--", "rabbitmq-diagnostics", "observer")
		},
	}
}

func newSecretsCmd(getExecutor func() *kubectlExecutor) *cobra.Command {
	return &cobra.Command{
		Use:   "secrets INSTANCE",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…