archive: add WithSourceDateEpoch() for whiteouts
This makes diff archives to be reproducible. The value is expected to be passed from CLI applications via the $SOUCE_DATE_EPOCH env var. See https://reproducible-builds.org/docs/source-date-epoch/ for the $SOURCE_DATE_EPOCH specification. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -145,6 +145,10 @@ func (l *local) Diff(ctx context.Context, dr *diffapi.DiffRequest, _ ...grpc.Cal
|
||||
if dr.Labels != nil {
|
||||
opts = append(opts, diff.WithLabels(dr.Labels))
|
||||
}
|
||||
if dr.SourceDateEpoch != nil {
|
||||
tm := dr.SourceDateEpoch.AsTime()
|
||||
opts = append(opts, diff.WithSourceDateEpoch(&tm))
|
||||
}
|
||||
|
||||
for _, d := range l.differs {
|
||||
ocidesc, err = d.Compare(ctx, aMounts, bMounts, opts...)
|
||||
|
||||
Reference in New Issue
Block a user