Skip to content

Commit 9af0de6

Browse files
committed
Fix status reporting when the source is not found
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 parent 2a2cee3 commit 9af0de6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

controllers/kustomization_controller.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,7 @@ func (r *KustomizationReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
147147

148148
// resolve source reference
149149
source, err := r.getSource(ctx, kustomization)
150-
if err != nil {
151-
return ctrl.Result{}, err
152-
}
153-
154-
// check source readiness
155-
if source.GetArtifact() == nil {
150+
if err != nil || source.GetArtifact() == nil {
156151
msg := "Source is not ready"
157152
kustomization = kustomizev1.KustomizationNotReady(kustomization, "", kustomizev1.ArtifactFailedReason, msg)
158153
if err := r.Status().Update(ctx, &kustomization); err != nil {

0 commit comments

Comments
 (0)