Skip to content

Commit a9f333a

Browse files
committed
bump shell
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
1 parent b010d4e commit a9f333a

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/dominikbraun/graph v0.23.0
1111
github.com/ettle/strcase v0.2.0
1212
github.com/flant/kube-client v1.3.1
13-
github.com/flant/shell-operator v1.11.0
13+
github.com/flant/shell-operator v1.11.2-0.20251006170554-9f8e9743f0ce
1414
github.com/go-chi/chi/v5 v5.2.2
1515
github.com/go-openapi/loads v0.19.5
1616
github.com/go-openapi/spec v0.19.8

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ github.com/flant/go-openapi-validate v0.19.12-flant.1 h1:GuB9XEfiLHq3M7fafRLq1AW
164164
github.com/flant/go-openapi-validate v0.19.12-flant.1/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4=
165165
github.com/flant/kube-client v1.3.1 h1:1SdD799sujXNg2F6Z27le/+qkcKQaKf9Z492YGEhVhc=
166166
github.com/flant/kube-client v1.3.1/go.mod h1:mql6hsZMgBLAhdj3Emb8TrP5MVdXduFQ2NLjzn6IF0Y=
167-
github.com/flant/shell-operator v1.11.0 h1:1fbhgVsO0OtZn5LZBsZcn6EU2NtQFI/yQZE7LvgMLjA=
168-
github.com/flant/shell-operator v1.11.0/go.mod h1:TFTCgXpp+yrvSUQSQKgotJbRK720fiqwaQdFVU6dAlU=
167+
github.com/flant/shell-operator v1.11.2-0.20251006170554-9f8e9743f0ce h1:NjGH3Go4MP6TvJLdzmoh16L9zC8GrfMzTJxM7Mdz5XA=
168+
github.com/flant/shell-operator v1.11.2-0.20251006170554-9f8e9743f0ce/go.mod h1:TFTCgXpp+yrvSUQSQKgotJbRK720fiqwaQdFVU6dAlU=
169169
github.com/flopp/go-findfont v0.1.0 h1:lPn0BymDUtJo+ZkV01VS3661HL6F4qFlkhcJN55u6mU=
170170
github.com/flopp/go-findfont v0.1.0/go.mod h1:wKKxRDjD024Rh7VMwoU90i6ikQRCr+JTHB5n4Ejkqvw=
171171
github.com/fluxcd/flagger v1.36.1 h1:X2PumtNwZz9YSGaOtZLFm2zAKLgHhFkbNv8beg7ifyc=

pkg/addon-operator/metrics.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package addon_operator
22

33
import (
4+
"context"
45
"time"
56

67
metricsstorage "github.com/deckhouse/deckhouse/pkg/metrics-storage"
@@ -148,7 +149,7 @@ func StartTasksQueueLengthUpdater(metricStorage metricsstorage.Storage, tqs *que
148149
go func() {
149150
for {
150151
// Gather task queues lengths.
151-
tqs.Iterate(func(queue *queue.TaskQueue) {
152+
tqs.Iterate(context.TODO(), func(_ context.Context, queue *queue.TaskQueue) {
152153
queueLen := float64(queue.Length())
153154
metricStorage.GaugeSet("{PREFIX}tasks_queue_length", queueLen, map[string]string{"queue": queue.Name})
154155
})

pkg/addon-operator/operator_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/deckhouse/deckhouse/pkg/log"
1313
metricstorage "github.com/deckhouse/deckhouse/pkg/metrics-storage"
1414
. "github.com/onsi/gomega"
15+
"github.com/prometheus/client_golang/prometheus"
1516
v1 "k8s.io/api/core/v1"
1617
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1718
k8types "k8s.io/apimachinery/pkg/types"
@@ -104,6 +105,10 @@ func assembleTestAddonOperator(t *testing.T, configPath string) (*AddonOperator,
104105
_, err := kubeClient.CoreV1().ConfigMaps(result.cmNamespace).Create(context.TODO(), cmObj, metav1.CreateOptions{})
105106
g.Expect(err).ShouldNot(HaveOccurred(), "Should create ConfigMap/%s", result.cmName)
106107

108+
registry := prometheus.NewRegistry()
109+
prometheus.DefaultGatherer = registry
110+
prometheus.DefaultRegisterer = registry
111+
107112
// Assemble AddonOperator.
108113
op := NewAddonOperator(context.Background(), WithLogger(log.NewNop()))
109114
op.engine.KubeClient = kubeClient
@@ -136,10 +141,12 @@ func assembleTestAddonOperator(t *testing.T, configPath string) (*AddonOperator,
136141
MetricStorage: metricstorage.NewMetricStorage(
137142
metricstorage.WithPrefix("addon_operator_"),
138143
metricstorage.WithLogger(log.NewNop()),
144+
metricstorage.WithNewRegistry(),
139145
),
140146
HookMetricStorage: metricstorage.NewMetricStorage(
141147
metricstorage.WithPrefix("addon_operator_"),
142148
metricstorage.WithLogger(log.NewNop()),
149+
metricstorage.WithNewRegistry(),
143150
),
144151
}
145152
cfg := module_manager.ModuleManagerConfig{

0 commit comments

Comments
 (0)