Files
airshipctl/cmd/argo/resume.go
Ian Howell 5999d17323 Add argo as a subcommand
This is a drop-in of the argo cmd package, with some slight tweaks to
adhere to airshipctl's models and linter. It still needs to be combed
over and modified to meet airshipctl's needs, as well as requiring unit
tests
2019-06-13 08:58:19 -05:00

34 lines
650 B
Go

package argo
import (
"fmt"
"log"
"os"
"github.com/spf13/cobra"
"github.com/argoproj/argo/workflow/util"
)
func NewResumeCommand() *cobra.Command {
var command = &cobra.Command{
Use: "resume WORKFLOW1 WORKFLOW2...",
Short: "resume a workflow",
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
cmd.HelpFunc()(cmd, args)
os.Exit(1)
}
InitWorkflowClient()
for _, wfName := range args {
err := util.ResumeWorkflow(wfClient, wfName)
if err != nil {
log.Fatalf("Failed to resume %s: %+v", wfName, err)
}
fmt.Printf("workflow %s resumed\n", wfName)
}
},
}
return command
}