airshipctl/cmd/workflow/workflow.go
Ian Howell 4c6b8486c9 Move all tests to proper table-tests
This commit also changes the way that output is handled while testing
2019-05-29 15:11:55 -05:00

30 lines
880 B
Go

package workflow
import (
"github.com/spf13/cobra"
"github.com/ian-howell/airshipctl/pkg/environment"
wfenv "github.com/ian-howell/airshipctl/pkg/workflow/environment"
)
// PluginSettingsID is used as a key in the root settings map of plugin settings
const PluginSettingsID = "argo"
// NewWorkflowCommand creates a new command for working with argo workflows
func NewWorkflowCommand(rootSettings *environment.AirshipCTLSettings) *cobra.Command {
workflowRootCmd := &cobra.Command{
Use: "workflow",
Short: "Access to argo workflows",
Aliases: []string{"workflows", "wf"},
}
wfSettings := &wfenv.Settings{}
wfSettings.InitFlags(workflowRootCmd)
rootSettings.Register(PluginSettingsID, wfSettings)
workflowRootCmd.AddCommand(NewWorkflowInitCommand(rootSettings))
workflowRootCmd.AddCommand(NewWorkflowListCommand(rootSettings))
return workflowRootCmd
}