• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opendefensecloud / artifact-conduit / 22094268672

17 Feb 2026 10:09AM UTC coverage: 83.724% (-0.8%) from 84.504%
22094268672

push

github

web-flow
fix(deps): update module github.com/argoproj/argo-workflows/v3 to v3.7.10 (#215)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[github.com/argoproj/argo-workflows/v3](https://redirect.github.com/argoproj/argo-workflows)
| `v3.7.9` → `v3.7.10` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fargoproj%2fargo-workflows%2fv3/v3.7.10?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fargoproj%2fargo-workflows%2fv3/v3.7.9/v3.7.10?slim=true)
|

---

### Release Notes

<details>
<summary>argoproj/argo-workflows
(github.com/argoproj/argo-workflows/v3)</summary>

###
[`v3.7.10`](https://redirect.github.com/argoproj/argo-workflows/blob/HEAD/CHANGELOG.md#v400-rc1-2025-12-11)

[Compare
Source](https://redirect.github.com/argoproj/argo-workflows/compare/v3.7.9...v3.7.10)

Full Changelog:
[v3.7.10...v4.0.0-rc1](https://redirect.github.com/argoproj/argo-workflows/compare/v3.7.10...v4.0.0-rc1)

##### Selected Changes

-
[afb0b7abe](https://redirect.github.com/argoproj/argo-workflows/commit/afb0b7abe)
perf: set ResourceVersion=0 in deleteTaskResults to reduce etcd
pressure.
([#&#8203;15115](https://redirect.github.com/argoproj/argo-workflows/issues/15115))
-
[0f31d8cd0](https://redirect.github.com/argoproj/argo-workflows/commit/0f31d8cd0)
fix: make executable
([#&#8203;15129](https://redirect.github.com/argoproj/argo-workflows/issues/15129))
-
[3e13180bf](https://redirect.github.com/argoproj/argo-workflows/commit/3e13180bf)
fix: more release fixing
([#&#8203;15128](https://redirect.github.com/argoproj/argo-workflows/issues/15128))
-
[9b4e92f28](https://redirect.github.com/argoproj/argo-workflows/commit/9b4e92f28)
fix: release proces... (continued)

751 of 897 relevant lines covered (83.72%)

2335.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.73
/pkg/controller/workflow_handler.go
1
// Copyright 2025 BWI GmbH and Artifact Conduit contributors
2
// SPDX-License-Identifier: Apache-2.0
3

4
package controller
5

6
import (
7
        "context"
8
        "fmt"
9

10
        wfv1alpha1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
11
        "github.com/go-logr/logr"
12
        "github.com/jastBytes/sprint"
13
        corev1 "k8s.io/api/core/v1"
14
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
15
        "sigs.k8s.io/controller-runtime/pkg/client"
16
        "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
17

18
        arcv1alpha1 "go.opendefense.cloud/arc/api/arc/v1alpha1"
19
)
20

21
type WorkflowHandler interface {
22
        DeleteArgoResources(ctx context.Context) error
23
        CreateArgoResources(ctx context.Context) error
24
        CheckArgoResources(ctx context.Context) error
25
}
26

27
var _ WorkflowHandler = &SingleWorkflowHandler{}
28

29
type SingleWorkflowHandler struct {
30
        *ArtifactWorkflowReconciler
31
        log logr.Logger
32
        aw  *arcv1alpha1.ArtifactWorkflow
33
}
34

35
func NewSingleWorkflowHandler(r *ArtifactWorkflowReconciler, log logr.Logger, aw *arcv1alpha1.ArtifactWorkflow) *SingleWorkflowHandler {
4,664✔
36
        return &SingleWorkflowHandler{r, log, aw}
4,664✔
37
}
4,664✔
38

39
func (h *SingleWorkflowHandler) DeleteArgoResources(ctx context.Context) error {
6✔
40
        wf := wfv1alpha1.Workflow{
6✔
41
                ObjectMeta: metav1.ObjectMeta{
6✔
42
                        Namespace: h.aw.Namespace,
6✔
43
                        Name:      h.aw.Name,
6✔
44
                },
6✔
45
        }
6✔
46
        if err := h.Delete(ctx, &wf); client.IgnoreNotFound(err) != nil {
6✔
47
                h.Recorder.Event(h.aw, corev1.EventTypeWarning, "DeletionFailed", fmt.Sprintf("Failed to delete associated workflow '%s': %v", h.aw.Name, err))
×
48
                return errLogAndWrap(h.log, err, "workflow deletion failed")
×
49
        }
×
50
        h.Recorder.Event(h.aw, corev1.EventTypeNormal, "Deleted", fmt.Sprintf("Deleted workflow '%s'", h.aw.Name))
6✔
51

6✔
52
        return nil
6✔
53
}
54

55
func (h *SingleWorkflowHandler) CreateArgoResources(ctx context.Context) error {
2,418✔
56
        srcSecret, dstSecret, err := h.retrieveSecrets(ctx, h.aw)
2,418✔
57
        if err != nil {
2,418✔
58
                return errLogAndWrap(h.log, err, "failed to fetch secrets for artifact workflow")
×
59
        }
×
60

61
        wf := hydrateArgoWorkflow(h.aw, srcSecret, dstSecret)
2,418✔
62

2,418✔
63
        if err := controllerutil.SetControllerReference(h.aw, wf, h.Scheme); err != nil {
2,418✔
64
                return errLogAndWrap(h.log, err, "failed to set controller reference")
×
65
        }
×
66

67
        if err := h.Create(ctx, wf); client.IgnoreAlreadyExists(err) != nil {
2,628✔
68
                h.Recorder.Event(h.aw, corev1.EventTypeWarning, "CreationFailed", fmt.Sprintf("Failed to create workflow '%s': %v", wf.GetName(), err))
210✔
69
                return errLogAndWrap(h.log, err, "failed to create argo workflow")
210✔
70
        }
210✔
71
        h.Recorder.Event(h.aw, corev1.EventTypeNormal, "Created", fmt.Sprintf("Created workflow '%s'", wf.GetName()))
2,208✔
72

2,208✔
73
        h.aw.Status.Phase = arcv1alpha1.WorkflowPending
2,208✔
74
        if err := h.Status().Update(ctx, h.aw); err != nil {
2,209✔
75
                return errLogAndWrap(h.log, err, "failed to update status")
1✔
76
        }
1✔
77

78
        return nil
2,207✔
79
}
80

81
func (h *SingleWorkflowHandler) CheckArgoResources(ctx context.Context) error {
2,209✔
82
        wf := wfv1alpha1.Workflow{}
2,209✔
83
        if err := h.Get(ctx, namespacedName(h.aw.Namespace, h.aw.Name), &wf); err != nil {
2,209✔
84
                return errLogAndWrap(h.log, err, "failed to get workflow")
×
85
        }
×
86

87
        if updated := h.setStatusFromWorkflow(ctx, h.log, h.aw, &wf); !updated {
2,212✔
88
                return nil // nothing updated
3✔
89
        }
3✔
90

91
        if err := h.Status().Update(ctx, h.aw); err != nil {
2,207✔
92
                return errLogAndWrap(h.log, err, "failed to update status")
1✔
93
        }
1✔
94

95
        return nil
2,205✔
96
}
97

98
var _ WorkflowHandler = &CronWorkflowHandler{}
99

100
type CronWorkflowHandler struct {
101
        *ArtifactWorkflowReconciler
102
        log logr.Logger
103
        aw  *arcv1alpha1.ArtifactWorkflow
104
}
105

106
func NewCronWorkflowHandler(r *ArtifactWorkflowReconciler, log logr.Logger, aw *arcv1alpha1.ArtifactWorkflow) *CronWorkflowHandler {
20✔
107
        return &CronWorkflowHandler{r, log, aw}
20✔
108
}
20✔
109

110
func (h *CronWorkflowHandler) DeleteArgoResources(ctx context.Context) error {
×
111
        cwf := wfv1alpha1.CronWorkflow{
×
112
                ObjectMeta: metav1.ObjectMeta{
×
113
                        Namespace: h.aw.Namespace,
×
114
                        Name:      h.aw.Name,
×
115
                },
×
116
        }
×
117
        if err := h.Delete(ctx, &cwf); client.IgnoreNotFound(err) != nil {
×
118
                h.Recorder.Event(h.aw, corev1.EventTypeWarning, "DeletionFailed", fmt.Sprintf("Failed to delete associated cron workflow '%s': %v", h.aw.Name, err))
×
119
                return errLogAndWrap(h.log, err, "cron workflow deletion failed")
×
120
        }
×
121
        h.Recorder.Event(h.aw, corev1.EventTypeNormal, "Deleted", fmt.Sprintf("Deleted cron workflow '%s'", h.aw.Name))
×
122

×
123
        return nil
×
124
}
125

126
func (h *CronWorkflowHandler) CreateArgoResources(ctx context.Context) error {
3✔
127
        srcSecret, dstSecret, err := h.retrieveSecrets(ctx, h.aw)
3✔
128
        if err != nil {
3✔
129
                return errLogAndWrap(h.log, err, "failed to fetch secrets for artifact workflow")
×
130
        }
×
131

132
        cwf := hydrateArgoCronWorkflow(h.aw, srcSecret, dstSecret)
3✔
133

3✔
134
        if err := controllerutil.SetControllerReference(h.aw, cwf, h.Scheme); err != nil {
3✔
135
                return errLogAndWrap(h.log, err, "failed to set controller reference")
×
136
        }
×
137

138
        if err := h.Create(ctx, cwf); err != nil {
4✔
139
                if client.IgnoreAlreadyExists(err) != nil {
1✔
140
                        h.Recorder.Event(h.aw, corev1.EventTypeWarning, "CreationFailed", fmt.Sprintf("Failed to create cron workflow '%s': %v", cwf.GetName(), err))
×
141
                        return errLogAndWrap(h.log, err, "failed to create argo cron workflow")
×
142
                }
×
143
        } else {
2✔
144
                h.Recorder.Event(h.aw, corev1.EventTypeNormal, "Created", fmt.Sprintf("Created cron workflow '%s'", cwf.GetName()))
2✔
145
        }
2✔
146

147
        h.aw.Status.Phase = arcv1alpha1.WorkflowPending
3✔
148
        if err := h.Status().Update(ctx, h.aw); err != nil {
4✔
149
                return errLogAndWrap(h.log, err, "failed to update status")
1✔
150
        }
1✔
151

152
        return nil
2✔
153
}
154

155
func (h *CronWorkflowHandler) CheckArgoResources(ctx context.Context) error {
15✔
156
        cwf := wfv1alpha1.CronWorkflow{}
15✔
157
        if err := h.Get(ctx, namespacedName(h.aw.Namespace, h.aw.Name), &cwf); err != nil {
15✔
158
                return errLogAndWrap(h.log, err, "failed to get cron workflow")
×
159
        }
×
160

161
        updated := false
15✔
162

15✔
163
        if !h.aw.Status.LastScheduled.Equal(cwf.Status.LastScheduledTime) {
16✔
164
                h.aw.Status.LastScheduled = cwf.Status.LastScheduledTime
1✔
165
                updated = true
1✔
166
        }
1✔
167
        if h.aw.Status.Failed != cwf.Status.Failed {
16✔
168
                h.aw.Status.Failed = cwf.Status.Failed
1✔
169
                updated = true
1✔
170
        }
1✔
171
        if h.aw.Status.Succeeded != cwf.Status.Succeeded {
16✔
172
                h.aw.Status.Succeeded = cwf.Status.Succeeded
1✔
173
                updated = true
1✔
174
        }
1✔
175

176
        // If the active workflow is not the same as the current one, update the reference
177
        if len(cwf.Status.Active) > 0 {
27✔
178
                // Should only contain a single element at most (expected to be in the same namespace!)
12✔
179
                ref := cwf.Status.Active[len(cwf.Status.Active)-1]
12✔
180

12✔
181
                if h.aw.Status.ActiveWorkflowRef.Name != ref.Name {
21✔
182
                        h.log.V(1).Info("Updating reference for cron workflow", "cronWorkflow", cwf.Name, "activeWorkflow", ref.Name)
9✔
183

9✔
184
                        // Get the active workflow
9✔
185
                        wf := wfv1alpha1.Workflow{}
9✔
186
                        if err := h.Get(ctx, namespacedName(h.aw.Namespace, ref.Name), &wf); err != nil {
9✔
187
                                return errLogAndWrap(h.log, err, "failed to fetch active workflow")
×
188
                        }
×
189

190
                        h.aw.Status.ActiveWorkflowRef = corev1.LocalObjectReference{
9✔
191
                                Name: wf.Name,
9✔
192
                        }
9✔
193
                        h.aw.Status.Message = ""
9✔
194
                        h.aw.Status.Phase = arcv1alpha1.WorkflowActive
9✔
195

9✔
196
                        updated = updated || h.setStatusFromWorkflow(ctx, h.log, h.aw, &wf)
9✔
197
                }
198
        }
199

200
        // If there is an active workflow, check its status
201
        if h.aw.Status.ActiveWorkflowRef.Name != "" {
27✔
202
                wf := wfv1alpha1.Workflow{}
12✔
203
                if err := h.Get(ctx, namespacedName(h.aw.Namespace, h.aw.Status.ActiveWorkflowRef.Name), &wf); err != nil {
12✔
204
                        return errLogAndWrap(h.log, err, "failed to fetch active workflow")
×
205
                }
×
206

207
                updated = updated || h.setStatusFromWorkflow(ctx, h.log, h.aw, &wf)
12✔
208

12✔
209
                if wf.Status.Phase.Completed() {
21✔
210
                        h.aw.Status.ActiveWorkflowRef.Name = ""
9✔
211
                        updated = true
9✔
212
                }
9✔
213
        }
214

215
        if !updated {
19✔
216
                return nil
4✔
217
        }
4✔
218

219
        h.log.V(1).Info("Updating status from active workflow", "cronWorkflow", cwf.Name)
11✔
220

11✔
221
        if err := h.Status().Update(ctx, h.aw); err != nil {
11✔
222
                return errLogAndWrap(h.log, err, "failed to update status")
×
223
        }
×
224

225
        return nil
11✔
226
}
227

228
func hydrateArgoWorkflowSpec(aw *arcv1alpha1.ArtifactWorkflow, srcSecret *corev1.Secret, dstSecret *corev1.Secret) wfv1alpha1.WorkflowSpec {
2,421✔
229
        srcVolume := corev1.Volume{
2,421✔
230
                Name: "src-secret-vol",
2,421✔
231
                VolumeSource: corev1.VolumeSource{
2,421✔
232
                        EmptyDir: &corev1.EmptyDirVolumeSource{},
2,421✔
233
                },
2,421✔
234
        }
2,421✔
235
        if srcSecret.Name != "" {
4,388✔
236
                srcVolume.VolumeSource = corev1.VolumeSource{
1,967✔
237
                        Secret: &corev1.SecretVolumeSource{
1,967✔
238
                                SecretName: srcSecret.Name,
1,967✔
239
                        },
1,967✔
240
                }
1,967✔
241
        }
1,967✔
242

243
        dstVolume := corev1.Volume{
2,421✔
244
                Name: "dst-secret-vol",
2,421✔
245
                VolumeSource: corev1.VolumeSource{
2,421✔
246
                        EmptyDir: &corev1.EmptyDirVolumeSource{},
2,421✔
247
                },
2,421✔
248
        }
2,421✔
249
        if dstSecret.Name != "" {
4,388✔
250
                dstVolume.VolumeSource = corev1.VolumeSource{
1,967✔
251
                        Secret: &corev1.SecretVolumeSource{
1,967✔
252
                                SecretName: dstSecret.Name,
1,967✔
253
                        },
1,967✔
254
                }
1,967✔
255
        }
1,967✔
256

257
        parameters := []wfv1alpha1.Parameter{}
2,421✔
258
        for _, p := range aw.Spec.Parameters {
19,607✔
259
                parameters = append(parameters, wfv1alpha1.Parameter{
17,186✔
260
                        Name:  p.Name,
17,186✔
261
                        Value: (*wfv1alpha1.AnyString)(&p.Value),
17,186✔
262
                })
17,186✔
263
        }
17,186✔
264

265
        return wfv1alpha1.WorkflowSpec{
2,421✔
266
                WorkflowTemplateRef: &wfv1alpha1.WorkflowTemplateRef{
2,421✔
267
                        Name:         aw.Spec.WorkflowTemplateRef.Name,
2,421✔
268
                        ClusterScope: aw.Spec.WorkflowTemplateRef.ClusterScope,
2,421✔
269
                },
2,421✔
270
                Volumes: []corev1.Volume{
2,421✔
271
                        srcVolume,
2,421✔
272
                        dstVolume,
2,421✔
273
                },
2,421✔
274
                Arguments: wfv1alpha1.Arguments{
2,421✔
275
                        Parameters: parameters,
2,421✔
276
                },
2,421✔
277
        }
2,421✔
278
}
279

280
func hydrateArgoWorkflow(aw *arcv1alpha1.ArtifactWorkflow, srcSecret *corev1.Secret, dstSecret *corev1.Secret) *wfv1alpha1.Workflow {
2,418✔
281
        return &wfv1alpha1.Workflow{
2,418✔
282
                ObjectMeta: workflowObjectMeta(aw),
2,418✔
283
                Spec:       hydrateArgoWorkflowSpec(aw, srcSecret, dstSecret),
2,418✔
284
        }
2,418✔
285
}
2,418✔
286

287
func hydrateArgoCronWorkflow(aw *arcv1alpha1.ArtifactWorkflow, srcSecret *corev1.Secret, dstSecret *corev1.Secret) *wfv1alpha1.CronWorkflow {
3✔
288
        om := workflowObjectMeta(aw)
3✔
289
        wf := &wfv1alpha1.CronWorkflow{
3✔
290
                ObjectMeta: om,
3✔
291
                Spec: wfv1alpha1.CronWorkflowSpec{
3✔
292
                        WorkflowSpec:               hydrateArgoWorkflowSpec(aw, srcSecret, dstSecret),
3✔
293
                        Schedules:                  aw.Spec.Cron.Schedules,
3✔
294
                        ConcurrencyPolicy:          wfv1alpha1.ReplaceConcurrent,
3✔
295
                        StartingDeadlineSeconds:    aw.Spec.Cron.StartingDeadlineSeconds,
3✔
296
                        Timezone:                   aw.Spec.Cron.Timezone,
3✔
297
                        When:                       aw.Spec.Cron.When,
3✔
298
                        SuccessfulJobsHistoryLimit: sprint.ToPointer(int32(1)),
3✔
299
                        FailedJobsHistoryLimit:     sprint.ToPointer(int32(1)),
3✔
300
                        WorkflowMetadata:           &om,
3✔
301
                },
3✔
302
        }
3✔
303

3✔
304
        return wf
3✔
305
}
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc