diff --git a/define/build.go b/define/build.go index 5648f8bbb..0a4771208 100644 --- a/define/build.go +++ b/define/build.go @@ -273,6 +273,10 @@ type BuildOptions struct { // the build was unsuccessful. ForceRmIntermediateCtrs bool // BlobDirectory is a directory which we'll use for caching layer blobs. + // + // This option will be overridden for cache pulls if + // CachePullDestinationLookupReferenceFunc is set, and overridden for cache pushes if + // CachePushSourceLookupReferenceFunc is set. BlobDirectory string // Target the targeted FROM in the Dockerfile to build. Target string @@ -349,10 +353,14 @@ type BuildOptions struct { // CachePullDestinationLookupReferenceFunc is an optional generator // function which provides a LookupReferenceFunc used to look up // destination references for cache pulls. + // + // BlobDirectory will be ignored for cache pulls if this option is set. CachePullDestinationLookupReferenceFunc func(srcRef types.ImageReference) libimage.LookupReferenceFunc // CachePushSourceLookupReferenceFunc is an optional generator function // which provides a LookupReferenceFunc used to look up source // references for cache pushes. + // + // BlobDirectory will be ignored for cache pushes if this option is set. CachePushSourceLookupReferenceFunc func(dest types.ImageReference) libimage.LookupReferenceFunc // CachePushDestinationLookupReferenceFunc is an optional // LookupReferenceFunc used to look up destination references for cache diff --git a/pull.go b/pull.go index abfe5e8b0..13c2bfbbc 100644 --- a/pull.go +++ b/pull.go @@ -33,6 +33,8 @@ type PullOptions struct { // BlobDirectory is the name of a directory in which we'll attempt to // store copies of layer blobs that we pull down, if any. It should // already exist. + // + // Not applicable if DestinationLookupReferenceFunc is set. BlobDirectory string // AllTags is a boolean value that determines if all tagged images // will be downloaded from the repository. The default is false. @@ -54,7 +56,7 @@ type PullOptions struct { // references. SourceLookupReferenceFunc libimage.LookupReferenceFunc // DestinationLookupReference provides a function to look up destination - // references. + // references. Overrides BlobDirectory, if set. DestinationLookupReferenceFunc libimage.LookupReferenceFunc } diff --git a/push.go b/push.go index 6acbb82ee..9d9d7a88b 100644 --- a/push.go +++ b/push.go @@ -66,6 +66,8 @@ type PushOptions struct { // prebuilt copies of layer blobs that we might otherwise need to // regenerate from on-disk layers, substituting them in the list of // blobs to copy whenever possible. + // + // Not applicable if SourceLookupReferenceFunc is set. BlobDirectory string // Quiet is a boolean value that determines if minimal output to // the user will be displayed, this is best used for logging. @@ -91,7 +93,7 @@ type PushOptions struct { // indexing. i.e. 0 is the first layer, -1 is the last (top-most) layer. OciEncryptLayers *[]int // SourceLookupReference provides a function to look up source - // references. + // references. Overrides BlobDirectory, if set. SourceLookupReferenceFunc libimage.LookupReferenceFunc // DestinationLookupReference provides a function to look up destination // references.