Skip to content

Commit

Permalink
Merge pull request #399 from ustackq/found
Browse files Browse the repository at this point in the history
fix evpa not found
  • Loading branch information
qmhu committed Jul 12, 2022
2 parents 5394779 + 212baf5 commit c06c0c3
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 c06c0c3

Please sign in to comment.