/
workspaceHa.go
37 lines (32 loc) · 1.04 KB
/
workspaceHa.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright © 2017 Chef Software
package main
import (
"github.com/chef/automate/components/automate-cli/pkg/docs"
"github.com/chef/automate/components/automate-cli/pkg/status"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
func init() {
workspaceCmd.SetUsageTemplate(workspaceCommandHelpDocs)
RootCmd.AddCommand(workspaceCmd)
}
var workspaceCmd = &cobra.Command{
Use: "workspace",
Short: "Set workspace env for Automate HA.",
Long: "Set up Automate HA cluster workspace.",
Annotations: map[string]string{
NoCheckVersionAnnotation: NoCheckVersionAnnotation,
docs.Compatibility: docs.CompatiblewithHA,
},
RunE: runWorkspaceCmd,
}
func runWorkspaceCmd(cmd *cobra.Command, args []string) error {
if isA2HARBFileExist() {
if len(args) == 0 {
writer.Print("please refer \n" + workspaceCommandHelpDocs)
return nil
}
return executeAutomateClusterCtlCommand("workspace", args, workspaceCommandHelpDocs)
}
return status.Wrap(errors.New(AUTOMATE_HA_INVALID_BASTION), status.InvalidCommandArgsError, workspaceCommandHelpDocs)
}