Skip to content

Commit

Permalink
Support for parent wfrun in lhctl run
Browse files Browse the repository at this point in the history
  • Loading branch information
eduwercamacaro committed Jan 19, 2024
1 parent cf3476e commit feb8e44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lhctl/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ lhctl run my_workflow_id foo '{"bar":"baz"}'
runReq.Id = &wfRunId
}

parentWfRunId, _ := cmd.Flags().GetString("parentWfRunId")
if parentWfRunId != "" {
parentId := &model.WfRunId{}
parentId.Id = parentWfRunId
runReq.ParentWfRunId = parentId
}

// Now parse variables
if len(args) > 1 {
if len(args)%2 != 1 {
Expand Down Expand Up @@ -120,6 +127,7 @@ odd total number of args. See 'lhctl run --help' for details.`)

func init() {
runCmd.Flags().String("wfRunId", "", "Set the id of the WfRun (for idempotence)")
runCmd.Flags().String("parentWfRunId", "", "Set the ID of the parent WfRun")
runCmd.Flags().Int32("majorVersion", -1, "Set specific WfSpec Major Version to run")
runCmd.Flags().Int32("revision", -1, "Set specific WfSpec Revision to run")
rootCmd.AddCommand(runCmd)
Expand Down

0 comments on commit feb8e44

Please sign in to comment.