Skip to content

Commit

Permalink
write successfull condition after writing droplet info
Browse files Browse the repository at this point in the history
  • Loading branch information
pbusko committed Oct 4, 2024
1 parent ca6d658 commit 3e5f3ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions kpack-image-builder/controllers/buildworkload_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,6 @@ func (r *BuildWorkloadReconciler) ReconcileResource(ctx context.Context, buildWo
ObservedGeneration: buildWorkload.Generation,
})
} else if latestBuildSuccessful.IsTrue() {
meta.SetStatusCondition(&buildWorkload.Status.Conditions, metav1.Condition{
Type: korifiv1alpha1.SucceededConditionType,
Status: metav1.ConditionTrue,
Reason: "BuildSucceeded",
Message: "Image built successfully",
ObservedGeneration: buildWorkload.Generation,
})

foundServiceAccount := corev1.ServiceAccount{}
err = r.k8sClient.Get(ctx, types.NamespacedName{
Namespace: buildWorkload.Namespace,
Expand All @@ -280,6 +272,14 @@ func (r *BuildWorkloadReconciler) ReconcileResource(ctx context.Context, buildWo
log.Info("error when compiling the DropletStatus", "reason", err)
return ctrl.Result{}, err
}

meta.SetStatusCondition(&buildWorkload.Status.Conditions, metav1.Condition{
Type: korifiv1alpha1.SucceededConditionType,
Status: metav1.ConditionTrue,
Reason: "BuildSucceeded",
Message: "Image built successfully",
ObservedGeneration: buildWorkload.Generation,
})
}

return ctrl.Result{}, nil
Expand Down

0 comments on commit 3e5f3ae

Please sign in to comment.