@@ -107,8 +107,9 @@ func TestMinioCredentials(t *testing.T) {
107
107
cfg := setting.MinioStorageConfig {
108
108
AccessKeyID : ExpectedAccessKey ,
109
109
SecretAccessKey : ExpectedSecretAccessKey ,
110
+ IamEndpoint : FakeEndpoint ,
110
111
}
111
- creds := buildMinioCredentials (cfg , FakeEndpoint )
112
+ creds := buildMinioCredentials (cfg )
112
113
v , err := creds .Get ()
113
114
114
115
assert .NoError (t , err )
@@ -117,13 +118,15 @@ func TestMinioCredentials(t *testing.T) {
117
118
})
118
119
119
120
t .Run ("Chain" , func (t * testing.T ) {
120
- cfg := setting.MinioStorageConfig {}
121
+ cfg := setting.MinioStorageConfig {
122
+ IamEndpoint : FakeEndpoint ,
123
+ }
121
124
122
125
t .Run ("EnvMinio" , func (t * testing.T ) {
123
126
t .Setenv ("MINIO_ACCESS_KEY" , ExpectedAccessKey + "Minio" )
124
127
t .Setenv ("MINIO_SECRET_KEY" , ExpectedSecretAccessKey + "Minio" )
125
128
126
- creds := buildMinioCredentials (cfg , FakeEndpoint )
129
+ creds := buildMinioCredentials (cfg )
127
130
v , err := creds .Get ()
128
131
129
132
assert .NoError (t , err )
@@ -135,7 +138,7 @@ func TestMinioCredentials(t *testing.T) {
135
138
t .Setenv ("AWS_ACCESS_KEY" , ExpectedAccessKey + "AWS" )
136
139
t .Setenv ("AWS_SECRET_KEY" , ExpectedSecretAccessKey + "AWS" )
137
140
138
- creds := buildMinioCredentials (cfg , FakeEndpoint )
141
+ creds := buildMinioCredentials (cfg )
139
142
v , err := creds .Get ()
140
143
141
144
assert .NoError (t , err )
@@ -144,11 +147,11 @@ func TestMinioCredentials(t *testing.T) {
144
147
})
145
148
146
149
t .Run ("FileMinio" , func (t * testing.T ) {
147
- t .Setenv ("MINIO_SHARED_CREDENTIALS_FILE" , "testdata/minio.json" )
148
150
// prevent loading any actual credentials files from the user
151
+ t .Setenv ("MINIO_SHARED_CREDENTIALS_FILE" , "testdata/minio.json" )
149
152
t .Setenv ("AWS_SHARED_CREDENTIALS_FILE" , "testdata/fake" )
150
153
151
- creds := buildMinioCredentials (cfg , FakeEndpoint )
154
+ creds := buildMinioCredentials (cfg )
152
155
v , err := creds .Get ()
153
156
154
157
assert .NoError (t , err )
@@ -161,7 +164,7 @@ func TestMinioCredentials(t *testing.T) {
161
164
t .Setenv ("MINIO_SHARED_CREDENTIALS_FILE" , "testdata/fake.json" )
162
165
t .Setenv ("AWS_SHARED_CREDENTIALS_FILE" , "testdata/aws_credentials" )
163
166
164
- creds := buildMinioCredentials (cfg , FakeEndpoint )
167
+ creds := buildMinioCredentials (cfg )
165
168
v , err := creds .Get ()
166
169
167
170
assert .NoError (t , err )
@@ -187,7 +190,9 @@ func TestMinioCredentials(t *testing.T) {
187
190
defer server .Close ()
188
191
189
192
// Use the provided EC2 Instance Metadata server
190
- creds := buildMinioCredentials (cfg , server .URL )
193
+ creds := buildMinioCredentials (setting.MinioStorageConfig {
194
+ IamEndpoint : server .URL ,
195
+ })
191
196
v , err := creds .Get ()
192
197
193
198
assert .NoError (t , err )
0 commit comments