Skip to content

Commit

Permalink
Merge pull request containers#1543 from vrothberg/v0.55-backports
Browse files Browse the repository at this point in the history
[v0.55] libimage: HasDifferentDigest: add InsecureSkipTLSVerify option
  • Loading branch information
openshift-merge-robot authored Jul 4, 2023
2 parents d8e5d9e + ae8714a commit b7b6122
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libimage/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ type HasDifferentDigestOptions struct {
// containers-auth.json(5) file to use when authenticating against
// container registries.
AuthFilePath string
// Allow contacting registries over HTTP, or HTTPS with failed TLS
// verification. Note that this does not affect other TLS connections.
InsecureSkipTLSVerify types.OptionalBool
}

// HasDifferentDigest returns true if the image specified by `remoteRef` has a
Expand All @@ -831,8 +834,15 @@ func (i *Image) HasDifferentDigest(ctx context.Context, remoteRef types.ImageRef
sys.VariantChoice = inspectInfo.Variant
}

if options != nil && options.AuthFilePath != "" {
sys.AuthFilePath = options.AuthFilePath
if options != nil {
if options.AuthFilePath != "" {
sys.AuthFilePath = options.AuthFilePath
}
if options.InsecureSkipTLSVerify != types.OptionalBoolUndefined {
sys.DockerInsecureSkipTLSVerify = options.InsecureSkipTLSVerify
sys.OCIInsecureSkipTLSVerify = options.InsecureSkipTLSVerify == types.OptionalBoolTrue
sys.DockerDaemonInsecureSkipTLSVerify = options.InsecureSkipTLSVerify == types.OptionalBoolTrue
}
}

return i.hasDifferentDigestWithSystemContext(ctx, remoteRef, sys)
Expand Down

0 comments on commit b7b6122

Please sign in to comment.