From 6e515b775d0462ba2c038a2ab35d08affb54edbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 17:04:57 +0100 Subject: [PATCH 1/8] fix: Remove dump in tests --- internal/pkg/service/stream/storage/cleanup/node_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/pkg/service/stream/storage/cleanup/node_test.go b/internal/pkg/service/stream/storage/cleanup/node_test.go index 88144b23cc..d7f3948d01 100644 --- a/internal/pkg/service/stream/storage/cleanup/node_test.go +++ b/internal/pkg/service/stream/storage/cleanup/node_test.go @@ -6,7 +6,6 @@ import ( "time" "github.com/benbjohnson/clock" - "github.com/davecgh/go-spew/spew" "github.com/keboola/go-client/pkg/keboola" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -95,7 +94,6 @@ func TestNode(t *testing.T) { require.NoError(t, defRepo.Source().Create("Create source", &source).Do(ctx).Err()) sink := test.NewSink(sinkKey) sink.Config = sink.Config.With(testconfig.LocalVolumeConfig(2, []string{"default"})) - spew.Dump(testconfig.LocalVolumeConfig(2, []string{"default"})) require.NoError(t, defRepo.Sink().Create("Create sink", &sink).Do(ctx).Err()) require.NoError(t, tokenRepo.Put(sink.SinkKey, keboola.Token{Token: "my-token"}).Do(ctx).Err()) } From 0f6995000c70a43af550bb08c81fbfb3039dce26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 15:49:46 +0100 Subject: [PATCH 2/8] feat: Add configmap.NewValueWithOrigin --- internal/pkg/service/common/configmap/value.go | 4 ++++ internal/pkg/service/common/configmap/value_test.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/internal/pkg/service/common/configmap/value.go b/internal/pkg/service/common/configmap/value.go index b0a4bc0eb7..d95b6163c9 100644 --- a/internal/pkg/service/common/configmap/value.go +++ b/internal/pkg/service/common/configmap/value.go @@ -30,6 +30,10 @@ func NewValue[T any](v T) Value[T] { return Value[T]{Value: v, SetBy: SetByDefault} } +func NewValueWithOrigin[T any](v T, setBy SetBy) Value[T] { + return Value[T]{Value: v, SetBy: setBy} +} + func (v fieldValue) IsSet() bool { return v.SetBy != SetByDefault } diff --git a/internal/pkg/service/common/configmap/value_test.go b/internal/pkg/service/common/configmap/value_test.go index 15cfa43152..de4f829299 100644 --- a/internal/pkg/service/common/configmap/value_test.go +++ b/internal/pkg/service/common/configmap/value_test.go @@ -22,3 +22,9 @@ func TestNewValue(t *testing.T) { t.Parallel() assert.Equal(t, configmap.Value[int]{Value: 123, SetBy: configmap.SetByDefault}, configmap.NewValue(123)) } + +func TestNewValueWithOrigin(t *testing.T) { + t.Parallel() + assert.Equal(t, configmap.Value[int]{Value: 123, SetBy: configmap.SetByDefault}, configmap.NewValueWithOrigin(123, configmap.SetByDefault)) + assert.Equal(t, configmap.Value[int]{Value: 123, SetBy: configmap.SetByFlag}, configmap.NewValueWithOrigin(123, configmap.SetByFlag)) +} From 06417038f8fc794ab52ea3363912fda4827a1fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 15:50:43 +0100 Subject: [PATCH 3/8] feat: Remove configmap.SetByUnknown --- internal/pkg/service/cli/options/options_test.go | 2 +- internal/pkg/service/common/configmap/bind.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/pkg/service/cli/options/options_test.go b/internal/pkg/service/cli/options/options_test.go index bc3444b37d..38e8b56431 100644 --- a/internal/pkg/service/cli/options/options_test.go +++ b/internal/pkg/service/cli/options/options_test.go @@ -30,7 +30,7 @@ func TestValuesPriority(t *testing.T) { err := options.Load(context.Background(), logger, env.Empty(), fs, &pflag.FlagSet{}) assert.NoError(t, err) assert.Equal(t, "", options.GetString(key)) - assert.Equal(t, configmap.SetByUnknown, options.KeySetBy(key)) + assert.Equal(t, configmap.SetByDefault, options.KeySetBy(key)) // 2. Lowest priority, flag default value flags := &pflag.FlagSet{} diff --git a/internal/pkg/service/common/configmap/bind.go b/internal/pkg/service/common/configmap/bind.go index be6177684c..8d9649bdfa 100644 --- a/internal/pkg/service/common/configmap/bind.go +++ b/internal/pkg/service/common/configmap/bind.go @@ -20,8 +20,7 @@ import ( ) const ( - SetByUnknown SetBy = iota - SetByDefault + SetByDefault SetBy = iota SetByConfig SetByFlag SetByEnv From c17887c13d4d9a8b1efb9a15795864a484952c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 15:55:26 +0100 Subject: [PATCH 4/8] refactor: Fix pointer usage --- internal/pkg/service/cli/cmd/sync/init/cmd.go | 4 ++-- internal/pkg/service/cli/dialog/init_test.go | 2 +- internal/pkg/service/common/configmap/bind.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/pkg/service/cli/cmd/sync/init/cmd.go b/internal/pkg/service/cli/cmd/sync/init/cmd.go index ea1b9b7378..10ed1df13f 100644 --- a/internal/pkg/service/cli/cmd/sync/init/cmd.go +++ b/internal/pkg/service/cli/cmd/sync/init/cmd.go @@ -22,8 +22,8 @@ type Flags struct { CIMainBranch configmap.Value[string] `configKey:"ci-main-branch" configUsage:"name of the main branch for push/pull workflows"` } -func DefaultFlags() *Flags { - return &Flags{ +func DefaultFlags() Flags { + return Flags{ CI: configmap.NewValue(true), CIValidate: configmap.NewValue(true), CIPull: configmap.NewValue(true), diff --git a/internal/pkg/service/cli/dialog/init_test.go b/internal/pkg/service/cli/dialog/init_test.go index 2a314c3900..5b9a360d26 100644 --- a/internal/pkg/service/cli/dialog/init_test.go +++ b/internal/pkg/service/cli/dialog/init_test.go @@ -67,7 +67,7 @@ func TestDialogs_AskInitOptions(t *testing.T) { }() // Run - opts, err := syncInit.AskInitOptions(context.Background(), dialog, d, *syncInit.DefaultFlags()) + opts, err := syncInit.AskInitOptions(context.Background(), dialog, d, syncInit.DefaultFlags()) assert.NoError(t, err) assert.NoError(t, console.Tty().Close()) wg.Wait() diff --git a/internal/pkg/service/common/configmap/bind.go b/internal/pkg/service/common/configmap/bind.go index 8d9649bdfa..674ff4fd5a 100644 --- a/internal/pkg/service/common/configmap/bind.go +++ b/internal/pkg/service/common/configmap/bind.go @@ -191,7 +191,7 @@ func Bind(inputs BindConfig, targets ...any) error { errs := errors.NewMultiError() for _, target := range targets { // Validate type - if v := reflect.ValueOf(target); v.Kind() != reflect.Pointer && v.Type().Elem().Kind() != reflect.Pointer { + if v := reflect.ValueOf(target); v.Kind() != reflect.Pointer || v.Type().Elem().Kind() != reflect.Struct { return errors.Errorf(`cannot bind to type "%s": expected a pointer to a struct`, v.Type().String()) } From abaa875bfb9dd0d3ac84e312382a12442dc2c718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 15:55:45 +0100 Subject: [PATCH 5/8] tests: Fix TestDialogs_AskInitOptions_No_CI --- internal/pkg/service/cli/dialog/init_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/pkg/service/cli/dialog/init_test.go b/internal/pkg/service/cli/dialog/init_test.go index 5b9a360d26..e4d52e776f 100644 --- a/internal/pkg/service/cli/dialog/init_test.go +++ b/internal/pkg/service/cli/dialog/init_test.go @@ -109,10 +109,9 @@ func TestDialogs_AskInitOptions_No_CI(t *testing.T) { o.Set("ci", "false") o.Set("branches", "main") - f := syncInit.Flags{ - Branches: configmap.NewValue("main"), - CI: configmap.NewValue(false), - } + f := syncInit.DefaultFlags() + f.Branches = configmap.NewValueWithOrigin("main", configmap.SetByFlag) + f.CI = configmap.NewValueWithOrigin(false, configmap.SetByFlag) // Run opts, err := syncInit.AskInitOptions(context.Background(), dialog, d, f) From 62b35e850bf1ee35589b9424014e33f1721d6ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 17:05:22 +0100 Subject: [PATCH 6/8] tests: Fix TestAskWorkflowsOptionsByFlag --- internal/pkg/service/cli/cmd/ci/workflow/cmd.go | 12 ++++++------ internal/pkg/service/cli/dialog/workflows_test.go | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/internal/pkg/service/cli/cmd/ci/workflow/cmd.go b/internal/pkg/service/cli/cmd/ci/workflow/cmd.go index 26379eb931..8e646036c5 100644 --- a/internal/pkg/service/cli/cmd/ci/workflow/cmd.go +++ b/internal/pkg/service/cli/cmd/ci/workflow/cmd.go @@ -19,8 +19,8 @@ type Flags struct { CIPush configmap.Value[bool] `configKey:"ci-push" configUsage:"create workflow to push change in main branch to the project"` } -func DefaultFlags() *Flags { - return &Flags{ +func DefaultFlags() Flags { + return Flags{ CI: configmap.NewValue(true), CIValidate: configmap.NewValue(true), CIPush: configmap.NewValue(true), @@ -35,9 +35,9 @@ func WorkflowsCommand(p dependencies.Provider) *cobra.Command { Short: helpmsg.Read(`ci/workflows/short`), Long: helpmsg.Read(`ci/workflows/long`), RunE: func(cmd *cobra.Command, args []string) (err error) { - f := DefaultFlags() - // bind flags to struct - if err := configmap.Bind(utils.GetBindConfig(cmd.Flags(), args), f); err != nil { + // Bind flags to struct + f := Flags{} + if err := configmap.Bind(utils.GetBindConfig(cmd.Flags(), args), &f); err != nil { return err } @@ -52,7 +52,7 @@ func WorkflowsCommand(p dependencies.Provider) *cobra.Command { } // Ask options - options := AskWorkflowsOptions(*f, d.Dialogs()) + options := AskWorkflowsOptions(f, d.Dialogs()) // Generate workflows return workflowsGen.Run(cmd.Context(), prj.Fs(), options, d) diff --git a/internal/pkg/service/cli/dialog/workflows_test.go b/internal/pkg/service/cli/dialog/workflows_test.go index 04f0fee084..8c52617a9e 100644 --- a/internal/pkg/service/cli/dialog/workflows_test.go +++ b/internal/pkg/service/cli/dialog/workflows_test.go @@ -44,7 +44,7 @@ func TestAskWorkflowsOptionsInteractive(t *testing.T) { }() // Run - out := workflow.AskWorkflowsOptions(*f, dialog) + out := workflow.AskWorkflowsOptions(f, dialog) assert.Equal(t, genWorkflows.Options{ Validate: false, Push: true, @@ -67,12 +67,11 @@ func TestAskWorkflowsOptionsByFlag(t *testing.T) { o.Set(`ci-pull`, `false`) o.Set(`ci-main-branch`, `main`) - f := workflow.Flags{ - CIValidate: configmap.NewValue(false), - CIPull: configmap.NewValue(false), - CIMainBranch: configmap.NewValue("main"), - CIPush: configmap.NewValue(true), - } + f := workflow.DefaultFlags() + f.CIValidate = configmap.NewValueWithOrigin(false, configmap.SetByFlag) + f.CIPull = configmap.NewValueWithOrigin(false, configmap.SetByFlag) + f.CIMainBranch = configmap.NewValueWithOrigin("main", configmap.SetByFlag) + f.CIPush = configmap.NewValueWithOrigin(true, configmap.SetByFlag) // Run out := workflow.AskWorkflowsOptions(f, dialog) From e57edccdc3c1b8bf8605b8894d04d95d9610b876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 17:07:00 +0100 Subject: [PATCH 7/8] fix: Data race: update otelgrpc to v0.48.0 --- go.mod | 14 +++++++------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 16e723f860..4efceb7f06 100644 --- a/go.mod +++ b/go.mod @@ -59,21 +59,21 @@ require ( go.etcd.io/etcd/tests/v3 v3.5.11 go.nhat.io/aferocopy/v2 v2.0.1 go.opencensus.io v0.24.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 go.opentelemetry.io/contrib/propagators/b3 v1.17.0 - go.opentelemetry.io/otel v1.20.0 + go.opentelemetry.io/otel v1.23.0 go.opentelemetry.io/otel/bridge/opencensus v0.39.0 go.opentelemetry.io/otel/exporters/prometheus v0.39.0 - go.opentelemetry.io/otel/metric v1.20.0 + go.opentelemetry.io/otel/metric v1.23.0 go.opentelemetry.io/otel/sdk v1.20.0 go.opentelemetry.io/otel/sdk/metric v0.39.0 - go.opentelemetry.io/otel/trace v1.20.0 + go.opentelemetry.io/otel/trace v1.23.0 go.uber.org/zap v1.26.0 goa.design/goa/v3 v3.14.6 goa.design/plugins/v3 v3.14.6 golang.org/x/sync v0.6.0 - google.golang.org/grpc v1.60.1 + google.golang.org/grpc v1.61.0 gopkg.in/DataDog/dd-trace-go.v1 v1.60.3 gopkg.in/Knetic/govaluate.v3 v3.0.0 v.io/x/lib v0.1.14 @@ -183,7 +183,7 @@ require ( github.com/felixge/httpsnoop v1.0.3 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/go-chi/chi/v5 v5.0.11 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/inflect v0.19.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -240,7 +240,7 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect gocloud.dev v0.29.0 // indirect golang.org/x/image v0.5.0 // indirect - golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/oauth2 v0.14.0 // indirect google.golang.org/api v0.149.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect diff --git a/go.sum b/go.sum index 0f0a932684..5a48dc2e04 100644 --- a/go.sum +++ b/go.sum @@ -754,8 +754,8 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= +github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= @@ -1047,8 +1047,8 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= @@ -2192,8 +2192,8 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 h1:P+/g8GpuJGYbOp2tAdKrIPUX9JO02q8Q0YNlHolpibA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0/go.mod h1:PFmBsWbldL1kiWZk9+0LBZz2brhByaGsvp6pRICMlPE= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0/go.mod h1:+ARmXlUlc51J7sZeCBkBJNdHGySrdOzgzxp6VWRWM1U= @@ -2207,8 +2207,8 @@ go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOU go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= go.opentelemetry.io/otel/bridge/opencensus v0.39.0 h1:YHivttTaDhbZIHuPlg1sWsy2P5gj57vzqPfkHItgbwQ= go.opentelemetry.io/otel/bridge/opencensus v0.39.0/go.mod h1:vZ4537pNjFDXEx//WldAR6Ro2LC8wwmFC76njAXwNPE= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= @@ -2233,8 +2233,8 @@ go.opentelemetry.io/otel/exporters/prometheus v0.39.0/go.mod h1:4jo5Q4CROlCpSPsX go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v0.28.0/go.mod h1:TrzsfQAmQaB1PDcdhBauLMk7nyyg9hm+GoQq/ekE9Iw= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= +go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= @@ -2253,8 +2253,8 @@ go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qE go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.opentelemetry.io/proto/otlp v0.12.1/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -2523,8 +2523,8 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -3108,8 +3108,8 @@ google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.52.1/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 65ebc344d09c2cc1ca86277b6ac002559a39aed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Jure=C4=8Dko?= Date: Thu, 22 Feb 2024 18:03:16 +0100 Subject: [PATCH 8/8] tests: Fix testFile, always close underlying os.File --- .../stream/storage/level/local/writer/volume/file_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/service/stream/storage/level/local/writer/volume/file_test.go b/internal/pkg/service/stream/storage/level/local/writer/volume/file_test.go index 7d4a2f6bcd..ea9dae376b 100644 --- a/internal/pkg/service/stream/storage/level/local/writer/volume/file_test.go +++ b/internal/pkg/service/stream/storage/level/local/writer/volume/file_test.go @@ -41,8 +41,9 @@ func (f *testFile) Sync() error { } func (f *testFile) Close() error { + err := f.file.Close() if f.CloseError != nil { return f.CloseError } - return f.file.Close() + return err }