Skip to content

Commit 604ed92

Browse files
author
Andrey Klimentyev
authored
Keychain panic fix (deckhouse#64)
1 parent d6c1709 commit 604ed92

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/registry_checker/registry_authn.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ func (lp lazyProvider) Authorization() (*authn.AuthConfig, error) {
1919
if !found || len(creds) < 1 {
2020
return nil, fmt.Errorf("keychain returned no credentials for %q", lp.image)
2121
}
22-
authConfig := creds[lp.kc.index]
22+
23+
// FIXME: an ugly hack for an upstream bug
24+
// https://github.com/google/go-containerregistry/issues/723
25+
index := lp.kc.index
26+
if lp.kc.index > len(creds) {
27+
index = len(creds)
28+
}
29+
30+
authConfig := creds[index]
2331
return &authn.AuthConfig{
2432
Username: authConfig.Username,
2533
Password: authConfig.Password,

0 commit comments

Comments
 (0)