epoch: propagate SOURCE_DATE_EPOCH via ctx
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"github.com/containerd/containerd/errdefs"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/mount"
|
||||
"github.com/containerd/containerd/pkg/epoch"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
@@ -64,6 +65,9 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o
|
||||
return emptyDesc, err
|
||||
}
|
||||
}
|
||||
if tm := epoch.FromContext(ctx); tm != nil && config.SourceDateEpoch == nil {
|
||||
config.SourceDateEpoch = tm
|
||||
}
|
||||
|
||||
var writeDiffOpts []archive.WriteDiffOpt
|
||||
if config.SourceDateEpoch != nil {
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/metadata"
|
||||
"github.com/containerd/containerd/mount"
|
||||
"github.com/containerd/containerd/pkg/epoch"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/opencontainers/go-digest"
|
||||
@@ -177,6 +178,9 @@ func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, op
|
||||
return emptyDesc, err
|
||||
}
|
||||
}
|
||||
if tm := epoch.FromContext(ctx); tm != nil && config.SourceDateEpoch == nil {
|
||||
config.SourceDateEpoch = tm
|
||||
}
|
||||
|
||||
layers, err := mountPairToLayerStack(lower, upper)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user