From 4308a2ebb74cc17b656d8ebe00572b03a3595f89 Mon Sep 17 00:00:00 2001 From: Mateusz Hazy Date: Tue, 2 Jul 2024 10:34:54 +0200 Subject: [PATCH] Don't mutate accounts if base image is set Signed-off-by: Mateusz Hazy --- ...4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e} | 2 +- ...eb2181defed3ffe4bed0383d7acf05b8850881b60a10} | 2 +- ...0535c9beaa4d90b7500739d79766b757b8253e7c84d7} | 2 +- ...7a9cd06b119c79d1c85c3c955f3d518e3bf5fe79ba799 | Bin 2866 -> 0 bytes ...3f29dbba3b123c4da15d2bd3bbe723bfddb949713342a | Bin 0 -> 2840 bytes ...f559438cd1b84a27223cd4518f4c875de82bcdc31017} | 2 +- ...e8eb1f8e3f1f1cc563712dfa095cc461d5c37a29057b0 | Bin 0 -> 2845 bytes ...b074fe3c40bc59a361d6a109a7af767e8fd8aa29c1184 | Bin 2870 -> 0 bytes internal/cli/testdata/top_image/index.json | 2 +- pkg/build/build_implementation.go | 9 +++++++-- 10 files changed, 12 insertions(+), 7 deletions(-) rename internal/cli/testdata/top_image/blobs/sha256/{187fd84e9e1772f5e76bd7c4f4c29a884885ece66514a9a3b7fc7a541fb11dd1 => 149f310693ee8812c28e4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e} (57%) rename internal/cli/testdata/top_image/blobs/sha256/{9c4e08d7a6ddc5ffe7bedfe52f1d8c344eace518f8a8d4ddcb231f191e558566 => 1b8f0b6e368cf22d86aaeb2181defed3ffe4bed0383d7acf05b8850881b60a10} (57%) rename internal/cli/testdata/top_image/blobs/sha256/{b185458f4501b9994baca82caf05a6c9f52e23430bd2d8f7fbbd9de11c8ef44b => 68daf87e56a0a846927c0535c9beaa4d90b7500739d79766b757b8253e7c84d7} (82%) delete mode 100644 internal/cli/testdata/top_image/blobs/sha256/9306473ad3e39b7a0a57a9cd06b119c79d1c85c3c955f3d518e3bf5fe79ba799 create mode 100644 internal/cli/testdata/top_image/blobs/sha256/97502a24c34c7cd4d1c3f29dbba3b123c4da15d2bd3bbe723bfddb949713342a rename internal/cli/testdata/top_image/blobs/sha256/{5f00660705c7553f86f6858fdc93c697a394ebc6753b1a634f46e766c9cd4867 => a54af7ae5da36e1d6feaf559438cd1b84a27223cd4518f4c875de82bcdc31017} (82%) create mode 100644 internal/cli/testdata/top_image/blobs/sha256/d509688b2e26be6f4c6e8eb1f8e3f1f1cc563712dfa095cc461d5c37a29057b0 delete mode 100644 internal/cli/testdata/top_image/blobs/sha256/ed2f299f342176fbf18b074fe3c40bc59a361d6a109a7af767e8fd8aa29c1184 diff --git a/internal/cli/testdata/top_image/blobs/sha256/187fd84e9e1772f5e76bd7c4f4c29a884885ece66514a9a3b7fc7a541fb11dd1 b/internal/cli/testdata/top_image/blobs/sha256/149f310693ee8812c28e4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e similarity index 57% rename from internal/cli/testdata/top_image/blobs/sha256/187fd84e9e1772f5e76bd7c4f4c29a884885ece66514a9a3b7fc7a541fb11dd1 rename to internal/cli/testdata/top_image/blobs/sha256/149f310693ee8812c28e4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e index 54d3e5504..d1e813b68 100644 --- a/internal/cli/testdata/top_image/blobs/sha256/187fd84e9e1772f5e76bd7c4f4c29a884885ece66514a9a3b7fc7a541fb11dd1 +++ b/internal/cli/testdata/top_image/blobs/sha256/149f310693ee8812c28e4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e @@ -1 +1 @@ -{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":716,"digest":"sha256:b185458f4501b9994baca82caf05a6c9f52e23430bd2d8f7fbbd9de11c8ef44b"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4123,"digest":"sha256:583625b6164fff3b017f62b9fcd60cb53fff18a7e89ee538212134a13fc29fb1"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2870,"digest":"sha256:ed2f299f342176fbf18b074fe3c40bc59a361d6a109a7af767e8fd8aa29c1184"}]} \ No newline at end of file +{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":716,"digest":"sha256:68daf87e56a0a846927c0535c9beaa4d90b7500739d79766b757b8253e7c84d7"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4123,"digest":"sha256:583625b6164fff3b017f62b9fcd60cb53fff18a7e89ee538212134a13fc29fb1"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2845,"digest":"sha256:d509688b2e26be6f4c6e8eb1f8e3f1f1cc563712dfa095cc461d5c37a29057b0"}]} \ No newline at end of file diff --git a/internal/cli/testdata/top_image/blobs/sha256/9c4e08d7a6ddc5ffe7bedfe52f1d8c344eace518f8a8d4ddcb231f191e558566 b/internal/cli/testdata/top_image/blobs/sha256/1b8f0b6e368cf22d86aaeb2181defed3ffe4bed0383d7acf05b8850881b60a10 similarity index 57% rename from internal/cli/testdata/top_image/blobs/sha256/9c4e08d7a6ddc5ffe7bedfe52f1d8c344eace518f8a8d4ddcb231f191e558566 rename to internal/cli/testdata/top_image/blobs/sha256/1b8f0b6e368cf22d86aaeb2181defed3ffe4bed0383d7acf05b8850881b60a10 index 7f9749fb6..f3fe58bda 100644 --- a/internal/cli/testdata/top_image/blobs/sha256/9c4e08d7a6ddc5ffe7bedfe52f1d8c344eace518f8a8d4ddcb231f191e558566 +++ b/internal/cli/testdata/top_image/blobs/sha256/1b8f0b6e368cf22d86aaeb2181defed3ffe4bed0383d7acf05b8850881b60a10 @@ -1 +1 @@ -{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":716,"digest":"sha256:5f00660705c7553f86f6858fdc93c697a394ebc6753b1a634f46e766c9cd4867"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4126,"digest":"sha256:bf74ddaf55d32ec9672a0a40efc6cb1bf0a167763c18fc22586c8a301167822f"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2866,"digest":"sha256:9306473ad3e39b7a0a57a9cd06b119c79d1c85c3c955f3d518e3bf5fe79ba799"}]} \ No newline at end of file +{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":716,"digest":"sha256:a54af7ae5da36e1d6feaf559438cd1b84a27223cd4518f4c875de82bcdc31017"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4126,"digest":"sha256:bf74ddaf55d32ec9672a0a40efc6cb1bf0a167763c18fc22586c8a301167822f"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2840,"digest":"sha256:97502a24c34c7cd4d1c3f29dbba3b123c4da15d2bd3bbe723bfddb949713342a"}]} \ No newline at end of file diff --git a/internal/cli/testdata/top_image/blobs/sha256/b185458f4501b9994baca82caf05a6c9f52e23430bd2d8f7fbbd9de11c8ef44b b/internal/cli/testdata/top_image/blobs/sha256/68daf87e56a0a846927c0535c9beaa4d90b7500739d79766b757b8253e7c84d7 similarity index 82% rename from internal/cli/testdata/top_image/blobs/sha256/b185458f4501b9994baca82caf05a6c9f52e23430bd2d8f7fbbd9de11c8ef44b rename to internal/cli/testdata/top_image/blobs/sha256/68daf87e56a0a846927c0535c9beaa4d90b7500739d79766b757b8253e7c84d7 index 2a466f544..d06160cc9 100644 --- a/internal/cli/testdata/top_image/blobs/sha256/b185458f4501b9994baca82caf05a6c9f52e23430bd2d8f7fbbd9de11c8ef44b +++ b/internal/cli/testdata/top_image/blobs/sha256/68daf87e56a0a846927c0535c9beaa4d90b7500739d79766b757b8253e7c84d7 @@ -1 +1 @@ -{"architecture":"arm64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This is an apko single-layer image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This is an apko single-layer image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:2888aac57b90cf66093aa48092bf1f1f1b1bdb85bde8601a5f8cf0f06c814763","sha256:17fea8af193693cbc59fa769361c0a0bc5cdca0bdf163abfa7e684dafe1f15cb"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"]}} \ No newline at end of file +{"architecture":"arm64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This is an apko single-layer image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This is an apko single-layer image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:2888aac57b90cf66093aa48092bf1f1f1b1bdb85bde8601a5f8cf0f06c814763","sha256:3545f2e3eb427fe9d3521abc55a45728969e1556a90e38bd4db481d8cdaba687"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"]}} \ No newline at end of file diff --git a/internal/cli/testdata/top_image/blobs/sha256/9306473ad3e39b7a0a57a9cd06b119c79d1c85c3c955f3d518e3bf5fe79ba799 b/internal/cli/testdata/top_image/blobs/sha256/9306473ad3e39b7a0a57a9cd06b119c79d1c85c3c955f3d518e3bf5fe79ba799 deleted file mode 100644 index 4dcc283865cb81e4dd58e50ac79aebec127b442a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2866 zcmV-23(fQ&iwFP!32ul0|Lk1pbD~VQpU?aimY?n|A7eLL168Se37Uv|+!FKLsi~%E z6h%P5xV$z0`z_qFOft!%z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testdata/top_image/index.json index 06a548c4a..b9ce272ba 100755 --- a/internal/cli/testdata/top_image/index.json +++ b/internal/cli/testdata/top_image/index.json @@ -1 +1 @@ -{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":557,"digest":"sha256:9c4e08d7a6ddc5ffe7bedfe52f1d8c344eace518f8a8d4ddcb231f191e558566","platform":{"architecture":"amd64","os":"linux"}},{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":557,"digest":"sha256:187fd84e9e1772f5e76bd7c4f4c29a884885ece66514a9a3b7fc7a541fb11dd1","platform":{"architecture":"arm64","os":"linux"}}]} \ No newline at end of file +{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":557,"digest":"sha256:1b8f0b6e368cf22d86aaeb2181defed3ffe4bed0383d7acf05b8850881b60a10","platform":{"architecture":"amd64","os":"linux"}},{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":557,"digest":"sha256:149f310693ee8812c28e4e23ee1bf0b35141ac2c19e1a665ff5baadb3fd8a68e","platform":{"architecture":"arm64","os":"linux"}}]} \ No newline at end of file diff --git a/pkg/build/build_implementation.go b/pkg/build/build_implementation.go index 69f4480b5..d90119ba8 100644 --- a/pkg/build/build_implementation.go +++ b/pkg/build/build_implementation.go @@ -160,8 +160,13 @@ func (bc *Context) buildImage(ctx context.Context) error { } } - if err := mutateAccounts(bc.fs, &bc.ic); err != nil { - return fmt.Errorf("failed to mutate accounts: %w", err) + // For now adding additional accounts is banned when using base image. On the other hand, we don't want to + // wipe out the users set in base. + // If one wants to add a support for adding additional users they would need to look into this piece of code. + if bc.ic.Contents.BaseImage == nil { + if err := mutateAccounts(bc.fs, &bc.ic); err != nil { + return fmt.Errorf("failed to mutate accounts: %w", err) + } } if err := mutatePaths(bc.fs, &bc.o, &bc.ic); err != nil {