Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Sep 11, 2024
1 parent 251417b commit cda845c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions controllers/devbox/internal/controller/devbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ func (r *DevboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
logger.Error(err, "sync secret failed")
r.Recorder.Eventf(devbox, corev1.EventTypeWarning, "Sync secret failed", "%v", err)
return ctrl.Result{}, err
} else {
logger.Info("sync secret success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync secret success", "Sync secret success")
}
logger.Info("sync secret success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync secret success", "Sync secret success")

// create service if network type is NodePort
if devbox.Spec.NetworkSpec.Type == devboxv1alpha1.NetworkTypeNodePort {
Expand Down Expand Up @@ -150,10 +149,9 @@ func (r *DevboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
logger.Error(err, "sync pod failed")
r.Recorder.Eventf(devbox, corev1.EventTypeWarning, "Sync pod failed", "%v", err)
return ctrl.Result{}, err
} else {
logger.Info("sync pod success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync pod success", "Sync pod success")
}
logger.Info("sync pod success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync pod success", "Sync pod success")

logger.Info("devbox reconcile success")
return ctrl.Result{}, nil
Expand Down Expand Up @@ -224,10 +222,9 @@ func (r *DevboxReconciler) syncPod(ctx context.Context, devbox *devboxv1alpha1.D
logger.Error(err, "sync pod failed")
r.Recorder.Eventf(devbox, corev1.EventTypeWarning, "Sync pod failed", "%v", err)
return
} else {
logger.Info("sync pod success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync pod success", "Sync pod success")
}
logger.Info("update devbox status success")
r.Recorder.Eventf(devbox, corev1.EventTypeNormal, "Sync pod success", "Sync pod success")
}()

var podList corev1.PodList
Expand Down Expand Up @@ -546,7 +543,7 @@ func (r *DevboxReconciler) generateDevboxPod(devbox *devboxv1alpha1.Devbox, runt
},
}
// set controller reference and finalizer
controllerutil.SetControllerReference(devbox, expectPod, r.Scheme)
_ = controllerutil.SetControllerReference(devbox, expectPod, r.Scheme)
controllerutil.AddFinalizer(expectPod, devboxv1alpha1.FinalizerName)
return expectPod
}
Expand Down

0 comments on commit cda845c

Please sign in to comment.