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

chore: remove dead code #1203

Merged
merged 1 commit into from
Aug 29, 2024
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
30 changes: 2 additions & 28 deletions controllers/dscinitialization/dscinitialization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ func (r *DSCInitializationReconciler) Reconcile(ctx context.Context, req ctrl.Re
saved.Status.Phase = status.PhaseProgressing
})
if err != nil {
r.Log.Error(err, "Failed to add conditions to status of DSCInitialization resource.", "DSCInitialization Request.Name", req.Name)
r.Log.Error(err, "Failed to add conditions to status of DSCInitialization resource.", "DSCInitialization", req.Namespace, "Request.Name", req.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change, btw

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, when removed the duplicated one, saw it has better logging than the kept one, so i just use it instead

r.Recorder.Eventf(instance, corev1.EventTypeWarning, "DSCInitializationReconcileError",
"%s for instance %s", message, instance.Name)

return reconcile.Result{}, err
}
}

// Check namespace
// Check namespace is not exist, then create
namespace := instance.Spec.ApplicationsNamespace
err = r.createOdhNamespace(ctx, instance, namespace)
if err != nil {
Expand Down Expand Up @@ -206,32 +206,6 @@ func (r *DSCInitializationReconciler) Reconcile(ctx context.Context, req ctrl.Re

return ctrl.Result{}, nil
default:
// Check namespace is not exist, then create
namespace := instance.Spec.ApplicationsNamespace
r.Log.Info("Standard Reconciling workflow to create namespaces")
err = r.createOdhNamespace(ctx, instance, namespace)
if err != nil {
// no need to log error as it was already logged in createOdhNamespace
return reconcile.Result{}, err
}

// Start reconciling
if instance.Status.Conditions == nil {
reason := status.ReconcileInit
message := "Initializing DSCInitialization resource"
instance, err = status.UpdateWithRetry(ctx, r.Client, instance, func(saved *dsciv1.DSCInitialization) {
status.SetProgressingCondition(&saved.Status.Conditions, reason, message)
saved.Status.Phase = status.PhaseProgressing
})
if err != nil {
r.Log.Error(err, "Failed to add conditions to status of DSCInitialization resource.", "DSCInitialization", req.Namespace, "Request.Name", req.Name)
r.Recorder.Eventf(instance, corev1.EventTypeWarning, "DSCInitializationReconcileError",
"%s for instance %s", message, instance.Name)

return reconcile.Result{}, err
}
}

switch platform {
case cluster.SelfManagedRhods:
err := r.createUserGroup(ctx, instance, "rhods-admins")
Expand Down
Loading