From e1b4d22fad0e19e76dce9e07456a4c054dc79279 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 15 Sep 2023 20:29:55 +0200 Subject: [PATCH 1/3] readme: contrib section update --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5501d01d..d0aeccdd 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,10 @@ Documentation can be found at https://crazymax.dev/undock/ ## Contributing -Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. If -you want to open a pull request, please read the [contributing guidelines](.github/CONTRIBUTING.md). - -You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by -making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! +Want to contribute? Awesome! The most basic way to show your support is to star +the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) +or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this +journey continues indefinitely! Thanks again for your support, it is much appreciated! :pray: From 52f5723c52ee4660433e0288718d7c5ef6b611a2 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 15 Sep 2023 20:30:47 +0200 Subject: [PATCH 2/3] warn on unknown blob format --- internal/extractor/blob.go | 9 ++++----- internal/extractor/image/image.go | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/internal/extractor/blob.go b/internal/extractor/blob.go index 95f41b79..90ab616a 100644 --- a/internal/extractor/blob.go +++ b/internal/extractor/blob.go @@ -32,7 +32,8 @@ func ExtractBlob(filename string, dest string, opts ExtractBlobOpts) error { format, r, err := archiver.Identify(filename, dt) if err != nil { - return err + opts.Logger.Warn().Msg("Blob format not recognized") + return nil } opts.Logger.Debug().Msgf("Blob format %s detected", format.Name()) @@ -72,7 +73,7 @@ func ExtractBlob(filename string, dest string, opts ExtractBlobOpts) error { pathsInArchive = nil } - err = u.Extract(opts.Context, r, pathsInArchive, func(ctx context.Context, f archiver.File) error { + return u.Extract(opts.Context, r, pathsInArchive, func(ctx context.Context, f archiver.File) error { if f.FileInfo.IsDir() { opts.Logger.Trace().Msgf("Extracting %s", f.NameInArchive) } else { @@ -80,7 +81,7 @@ func ExtractBlob(filename string, dest string, opts ExtractBlobOpts) error { } path := filepath.Join(dest, f.NameInArchive) - if err = os.MkdirAll(filepath.Dir(path), 0755); err != nil { + if err = os.MkdirAll(filepath.Dir(path), 0o700); err != nil { return err } @@ -95,8 +96,6 @@ func ExtractBlob(filename string, dest string, opts ExtractBlobOpts) error { return fmt.Errorf("cannot handle file mode: %v", f.FileInfo.Mode()) } }) - - return err } func writeFile(ctx context.Context, path string, f archiver.File) error { diff --git a/internal/extractor/image/image.go b/internal/extractor/image/image.go index 5ea02af6..99c97f4e 100644 --- a/internal/extractor/image/image.go +++ b/internal/extractor/image/image.go @@ -101,11 +101,11 @@ func (c *Client) Extract() error { if !c.cli.Wrap && len(mans) > 1 { dest = path.Join(c.cli.Dist, fmt.Sprintf("%s_%s%s", mane.platform.OS, mane.platform.Architecture, mane.platform.Variant)) } - if err := os.MkdirAll(dest, 0o700); err != nil { - return errors.Wrapf(err, "failed to create destination folder %q", dest) - } for _, layer := range mane.manifest.LayerInfos() { - sublogger := c.logger.With().Str("platform", platforms.Format(mane.platform)).Str("blob", layer.Digest.String()).Logger() + sublogger := c.logger.With(). + Str("platform", platforms.Format(mane.platform)). + Str("media-type", layer.MediaType). + Str("blob", layer.Digest.String()).Logger() if err = extractor.ExtractBlob(path.Join(cachedir, "blobs", layer.Digest.Algorithm().String(), layer.Digest.Hex()), dest, extractor.ExtractBlobOpts{ Context: c.ctx, Logger: sublogger, From 1f49912f2e2a01b3d1e9598668b73da8e58382ac Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 15 Sep 2023 20:34:41 +0200 Subject: [PATCH 3/3] ci(e2e): test image with attestations --- .github/workflows/e2e.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3e2a77cf..0e3cbcbd 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,11 +24,11 @@ jobs: matrix: include: - - image: "crazymax/buildx-pkg:latest" + image: "dockereng/packaging:buildx-v0.11.1" all: "true" loglevel: "debug" - - image: "crazymax/buildx-pkg:latest" + image: "dockereng/packaging:buildx-v0.11.1" all: "true" wrap: "true" loglevel: "debug" @@ -131,8 +131,8 @@ jobs: - name: Create docker archive run: | - docker pull crazymax/buildx-pkg:latest - docker save crazymax/buildx-pkg:latest > archive.tar + docker pull dockereng/packaging:buildx-v0.11.1 + docker save dockereng/packaging:buildx-v0.11.1 > archive.tar - name: Run run: |