
This will allows external commands to be able to see internal settings. This will be important when more commands begin to need shared settings, e.g. kubernetes configuration This also has the downside of causing a compatibility issue - backwards compatibility changes to AirshipCTLSettings will need to wait for each major version upgrade
24 lines
620 B
Go
24 lines
620 B
Go
package workflow
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/ian-howell/airshipctl/pkg/environment"
|
|
)
|
|
|
|
// NewWorkflowCommand creates a new command for working with argo workflows
|
|
func NewWorkflowCommand(out io.Writer, settings *environment.AirshipCTLSettings, args []string) *cobra.Command {
|
|
workflowRootCmd := &cobra.Command{
|
|
Use: "workflow",
|
|
Short: "Access to argo workflows",
|
|
Aliases: []string{"workflows", "wf"},
|
|
}
|
|
|
|
workflowRootCmd.AddCommand(NewWorkflowInitCommand(out, settings, args))
|
|
workflowRootCmd.AddCommand(NewWorkflowListCommand(out, settings, args))
|
|
|
|
return workflowRootCmd
|
|
}
|