Skip to content

Commit

Permalink
fix: use zero value as deterministic time
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hughes committed Nov 10, 2021
1 parent b2ad396 commit 28ad31b
Show file tree
Hide file tree
Showing 46 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/sif/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func OptCreateWithLaunchScript(s string) CreateOpt {
func OptCreateDeterministic() CreateOpt {
return func(co *createOpts) error {
co.id = uuid.Nil
co.t = time.Unix(0, 0)
co.t = time.Time{}
return nil
}
}
Expand Down Expand Up @@ -378,7 +378,7 @@ type AddOpt func(*addOpts) error
// modification of images.
func OptAddDeterministic() AddOpt {
return func(ao *addOpts) error {
ao.t = time.Unix(0, 0)
ao.t = time.Time{}
return nil
}
}
Expand Down Expand Up @@ -486,7 +486,7 @@ func OptDeleteCompact(b bool) DeleteOpt {
// modification of images.
func OptDeleteDeterministic() DeleteOpt {
return func(do *deleteOpts) error {
do.t = time.Unix(0, 0)
do.t = time.Time{}
return nil
}
}
Expand Down Expand Up @@ -576,7 +576,7 @@ type SetOpt func(*setOpts) error
// modification of images.
func OptSetDeterministic() SetOpt {
return func(so *setOpts) error {
so.t = time.Unix(0, 0)
so.t = time.Time{}
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sif/descriptor_input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestNewDescriptorInput(t *testing.T) {

if err == nil {
d := rawDescriptor{}
if err := di.fillDescriptor(time.Unix(0, 0), &d); err != nil {
if err := di.fillDescriptor(time.Time{}, &d); err != nil {
t.Fatal(err)
}

Expand Down
Binary file modified pkg/sif/testdata/TestAddObject/Empty.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/EmptyAligned.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/EmptyNotAligned.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/ErrInsufficientCapacity.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/ErrPrimaryPartition.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/NotEmpty.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/NotEmptyAligned.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/NotEmptyNotAligned.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestAddObject/WithTime.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/Empty.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/EmptyCloseOnUnload.golden
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/EmptyLaunchScript.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/EmptyWithID.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/OneDescriptor.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainer/TwoDescriptors.golden
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainerAtPath/Empty.golden
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainerAtPath/OneDescriptor.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestCreateContainerAtPath/TwoDescriptors.golden
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/Compact.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/ErrObjectNotFound.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/PrimaryPartition.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/WithTime.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/Zero.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestDeleteObject/ZeroCompact.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/Empty.golden
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/OptGroupID.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/OptLinkedGroupID.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/OptLinkedID.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/OptNoGroup.golden
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestNewDescriptorInput/OptObjectName.golden
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified pkg/sif/testdata/TestSetPrimPart/ErrObjectNotFound.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestSetPrimPart/One.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestSetPrimPart/Two.golden
Binary file not shown.
Binary file modified pkg/sif/testdata/TestSetPrimPart/WithTime.golden
Binary file not shown.

0 comments on commit 28ad31b

Please sign in to comment.