From d1732e7b5131c1f37f4c18728938ec2bc64728af Mon Sep 17 00:00:00 2001 From: Dimitrij Drus Date: Wed, 11 Sep 2024 22:34:13 +0200 Subject: [PATCH 1/2] go mod tidy --- go.mod | 2 +- go.sum | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 171292b33..78c6f6916 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.29.0 go.opentelemetry.io/otel/trace v1.29.0 go.uber.org/fx v1.22.2 - gocloud.dev v0.38.0 + gocloud.dev v0.39.0 golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c google.golang.org/grpc v1.65.0 diff --git a/go.sum b/go.sum index ea91cfeb3..82c1a03a9 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJ cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4= cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus= -cloud.google.com/go/longrunning v0.5.11 h1:Havn1kGjz3whCfoD8dxMLP73Ph5w+ODyZB9RUsDxtGk= -cloud.google.com/go/longrunning v0.5.11/go.mod h1:rDn7//lmlfWV1Dx6IB4RatCPenTwwmqXuiP0/RgoEO4= +cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE= +cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= @@ -202,8 +202,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE= -github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk= +github.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo= +github.com/google/go-replayers/grpcreplay v1.3.0/go.mod h1:v6NgKtkijC0d3e3RW8il6Sy5sqRVUwoQa4mHOGEy8DI= github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk= github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -479,8 +479,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -gocloud.dev v0.38.0 h1:SpxfaOc/Fp4PeO8ui7wRcCZV0EgXZ+IWcVSLn6ZMSw0= -gocloud.dev v0.38.0/go.mod h1:3XjKvd2E5iVNu/xFImRzjN0d/fkNHe4s0RiKidpEUMQ= +gocloud.dev v0.39.0 h1:EYABYGhAalPUaMrbSKOr5lejxoxvXj99nE8XFtsDgds= +gocloud.dev v0.39.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From cc3214a259d8a37b52eaf2fe821d26494150c895 Mon Sep 17 00:00:00 2001 From: Dimitrij Drus Date: Wed, 11 Sep 2024 23:38:50 +0200 Subject: [PATCH 2/2] cloudblob provider tests updated to work with AWS S3 V2 bucket API --- .../rules/provider/cloudblob/provider_test.go | 12 +++++------ .../cloudblob/ruleset_endpoint_test.go | 20 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/rules/provider/cloudblob/provider_test.go b/internal/rules/provider/cloudblob/provider_test.go index 63b2ecc34..930fee305 100644 --- a/internal/rules/provider/cloudblob/provider_test.go +++ b/internal/rules/provider/cloudblob/provider_test.go @@ -192,7 +192,7 @@ func TestProviderLifecycle(t *testing.T) { uc: "with no blobs in the bucket", conf: []byte(` buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), assert: func(t *testing.T, _ testCase, logs fmt.Stringer, _ *mocks.RuleSetProcessorMock) { t.Helper() @@ -208,7 +208,7 @@ buckets: uc: "with an empty blob in the bucket", conf: []byte(` buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), setupBucket: func(t *testing.T) { t.Helper() @@ -232,7 +232,7 @@ buckets: uc: "with not empty blob and without watch interval", conf: []byte(` buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), setupBucket: func(t *testing.T) { t.Helper() @@ -281,7 +281,7 @@ rules: conf: []byte(` watch_interval: 250ms buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), setupBucket: func(t *testing.T) { t.Helper() @@ -330,7 +330,7 @@ rules: conf: []byte(` watch_interval: 250ms buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), setupBucket: func() func(t *testing.T) { callIdx := 1 @@ -426,7 +426,7 @@ rules: conf: []byte(` watch_interval: 250ms buckets: -- url: s3://` + bucketName + `?endpoint=` + srv.URL + `&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1 +- url: s3://` + bucketName + `?endpoint=` + srv.URL + `®ion=eu-central-1 `), setupBucket: func() func(t *testing.T) { callIdx := 1 diff --git a/internal/rules/provider/cloudblob/ruleset_endpoint_test.go b/internal/rules/provider/cloudblob/ruleset_endpoint_test.go index 592894ee3..244ecc345 100644 --- a/internal/rules/provider/cloudblob/ruleset_endpoint_test.go +++ b/internal/rules/provider/cloudblob/ruleset_endpoint_test.go @@ -91,14 +91,14 @@ func TestFetchRuleSets(t *testing.T) { URL: &url.URL{ Scheme: "s3", Host: "foo", - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, }, assert: func(t *testing.T, err error, _ []*config.RuleSet) { t.Helper() require.Error(t, err) - require.ErrorIs(t, err, heimdall.ErrInternal) + require.ErrorIs(t, err, heimdall.ErrCommunication) assert.Contains(t, err.Error(), "failed iterate blobs") }, }, @@ -108,7 +108,7 @@ func TestFetchRuleSets(t *testing.T) { URL: &url.URL{ Scheme: "s3", Host: bucketName, - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, }, setup: func(t *testing.T) { @@ -135,7 +135,7 @@ func TestFetchRuleSets(t *testing.T) { URL: &url.URL{ Scheme: "s3", Host: bucketName, - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, }, assert: func(t *testing.T, err error, ruleSets []*config.RuleSet) { @@ -151,7 +151,7 @@ func TestFetchRuleSets(t *testing.T) { URL: &url.URL{ Scheme: "s3", Host: bucketName, - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, }, setup: func(t *testing.T) { @@ -175,7 +175,7 @@ func TestFetchRuleSets(t *testing.T) { URL: &url.URL{ Scheme: "s3", Host: bucketName, - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, }, setup: func(t *testing.T) { @@ -253,7 +253,7 @@ rules: URL: &url.URL{ Scheme: "s3", Host: bucketName, - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, Prefix: "api", }, @@ -326,7 +326,7 @@ rules: Scheme: "s3", Host: bucketName, Path: "ruleset", - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, Prefix: "api", }, @@ -345,7 +345,7 @@ rules: Scheme: "s3", Host: bucketName, Path: "ruleset", - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, Prefix: "api", }, @@ -371,7 +371,7 @@ rules: Scheme: "s3", Host: bucketName, Path: "ruleset", - RawQuery: fmt.Sprintf("endpoint=%s&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1", srv.URL), + RawQuery: fmt.Sprintf("endpoint=%s®ion=eu-central-1", srv.URL), }, Prefix: "api", },