Skip to content

Commit 368367c

Browse files
Hedingberomesser
authored andcommitted
[Bugfix] poller should not throw on not found errors (#27)
1 parent a580fa1 commit 368367c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/autoscaler/poller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/nuclio/errors"
77
"github.com/nuclio/logger"
88
"github.com/v3io/scaler-types"
9+
k8serrors "k8s.io/apimachinery/pkg/api/errors"
910
"k8s.io/apimachinery/pkg/labels"
1011
"k8s.io/apimachinery/pkg/runtime/schema"
1112
custommetricsv1 "k8s.io/metrics/pkg/client/custom_metrics"
@@ -59,6 +60,9 @@ func (mp *MetricsPoller) getResourceMetrics() error {
5960
resourceLabels,
6061
mp.metricName)
6162
if err != nil {
63+
if k8serrors.IsNotFound(err) {
64+
return nil
65+
}
6266
return errors.Wrap(err, "Failed to get custom metrics")
6367
}
6468

0 commit comments

Comments
 (0)