diff --git a/controllers/imageupdateautomation_controller.go b/controllers/imageupdateautomation_controller.go index 5f3bc178..03fbbb32 100644 --- a/controllers/imageupdateautomation_controller.go +++ b/controllers/imageupdateautomation_controller.go @@ -249,16 +249,6 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr } } - manifestsPath := tmp - if auto.Spec.Update.Path != "" { - tracelog.Info("adjusting update path according to .spec.update.path", "base", tmp, "spec-path", auto.Spec.Update.Path) - if p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path); err != nil { - return failWithError(err) - } else { - manifestsPath = p - } - } - switch { case auto.Spec.Update != nil && auto.Spec.Update.Strategy == imagev1.UpdateStrategySetters: // 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 return failWithError(err) } + manifestsPath := tmp + if auto.Spec.Update.Path != "" { + tracelog.Info("adjusting update path according to .spec.update.path", "base", tmp, "spec-path", auto.Spec.Update.Path) + p, err := securejoin.SecureJoin(tmp, auto.Spec.Update.Path) + if err != nil { + return failWithError(err) + } + manifestsPath = p + } + debuglog.Info("updating with setters according to image policies", "count", len(policies.Items), "manifests-path", manifestsPath) if tracelog.Enabled() { for _, item := range policies.Items {