Skip to content

Commit

Permalink
Copy urlError in Bundle annotations to status
Browse files Browse the repository at this point in the history
This leads to the GitRepo controller picking up the status message from
the Bundle, so that the GitRepo resource also shows the same error that
is shown in the Bundle.

This works without having to further adapt the GitRepo but likely is the
same mechanism that copies the template errors from the Bundle to the
GitRepo.
  • Loading branch information
p-se committed Jan 29, 2025
1 parent 3fc985b commit 3e31e7f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/cmd/controller/reconciler/bundle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@ func (r *BundleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
return ctrl.Result{}, err
}

if bundle.Annotations != nil && bundle.Annotations["fleet.cattle.io/urlError"] != "" {
bundle.Status.Conditions = []genericcondition.GenericCondition{
{
Type: string(fleet.Ready),
Status: v1.ConditionFalse,
Message: "URL error: " + bundle.Annotations["fleet.cattle.io/urlError"],
LastUpdateTime: metav1.Now().UTC().Format(time.RFC3339),
},
}

err := r.updateStatus(ctx, bundleOrig, bundle)
return ctrl.Result{}, err
}

if (!contentsInOCI && !contentsInHelmChart) && len(matchedTargets) > 0 {
// when not using the OCI registry or helm chart we need to create a contents resource
// so the BundleDeployments are able to access the contents to be deployed.
Expand Down

0 comments on commit 3e31e7f

Please sign in to comment.