timflannagan / rukpak

Rukpak runs in a Kubernetes cluster and defines an API for installing cloud native bundle content
Apache License 2.0
0 stars 0 forks source link

should we be deleting Bundles that have a different spec.ProvisionerClassName #52

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

compared to the BI's BundleTemplate value?

https://github.com/timflannagan/rukpak/blob/d4da363c57e57c975d007b787116aa9368a1da6d/internal/provisioner/plain/controllers/bundleinstance_controller.go#L362


            Spec: bi.Spec.Template.Spec,
        }
        if err := r.Create(ctx, b); err != nil {
            return nil, nil, err
        }
    }
    return b, existingBundles, err
}

// reconcileOldBundles is responsible for garbage collecting any Bundles
// that no longer match the desired Bundle template.
func (r *BundleInstanceReconciler) reconcileOldBundles(ctx context.Context, oldBundles []*rukpakv1alpha1.Bundle, currBundle *rukpakv1alpha1.Bundle) (int, error) {
    var (
        errors         []error
        deletedBundles int
    )
    for _, b := range oldBundles {
        if b.GetName() == currBundle.GetName() {
            continue
        }
        // TODO: should we be deleting Bundles that have a different spec.ProvisionerClassName
        // compared to the BI's BundleTemplate value?
        if err := r.Delete(ctx, b); err != nil {
            errors = append(errors, err)
            continue
        }
        deletedBundles++
    }
    return deletedBundles, utilerrors.NewAggregate(errors)
}

type releaseState string
github-actions[bot] commented 1 year ago

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.