Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant/unused code. #73

Merged
merged 1 commit into from
Mar 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions controllers/dspipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ func (r *DSPAReconciler) Apply(owner mf.Owner, params *DSPAParams, template stri
return err
}

if err = tmplManifest.Apply(); err != nil {
return err
}
return nil
return tmplManifest.Apply()
}

func (r *DSPAReconciler) ApplyWithoutOwner(params *DSPAParams, template string, fns ...mf.Transformer) error {
Expand All @@ -79,10 +76,7 @@ func (r *DSPAReconciler) ApplyWithoutOwner(params *DSPAParams, template string,
return err
}

if err = tmplManifest.Apply(); err != nil {
return err
}
return nil
return tmplManifest.Apply()
}

func (r *DSPAReconciler) DeleteResource(params *DSPAParams, template string, fns ...mf.Transformer) error {
Expand All @@ -96,10 +90,7 @@ func (r *DSPAReconciler) DeleteResource(params *DSPAParams, template string, fns
return err
}

if err = tmplManifest.Delete(); err != nil {
return err
}
return nil
return tmplManifest.Delete()
}

func (r *DSPAReconciler) DeleteResourceIfItExists(ctx context.Context, obj client.Object, nn types.NamespacedName) error {
Expand Down Expand Up @@ -179,7 +170,7 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
if controllerutil.ContainsFinalizer(dspa, finalizerName) {
params.Name = dspa.Name
params.Namespace = dspa.Namespace
if err := r.cleanUpResources(ctx, req, dspa, params); err != nil {
if err := r.cleanUpResources(params); err != nil {
return ctrl.Result{}, err
}
controllerutil.RemoveFinalizer(dspa, finalizerName)
Expand Down Expand Up @@ -259,11 +250,6 @@ func (r *DSPAReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

// Clean Up any resources not handled by garbage collection, like Cluster ResourceRequirements
func (r *DSPAReconciler) cleanUpResources(ctx context.Context, req ctrl.Request, dsp *dspav1alpha1.DataSciencePipelinesApplication, params *DSPAParams) error {
err := r.CleanUpCommon(params)
if err != nil {
return err
}

return nil
func (r *DSPAReconciler) cleanUpResources(params *DSPAParams) error {
return r.CleanUpCommon(params)
}