diff --git a/internal/controller/lease_controller.go b/internal/controller/lease_controller.go index 81f7e5e..aba7b85 100644 --- a/internal/controller/lease_controller.go +++ b/internal/controller/lease_controller.go @@ -23,6 +23,7 @@ import ( jumpstarterdevv1alpha1 "github.com/jumpstarter-dev/jumpstarter-controller/api/v1alpha1" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -57,7 +58,9 @@ func (r *LeaseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl var lease jumpstarterdevv1alpha1.Lease if err := r.Get(ctx, req.NamespacedName, &lease); err != nil { - logger.Error(err, "Reconcile: unable to get lease", "lease", req.NamespacedName) + if !apierrors.IsNotFound(err) { + logger.Error(err, "Reconcile: unable to get lease", "lease", req.NamespacedName) + } return ctrl.Result{}, client.IgnoreNotFound(err) }