Skip to content

Commit

Permalink
Add const for "localhost:80"
Browse files Browse the repository at this point in the history
golangci lint was complaining

Signed-off-by: Alex Vest <[email protected]>
  • Loading branch information
Alex Vest committed Jan 25, 2022
1 parent 5bbf7d8 commit f861270
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/objstore/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"github.com/thanos-io/thanos/pkg/testutil"
)

const endpoint string = "localhost:80"

func TestParseConfig(t *testing.T) {
input := []byte(`bucket: abcd
insecure: false`)
Expand Down Expand Up @@ -306,7 +308,7 @@ list_objects_version: "abcd"`)
func TestBucket_getServerSideEncryption(t *testing.T) {
// Default config should return no SSE config.
cfg := DefaultConfig
cfg.Endpoint = "localhost:80"
cfg.Endpoint = endpoint
bkt, err := NewBucketWithConfig(log.NewNopLogger(), cfg, "test")
testutil.Ok(t, err)

Expand All @@ -316,7 +318,7 @@ func TestBucket_getServerSideEncryption(t *testing.T) {

// If SSE is configured in the client config it should be used.
cfg = DefaultConfig
cfg.Endpoint = "localhost:80"
cfg.Endpoint = endpoint
cfg.SSEConfig = SSEConfig{Type: SSES3}
bkt, err = NewBucketWithConfig(log.NewNopLogger(), cfg, "test")
testutil.Ok(t, err)
Expand All @@ -329,7 +331,7 @@ func TestBucket_getServerSideEncryption(t *testing.T) {
// KMSEncryptionContext - In this case the encryptionContextHeader should be
// a base64 encoded string which represents a string-string map "{}"
cfg = DefaultConfig
cfg.Endpoint = "localhost:80"
cfg.Endpoint = endpoint
cfg.SSEConfig = SSEConfig{
Type: SSEKMS,
KMSKeyID: "key",
Expand All @@ -352,7 +354,7 @@ func TestBucket_getServerSideEncryption(t *testing.T) {
// If the KMSEncryptionContext is set then the header should reflect it's
// value.
cfg = DefaultConfig
cfg.Endpoint = "localhost:80"
cfg.Endpoint = endpoint
cfg.SSEConfig = SSEConfig{
Type: SSEKMS,
KMSKeyID: "key",
Expand All @@ -374,7 +376,7 @@ func TestBucket_getServerSideEncryption(t *testing.T) {

// If SSE is configured in the context it should win.
cfg = DefaultConfig
cfg.Endpoint = "localhost:80"
cfg.Endpoint = endpoint
cfg.SSEConfig = SSEConfig{Type: SSES3}
override, err := encrypt.NewSSEKMS("test", nil)
testutil.Ok(t, err)
Expand Down

0 comments on commit f861270

Please sign in to comment.