Skip to content

Commit

Permalink
Fix empty keychain panic (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: m.nabokikh <[email protected]>
  • Loading branch information
nabokihms authored Jan 6, 2024
1 parent bd1836c commit 409dec7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/registry/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ func check(ref name.Reference, kc authn.Keychain, registryTransport *http.Transp
// Fallback to default keychain if image is not found in the provided one.
// This is a behavior that is close to what CRI does. Because, there is maybe an image pull secret, but with
// the wrong credentials. Yet, the image may be available with the default keychain.
kc = authn.NewMultiKeychain(kc, authn.DefaultKeychain)
if kc != nil {
kc = authn.NewMultiKeychain(kc, authn.DefaultKeychain)
} else {
kc = authn.DefaultKeychain
}

_, imgErr = remote.Head(
ref,
Expand Down

0 comments on commit 409dec7

Please sign in to comment.