@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package gcp_credentials
17
+ package gcp
18
18
19
19
import (
20
20
"encoding/base64"
@@ -42,7 +42,7 @@ func createProductNameFile() (string, error) {
42
42
}
43
43
44
44
func TestDockerKeyringFromGoogleDockerConfigMetadata (t * testing.T ) {
45
- registryUrl := "hello.kubernetes.io"
45
+ registryURL := "hello.kubernetes.io"
46
46
47
47
username := "foo"
48
48
password := "bar"
@@ -52,7 +52,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadata(t *testing.T) {
52
52
"email": %q,
53
53
"auth": %q
54
54
}
55
- }` , registryUrl , email , auth )
55
+ }` , registryURL , email , auth )
56
56
57
57
var err error
58
58
gceProductNameFile , err = createProductNameFile ()
@@ -93,9 +93,9 @@ func TestDockerKeyringFromGoogleDockerConfigMetadata(t *testing.T) {
93
93
94
94
keyring .Add (provider .Provide ("" ))
95
95
96
- creds , ok := keyring .Lookup (registryUrl )
96
+ creds , ok := keyring .Lookup (registryURL )
97
97
if ! ok {
98
- t .Errorf ("Didn't find expected URL: %s" , registryUrl )
98
+ t .Errorf ("Didn't find expected URL: %s" , registryURL )
99
99
return
100
100
}
101
101
if len (creds ) > 1 {
@@ -115,7 +115,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadata(t *testing.T) {
115
115
}
116
116
117
117
func TestDockerKeyringFromGoogleDockerConfigMetadataUrl (t * testing.T ) {
118
- registryUrl := "hello.kubernetes.io"
118
+ registryURL := "hello.kubernetes.io"
119
119
120
120
username := "foo"
121
121
password := "bar"
@@ -125,7 +125,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadataUrl(t *testing.T) {
125
125
"email": %q,
126
126
"auth": %q
127
127
}
128
- }` , registryUrl , email , auth )
128
+ }` , registryURL , email , auth )
129
129
130
130
var err error
131
131
gceProductNameFile , err = createProductNameFile ()
@@ -143,7 +143,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadataUrl(t *testing.T) {
143
143
w .WriteHeader (http .StatusOK )
144
144
w .Header ().Set ("Content-Type" , "application/json" )
145
145
fmt .Fprintln (w , sampleDockerConfig )
146
- } else if strings .HasSuffix (dockerConfigUrlKey , r .URL .Path ) {
146
+ } else if strings .HasSuffix (dockerConfigURLKey , r .URL .Path ) {
147
147
w .WriteHeader (http .StatusOK )
148
148
w .Header ().Set ("Content-Type" , "application/text" )
149
149
fmt .Fprint (w , "http://foo.bar.com" + valueEndpoint )
@@ -161,7 +161,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadataUrl(t *testing.T) {
161
161
})
162
162
163
163
keyring := & credentialprovider.BasicDockerKeyring {}
164
- provider := & dockerConfigUrlKeyProvider {
164
+ provider := & dockerConfigURLKeyProvider {
165
165
metadataProvider {Client : & http.Client {Transport : transport }},
166
166
}
167
167
@@ -171,9 +171,9 @@ func TestDockerKeyringFromGoogleDockerConfigMetadataUrl(t *testing.T) {
171
171
172
172
keyring .Add (provider .Provide ("" ))
173
173
174
- creds , ok := keyring .Lookup (registryUrl )
174
+ creds , ok := keyring .Lookup (registryURL )
175
175
if ! ok {
176
- t .Errorf ("Didn't find expected URL: %s" , registryUrl )
176
+ t .Errorf ("Didn't find expected URL: %s" , registryURL )
177
177
return
178
178
}
179
179
if len (creds ) > 1 {
@@ -193,7 +193,7 @@ func TestDockerKeyringFromGoogleDockerConfigMetadataUrl(t *testing.T) {
193
193
}
194
194
195
195
func TestContainerRegistryBasics (t * testing.T ) {
196
- registryUrl := "container.cloud.google.com"
196
+ registryURL := "container.cloud.google.com"
197
197
198
198
token := & tokenBlob {AccessToken : "ya26.lots-of-indiscernible-garbage" }
199
199
@@ -255,9 +255,9 @@ func TestContainerRegistryBasics(t *testing.T) {
255
255
256
256
keyring .Add (provider .Provide ("" ))
257
257
258
- creds , ok := keyring .Lookup (registryUrl )
258
+ creds , ok := keyring .Lookup (registryURL )
259
259
if ! ok {
260
- t .Errorf ("Didn't find expected URL: %s" , registryUrl )
260
+ t .Errorf ("Didn't find expected URL: %s" , registryURL )
261
261
return
262
262
}
263
263
if len (creds ) > 1 {
@@ -425,7 +425,7 @@ func TestAllProvidersNoMetadata(t *testing.T) {
425
425
& dockerConfigKeyProvider {
426
426
metadataProvider {Client : & http.Client {Transport : transport }},
427
427
},
428
- & dockerConfigUrlKeyProvider {
428
+ & dockerConfigURLKeyProvider {
429
429
metadataProvider {Client : & http.Client {Transport : transport }},
430
430
},
431
431
& containerRegistryProvider {
0 commit comments