INNER CODE UNIT · Go

newSecretsCmd

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

func newSecretsCmd(getExecutor func() *kubectlExecutor) *cobra.Command {
	return &cobra.Command{
		Use:   "secrets INSTANCE",
		Short: "Print default-user credentials for an instance",
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			executor := getExecutor()
			instance := args[0]

			creds, err := getInstanceCredentials(executor, instance)
			if err != nil {
				return err
			}

			fmt.Printf("username: %s\n", creds.Username)
			fmt.Printf("password: %s\n", creds.Password)
			return nil
		},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…