timflannagan/rukpak

clean up this implementation

github-actions opened this issue · 1 comments

		}
	}()

	bundle, oldBundles, err := r.reconcileDesiredBundle(ctx, bi)
	if err != nil {
		// TODO: clean up this implementation
		if errors.Is(err, ErrMaxGeneratedLimit) {
			meta.SetStatusCondition(&bi.Status.Conditions, metav1.Condition{
				Type:    rukpakv1alpha1.TypeHasValidBundle,
				Status:  metav1.ConditionFalse,
				Reason:  "InvalidDesiredBundle",
				Message: err.Error(),
			})
			return ctrl.Result{}, nil
		}
		meta.SetStatusCondition(&bi.Status.Conditions, metav1.Condition{
			Type:    rukpakv1alpha1.TypeHasValidBundle,
			Status:  metav1.ConditionUnknown,
			Reason:  "InvalidDesiredBundle",
			Message: err.Error(),
		})
		return ctrl.Result{}, err
	}
	if bundle.Status.Phase != rukpakv1alpha1.PhaseUnpacked {
		reason := rukpakv1alpha1.ReasonUnpackPending
		status := metav1.ConditionTrue
		message := fmt.Sprintf("Waiting for the %s Bundle to be unpacked", bundle.GetName())
		if bundle.Status.Phase == rukpakv1alpha1.PhaseFailing {
			reason = rukpakv1alpha1.ReasonUnpackFailed
			status = metav1.ConditionFalse
			message = fmt.Sprintf("Failed to unpack the %s Bundle", bundle.GetName())
		}
		meta.SetStatusCondition(&bi.Status.Conditions, metav1.Condition{
			Type:    rukpakv1alpha1.TypeHasValidBundle,
			Status:  status,
			Reason:  reason,
			Message: message,
		})
		return ctrl.Result{}, nil
	}
	meta.SetStatusCondition(&bi.Status.Conditions, metav1.Condition{
		Type:    rukpakv1alpha1.TypeHasValidBundle,
		Status:  metav1.ConditionTrue,
		Reason:  rukpakv1alpha1.ReasonUnpackSuccessful,
		Message: fmt.Sprintf("Successfully unpacked the %s Bundle", bundle.GetName()),
	})
	desiredObjects, err := r.loadBundle(ctx, bundle, bi.GetName())
	if err != nil {
		meta.SetStatusCondition(&bi.Status.Conditions, metav1.Condition{
			Type:    rukpakv1alpha1.TypeHasValidBundle,
			Status:  metav1.ConditionFalse,

This issue has become stale because it has been open 60 days with no activity. The maintainers of this repo will remove this label during issue triage or it will be removed automatically after an update. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.