Browse Source

go fmt

pull/8388/head
Chris Lu 1 day ago
parent
commit
bd3241960b
  1. 12
      test/s3tables/table-buckets/s3tables_integration_test.go
  2. 28
      test/volume_server/framework/cluster_dual.go
  3. 24
      weed/s3api/auth_credentials_subscribe_test.go
  4. 2
      weed/s3api/bucket_paths.go
  5. 2
      weed/s3api/s3_constants/extend_key.go

12
test/s3tables/table-buckets/s3tables_integration_test.go

@ -751,7 +751,7 @@ func writeIAMConfig(t *testing.T, dir, allowedBucket string) string {
t.Helper() t.Helper()
config := map[string]any{ config := map[string]any{
"sts": map[string]string{ "sts": map[string]string{
"tokenDuration": "1h",
"tokenDuration": "1h",
"maxSessionLength": "12h", "maxSessionLength": "12h",
"issuer": "seaweedfs-sts", "issuer": "seaweedfs-sts",
"signingKey": testIAMSigningKey, "signingKey": testIAMSigningKey,
@ -759,9 +759,9 @@ func writeIAMConfig(t *testing.T, dir, allowedBucket string) string {
"accounts": []map[string]string{{"id": testAccountID, "displayName": "tables-integration"}}, "accounts": []map[string]string{{"id": testAccountID, "displayName": "tables-integration"}},
"identities": []map[string]any{ "identities": []map[string]any{
{ {
"name": "admin",
"name": "admin",
"credentials": []map[string]string{{"accessKey": testAccessKey, "secretKey": testSecretKey}}, "credentials": []map[string]string{{"accessKey": testAccessKey, "secretKey": testSecretKey}},
"account": map[string]string{"id": testAccountID, "displayName": "tables-integration"},
"account": map[string]string{"id": testAccountID, "displayName": "tables-integration"},
"policyNames": []string{"S3TablesBucketPolicy"}, "policyNames": []string{"S3TablesBucketPolicy"},
}, },
}, },
@ -800,10 +800,10 @@ func writeS3APIConfig(t *testing.T, dir string) string {
config := map[string]any{ config := map[string]any{
"identities": []map[string]any{ "identities": []map[string]any{
{ {
"name": "admin",
"name": "admin",
"credentials": []map[string]string{{"accessKey": testAccessKey, "secretKey": testSecretKey}}, "credentials": []map[string]string{{"accessKey": testAccessKey, "secretKey": testSecretKey}},
"actions": []string{"Admin", "Read", "List", "Tagging", "Write"},
"account": map[string]string{"id": testAccountID, "displayName": "tables-integration"},
"actions": []string{"Admin", "Read", "List", "Tagging", "Write"},
"account": map[string]string{"id": testAccountID, "displayName": "tables-integration"},
}, },
}, },
"accounts": []map[string]string{{"id": testAccountID, "displayName": "tables-integration"}}, "accounts": []map[string]string{{"id": testAccountID, "displayName": "tables-integration"}},

28
test/volume_server/framework/cluster_dual.go

@ -33,7 +33,7 @@ type DualVolumeCluster struct {
volumeGrpcPort1 int volumeGrpcPort1 int
volumePubPort1 int volumePubPort1 int
masterCmd *exec.Cmd
masterCmd *exec.Cmd
volumeCmd0 *exec.Cmd volumeCmd0 *exec.Cmd
volumeCmd1 *exec.Cmd volumeCmd1 *exec.Cmd
@ -79,21 +79,21 @@ func StartDualVolumeCluster(t testing.TB, profile matrix.Profile) *DualVolumeClu
} }
c := &DualVolumeCluster{ c := &DualVolumeCluster{
testingTB: t,
profile: profile,
weedBinary: weedBinary,
baseDir: baseDir,
configDir: configDir,
logsDir: logsDir,
keepLogs: keepLogs,
masterPort: masterPort,
masterGrpcPort: masterGrpcPort,
volumePort0: ports[0],
testingTB: t,
profile: profile,
weedBinary: weedBinary,
baseDir: baseDir,
configDir: configDir,
logsDir: logsDir,
keepLogs: keepLogs,
masterPort: masterPort,
masterGrpcPort: masterGrpcPort,
volumePort0: ports[0],
volumeGrpcPort0: ports[1], volumeGrpcPort0: ports[1],
volumePubPort0: ports[0],
volumePort1: ports[2],
volumePubPort0: ports[0],
volumePort1: ports[2],
volumeGrpcPort1: ports[3], volumeGrpcPort1: ports[3],
volumePubPort1: ports[2],
volumePubPort1: ports[2],
} }
if profile.SplitPublicPort { if profile.SplitPublicPort {
c.volumePubPort0 = ports[4] c.volumePubPort0 = ports[4]

24
weed/s3api/auth_credentials_subscribe_test.go

@ -90,18 +90,18 @@ func newTestS3ApiServerWithMemoryIAM(t *testing.T, identities []*iam_pb.Identity
// Create a test IAM instance // Create a test IAM instance
iam := &IdentityAccessManagement{ iam := &IdentityAccessManagement{
m: sync.RWMutex{},
nameToIdentity: make(map[string]*Identity),
accessKeyIdent: make(map[string]*Identity),
identities: []*Identity{},
policies: make(map[string]*iam_pb.Policy),
accounts: make(map[string]*Account),
emailAccount: make(map[string]*Account),
hashes: make(map[string]*sync.Pool),
hashCounters: make(map[string]*int32),
isAuthEnabled: false,
stopChan: make(chan struct{}),
useStaticConfig: false,
m: sync.RWMutex{},
nameToIdentity: make(map[string]*Identity),
accessKeyIdent: make(map[string]*Identity),
identities: []*Identity{},
policies: make(map[string]*iam_pb.Policy),
accounts: make(map[string]*Account),
emailAccount: make(map[string]*Account),
hashes: make(map[string]*sync.Pool),
hashCounters: make(map[string]*int32),
isAuthEnabled: false,
stopChan: make(chan struct{}),
useStaticConfig: false,
credentialManager: cm, credentialManager: cm,
} }

2
weed/s3api/bucket_paths.go

@ -95,7 +95,7 @@ func (s3a *S3ApiServer) readTableLocationMappingFromDirectory(bucket string) (st
conflict := false conflict := false
err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
stream, err := client.ListEntries(context.Background(), &filer_pb.ListEntriesRequest{
stream, err := client.ListEntries(context.Background(), &filer_pb.ListEntriesRequest{
Directory: mappingDir, Directory: mappingDir,
Limit: 4294967295, // math.MaxUint32 Limit: 4294967295, // math.MaxUint32
}) })

2
weed/s3api/s3_constants/extend_key.go

@ -11,7 +11,7 @@ const (
ExtETagKey = "Seaweed-X-Amz-ETag" ExtETagKey = "Seaweed-X-Amz-ETag"
ExtLatestVersionIdKey = "Seaweed-X-Amz-Latest-Version-Id" ExtLatestVersionIdKey = "Seaweed-X-Amz-Latest-Version-Id"
ExtLatestVersionFileNameKey = "Seaweed-X-Amz-Latest-Version-File-Name" ExtLatestVersionFileNameKey = "Seaweed-X-Amz-Latest-Version-File-Name"
ExtAllowEmptyFolders = "Seaweed-X-Amz-Allow-Empty-Folders"
ExtAllowEmptyFolders = "Seaweed-X-Amz-Allow-Empty-Folders"
// Cached list metadata in .versions directory for single-scan efficiency // Cached list metadata in .versions directory for single-scan efficiency
ExtLatestVersionSizeKey = "Seaweed-X-Amz-Latest-Version-Size" ExtLatestVersionSizeKey = "Seaweed-X-Amz-Latest-Version-Size"
ExtLatestVersionETagKey = "Seaweed-X-Amz-Latest-Version-ETag" ExtLatestVersionETagKey = "Seaweed-X-Amz-Latest-Version-ETag"

Loading…
Cancel
Save