dev: v22: Add json5-to-json (#9043)

`json5-to-json` lets us process JSON files like devcontainer.json
safely.

Also add `just` to the go image.

Signed-off-by: Oliver Gould <ver@buoyant.io>
This commit is contained in:
Oliver Gould 2022-07-29 10:55:20 -07:00 committed by GitHub
parent deb49115aa
commit 18716ca206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 21 deletions

View File

@ -112,15 +112,15 @@ RUN for p in \
github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest \
golang.org/x/tools/gopls@latest \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 \
google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 \
google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 \
gotest.tools/gotestsum@v0.4.2 \
; do go install "$p" ; done \
; do go install -mod=readonly "$p" ; done \
&& rm -rf /go/pkg/* /go/src/*
COPY bin/scurl /usr/local/bin/scurl
COPY --from=protoc /usr/local/bin/protoc /usr/local/bin/
COPY --from=just /usr/local/bin/just /usr/local/bin/
ENV PROTOC_NO_VENDOR=1
ENV PROTOC=/usr/local/bin/protoc
COPY --from=protoc /usr/local/bin/protoc $PROTOC
##
## Kubernetes tools
@ -163,6 +163,9 @@ ARG ACTIONLINT_VERSION=v1.6.15
RUN url="https://github.com/rhysd/actionlint/releases/download/${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION#v}_linux_amd64.tar.gz" ; \
scurl "$url" | tar xzvf - -C /usr/local/bin actionlint
FROM docker.io/rust:${RUST_TOOLCHAIN}-slim as json5-to-json
RUN cargo install json5-to-json
##
## Tools: Everything needed for a development environment, minus non-root settings.
##
@ -170,6 +173,7 @@ RUN url="https://github.com/rhysd/actionlint/releases/download/${ACTIONLINT_VERS
FROM base as tools
COPY --from=actionlint /usr/local/bin/actionlint /usr/local/bin/
COPY --from=checksec /usr/local/bin/checksec /usr/local/bin/che
COPY --from=json5-to-json /usr/local/cargo/bin/json5-to-json /usr/local/bin/
COPY --from=just /usr/local/bin/just /usr/local/bin/
COPY --from=k8s /usr/local/bin/helm /usr/local/bin/
COPY --from=k8s /usr/local/bin/helm-docs /usr/local/bin/

View File

@ -1,6 +1,6 @@
{
"name": "linkerd2",
"image": "ghcr.io/linkerd/dev:v21",
"image": "ghcr.io/linkerd/dev:v22",
// "dockerFile": "./Dockerfile",
// "context": "..",
"extensions": [

View File

@ -3,6 +3,7 @@ name: Actions
on:
pull_request:
paths:
- .devcontainer/devcontainer.json
- .github/workflows/**
permissions:
@ -12,7 +13,7 @@ jobs:
actionlint:
runs-on: ubuntu-20.04
timeout-minutes: 10
container: ghcr.io/linkerd/dev:v21-tools
container: ghcr.io/linkerd/dev:v22-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run actionlint
@ -24,13 +25,15 @@ jobs:
devcontainer-versions:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v21-tools
container: ghcr.io/linkerd/dev:v22-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Scan workflows for other Devcontainer image versions
shell: bash
run: |
set -euo pipefail
# Strip jsonc comments because `jq` doesn't support them.
image=$(sed -E '/^\s*\/\/.*/d' .devcontainer/devcontainer.json |jq -Mr .image)
image=$(json5-to-json <.devcontainer/devcontainer.json |jq -r '.image')
for f in .github/workflows/* ; do
for i in $(yq '.jobs.* | .container.image // .container // "" | match("ghcr.io/linkerd/dev:v[0-9]+").string' < "$f") ; do
if [ "$i" != "$image" ]; then

View File

@ -16,7 +16,7 @@ jobs:
go-lint:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v21-go
container: ghcr.io/linkerd/dev:v22-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: golangci-lint run --verbose --timeout=10m
@ -24,7 +24,7 @@ jobs:
go-format:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v21-go
container: ghcr.io/linkerd/dev:v22-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/fmt
@ -32,7 +32,7 @@ jobs:
go-test:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v21-go
container: ghcr.io/linkerd/dev:v22-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: go mod download

View File

@ -15,7 +15,7 @@ jobs:
helm-docs-diff:
runs-on: ubuntu-20.04
timeout-minutes: 5
container: ghcr.io/linkerd/dev:v21-tools
container: ghcr.io/linkerd/dev:v22-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/helm-docs-diff

View File

@ -15,7 +15,7 @@ jobs:
proto-diff:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v21-go
container: ghcr.io/linkerd/dev:v22-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/protoc-diff

View File

@ -42,7 +42,7 @@ jobs:
fmt:
timeout-minutes: 5
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v21-rust
container: ghcr.io/linkerd/dev:v22-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-check-fmt
@ -50,7 +50,7 @@ jobs:
clippy:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v21-rust
container: ghcr.io/linkerd/dev:v22-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch
@ -60,7 +60,7 @@ jobs:
check:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v21-rust
container: ghcr.io/linkerd/dev:v22-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch
@ -70,7 +70,7 @@ jobs:
name: test
runs-on: ubuntu-latest
timeout-minutes: 15
container: ghcr.io/linkerd/dev:v21-rust
container: ghcr.io/linkerd/dev:v22-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch

View File

@ -15,7 +15,7 @@ jobs:
shellcheck:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v21-tools
container: ghcr.io/linkerd/dev:v22-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/shellcheck-all

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc-gen-go v1.28.1
// protoc v3.20.0
// source: common/net.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc-gen-go v1.28.1
// protoc v3.20.0
// source: viz.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc-gen-go v1.28.1
// protoc v3.20.0
// source: viz_tap.proto