Skip to content

Commit f82654d

Browse files
authored
Merge pull request #284 from Nalum/issue-245
Move Path check into switch case
2 parents b19e3e9 + f75315e commit f82654d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

controllers/imageupdateautomation_controller.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,6 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
249249
}
250250
}
251251

252-
manifestsPath := tmp
253-
if auto.Spec.Update.Path != "" {
254-
tracelog.Info("adjusting update path according to .spec.update.path", "base", tmp, "spec-path", auto.Spec.Update.Path)
255-
if p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path); err != nil {
256-
return failWithError(err)
257-
} else {
258-
manifestsPath = p
259-
}
260-
}
261-
262252
switch {
263253
case auto.Spec.Update != nil && auto.Spec.Update.Strategy == imagev1.UpdateStrategySetters:
264254
// For setters we first want to compile a list of _all_ the
@@ -269,6 +259,16 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
269259
return failWithError(err)
270260
}
271261

262+
manifestsPath := tmp
263+
if auto.Spec.Update.Path != "" {
264+
tracelog.Info("adjusting update path according to .spec.update.path", "base", tmp, "spec-path", auto.Spec.Update.Path)
265+
p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path)
266+
if err != nil {
267+
return failWithError(err)
268+
}
269+
manifestsPath = p
270+
}
271+
272272
debuglog.Info("updating with setters according to image policies", "count", len(policies.Items), "manifests-path", manifestsPath)
273273
if tracelog.Enabled() {
274274
for _, item := range policies.Items {

0 commit comments

Comments
 (0)