Skip to content

Commit

Permalink
[Bugfix] poller should not throw on not found errors (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedingber authored and omesser committed Sep 5, 2019
1 parent a580fa1 commit 368367c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/autoscaler/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/nuclio/errors"
"github.com/nuclio/logger"
"github.com/v3io/scaler-types"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
custommetricsv1 "k8s.io/metrics/pkg/client/custom_metrics"
Expand Down Expand Up @@ -59,6 +60,9 @@ func (mp *MetricsPoller) getResourceMetrics() error {
resourceLabels,
mp.metricName)
if err != nil {
if k8serrors.IsNotFound(err) {
return nil
}
return errors.Wrap(err, "Failed to get custom metrics")
}

Expand Down

0 comments on commit 368367c

Please sign in to comment.