diff --git a/.envrc b/.envrc index 84fc8e53..40b21021 100644 --- a/.envrc +++ b/.envrc @@ -5,3 +5,5 @@ eval "$(devbox generate direnv --print-envrc)" # check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ # for more details + +export TASK_X_ANY_VARIABLES=1 diff --git a/.github/workflows/checks-macos.yml b/.github/workflows/checks-macos.yml index b57e8d1e..e13d9d6f 100644 --- a/.github/workflows/checks-macos.yml +++ b/.github/workflows/checks-macos.yml @@ -15,12 +15,16 @@ on: branches: - main +defaults: + run: + shell: bash + +env: + TASK_X_ANY_VARIABLES: 1 + jobs: build-and-run: runs-on: macos-13 - defaults: - run: - shell: bash steps: - name: Check out code uses: actions/checkout@v4 @@ -36,10 +40,7 @@ jobs: - name: Build run: | - devbox run -- \ - make GORELEASER_FLAGS=$'--config=<(gojq --yaml-input --yaml-output \'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=(["darwin_amd64_v1"])\' .goreleaser.yml) --skip=validate,publish' release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_PLATFORMS="\"darwin_amd64\"" devbox run -- task build:release-unpublished - name: Run binary run: | diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d9533a0c..ddb8db90 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,15 +12,20 @@ on: - opened - synchronize - reopened - branches: - - main + +permissions: + contents: read + +defaults: + run: + shell: bash + +env: + TASK_X_ANY_VARIABLES: 1 jobs: unit-test: runs-on: ubuntu-22.04 - defaults: - run: - shell: bash permissions: checks: write pull-requests: write @@ -33,8 +38,18 @@ jobs: with: enable-cache: true + - name: Go cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Run unit tests - run: devbox run -- make test + run: devbox run -- task test:unit - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 @@ -46,9 +61,6 @@ jobs: e2e-test: runs-on: ubuntu-22.04 - defaults: - run: - shell: bash permissions: checks: write pull-requests: write @@ -69,7 +81,7 @@ jobs: platforms: arm64 - name: Run e2e tests - run: devbox run -- make e2e-test + run: devbox run -- task test:e2e env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TMPDIR: ${{ runner.temp }} @@ -84,9 +96,6 @@ jobs: lint: runs-on: ubuntu-22.04 - defaults: - run: - shell: bash steps: - name: Check out code uses: actions/checkout@v4 @@ -97,39 +106,75 @@ jobs: enable-cache: true - name: Export golang and golangci-lint versions + id: versions run: | - echo "GOLANGCI_LINT_VERSION=v$(devbox run -- golangci-lint version --format short)" >>$GITHUB_ENV - echo "GO_VERSION=$(devbox run -- go version | grep -o "[[:digit:]]\+.[[:digit:]]\+\(.[[:digit:]]\+\)\?")" >>$GITHUB_ENV + echo "golangci-lint=$(devbox run -- golangci-lint version --format short)" >>"${GITHUB_OUTPUT}" + echo "golang=$(devbox run -- go version | grep -o "[[:digit:]]\+.[[:digit:]]\+\(.[[:digit:]]\+\)\?")" >>"${GITHUB_OUTPUT}" - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 with: fail_on_error: true reporter: github-pr-review - golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }} - go_version: ${{ env.GO_VERSION }} + golangci_lint_version: v${{ steps.versions.outputs.golangci-lint }} + go_version: v${{ steps.versions.outputs.golang }} + + lint-gha: + runs-on: ubuntu-22.04 + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: actionlint + uses: reviewdog/action-actionlint@v1 + with: + fail_on_error: true + reporter: github-pr-review pre-commit: runs-on: ubuntu-22.04 - defaults: - run: - shell: bash steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Install devbox uses: jetpack-io/devbox-install-action@v0.8.0 with: enable-cache: true + - name: Go cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Set up pre-commit cache uses: actions/cache@v4 with: path: ~/.cache/pre-commit - key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit - run: devbox run -- make pre-commit + run: devbox run -- task pre-commit:run env: - SKIP: no-commit-to-branch,golangci-lint + SKIP: no-commit-to-branch,golangci-lint,actionlint-system + + govulncheck: + runs-on: ubuntu-22.04 + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install devbox + uses: jetpack-io/devbox-install-action@v0.8.0 + with: + enable-cache: true + + - id: govulncheck + run: devbox run -- task go:vulncheck diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c1c5031f..ebc24521 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -7,6 +7,9 @@ on: schedule: - cron: '32 21 * * 2' +env: + TASK_X_ANY_VARIABLES: 1 + jobs: analyze: name: Analyze @@ -39,7 +42,7 @@ jobs: enable-cache: true - name: Build - run: devbox run -- make build-snapshot + run: devbox run -- task build:snapshot - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/dependabot-automation.yaml b/.github/workflows/dependabot-automation.yaml index 11201f71..f19cd77c 100644 --- a/.github/workflows/dependabot-automation.yaml +++ b/.github/workflows/dependabot-automation.yaml @@ -12,6 +12,10 @@ permissions: pull-requests: write contents: write +defaults: + run: + shell: bash + jobs: enable-automerge: runs-on: ubuntu-22.04 diff --git a/.github/workflows/devbox-update.yaml b/.github/workflows/devbox-update.yaml index 326af2b3..2c9b4f22 100644 --- a/.github/workflows/devbox-update.yaml +++ b/.github/workflows/devbox-update.yaml @@ -73,12 +73,11 @@ jobs: - name: Create PR using app token if: steps.devbox-versions-changed.outputs.number_changed > 0 - id: create-pr env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | - pr_url="$(gh pr create --base "${{ github.ref_name }}" --head "${DESTINATION_BRANCH}" \ - --title "${{ steps.commit-changes.outputs.message }}" \ - --body "This PR was automatically created by the scheduled devbox update workflow.")" + pr_url="$(gh pr create --base '${{ github.ref_name }}' --head "${DESTINATION_BRANCH}" \ + --title '${{ steps.commit-changes.outputs.message }}' \ + --body 'This PR was automatically created by the scheduled devbox update workflow.' \ + --label ignore-for-release)" gh pr merge --auto --squash "${pr_url}" - echo "pr_url=${pr_url}" >>"${GITHUB_OUTPUT}" diff --git a/.github/workflows/recover-secret.yaml b/.github/workflows/recover-secret.yaml deleted file mode 100644 index ede4e162..00000000 --- a/.github/workflows/recover-secret.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -on: workflow_dispatch -jobs: - openssl: - name: Recover Secret With OpenSSL - runs-on: ubuntu-22.04 - defaults: - run: - shell: bash - steps: - - env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - OPENSSL_PASSWORD: ${{ secrets.OPENSSL_PASSWORD }} - OPENSSL_ITER: ${{ secrets.OPENSSL_ITER }} - run: | - echo "$(echo "${DOCKER_PASSWORD}" | openssl enc -e -aes-256-cbc -a -pbkdf2 -iter ${OPENSSL_ITER} -k "${OPENSSL_PASSWORD}")" - echo "Copy the above value, and then execute locally:" - echo "echo PASTE_HERE | openssl base64 -d | openssl enc -d -pbkdf2 -iter \$OPENSSL_ITER -aes-256-cbc -k \$OPENSSL_PASSWORD" diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 100e8138..97ea1b72 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -13,12 +13,16 @@ permissions: contents: write packages: write +defaults: + run: + shell: bash + +env: + TASK_X_ANY_VARIABLES: 1 + jobs: release-tag: runs-on: ubuntu-22.04 - defaults: - run: - shell: bash steps: - uses: actions/checkout@v4 with: @@ -31,6 +35,6 @@ jobs: enable-cache: true - name: Release - run: devbox run -- make release + run: devbox run -- task build:release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index b7f9ed8e..576b5fea 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ dist/ *.tar.gz *.tar + +.task +.devbox diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85dc2c13..eff4be17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,11 +35,17 @@ repos: stages: [commit] - id: end-of-file-fixer stages: [commit] +- repo: https://github.com/rhysd/actionlint + rev: v1.6.25 + hooks: + - id: actionlint-system + stages: [commit] - repo: https://github.com/jorisroovers/gitlint rev: v0.19.1 hooks: - id: gitlint - stages: [commit-msg] + - id: gitlint-ci + args: ["--commits", "origin/main..HEAD"] - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: @@ -74,9 +80,9 @@ repos: - // - --allow-past-years - id: insert-license - name: License headers - YAML and Makefiles + name: License headers - YAML stages: [commit] - files: (^Makefile|\.(ya?ml|mk))$ + files: \.ya?ml$ args: - --license-filepath - header.txt diff --git a/.vscode/settings.json b/.vscode/settings.json index e585c6d4..ee88837e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,14 @@ { "go.buildTags": "e2e", - "ginkgotestexplorer.buildTags": "e2e" + "ginkgotestexplorer.buildTags": "e2e", + "yaml.schemas": { + "https://taskfile.dev/schema.json": [ + "tasks/build.yaml", + "tasks/repo.yaml", + "tasks/git.yaml", + "tasks/pre-commit.yaml", + "tasks/go.yaml", + "tasks/test.yaml" + ] + } } diff --git a/Makefile b/Makefile deleted file mode 100644 index 8c2a8333..00000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -REPO_ROOT := $(CURDIR) - -include make/all.mk diff --git a/README.md b/README.md index bf5a69fc..a4729946 100644 --- a/README.md +++ b/README.md @@ -175,17 +175,10 @@ Install direnv: Hook direnv into your shell if you haven't already: . -### Configure global go mod cache - -By default `devenv` will use an isolated go mod cache for each project which is great from an isolation point of view, -but terrible for disk space (duplication!). To configure a global go mod cache, add the following after the `direnv` -integration above to your shell config file, adapting the path as appropriate: - -```bash -export GOMODCACHE=~/go/pkg/mod -``` - ## Building the CLI -Build the CLI using `make build-snapshot` that will output binary into -`dist/mindthegap_$(GOOS)_$(GOARCH)/mindthegap` and put it in `$PATH`. +`mindthegap` uses [`task`](https://taskfile.dev/) for running build tasks. `task` will be automatically available when +the devbox environment is correctly set up. + +Build the CLI using `task build:snapshot` that will output binary into +`./dist/mindthegap_$(GOOS)_$(GOARCH)/mindthegap`. diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 00000000..4cdebf5a --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,16 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +set: + - errexit + - nounset + - pipefail + +includes: + build: ./tasks/build.yaml + git: ./tasks/git.yaml + pre-commit: ./tasks/pre-commit.yaml + go: ./tasks/go.yaml + test: ./tasks/test.yaml diff --git a/devbox.json b/devbox.json index 9c040a4e..aac3aa46 100644 --- a/devbox.json +++ b/devbox.json @@ -1,19 +1,20 @@ { "packages": [ - "bash@latest", + "actionlint@latest", "coreutils@latest", "crane@latest", - "findutils@latest", + "fd@latest", "ginkgo@latest", "git@latest", "gnused@latest", "gnugrep@latest", - "gnumake@latest", "go@latest", + "go-task@latest", "gojq@latest", "golines@latest", "goreleaser@latest", "gotestsum@latest", + "govulncheck@latest", "ko@latest", "kubernetes-helm@latest", "pre-commit@latest", diff --git a/devbox.lock b/devbox.lock index b553064d..4c49ad42 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,127 +1,51 @@ { "lockfile_version": "1", "packages": { - "bash@latest": { - "last_modified": "2024-03-29T03:06:03Z", - "resolved": "github:NixOS/nixpkgs/9b09bde6e3fc9493b6a8b2a5702ac87c66505c64#bash", + "actionlint@latest": { + "last_modified": "2024-03-22T11:26:23Z", + "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#actionlint", "source": "devbox-search", - "version": "5.2p26", + "version": "1.6.27", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/bsa1v1mr7c42a0yd90ncnchcs18ylm4b-bash-5.2p26", - "default": true - }, - { - "name": "man", - "path": "/nix/store/q20597820xwxgrx1ms4bds46lv1iii83-bash-5.2p26-man", + "path": "/nix/store/7kx2di7x0fwk2aqjvb2sm3g52cwfmdjf-actionlint-1.6.27", "default": true - }, - { - "name": "info", - "path": "/nix/store/gr8205m5ily1x09mkg2vgmid7hkl4968-bash-5.2p26-info" - }, - { - "name": "dev", - "path": "/nix/store/21p4r6rq65cji6fjs7pcmywd35y2v7iy-bash-5.2p26-dev" - }, - { - "name": "doc", - "path": "/nix/store/0rxrvwwj9qkafibca5hn3f3cvlzhz9qs-bash-5.2p26-doc" } ], - "store_path": "/nix/store/bsa1v1mr7c42a0yd90ncnchcs18ylm4b-bash-5.2p26" + "store_path": "/nix/store/7kx2di7x0fwk2aqjvb2sm3g52cwfmdjf-actionlint-1.6.27" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/k4rn5s600l1mvf9l10q13fw1r7r21yi7-bash-5.2p26", - "default": true - }, - { - "name": "man", - "path": "/nix/store/m83q8jnccdk3hrychgiwdharg0cwqykc-bash-5.2p26-man", + "path": "/nix/store/ncs3j3wdpmfahjky763cpx2cmhj85ynl-actionlint-1.6.27", "default": true - }, - { - "name": "info", - "path": "/nix/store/154w6sgkyvjivc6r8b6k18ffc1sq999q-bash-5.2p26-info" - }, - { - "name": "debug", - "path": "/nix/store/7m0xmvqjzhyl70q5w2mwkpbi65ixwg86-bash-5.2p26-debug" - }, - { - "name": "dev", - "path": "/nix/store/7rysdpjb1wy71rq255a0rmq63gli0fyv-bash-5.2p26-dev" - }, - { - "name": "doc", - "path": "/nix/store/35fc1j2p1h5wm7wkwdr08abs2pkkqgxa-bash-5.2p26-doc" } ], - "store_path": "/nix/store/k4rn5s600l1mvf9l10q13fw1r7r21yi7-bash-5.2p26" + "store_path": "/nix/store/ncs3j3wdpmfahjky763cpx2cmhj85ynl-actionlint-1.6.27" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/7xmqfgfgipjypqprhz0xw6bd3jb58z3y-bash-5.2p26", + "path": "/nix/store/b1m4gxk0kg5d3xhfn3q6f6mn0z6l8v4y-actionlint-1.6.27", "default": true - }, - { - "name": "man", - "path": "/nix/store/b8jhwnbnygwqfrl3fm2awch9s3wx1s65-bash-5.2p26-man", - "default": true - }, - { - "name": "dev", - "path": "/nix/store/hmr85m39s495swfw50vcm2dg9fpmdkjr-bash-5.2p26-dev" - }, - { - "name": "doc", - "path": "/nix/store/00h3sadi1d8szn2aa0fr68p71dvp6pk5-bash-5.2p26-doc" - }, - { - "name": "info", - "path": "/nix/store/j388s7hb4ygs8faynz31w3pd4imwqls5-bash-5.2p26-info" } ], - "store_path": "/nix/store/7xmqfgfgipjypqprhz0xw6bd3jb58z3y-bash-5.2p26" + "store_path": "/nix/store/b1m4gxk0kg5d3xhfn3q6f6mn0z6l8v4y-actionlint-1.6.27" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/5lr5n3qa4day8l1ivbwlcby2nknczqkq-bash-5.2p26", - "default": true - }, - { - "name": "man", - "path": "/nix/store/xc55xin8rrj0awz4givys2bdv19gjq0n-bash-5.2p26-man", + "path": "/nix/store/l0p42frr7hgp1rll6y8mxwy8m9zqrv3w-actionlint-1.6.27", "default": true - }, - { - "name": "debug", - "path": "/nix/store/3s50cqzyj30j6fq7b1zswxyyr3j86mib-bash-5.2p26-debug" - }, - { - "name": "dev", - "path": "/nix/store/vr81q58rgd9gil1im30j4s8jqs889hq4-bash-5.2p26-dev" - }, - { - "name": "doc", - "path": "/nix/store/m0fc8n70x6bfwn3alh9di2bara8m6kkv-bash-5.2p26-doc" - }, - { - "name": "info", - "path": "/nix/store/ld1f9nmzw7lfw41snqwdr33a0sj9vi5z-bash-5.2p26-info" } ], - "store_path": "/nix/store/5lr5n3qa4day8l1ivbwlcby2nknczqkq-bash-5.2p26" + "store_path": "/nix/store/l0p42frr7hgp1rll6y8mxwy8m9zqrv3w-actionlint-1.6.27" } } }, @@ -281,83 +205,51 @@ } } }, - "findutils@latest": { - "last_modified": "2024-03-29T12:35:36Z", - "resolved": "github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d#findutils", + "fd@latest": { + "last_modified": "2024-03-22T11:26:23Z", + "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#fd", "source": "devbox-search", - "version": "4.9.0", + "version": "9.0.0", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/mxvqp1mpk5a7n4k25pn000lribabn92k-findutils-4.9.0", + "path": "/nix/store/wi2gyzpv6kn7dr5rp94hzizjia8byap3-fd-9.0.0", "default": true - }, - { - "name": "info", - "path": "/nix/store/6pkh304b1fidjrgm5ss0pbwz53nrp6p4-findutils-4.9.0-info" - }, - { - "name": "locate", - "path": "/nix/store/fcl25il2pndddcgzlj5rf3crwgjv9zbx-findutils-4.9.0-locate" } ], - "store_path": "/nix/store/mxvqp1mpk5a7n4k25pn000lribabn92k-findutils-4.9.0" + "store_path": "/nix/store/wi2gyzpv6kn7dr5rp94hzizjia8byap3-fd-9.0.0" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/absz528qxkasvvv349rsjx2pl5fh2k3l-findutils-4.9.0", + "path": "/nix/store/p4qld2yjkprcy0iyadshpla5hhh86g7g-fd-9.0.0", "default": true - }, - { - "name": "info", - "path": "/nix/store/nbd4xs7r18n8wdvb9356sxz7qa4wqmis-findutils-4.9.0-info" - }, - { - "name": "locate", - "path": "/nix/store/6q78dcaqchg1128rr942lb772v9lk6in-findutils-4.9.0-locate" } ], - "store_path": "/nix/store/absz528qxkasvvv349rsjx2pl5fh2k3l-findutils-4.9.0" + "store_path": "/nix/store/p4qld2yjkprcy0iyadshpla5hhh86g7g-fd-9.0.0" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/rwvrdal864r5yml4zvdz1f0yih09yvjg-findutils-4.9.0", + "path": "/nix/store/1yzgfbaqrxy04sxarc4s82y3k9pb689c-fd-9.0.0", "default": true - }, - { - "name": "info", - "path": "/nix/store/4bj4dcv9q25h5dr8vhpr468nwhzbvm9m-findutils-4.9.0-info" - }, - { - "name": "locate", - "path": "/nix/store/r9xnm8jym1m52sx06h18ys4czqifqngw-findutils-4.9.0-locate" } ], - "store_path": "/nix/store/rwvrdal864r5yml4zvdz1f0yih09yvjg-findutils-4.9.0" + "store_path": "/nix/store/1yzgfbaqrxy04sxarc4s82y3k9pb689c-fd-9.0.0" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/6xyv6b1l5zvzd23scbim221rxkcp8g9w-findutils-4.9.0", + "path": "/nix/store/rym51bxaidl738b2nmxsd1hzr83wkk9a-fd-9.0.0", "default": true - }, - { - "name": "locate", - "path": "/nix/store/w9lgydl4ff6k313lyn6yzay204vr7vrc-findutils-4.9.0-locate" - }, - { - "name": "info", - "path": "/nix/store/6dvzilvsnr4zy4msrsmm0yhwsamfl6gq-findutils-4.9.0-info" } ], - "store_path": "/nix/store/6xyv6b1l5zvzd23scbim221rxkcp8g9w-findutils-4.9.0" + "store_path": "/nix/store/rym51bxaidl738b2nmxsd1hzr83wkk9a-fd-9.0.0" } } }, @@ -545,159 +437,115 @@ } } }, - "gnumake@latest": { - "last_modified": "2024-03-25T12:46:37Z", - "resolved": "github:NixOS/nixpkgs/c726225724e681b3626acc941c6f95d2b0602087#gnumake", + "gnused@latest": { + "last_modified": "2024-03-22T11:26:23Z", + "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#gnused", "source": "devbox-search", - "version": "4.4.1", + "version": "4.9", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/d9wnf8z9xpl90kghagl5jh3lncqc893q-gnumake-4.4.1", - "default": true - }, - { - "name": "man", - "path": "/nix/store/cj2kz1p6fzkxyr6s2a6h2kkz6vy3hs66-gnumake-4.4.1-man", + "path": "/nix/store/051x0h9iyrbqibxn8nm2p88yasx8gz3b-gnused-4.9", "default": true }, { "name": "info", - "path": "/nix/store/rkg39gf40dyllcppicbl2jjmx5jgfasz-gnumake-4.4.1-info" + "path": "/nix/store/90zfldi5jbb2pnbhcz88j1rfxr33abf6-gnused-4.9-info" } ], - "store_path": "/nix/store/d9wnf8z9xpl90kghagl5jh3lncqc893q-gnumake-4.4.1" + "store_path": "/nix/store/051x0h9iyrbqibxn8nm2p88yasx8gz3b-gnused-4.9" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/fff78x6lxmsmhzkcijpia3pac6gy2hfs-gnumake-4.4.1", - "default": true - }, - { - "name": "man", - "path": "/nix/store/l4m6k61i066b84f24pfgspy5anm0ic55-gnumake-4.4.1-man", + "path": "/nix/store/wij6vi3xmm8bmzph1js4i4jv2g04s8j3-gnused-4.9", "default": true }, - { - "name": "debug", - "path": "/nix/store/xwwa9jvl8wkvzslh9f4f9paqd66jxhdy-gnumake-4.4.1-debug" - }, { "name": "info", - "path": "/nix/store/h7g4d56a69cchg4ph7rgaqwy8xvrfk8c-gnumake-4.4.1-info" + "path": "/nix/store/hjxjynhv77jncb22sqa0l4p6c7fhmgj5-gnused-4.9-info" } ], - "store_path": "/nix/store/fff78x6lxmsmhzkcijpia3pac6gy2hfs-gnumake-4.4.1" + "store_path": "/nix/store/wij6vi3xmm8bmzph1js4i4jv2g04s8j3-gnused-4.9" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/224fzspjyx3mwc050v2bi9bikiq3h417-gnumake-4.4.1", - "default": true - }, - { - "name": "man", - "path": "/nix/store/fxrnymr71z4q2bs91zsnwqqah976wz10-gnumake-4.4.1-man", + "path": "/nix/store/jwka3z87sxdczv18vjxiz38b83qwpvnm-gnused-4.9", "default": true }, { "name": "info", - "path": "/nix/store/pn0agdr8mqyz1hndxldrzgz073r2javv-gnumake-4.4.1-info" + "path": "/nix/store/cvpj2nfcy2hahmp6i4dxrrzflj8x3l46-gnused-4.9-info" } ], - "store_path": "/nix/store/224fzspjyx3mwc050v2bi9bikiq3h417-gnumake-4.4.1" + "store_path": "/nix/store/jwka3z87sxdczv18vjxiz38b83qwpvnm-gnused-4.9" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/x1aqq14561lsgck9ii5dfibpf58jy7d9-gnumake-4.4.1", - "default": true - }, - { - "name": "man", - "path": "/nix/store/1y6xvn5ff1b4h5vc0sx4kr0ad5h93viq-gnumake-4.4.1-man", + "path": "/nix/store/kqb7yncgd6a17nlgbixhcvcwync0nqg0-gnused-4.9", "default": true }, - { - "name": "debug", - "path": "/nix/store/r8yg8v3x21rvpzjzjqvgzmrdqvg3hqwy-gnumake-4.4.1-debug" - }, { "name": "info", - "path": "/nix/store/2mrrh6f51cncy67i3xxj1s2f4i99djwh-gnumake-4.4.1-info" + "path": "/nix/store/fdvqvjjw6qzh6ishvikb4b7vy8xkmqm5-gnused-4.9-info" } ], - "store_path": "/nix/store/x1aqq14561lsgck9ii5dfibpf58jy7d9-gnumake-4.4.1" + "store_path": "/nix/store/kqb7yncgd6a17nlgbixhcvcwync0nqg0-gnused-4.9" } } }, - "gnused@latest": { + "go-task@latest": { "last_modified": "2024-03-22T11:26:23Z", - "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#gnused", + "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#go-task", "source": "devbox-search", - "version": "4.9", + "version": "3.35.1", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/051x0h9iyrbqibxn8nm2p88yasx8gz3b-gnused-4.9", + "path": "/nix/store/8xlnzmvkpj03yw5xmsm6acz8w0rd3cr7-go-task-3.35.1", "default": true - }, - { - "name": "info", - "path": "/nix/store/90zfldi5jbb2pnbhcz88j1rfxr33abf6-gnused-4.9-info" } ], - "store_path": "/nix/store/051x0h9iyrbqibxn8nm2p88yasx8gz3b-gnused-4.9" + "store_path": "/nix/store/8xlnzmvkpj03yw5xmsm6acz8w0rd3cr7-go-task-3.35.1" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/wij6vi3xmm8bmzph1js4i4jv2g04s8j3-gnused-4.9", + "path": "/nix/store/n0gjrdfrjj5pxirp3v6w9qdw3r8d076r-go-task-3.35.1", "default": true - }, - { - "name": "info", - "path": "/nix/store/hjxjynhv77jncb22sqa0l4p6c7fhmgj5-gnused-4.9-info" } ], - "store_path": "/nix/store/wij6vi3xmm8bmzph1js4i4jv2g04s8j3-gnused-4.9" + "store_path": "/nix/store/n0gjrdfrjj5pxirp3v6w9qdw3r8d076r-go-task-3.35.1" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/jwka3z87sxdczv18vjxiz38b83qwpvnm-gnused-4.9", + "path": "/nix/store/9a8myn2zjl17ws0h7pgw210mwvgd6dm8-go-task-3.35.1", "default": true - }, - { - "name": "info", - "path": "/nix/store/cvpj2nfcy2hahmp6i4dxrrzflj8x3l46-gnused-4.9-info" } ], - "store_path": "/nix/store/jwka3z87sxdczv18vjxiz38b83qwpvnm-gnused-4.9" + "store_path": "/nix/store/9a8myn2zjl17ws0h7pgw210mwvgd6dm8-go-task-3.35.1" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/kqb7yncgd6a17nlgbixhcvcwync0nqg0-gnused-4.9", + "path": "/nix/store/1xb7vmm16bhlq12lk1q3fhkcypv2p9kb-go-task-3.35.1", "default": true - }, - { - "name": "info", - "path": "/nix/store/fdvqvjjw6qzh6ishvikb4b7vy8xkmqm5-gnused-4.9-info" } ], - "store_path": "/nix/store/kqb7yncgd6a17nlgbixhcvcwync0nqg0-gnused-4.9" + "store_path": "/nix/store/1xb7vmm16bhlq12lk1q3fhkcypv2p9kb-go-task-3.35.1" } } }, @@ -941,6 +789,54 @@ } } }, + "govulncheck@latest": { + "last_modified": "2024-03-22T11:26:23Z", + "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#govulncheck", + "source": "devbox-search", + "version": "1.0.4", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/w6n78s03arv75ymqhzb4lgbi3kx5kx5x-govulncheck-1.0.4", + "default": true + } + ], + "store_path": "/nix/store/w6n78s03arv75ymqhzb4lgbi3kx5kx5x-govulncheck-1.0.4" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/vzmbb40a0xy6hr9zw6r4jqhy786qpiaz-govulncheck-1.0.4", + "default": true + } + ], + "store_path": "/nix/store/vzmbb40a0xy6hr9zw6r4jqhy786qpiaz-govulncheck-1.0.4" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/zgcyah07vgd222pw8lksr7d4mys2gx1d-govulncheck-1.0.4", + "default": true + } + ], + "store_path": "/nix/store/zgcyah07vgd222pw8lksr7d4mys2gx1d-govulncheck-1.0.4" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/6lxqgj80bhikfq3a9azk6mfrlskb4rv2-govulncheck-1.0.4", + "default": true + } + ], + "store_path": "/nix/store/6lxqgj80bhikfq3a9azk6mfrlskb4rv2-govulncheck-1.0.4" + } + } + }, "ko@latest": { "last_modified": "2024-03-22T11:26:23Z", "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#ko", diff --git a/go.mod b/go.mod index b540db9c..17ed3063 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/distribution/distribution/v3 v3.0.0-alpha.1 github.com/distribution/reference v0.6.0 github.com/docker/cli v26.0.0+incompatible - github.com/docker/docker v25.0.3+incompatible + github.com/docker/docker v26.0.0+incompatible github.com/docker/docker-credential-helpers v0.8.1 github.com/docker/go-connections v0.5.0 github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027 @@ -152,6 +152,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/spdystream v0.2.0 // indirect github.com/moby/term v0.5.0 // indirect @@ -191,13 +192,13 @@ require ( go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.18.0 // indirect diff --git a/go.sum b/go.sum index 8bf1a257..bf0e9c0c 100644 --- a/go.sum +++ b/go.sum @@ -326,8 +326,8 @@ github.com/docker/cli v26.0.0+incompatible h1:90BKrx1a1HKYpSnnBFR6AgDq/FqkHxwlUy github.com/docker/cli v26.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= -github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU= +github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -664,6 +664,8 @@ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTS github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -865,8 +867,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -958,8 +960,8 @@ golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1073,16 +1075,16 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/make/all.mk b/make/all.mk deleted file mode 100644 index 0bab4cd7..00000000 --- a/make/all.mk +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -INCLUDE_DIR := $(dir $(lastword $(MAKEFILE_LIST))) - -include $(INCLUDE_DIR)make.mk -include $(INCLUDE_DIR)shell.mk -include $(INCLUDE_DIR)help.mk -include $(INCLUDE_DIR)repo.mk -include $(INCLUDE_DIR)platform.mk -include $(INCLUDE_DIR)pre-commit.mk -include $(INCLUDE_DIR)go.mk -include $(INCLUDE_DIR)goreleaser.mk -include $(INCLUDE_DIR)tag.mk diff --git a/make/go.mk b/make/go.mk deleted file mode 100644 index 73b047e9..00000000 --- a/make/go.mk +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# The GOPRIVATE environment variable controls which modules the go command considers -# to be private (not available publicly) and should therefore not use the proxy or checksum database -export GOPRIVATE ?= github.com/mesosphere - -ALL_GO_SUBMODULES := $(shell PATH='$(PATH)'; find -mindepth 2 -maxdepth 2 -name go.mod -printf '%P\n' | sort) -GO_SUBMODULES_NO_TOOLS := $(filter-out $(addsuffix /go.mod,tools),$(ALL_GO_SUBMODULES)) - -ifndef GOOS -export GOOS := $(OS) -endif -ifndef GOARCH -export GOARCH := $(shell go env GOARCH) -endif - -define go_test - gotestsum \ - --jsonfile test.json \ - --junitfile junit-report.xml \ - --junitfile-testsuite-name=relative \ - --junitfile-testcase-classname=short \ - -- \ - -covermode=atomic \ - -coverprofile=coverage.out \ - -race \ - -short \ - -v \ - $(if $(GOTEST_RUN),-run "$(GOTEST_RUN)") \ - ./... && \ - go tool cover \ - -html=coverage.out \ - -o coverage.html -endef - -.PHONY: test -test: ## Runs go tests for all modules in repository -ifneq ($(wildcard $(REPO_ROOT)/go.mod),) -test: test.root -endif -ifneq ($(words $(GO_SUBMODULES_NO_TOOLS)),0) -test: $(addprefix test.,$(GO_SUBMODULES_NO_TOOLS:/go.mod=)) -endif - -.PHONY: test.% -test.%: ## Runs go tests for a specific module -test.%: ; $(info $(M) running tests$(if $(GOTEST_RUN), matching "$(GOTEST_RUN)") for $* module) - $(if $(filter-out root,$*),cd $* && )$(call go_test) - -.PHONY: integration-test -integration-test: ## Runs integration tests for all modules in repository -integration-test: - $(MAKE) GOTEST_RUN=Integration test - -.PHONY: integration-test.% -integration-test.%: ## Runs integration tests for a specific module -integration-test.%: - $(MAKE) GOTEST_RUN=Integration test.$* - -.PHONY: bench -bench: ## Runs go benchmarks for all modules in repository -ifneq ($(wildcard $(REPO_ROOT)/go.mod),) -bench: bench.root -endif -ifneq ($(words $(GO_SUBMODULES_NO_TOOLS)),0) -bench: $(addprefix bench.,$(GO_SUBMODULES_NO_TOOLS:/go.mod=)) -endif - -.PHONY: bench.% -bench.%: ## Runs go benchmarks for a specific module -bench.%: ; $(info $(M) running benchmarks$(if $(GOTEST_RUN), matching "$(GOTEST_RUN)") for $* module) - $(if $(filter-out root,$*),cd $* && )go test $(if $(GOTEST_RUN),-run "$(GOTEST_RUN)") -race -cover -v ./... - -E2E_PARALLEL_NODES ?= $(shell nproc --ignore=1) -E2E_FLAKE_ATTEMPTS ?= 1 - -.PHONY: e2e-test -e2e-test: ## Runs e2e tests - $(info $(M) running e2e tests$(if $(E2E_LABEL), labelled "$(E2E_LABEL)")$(if $(E2E_FOCUS), matching "$(E2E_FOCUS)")) -ifndef E2E_SKIP_BUILD - $(MAKE) GORELEASER_FLAGS=$$'--config=<(env GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) gojq --yaml-input --yaml-output \'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=(["linux_amd64","linux_arm64",env.GOOS+"_"+env.GOARCH] | unique | map(. | sub("_amd64";"_amd64_v1")))\' .goreleaser.yml) --skip=validate,publish' release -endif - ginkgo run \ - --r \ - --race \ - --show-node-events \ - --trace \ - --randomize-all \ - --randomize-suites \ - --fail-on-pending \ - --keep-going \ - $(if $(filter $(CI),true),--vv) \ - --covermode=atomic \ - --coverprofile coverage-e2e.out \ - --procs=$(E2E_PARALLEL_NODES) \ - --compilers=$(E2E_PARALLEL_NODES) \ - --flake-attempts=$(E2E_FLAKE_ATTEMPTS) \ - $(if $(E2E_FOCUS),--focus="$(E2E_FOCUS)") \ - $(if $(E2E_SKIP),--skip="$(E2E_SKIP)") \ - $(if $(E2E_LABEL),--label-filter="$(E2E_LABEL)") \ - $(E2E_GINKGO_FLAGS) \ - --junit-report=junit-e2e.xml \ - --json-report=report-e2e.json \ - --tags e2e \ - test/e2e/... && \ - go tool cover \ - -html=coverage-e2e.out \ - -o coverage-e2e.html - -GOLANGCI_CONFIG_FILE ?= $(wildcard $(REPO_ROOT)/.golangci.y*ml) - -.PHONY: lint -lint: ## Runs golangci-lint for all modules in repository -ifneq ($(wildcard $(REPO_ROOT)/go.mod),) -lint: lint.root -endif -ifneq ($(words $(GO_SUBMODULES_NO_TOOLS)),0) -lint: $(addprefix lint.,$(GO_SUBMODULES_NO_TOOLS:/go.mod=)) -endif - -.PHONY: lint.% -lint.%: ## Runs golangci-lint for a specific module -lint.%: ; $(info $(M) linting $* module) - $(if $(filter-out root,$*),cd $* && )golines -w $$(go list ./... | sed "s|^$$(go list -m)|.|") - $(if $(filter-out root,$*),cd $* && )golangci-lint run --fix --config=$(GOLANGCI_CONFIG_FILE) - $(if $(filter-out root,$*),cd $* && )golines -w $$(go list ./... | sed "s|^$$(go list -m)|.|") - $(if $(filter-out root,$*),cd $* && )go fix ./... - -.PHONY: mod-tidy -mod-tidy: ## Run go mod tidy for all modules -ifneq ($(wildcard $(REPO_ROOT)/go.mod),) -mod-tidy: mod-tidy.root -endif -ifneq ($(words $(ALL_GO_SUBMODULES)),0) -mod-tidy: $(addprefix mod-tidy.,$(ALL_GO_SUBMODULES:/go.mod=)) -endif - -.PHONY: mod-tidy.% -mod-tidy.%: ## Runs go mod tidy for a specific module -mod-tidy.%: ; $(info $(M) running go mod tidy for $* module) - $(if $(filter-out root,$*),cd $* && )go mod tidy -v - $(if $(filter-out root,$*),cd $* && )go mod verify - -.PHONY: go-clean -go-clean: ## Cleans go build, test and modules caches for all modules -ifneq ($(wildcard $(REPO_ROOT)/go.mod),) -go-clean: go-clean.root -endif -ifneq ($(words $(ALL_GO_SUBMODULES)),0) -go-clean: $(addprefix go-clean.,$(ALL_GO_SUBMODULES:/go.mod=)) -endif - -.PHONY: go-clean.% -go-clean.%: ## Cleans go build, test and modules caches for a specific module -go-clean.%: ; $(info $(M) running go clean for $* module) - $(if $(filter-out root,$*),cd $* && )go clean -r -i -cache -testcache -modcache - -.PHONY: go-generate -go-generate: ## Runs go generate -go-generate: ; $(info $(M) running go generate) - go generate -x ./... - go fix ./... - -.PHONY: go-mod-upgrade -go-mod-upgrade: ## Interactive check for direct module dependency upgrades -go-mod-upgrade: ; $(info $(M) checking for direct module dependency upgrades) - go-mod-upgrade diff --git a/make/goreleaser.mk b/make/goreleaser.mk deleted file mode 100644 index 6f9d853f..00000000 --- a/make/goreleaser.mk +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -GORELEASER_PARALLELISM ?= $(shell nproc --ignore=1) -GORELEASER_DEBUG ?= false - -ifndef GORELEASER_CURRENT_TAG -export GORELEASER_CURRENT_TAG=$(GIT_TAG) -endif - -.PHONY: build-snapshot -build-snapshot: ## Builds a snapshot with goreleaser -build-snapshot: ; $(info $(M) building snapshot $*) - goreleaser --debug=$(GORELEASER_DEBUG) \ - build \ - --snapshot \ - --clean \ - --parallelism=$(GORELEASER_PARALLELISM) \ - $(if $(BUILD_ALL),,--single-target) - -.PHONY: release -release: ## Builds a release with goreleaser -release: ; $(info $(M) building release $*) - goreleaser --debug=$(GORELEASER_DEBUG) \ - release \ - --clean \ - --parallelism=$(GORELEASER_PARALLELISM) \ - --timeout=60m \ - $(GORELEASER_FLAGS) - -.PHONY: release-snapshot -release-snapshot: ## Builds a snapshot release with goreleaser -release-snapshot: ; $(info $(M) building snapshot release $*) - goreleaser --debug=$(GORELEASER_DEBUG) \ - release \ - --snapshot \ - --clean \ - --parallelism=$(GORELEASER_PARALLELISM) \ - --timeout=60m diff --git a/make/help.mk b/make/help.mk deleted file mode 100644 index dc0b15e1..00000000 --- a/make/help.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -.DEFAULT_GOAL := help - -ifndef VERBOSE -.SILENT: -endif - -INTERACTIVE := $(shell [ -t 0 ] && echo 1) -ifeq ($(INTERACTIVE),1) -M := $(shell printf "\033[34;1m▶\033[0m") -else -M := => -endif - -.PHONY: help -help: ## Shows this help message - awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_\-.]+:.*?##/ { printf " \033[36m%-15s\033[0m\t %s\n", $$1, $$2 }' $(MAKEFILE_LIST) diff --git a/make/make.mk b/make/make.mk deleted file mode 100644 index ef167013..00000000 --- a/make/make.mk +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -MAKEFLAGS += --no-builtin-rules -MAKEFLAGS += --no-builtin-variables diff --git a/make/platform.mk b/make/platform.mk deleted file mode 100644 index 8c4bf844..00000000 --- a/make/platform.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -OS := $(shell uname -s | tr '[:upper:]' '[:lower:]') diff --git a/make/pre-commit.mk b/make/pre-commit.mk deleted file mode 100644 index 809e7c53..00000000 --- a/make/pre-commit.mk +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -ifneq ($(wildcard $(REPO_ROOT)/.pre-commit-config.yaml),) - PRE_COMMIT_CONFIG_FILE ?= $(REPO_ROOT)/.pre-commit-config.yaml -else - PRE_COMMIT_CONFIG_FILE ?= $(REPO_ROOT)/repo-infra/.pre-commit-config.yaml -endif - -.PHONY: pre-commit -pre-commit: ## Runs pre-commit on all files -pre-commit: ; $(info $(M) running pre-commit) -ifeq ($(wildcard $(PRE_COMMIT_CONFIG_FILE)),) - $(error Cannot find pre-commit config file $(PRE_COMMIT_CONFIG_FILE). Specify the config file via PRE_COMMIT_CONFIG_FILE variable) -endif - env SKIP=$(SKIP) pre-commit run -a --show-diff-on-failure --config $(PRE_COMMIT_CONFIG_FILE) diff --git a/make/repo.mk b/make/repo.mk deleted file mode 100644 index f62b8187..00000000 --- a/make/repo.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -ifeq ($(strip $(REPO_ROOT)),) -REPO_ROOT := $(shell git rev-parse --show-toplevel) -endif - -GIT_COMMIT := $(shell git rev-parse "HEAD^{commit}") -export GIT_TAG ?= $(shell git describe --tags "$(GIT_COMMIT)^{commit}" --match v* --abbrev=0 2>/dev/null) -export GIT_CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) - -export GITHUB_ORG ?= $(notdir $(realpath $(dir $(REPO_ROOT)))) -export GITHUB_REPOSITORY ?= $(notdir $(REPO_ROOT)) - -ifneq ($(shell git status --porcelain 2>/dev/null; echo $$?), 0) - export GIT_TREE_STATE := dirty -else - export GIT_TREE_STATE := -endif diff --git a/make/shell.mk b/make/shell.mk deleted file mode 100644 index 680904db..00000000 --- a/make/shell.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# This is compatible with Darwin, see https://itnext.io/upgrading-bash-on-macos-7138bd1066ba -SHELL := /usr/bin/env bash -.SHELLFLAGS = -euo pipefail -c - -# We need to explicitly get the bash version via shell command here because the user could be -# running a different shell and hence BASH_VERSION var will not be set in the Make environment. -BASH_VERSION := $(shell echo $${BASH_VERSION}) -ifneq (5, $(word 1, $(sort 5 $(BASH_VERSION)))) - $(error Only bash >= 5 is supported (current version: $(BASH_VERSION)). Please upgrade your version of bash. If on macOS, see https://formulae.brew.sh/formula/bash) -endif diff --git a/make/tag.mk b/make/tag.mk deleted file mode 100644 index 804dd17a..00000000 --- a/make/tag.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2021 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -.PHONY: tag -tag: -ifndef NEW_GIT_TAG - $(error Please specify git tag to create via NEW_GIT_TAG env var or make variable) -endif - $(foreach module,\ - $(dir $(GO_SUBMODULES_NO_TOOLS)),\ - git tag -s "$(module)$(NEW_GIT_TAG)" -a -m "$(module)$(NEW_GIT_TAG)";\ - ) - git tag -s "$(NEW_GIT_TAG)" -a -m "$(NEW_GIT_TAG)" diff --git a/tasks/build.yaml b/tasks/build.yaml new file mode 100644 index 00000000..5655d037 --- /dev/null +++ b/tasks/build.yaml @@ -0,0 +1,64 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +vars: + GORELEASER_PARALLELISM: '$nproc --ignore=1' + GORELEASER_DEBUG: false + GORELEASER_BUILD_ALL: false + +env: + GIT_TREE_STATE: '$git status --porcelain &>/dev/null || echo dirty' + +tasks: + snapshot: + desc: Builds a snapshot with goreleaser + cmds: + - | + goreleaser --debug={{ .GORELEASER_DEBUG }} \ + build \ + --snapshot \ + --clean \ + --parallelism={{ .GORELEASER_PARALLELISM }} \ + {{ if not .GORELEASER_BUILD_ALL }}--single-target{{ end }} + + release: + desc: Builds a release with goreleaser + cmds: + - | + {{if not .SKIP_BUILD}} + goreleaser --debug={{ .GORELEASER_DEBUG }} \ + release \ + --clean \ + --parallelism={{ .GORELEASER_PARALLELISM }} \ + {{ .GORELEASER_FLAGS }} + {{end}} + + release-unpublished: + desc: Builds a release locally with goreleaser for specific platforms without publishing + vars: + TEMP_CONFIG: '$mktemp' + TEMP_RELEASE_NOTES: '$mktemp' + requires: + vars: + - GORELEASER_PLATFORMS + cmds: + - defer: rm -f '{{.TEMP_CONFIG}}' '{{.TEMP_RELEASE_NOTES}}' + - cmd: | + gojq --yaml-input --yaml-output 'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=([{{.GORELEASER_PLATFORMS}}] | unique | map(. | sub("_amd64$";"_amd64_v1")))' .goreleaser.yml > '{{.TEMP_CONFIG}}' + silent: true + - task: release + vars: + GORELEASER_FLAGS: '--config={{.TEMP_CONFIG}} --release-notes={{.TEMP_RELEASE_NOTES}} --skip=announce,publish,validate' + + release-snapshot: + desc: Builds a snapshot release with goreleaser + cmds: + - | + goreleaser --debug={{ .GORELEASER_DEBUG }} \ + release \ + --snapshot \ + --clean \ + --parallelism={{ .GORELEASER_PARALLELISM }} \ + {{ .GORELEASER_FLAGS }} diff --git a/tasks/git.yaml b/tasks/git.yaml new file mode 100644 index 00000000..c16ca3a6 --- /dev/null +++ b/tasks/git.yaml @@ -0,0 +1,17 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +tasks: + tag: + desc: Tags the current commit with the specified version + requires: + vars: + - NEW_GIT_TAG + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - git tag -s "{{.NEW_GIT_TAG}}" -a -m "{{.NEW_GIT_TAG}}" + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + cmd: git tag -s "{{.GO_SUBMODULE_PATH}}{{.NEW_GIT_TAG}}" -a -m "{{.GO_SUBMODULE_PATH}}{{.NEW_GIT_TAG}}" diff --git a/tasks/go.yaml b/tasks/go.yaml new file mode 100644 index 00000000..21918d69 --- /dev/null +++ b/tasks/go.yaml @@ -0,0 +1,97 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +tasks: + lint-macro: + internal: true + dir: '{{.MODULE_DIR}}' + requires: + vars: + - MODULE_DIR + cmds: + - golines -w $(go list ./... | sed "s|^$(go list -m)|.|") + - golangci-lint run --fix --config='{{.ROOT_DIR}}/.golangci.yml' + - golines -w $(go list ./... | sed "s|^$(go list -m)|.|") + - go fix ./... + + lint: + desc: Runs golangci-lint for all modules in repository + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - task: lint-macro + vars: + MODULE_DIR: . + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + task: lint-macro + vars: + MODULE_DIR: '{{.GO_SUBMODULE_PATH}}' + + mod-tidy-macro: + internal: true + dir: '{{.MODULE_DIR}}' + requires: + vars: + - MODULE_DIR + cmds: + - go mod tidy -v + - go mod verify + + mod-tidy: + desc: Run go mod tidy for all modules in the repository + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - task: mod-tidy-macro + vars: + MODULE_DIR: . + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + task: mod-tidy-macro + vars: + MODULE_DIR: '{{.GO_SUBMODULE_PATH}}' + + clean-macro: + internal: true + dir: '{{.MODULE_DIR}}' + requires: + vars: + - MODULE_DIR + cmds: + - go clean -r -i -cache -testcache -modcache + + clean: + desc: Cleans go build, test and modules caches for all modules in the repository + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - task: clean-macro + vars: + MODULE_DIR: . + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + task: clean-macro + vars: + MODULE_DIR: '{{.GO_SUBMODULE_PATH}}' + + vulncheck-macro: + internal: true + dir: '{{.MODULE_DIR}}' + requires: + vars: + - MODULE_DIR + cmds: + - govulncheck ./... + + vulncheck: + desc: Runs govulncheck for all modules in repository + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - task: vulncheck-macro + vars: + MODULE_DIR: . + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + task: vulncheck-macro + vars: + MODULE_DIR: '{{.GO_SUBMODULE_PATH}}' diff --git a/tasks/pre-commit.yaml b/tasks/pre-commit.yaml new file mode 100644 index 00000000..d8e16958 --- /dev/null +++ b/tasks/pre-commit.yaml @@ -0,0 +1,13 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +tasks: + run: + desc: Runs pre-commit on all files + cmds: + - env VIRTUALENV_PIP=24.0 pre-commit install-hooks + - pre-commit run -a --show-diff-on-failure + - git fetch origin main + - pre-commit run --hook-stage manual gitlint-ci diff --git a/tasks/test.yaml b/tasks/test.yaml new file mode 100644 index 00000000..2a27a690 --- /dev/null +++ b/tasks/test.yaml @@ -0,0 +1,86 @@ +# Copyright 2024 D2iQ, Inc. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: '3' + +tasks: + gotestsum-macro: + internal: true + dir: '{{.MODULE_DIR}}' + requires: + vars: + - MODULE_DIR + cmds: + - cmd: | + gotestsum \ + --jsonfile test.json \ + --junitfile junit-report.xml \ + --junitfile-testsuite-name=relative \ + --junitfile-testcase-classname=short \ + -- \ + -covermode=atomic \ + -coverprofile=coverage.out \ + -race \ + -short \ + -v \ + -run "{{.GOTEST_RUN}}" \ + ./... + silent: true + + unit: + desc: Runs tests + vars: + GO_SUBMODULES: '$fd go.mod --min-depth 2 --strip-cwd-prefix --exec echo {//}/' + cmds: + - task: gotestsum-macro + vars: + MODULE_DIR: . + GOTEST_RUN: '{{.GOTEST_RUN}}' + - for: {var: GO_SUBMODULES, as: GO_SUBMODULE_PATH} + task: gotestsum-macro + vars: + MODULE_DIR: '{{.GO_SUBMODULE_PATH}}' + GOTEST_RUN: '{{.GOTEST_RUN}}' + + integration: + desc: Runs integration tests + cmds: + - task: test + vars: + GOTEST_RUN: Integration + + e2e: + desc: Runs end-to-end tests + deps: + - task: :build:release-unpublished + vars: + GORELEASER_PLATFORMS: '"linux_amd64","linux_arm64","{{.E2E_GOOS}}_{{.E2E_GOARCH}}"' + vars: + E2E_GOOS: '$go env GOOS' + E2E_GOARCH: '$go env GOARCH' + cmds: + - cmd: | + ginkgo run \ + --r \ + --race \ + --show-node-events \ + --trace \ + --randomize-all \ + --randomize-suites \ + --fail-on-pending \ + --keep-going \ + {{if .CI}}--vv{{end}} \ + --covermode=atomic \ + --coverprofile coverage-e2e.out \ + {{if .E2E_PARALLEL_NODES}}--procs={{.E2E_PARALLEL_NODES}}{{end}} \ + {{if .E2E_PARALLEL_NODES}}--compilers={{.E2E_PARALLEL_NODES}}{{end}} \ + {{if .E2E_FLAKE_ATTEMPTS}}--flake-attempts={{.E2E_FLAKE_ATTEMPTS}}{{end}} \ + {{if .E2E_FOCUS}}--focus="{{.E2E_FOCUS}}"{{end}} \ + {{if .E2E_SKIP}}--skip="{{.E2E_SKIP}}"{{end}} \ + {{if .E2E_LABEL}}--label-filter="{{.E2E_LABEL}}"{{end}} \ + {{if .E2E_LE2E_GINKGO_FLAGSABEL}}{{.E2E_GINKGO_FLAGS}}{{end}} \ + --junit-report=junit-e2e.xml \ + --json-report=report-e2e.json \ + --tags e2e \ + test/e2e/... + silent: true diff --git a/test/e2e/imagebundle/helpers/docker.go b/test/e2e/imagebundle/helpers/docker.go index 46be43d3..06a7e135 100644 --- a/test/e2e/imagebundle/helpers/docker.go +++ b/test/e2e/imagebundle/helpers/docker.go @@ -78,7 +78,7 @@ func (d *Docker) StartContainerWithPlatform( return nil, err } - container, err := d.cl.ContainerCreate( + ctr, err := d.cl.ContainerCreate( ctx, &cfg, &container.HostConfig{}, @@ -90,18 +90,18 @@ func (d *Docker) StartContainerWithPlatform( return nil, err } - if err := d.cl.ContainerStart(ctx, container.ID, types.ContainerStartOptions{}); err != nil { + if err := d.cl.ContainerStart(ctx, ctr.ID, container.StartOptions{}); err != nil { _ = d.cl.ContainerRemove( ctx, - container.ID, - types.ContainerRemoveOptions{Force: true, RemoveVolumes: true}, + ctr.ID, + container.RemoveOptions{Force: true, RemoveVolumes: true}, ) return nil, err } return &Container{ - id: container.ID, + id: ctr.ID, d: d, }, nil } @@ -119,7 +119,7 @@ func (c *Container) Stop(ctx context.Context) error { return c.d.cl.ContainerRemove( ctx, c.id, - types.ContainerRemoveOptions{Force: true, RemoveVolumes: true}, + container.RemoveOptions{Force: true, RemoveVolumes: true}, ) }