Commit Graph

8 Commits

Author SHA1 Message Date
Nalin Dahyabhai 5b1d3e666f Add CommitOptions.OmitLayerHistoryEntry, for skipping the new bits
Add an OmitLayerHistoryEntry field to CommitOptions, which more or less
causes us to reproduce our base image, except with PrependedEmptyLayers,
AppendedEmptyLayers, PrependedLinkedLayers, AppendedLinkedLayers, and
config changes still added in.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-18 10:48:54 -04:00
Aaron Lehmann 2eb666c22d Fix lint issue in TestCommitCompression
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2025-06-11 22:53:13 +00:00
Nalin Dahyabhai 873e5458c6 Add a unit test for compression types in OCI images
Add a unit test that commits OCI layouts with various types of
compression specified, and verifies that the layers end up written with
the desired compression and media type descriptors.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-11 22:42:59 +00:00
Nalin Dahyabhai 6c82e7eac0 commit: add --source-date-epoch and --rewrite-timestamp flags
Add a --source-date-epoch flag, defaulting to $SOURCE_DATE_EPOCH if set,
which sets the created-on date and the timestamp for the new history
entries, but does not default to modifying the timestamps on contents in
new layers.

Add a --rewrite-timestamp flag, which "clamps" timestamps in the new
layers to not be later than the --source-date-epoch value if both
the --rewrite-timestamp and --source-date-epoch flags were set.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-04 13:02:26 -04:00
flouthoc de3c3baf09
unit: deparallize some tests
See issue: https://github.com/containers/buildah/issues/5967

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-04 11:07:43 -08:00
flouthoc aadfc5cf30
unit_test: use Parallel test where possible
Add `t.Parallel()` to unit tests whereever its possible without race.

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-04 11:07:15 -08:00
Nalin Dahyabhai c39f622d0a unit tests: use test-specific policy.json and registries.conf
In unit tests that create a SystemContext, point that SystemContext at
the testing signature policy and registries configuration.  This should
cause us to pay attention to mirroring settings for images used by this
set of tests.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-08 15:56:17 -04:00
Nalin Dahyabhai c467bd139a Add PrependedLinkedLayers/AppendedLinkedLayers to CommitOptions
Add API for adding arbitrary layers at commit-time via CommitOptions,
and via methods of the Builder type.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-07-25 15:49:17 -04:00