Skip to content

Commit

Permalink
fix not found
Browse files Browse the repository at this point in the history
Signed-off-by: zounengren <zouyee1989@gmail.com>
  • Loading branch information
zouyee committed Jul 11, 2022
1 parent 7d8cb3d commit 212baf5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/controller/evpa/effective_vpa_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
vpatypes "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
Expand Down Expand Up @@ -43,8 +44,13 @@ func (c *EffectiveVPAController) Reconcile(ctx context.Context, req ctrl.Request
klog.V(4).Infof("Got evpa %s", req.NamespacedName)

evpa := &autoscalingapi.EffectiveVerticalPodAutoscaler{}
err := c.Client.Get(ctx, req.NamespacedName, evpa)
err := c.Get(ctx, req.NamespacedName, evpa)
if err != nil {
if errors.IsNotFound(err) {
// Object not found, return
klog.V(3).Infof("EffectiveVPA %s has been deleted.", req)
return ctrl.Result{}, nil
}
return ctrl.Result{}, err
}

Expand Down

0 comments on commit 212baf5

Please sign in to comment.