Skip to content

Commit

Permalink
fix(controller): clean up before insert into argo_archived_workflows_…
Browse files Browse the repository at this point in the history
…labels (#5568)

Signed-off-by: BOOK <book78987book@gmail.com>
  • Loading branch information
book987 authored Apr 1, 2021
1 parent 2b3655e commit ed54f15
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions persist/sqldb/workflow_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error {
return err
}

_, err = sess.
DeleteFrom(archiveLabelsTableName).
Where(db.Cond{"clustername": r.clusterName}).
And(db.Cond{"uid": wf.UID}).
Exec()
if err != nil {
return err
}
// insert the labels
for key, value := range wf.GetLabels() {
_, err := sess.Collection(archiveLabelsTableName).
Expand Down

0 comments on commit ed54f15

Please sign in to comment.