From 296dd0f3095dce8a468ed5d09ddf21b10d89403f Mon Sep 17 00:00:00 2001 From: Saravanan Balasubramanian Date: Fri, 13 Dec 2019 15:40:01 -0800 Subject: [PATCH 1/2] Fixed Panic if DB context has issue --- workflow/controller/config_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/controller/config_controller.go b/workflow/controller/config_controller.go index f23085ee3832..e4bac7b219cf 100644 --- a/workflow/controller/config_controller.go +++ b/workflow/controller/config_controller.go @@ -48,11 +48,12 @@ func (wfc *WorkflowController) updateConfig(cm *apiv1.ConfigMap) error { if wfc.Config.Persistence != nil { log.Info("Persistence configuration enabled") - wfc.wfDBctx, err = wfc.createPersistenceContext() + dbctx, err := wfc.createPersistenceContext() if err != nil { log.Errorf("Error Creating Persistence context. %v", err) } else { log.Info("Persistence Session created successfully") + wfc.wfDBctx = dbctx } } else { log.Info("Persistence configuration disabled") From 11b6d301b05bc233ff028f873e1a11b7906534cb Mon Sep 17 00:00:00 2001 From: Saravanan Balasubramanian Date: Fri, 10 Jan 2020 11:07:55 -0800 Subject: [PATCH 2/2] Added Decompress on retry, resubmit and resume --- cmd/argo/commands/retry.go | 6 ++++++ workflow/util/util.go | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/cmd/argo/commands/retry.go b/cmd/argo/commands/retry.go index 95434b7de0a7..513a3df0998d 100644 --- a/cmd/argo/commands/retry.go +++ b/cmd/argo/commands/retry.go @@ -28,6 +28,12 @@ func NewRetryCommand() *cobra.Command { if err != nil { log.Fatal(err) } + + err = util.DecompressWorkflow(wf) + if err != nil { + log.Fatal(err) + } + wf, err = util.RetryWorkflow(kubeClient, wfClient, wf) if err != nil { log.Fatal(err) diff --git a/workflow/util/util.go b/workflow/util/util.go index 134b6dfe99fc..9c088616d817 100644 --- a/workflow/util/util.go +++ b/workflow/util/util.go @@ -335,6 +335,12 @@ func ResumeWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error if err != nil { return false, err } + + err = DecompressWorkflow(wf) + if err != nil { + log.Fatal(err) + } + updated := false if wf.Spec.Suspend != nil && *wf.Spec.Suspend { wf.Spec.Suspend = nil @@ -434,6 +440,10 @@ func FormulateResubmitWorkflow(wf *wfv1.Workflow, memoized bool) (*wfv1.Workflow replaceRegexp := regexp.MustCompile("^" + wf.ObjectMeta.Name) newWF.Status.Nodes = make(map[string]wfv1.NodeStatus) onExitNodeName := wf.ObjectMeta.Name + ".onExit" + err := DecompressWorkflow(wf) + if err != nil { + log.Fatal(err) + } for _, node := range wf.Status.Nodes { newNode := node.DeepCopy() if strings.HasPrefix(node.Name, onExitNodeName) {