Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: v34 #92

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kubert",
"image": "ghcr.io/linkerd/dev:v32",
"image": "ghcr.io/linkerd/dev:v34",
"extensions": [
"kokakiwi.vscode-just",
"NathanRidley.autotrim",
Expand All @@ -20,6 +20,15 @@
"overrideCommand": false,
"remoteUser": "code",
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
{
"source": "/var/run/docker.sock",
"target": "/var/run/docker-host.sock",
"type": "bind"
},
{
"source": "${localEnv:HOME}/.docker",
"target": "/home/code/.docker",
"type": "bind"
}
]
}
16 changes: 14 additions & 2 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
matrix:
k8s:
- v1.21
- v1.24
- v1.25
timeout-minutes: 10
runs-on: ubuntu-latest
env:
Expand All @@ -42,6 +42,15 @@ jobs:
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: curl --proto =https --tlsv1.3 -fLsSv https://raw.githubusercontent.com/k3d-io/k3d/${K3D_VERSION}/install.sh | bash
# XXX This sucks
- run: |
cd /usr/local/bin
curl --proto =https --tlsv1.3 -fLsSvO https://raw.githubusercontent.com/linkerd/dev/574d6bab940a5fcfcd49169cd0b24ee72e2b5a04/bin/just-k3d
curl --proto =https --tlsv1.3 -fLsSvO https://raw.githubusercontent.com/linkerd/dev/574d6bab940a5fcfcd49169cd0b24ee72e2b5a04/bin/just-cargo
chmod 755 /usr/local/bin/just-cargo /usr/local/bin/just-k3d
- uses: docker://ghcr.io/linkerd/dev:v34-rust
with:
entrypoint: mount
- name: Set kubert test server version to ${{ matrix.k8s }}
run: echo "KUBERT_TEST_CLUSTER_VERSION=${{ matrix.k8s }}" >> $GITHUB_ENV
- run: just fetch
Expand All @@ -54,7 +63,7 @@ jobs:
just test-cluster-run-watch-pods --log-level=debug \
--as=system:serviceaccount:${KUBERT_TEST_NS}:watch-pods \
--kubeconfig=$HOME/.kube/config
- run: just build-test-lease
- run: just test-lease-build
- run: just test-lease

in-cluster:
Expand All @@ -72,6 +81,9 @@ jobs:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325
- run: curl --proto =https --tlsv1.3 -fLsSv https://raw.githubusercontent.com/k3d-io/k3d/${K3D_VERSION}/install.sh | bash
# XXX This sucks
- run: curl --proto =https --tlsv1.3 -fLsSv https://raw.githubusercontent.com/linkerd/dev/574d6bab940a5fcfcd49169cd0b24ee72e2b5a04/bin/just-k3d
-o /usr/local/bin/just-k3d && chmod 755 /usr/local/bin/just-k3d
- name: Set kubert test server version to ${{ matrix.k8s }}
run: echo "KUBERT_TEST_CLUSTER_VERSION=${{ matrix.k8s }}" >> $GITHUB_ENV
- run: just build-examples-image
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
matrix:
rust:
- "1.60"
- "1.64"
- "1.65"
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:${{ matrix.rust }}
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: olix0r/cargo-action-fmt@ed3530f0739c46ffa0dd983f8746b8c4a3d0a01c
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
- run: rustup toolchain install '${{ matrix.rust }}'
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: just fetch
- run: just features=all clippy
env:
CARGO: cargo '+${{ matrix.rust }}'

feature-check:
strategy:
Expand All @@ -51,8 +51,7 @@ jobs:
- shutdown
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.64
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: olix0r/cargo-action-fmt@ed3530f0739c46ffa0dd983f8746b8c4a3d0a01c
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,16 @@ jobs:
fmt:
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: rustup component add rustfmt
- run: just check-fmt
- run: just fmt-check

doc:
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: just fetch
- run: just doc
Expand Down
35 changes: 15 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,28 @@ jobs:
meta:
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.64-bullseye
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- id: meta
shell: bash
run: |
ref="${{ github.ref }}"
if [[ "$ref" == refs/tags/release/* ]]; then
echo ::set-output name=version::"${ref##refs/tags/release/}"
echo ::set-output name=mode::release
version="${ref##refs/tags/release/}"
crate=$(just-cargo crate-version kubert)
if [[ "$crate" != "$version" ]]; then
echo "::error ::Crate version $crate does not match tag $version" >&2
exit 1
fi
( echo version="$version"
echo mode=release
) >> "$GITHUB_OUTPUT"
else
sha="${{ github.sha }}"
echo ::set-output name=version::"test-${sha:0:7}"
echo ::set-output name=mode::test
fi
- if: steps.meta.outputs.mode == 'release'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- if: steps.meta.outputs.mode == 'release'
shell: bash
run: |
curl --proto '=https' --tlsv1.3 -fsSL https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o $HOME/jq
chmod 755 $HOME/jq
version=$(cargo metadata --format-version=1 | $HOME/jq -r '.packages[] | select(.name == "kubert") | .version')
if [[ "v${version}" != "${{ steps.meta.outputs.version }}" ]]; then
echo "::error ::Crate version v${version} does not match tag ${{ steps.meta.outputs.version }}"
exit 1
( echo version="$(just-cargo crate-version kubert)-git-${sha:0:7}"
echo mode=test
) >> "$GITHUB_OUTPUT"
fi
outputs:
mode: ${{ steps.meta.outputs.mode }}
Expand All @@ -70,8 +66,7 @@ jobs:
needs: [meta, release]
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: docker://rust:1.64.0-bullseye
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: cargo publish --package=kubert --dry-run
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: docker://rust:1.64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container: ghcr.io/linkerd/dev:v34-rust
steps:
- uses: olix0r/cargo-action-fmt@ed3530f0739c46ffa0dd983f8746b8c4a3d0a01c
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: cargo fetch
- run: just build-test
- run: just fetch
- run: just test-build
- run: just test
13 changes: 7 additions & 6 deletions examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
ARG RUST_VERSION=1.64

FROM docker.io/library/rust:${RUST_VERSION}-bullseye as build
FROM ghcr.io/linkerd/dev:v34-rust as build
WORKDIR /kubert
COPY . .
RUN cargo fetch
RUN cargo build --frozen --package=kubert-examples --examples
RUN --mount=type=cache,target=/usr/local/cargo/registry \
CARGO_NET_RETRY=10 just-cargo fetch
RUN --mount=type=cache,target=/usr/local/cargo/registry \
CARGO_INCREMENTAL=0 just-cargo build --frozen --package=kubert-examples --examples

FROM gcr.io/distroless/cc
COPY --from=build /kubert/target/debug/examples/watch-pods /usr/local/bin/
COPY --from=build /kubert/target/debug/examples/watch-pods /watch-pods
ENTRYPOINT ["/watch-pods"]
Loading