From 2c8d5290044b51b1d114ced6cf7597a92aee3852 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 16:15:32 -0500 Subject: [PATCH 1/6] ci(release-container): fix manifest annotation quoting Args are split on commas for `buildah manifest create --annotation` unless they are quoted. Signed-off-by: Paul Nettleton --- .github/workflows/release-container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-container.yml b/.github/workflows/release-container.yml index cfb56f7..b024cdc 100644 --- a/.github/workflows/release-container.yml +++ b/.github/workflows/release-container.yml @@ -28,7 +28,7 @@ jobs: run: | buildah manifest create \ --annotation "org.opencontainers.image.source=https://github.com/containers/podlet" \ - --annotation "org.opencontainers.image.description=Generate Podman Quadlet files from a Podman command, compose file, or existing object" \ + --annotation '"org.opencontainers.image.description=Generate Podman Quadlet files from a Podman command, compose file, or existing object"' \ --annotation "org.opencontainers.image.licenses=MPL-2.0" \ "${MANIFEST}" From ec30d6aae51be725c8f13b9e5ade4a9a13bfa80e Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 16:17:13 -0500 Subject: [PATCH 2/6] ci: use consistent formatting Signed-off-by: Paul Nettleton --- .github/workflows/ci.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b2e237..4e9c3de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,29 +13,38 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Rust Toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt + - run: cargo fmt --verbose --check clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Rust Toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy + - run: cargo clippy -- -Dwarnings test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Rust Toolchain uses: dtolnay/rust-toolchain@stable + - run: cargo test --verbose build-container: From 5b4ff670fe9855dfe4685e928f00fce1d2357148 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 16:25:41 -0500 Subject: [PATCH 3/6] ci: add image to manifest when building container Makes the `build-container` job more similar to the `release-container` workflow. Signed-off-by: Paul Nettleton --- .github/workflows/ci.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e9c3de..c620a72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -49,6 +49,8 @@ jobs: build-container: runs-on: ubuntu-latest + env: + MANIFEST: podlet-multiarch container: image: quay.io/containers/buildah:latest options: --security-opt seccomp=unconfined --security-opt apparmor=unconfined --device /dev/fuse:rw @@ -58,8 +60,16 @@ jobs: - run: buildah version + - name: Create manifest + run: | + buildah manifest create \ + --annotation "org.opencontainers.image.source=https://github.com/containers/podlet" \ + --annotation '"org.opencontainers.image.description=Generate Podman Quadlet files from a Podman command, compose file, or existing object"' \ + --annotation "org.opencontainers.image.licenses=MPL-2.0" \ + "${MANIFEST}" + - name: Build ARM image - run: buildah build --platform linux/arm64/v8 -t podlet . + run: buildah build --manifest "${MANIFEST}" --platform linux/arm64/v8 -t podlet . - name: Build x86 image - run: buildah build --platform linux/amd64 -t podlet . + run: buildah build --manifest "${MANIFEST}" --platform linux/amd64 -t podlet . From b6be7ead900ba1c9b75db08638e36c46192aef8f Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 16:36:57 -0500 Subject: [PATCH 4/6] ci: add `build` job The `build` job ensures that Podlet can be built for all supported platforms, Linux, Windows, and macOS. Signed-off-by: Paul Nettleton --- .github/workflows/ci.yaml | 16 ++++++++++++++++ CONTRIBUTING.md | 3 +++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c620a72..dc87f30 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,23 @@ jobs: - run: cargo test --verbose + build: + strategy: + fail-fast: false + matrix: + runner: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.runner }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust Toolchain + uses: dtolnay/rust-toolchain@stable + + - run: cargo build --verbose + build-container: + needs: build runs-on: ubuntu-latest env: MANIFEST: podlet-multiarch diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b92e01..fa59975 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -136,6 +136,9 @@ below is a list of all the jobs with explanations and the commands that they run - Unit tests are defined in the source. - All tests should pass. - `cargo test` +- build: + - Ensures Podlet can build on all target platforms. + - `cargo build` - build-container: - Ensures that the [Podlet container](./Containerfile) can build for both x86 and ARM platforms. - First, [install Buildah](https://github.com/containers/buildah/blob/main/install.md). From acc239704a7cc8865dc6ba5c1ce4d1560ff01f10 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 16:58:33 -0500 Subject: [PATCH 5/6] fix: correct use of `eyre::bail!()` on non-Unix platforms In `Cli::file_path()`, `color_eyre::eyre::bail!()` is used to return an error on non-Unix platforms if the `podlet --unit-directory` option is used. The `eyre` import was removed, so this resulted in a compiler error before. Signed-off-by: Paul Nettleton --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 3acd61c..cadd2a4 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -211,7 +211,7 @@ impl Cli { } #[cfg(not(unix))] - eyre::bail!("Cannot get Podman unit directory on non-unix system"); + color_eyre::eyre::bail!("Cannot get Podman unit directory on non-Unix system"); } else if let Some(Some(path)) = &self.file { if path.is_dir() { path.clone() From f69b79b54091915e78686b0fc7dc32eb2fbbf2c9 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Mon, 20 May 2024 17:11:04 -0500 Subject: [PATCH 6/6] docs(changelog): add v0.3.0 fixes Signed-off-by: Paul Nettleton --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0010d86..dc78480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.3.0] - 2024-05-20 +## [0.3.0] - 2024-05-21 Big release for Podlet! @@ -54,6 +54,7 @@ Note that the existing option for generating Kubernetes Pod YAML from a Compose - *(container)* Enforce `--blkio-weight` range `10..=1000`. - *(container)* `--blkio-weight-device` can be specified multiple times. - *(container)* Don't add empty `PodmanArgs=` when downgrading Podman version. +- Correct use of `eyre::bail!()` on non-Unix platforms. ### Documentation - *(clippy)* Fix Clippy lint warning for `Idmap`. @@ -101,6 +102,10 @@ Note that the existing option for generating Kubernetes Pod YAML from a Compose - *(ci)* Use Buildah container to build Podlet container. - *(deps)* Update dependencies. - *(release)* Update cargo-dist. +- *(release-container)* Fix manifest annotation quoting. +- *(ci)* Use consistent formatting. +- *(ci)* Add image to manifest when building container. +- *(ci)* Add `build` job. ## [0.2.4] - 2024-01-30