diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 00000000000..459f9e10287 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,14 @@ +project { + license = "BUSL-1.1" + copyright_year = 2024 + header_ignore = [ + "*.hcl2spec.go", # generated code specs, since they'll be wiped out until we support adding the headers at generation-time + "hcl2template/testdata/**", + "test/**", + "**/test-fixtures/**", + "examples/**", + "hcl2template/fixtures/**", + "command/plugin.go", + "website/**" # candidates for copyright are coming from external sources, so we should not handle those in Packer + ] +} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 86e030cce3b..2696178f861 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -70,7 +70,7 @@ runtime in order to build packer. 1. This project always releases from the latest version of golang. [Install go](https://golang.org/doc/install#install) To properly build from -source, you need to have golang >= v1.18 +source, you need to have golang >= v1.20 ## Setting up Packer for dev @@ -274,7 +274,7 @@ does not attempt to track the latest version for each dependency. Packer relies on `go generate` to generate a [peg parser for boot commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go), [docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx) -and HCL2's bridging code. Packer's testing suite will run `make check-generate` +and HCL2's bridging code. Packer's testing suite will run `make generate-check` to check that all the generated files Packer needs are what they should be. `make generate` re-generates all these file and can take a while depending on your machine's performances. To make it faster it is recommended to run diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7221ea28b04..b79897d5954 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + blank_issues_enabled: false contact_links: - name: Packer Community Support diff --git a/.github/ISSUE_TEMPLATE/plugin_integration.md b/.github/ISSUE_TEMPLATE/plugin_integration.md new file mode 100644 index 00000000000..540e437fe6e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/plugin_integration.md @@ -0,0 +1,21 @@ +--- +name: Plugin Integration Request +about: Open request to add your plugin as a Packer integration (https://developer.hashicorp.com/packer/integrations) +labels: integration-request +--- + +#### Description + +A written description of your plugin along with a link to the plugin repository. + +#### Integration Tier + + +#### Checklist +- [ ] Has valid [`metadata.hcl`](https://github.com/hashicorp/integration-template) file in plugin repository. +- [ ] Has added integration scripts [packer-plugin-scaffolding](https://github.com/hashicorp/packer-plugin-scoffolding) to plugin repository. +- [ ] Has added top-level integration README.md file to plugin `docs` directory. +- [ ] All plugins components have one README.md describing their usage. +- [ ] Has a fully synced `.web-docs` directory ready for publishing to the integrations portal. + diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 96502c2e109..bbf1c27f6ce 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,10 +6,4 @@ updates: interval: daily allow: - dependency-name: "github.com/hashicorp/packer-plugin-sdk" - - dependency-name: "github.com/hashicorp/hcl/v2" - - dependency-name: "github.com/zclconf/go-cty" - dependency-name: "github.com/hashicorp/hcp-sdk-go" -- package-ecosystem: github-actions - directory: / - schedule: - interval: daily diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 9e024296b29..6d9ef6d547c 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + bug: - 'panic:' crash: diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index df1f620a82a..126b751d060 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -19,14 +19,14 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go # version, because "goenv" can react to it automatically. run: | echo "Building with Go $(cat .go-version)" - echo "::set-output name=go-version::$(cat .go-version)" + echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT acceptance-test: runs-on: ubuntu-latest name: Acceptance Test @@ -37,13 +37,15 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.TESTACC_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTACC_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.TESTACC_AWS_REGION }} + # Packer GH Token for API Rate Limiting + PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - name: IAM Assume Role - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: role-to-assume: ${{ env.AWS_ROLE_ARN }} aws-region: ${{ env.AWS_REGION }} @@ -68,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@v1.23.0 + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: payload: | { @@ -90,4 +92,4 @@ jobs: } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml index 91d24bca094..2e593d579fa 100644 --- a/.github/workflows/auto-close-stale-issues.yml +++ b/.github/workflows/auto-close-stale-issues.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - - uses: actions/stale@v5.2.0 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-issue-stale: 23 diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index bb6e5b88158..8e4ebf5e0b2 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,7 +16,7 @@ jobs: contents: none if: github.event.pull_request.merged runs-on: ubuntu-latest - container: hashicorpdev/backport-assistant:0.2.3 + container: hashicorpdev/backport-assistant:0.3.4 steps: - name: Backport changes to stable-website run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab949cc762e..352a84945e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,11 +6,16 @@ name: build -on: [ workflow_dispatch, push, workflow_call ] +on: + workflow_dispatch: + workflow_call: + push: + branches: + - main + - release/** env: REPO_NAME: "packer" - GO_TAGS: "" permissions: contents: read @@ -21,67 +26,64 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go # version, because "goenv" can react to it automatically. run: | echo "Building with Go $(cat .go-version)" - echo "::set-output name=go-version::$(cat .go-version)" + echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT - get-product-version: + set-product-version: runs-on: ubuntu-latest outputs: - product-version: ${{ steps.get-product-version.outputs.product-version }} + product-version: ${{ steps.set-product-version.outputs.product-version }} + base-product-version: ${{ steps.set-product-version.outputs.base-product-version }} + product-date: ${{ steps.set-product-version.outputs.product-date }} + product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }} + set-ld-flags: ${{ steps.set-ld-flags.outputs.set-ld-flags }} steps: - - uses: actions/checkout@v2 - - name: get product version - id: get-product-version + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: set product version + id: set-product-version + uses: hashicorp/actions-set-product-version@v1 + - name: set-ld-flags + id: set-ld-flags run: | - make version - echo "::set-output name=product-version::$(make version)" + T="github.com/hashicorp/packer/version" + echo "set-ld-flags=-s -w -X ${T}.GitCommit=${GITHUB_SHA::8} -X ${T}.GitDescribe=${{ steps.set-product-version.outputs.product-version }} -X ${T}.Version=${{ steps.set-product-version.outputs.base-product-version }} -X ${T}.VersionPrerelease=${{ steps.set-product-version.outputs.prerelease-product-version }} -X ${T}.VersionMetadata=" >> $GITHUB_OUTPUT + - name: validate outputs + run: | + echo "Product Version: ${{ steps.set-product-version.outputs.product-version }}" + echo "Base Product Version: ${{ steps.set-product-version.outputs.base-product-version }}" + echo "Prerelease Version: ${{ steps.set-product-version.outputs.prerelease-product-version }}" + echo "ldflags: ${{ steps.set-ld-flags.outputs.set-ld-flags }}" generate-metadata-file: - needs: - - get-product-version + needs: set-product-version runs-on: ubuntu-latest outputs: filepath: ${{ steps.generate-metadata-file.outputs.filepath }} steps: - name: 'Checkout directory' - uses: actions/checkout@v2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Generate metadata file id: generate-metadata-file uses: hashicorp/actions-generate-metadata@main with: - version: ${{ needs.get-product-version.outputs.product-version }} + version: ${{ needs.set-product-version.outputs.product-version }} product: ${{ env.REPO_NAME }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: metadata.json path: ${{ steps.generate-metadata-file.outputs.filepath }} - - set-ld-flags: - needs: get-product-version - runs-on: ubuntu-latest - outputs: - ldflags: ${{ steps.generate-ld-flags.outputs.ldflags }} - steps: - - uses: actions/checkout@v2 - - name: 'Generate ld flags' - id: generate-ld-flags - run: | - project="$(go list -m)" - sha="$(git rev-parse HEAD)" - echo "::set-output name=ldflags::"-s -w -X \'$project/version.GitCommit=$sha\'"" - + build-other: needs: - - get-product-version + - set-product-version - get-go-version - - set-ld-flags runs-on: ubuntu-latest strategy: matrix: @@ -98,36 +100,34 @@ jobs: fail-fast: true name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build + env: GOPRIVATE: "github.com/hashicorp" GO111MODULE: on - LD_FLAGS: ${{ needs.set-ld-flags.outputs.ldflags }} steps: - - uses: actions/checkout@v2 - - name: Setup go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Go Build env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - CGO_ENABLED: 0 - run: | - mkdir -p dist out - unset GOPATH; - go build -v -tags "${{ env.GO_TAGS }}" -ldflags "${{ env.LD_FLAGS }}" -o dist/ . - zip -r -j out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ - - uses: actions/upload-artifact@v2 + PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} + PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version }} + LD_FLAGS: "${{ needs.set-product-version.outputs.set-ld-flags}}" + CGO_ENABLED: "0" + uses: hashicorp/actions-go-build@v0.1.9 with: - name: ${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - path: out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + product_name: ${{ env.REPO_NAME }} + product_version: ${{ needs.set-product-version.outputs.product-version }} + go_version: ${{ matrix.go }} + os: ${{ matrix.goos }} + arch: ${{ matrix.goarch }} + reproducible: report + instructions: |- + cp LICENSE "$TARGET_DIR/LICENSE.txt" + go build -o "$BIN_PATH" -ldflags="$LD_FLAGS" -trimpath -buildvcs=false build-linux: needs: - - get-product-version + - set-product-version - get-go-version - - set-ld-flags runs-on: ubuntu-latest strategy: matrix: @@ -141,60 +141,64 @@ jobs: env: GOPRIVATE: "github.com/hashicorp" GO111MODULE: on - LD_FLAGS: ${{ needs.set-ld-flags.outputs.ldflags }} steps: - - uses: actions/checkout@v2 - - name: Setup go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Go Build env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - CGO_ENABLED: 0 - run: | - mkdir -p dist out - unset GOPATH; - go build -v -tags "${{ env.GO_TAGS }}" -ldflags "${{ env.LD_FLAGS }}" -o dist/ . - zip -r -j out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ - - uses: actions/upload-artifact@v2 + PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} + PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version }} + LD_FLAGS: "${{ needs.set-product-version.outputs.set-ld-flags}}" + CGO_ENABLED: "0" + uses: hashicorp/actions-go-build@v0.1.9 with: - name: ${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - path: out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + product_name: ${{ env.REPO_NAME }} + product_version: ${{ needs.set-product-version.outputs.product-version }} + go_version: ${{ matrix.go }} + os: ${{ matrix.goos }} + arch: ${{ matrix.goarch }} + reproducible: report + instructions: |- + cp LICENSE "$TARGET_DIR/LICENSE.txt" + go build -o "$BIN_PATH" -ldflags="$LD_FLAGS" -trimpath -buildvcs=false + - name: Copy license file to config_dir + if: ${{ matrix.goos == 'linux' }} + env: + LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ env.REPO_NAME }}" + run: | + mkdir -p "$LICENSE_DIR" && cp LICENSE "$LICENSE_DIR/LICENSE.txt" - name: Linux Packaging uses: hashicorp/actions-packaging-linux@v1 with: name: ${{ env.REPO_NAME }} description: "HashiCorp Packer - A tool for creating identical machine images for multiple platforms from a single source configuration" arch: ${{ matrix.goarch }} - version: ${{ needs.get-product-version.outputs.product-version }} + version: ${{ needs.set-product-version.outputs.product-version }} maintainer: "HashiCorp" homepage: "https://www.packer.io/docs" - license: "MPL-2.0" + license: "BUSL-1.1" binary: "dist/${{ env.REPO_NAME }}" deb_depends: "openssl" rpm_depends: "openssl" + config_dir: ".release/linux/package/" - name: Add Linux Package names to env run: | echo "RPM_PACKAGE=$(basename out/*.rpm)" >> $GITHUB_ENV echo "DEB_PACKAGE=$(basename out/*.deb)" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: ${{ env.RPM_PACKAGE }} path: out/${{ env.RPM_PACKAGE }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: ${{ env.DEB_PACKAGE }} path: out/${{ env.DEB_PACKAGE }} build-darwin: needs: - - get-product-version + - set-product-version - get-go-version - - set-ld-flags runs-on: macos-latest strategy: matrix: @@ -207,42 +211,40 @@ jobs: env: GOPRIVATE: "github.com/hashicorp" GO111MODULE: on - LD_FLAGS: ${{ needs.set-ld-flags.outputs.ldflags }} steps: - - uses: actions/checkout@v2 - - name: Setup go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Go Build env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - CGO_ENABLED: 0 - run: | - mkdir -p dist out - unset GOPATH; - go build -v -tags "${{ env.GO_TAGS }} netcgo" -ldflags "${{ env.LD_FLAGS }}" -o dist/ . - zip -r -j out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ - - uses: actions/upload-artifact@v2 + PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} + PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version }} + LD_FLAGS: "${{ needs.set-product-version.outputs.set-ld-flags}}" + CGO_ENABLED: "0" + uses: hashicorp/actions-go-build@v0.1.9 with: - name: ${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - path: out/${{ env.REPO_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + product_name: ${{ env.REPO_NAME }} + product_version: ${{ needs.set-product-version.outputs.product-version }} + go_version: ${{ matrix.go }} + os: ${{ matrix.goos }} + arch: ${{ matrix.goarch }} + reproducible: report + instructions: |- + cp LICENSE "$TARGET_DIR/LICENSE.txt" + go build -o "$BIN_PATH" -ldflags="$LD_FLAGS" -tags netcgo -trimpath -buildvcs=false - build-docker: + build-docker-light: name: Docker light ${{ matrix.arch }} build needs: - - get-product-version + - set-product-version - build-linux runs-on: ubuntu-latest strategy: matrix: arch: [ "arm", "arm64", "386", "amd64" ] env: - version: ${{ needs.get-product-version.outputs.product-version }} + version: ${{ needs.set-product-version.outputs.product-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Docker Build (Action) uses: hashicorp/actions-docker-build@v1 with: @@ -250,12 +252,40 @@ jobs: target: release-light arch: ${{ matrix.arch }} tags: | - docker.io/hashicorp/${{ env.REPO_NAME }}:light + ${{ steps.set-product-version.output.prerelease-product-version == '' && format('docker.io/hashicorp/{0}:light', env.REPO_NAME) }} docker.io/hashicorp/${{ env.REPO_NAME }}:light-${{ env.version }} docker.io/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} - public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:light + ${{ steps.set-product-version.output.prerelease-product-version == '' && format('public.ecr.aws/hashicorp/{0}:light', env.REPO_NAME) }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:light-${{ env.version }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} dev_tags: | docker.io/hashicorppreview/${{ env.REPO_NAME }}:${{ env.version }} docker.io/hashicorppreview/${{ env.REPO_NAME }}:${{ env.version }}-${{ github.sha }} + + build-docker-full: + name: Docker full ${{ matrix.arch }} build + needs: + - set-product-version + - build-linux + runs-on: ubuntu-latest + strategy: + matrix: + arch: [ "arm", "arm64", "386", "amd64" ] + env: + version: ${{ needs.set-product-version.outputs.product-version }} + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Docker Build (Action) + uses: hashicorp/actions-docker-build@v1 + with: + version: ${{ env.version }} + target: release-full + arch: ${{ matrix.arch }} + tags: | + ${{ steps.set-product-version.output.prerelease-product-version == '' && format('docker.io/hashicorp/{0}:full', env.REPO_NAME) }} + docker.io/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} + ${{ steps.set-product-version.output.prerelease-product-version == '' && format('public.ecr.aws/hashicorp/{0}:full', env.REPO_NAME) }} + public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} + dev_tags: | + docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }} + docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }}-${{ github.sha }} diff --git a/.github/workflows/check-plugin-docs.js b/.github/workflows/check-plugin-docs.js deleted file mode 100644 index cb61a1870ab..00000000000 --- a/.github/workflows/check-plugin-docs.js +++ /dev/null @@ -1,105 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const { resolvePluginDocs } = require("@hashicorp/platform-packer-plugins"); - -const COLOR_RESET = "\x1b[0m"; -const COLOR_GREEN = "\x1b[32m"; -const COLOR_BLUE = "\x1b[34m"; -const COLOR_RED = "\x1b[31m"; - -const VALID_PLUGIN_TIERS = ["official", "community", "verified"]; - - -async function checkPluginDocs() { - const failureMessages = []; - const pluginsPath = "website/data/plugins-manifest.json"; - const pluginsFile = fs.readFileSync(path.join(process.cwd(), pluginsPath)); - const pluginEntries = JSON.parse(pluginsFile); - const pluginEntriesWithDocs = await resolvePluginDocs(pluginEntries); - const entriesCount = pluginEntries.length; - console.log(`\nResolving plugin docs from ${entriesCount} repositories …`); - for (var i = 0; i < entriesCount; i++) { - const pluginEntry = pluginEntriesWithDocs[i]; - const { title, repo, version } = pluginEntry; - console.log(`\n${COLOR_BLUE}${repo}${COLOR_RESET} | ${title}`); - console.log(`Fetching docs from release "${version}" …`); - try { - // Validate that all required properties are present - const undefinedProps = ["title", "repo", "version", "path"].filter( - (key) => typeof pluginEntry[key] == "undefined" - ); - if (undefinedProps.length > 0) { - throw new Error( - `Failed to validate plugin docs config. Undefined configuration properties ${JSON.stringify( - undefinedProps - )} found for "${ - title || pluginEntry.path || repo - }". In "website/data/docs-remote-plugins.json", please ensure the missing properties ${JSON.stringify( - undefinedProps - )} are defined. Additional information on this configuration can be found in "website/README.md".` - ); - } - // Validate pluginTier property - const { pluginTier } = pluginEntry; - if (typeof pluginTier !== "undefined") { - const isValid = VALID_PLUGIN_TIERS.indexOf(pluginTier) !== -1; - if (!isValid) { - throw new Error( - `Failed to validate plugin docs config. Invalid pluginTier "${pluginTier}" found for "${ - title || pluginEntry.path || repo - }". In "website/data/docs-remote-plugins.json", the optional pluginTier property must be one of ${JSON.stringify( - VALID_PLUGIN_TIERS - )}. The pluginTier property can also be omitted, in which case it will be determined from the plugin repository owner.` - ); - } - } - // Validate that local zip files are not used in production - if (typeof pluginEntry.zipFile !== "undefined") { - throw new Error( - `Local ZIP file being used for "${ - title || pluginEntry.path || repo - }". The zipFile option should only be used for local development. Please omit the zipFile attribute and ensure the plugin entry points to a remote repository.` - ); - } - // Attempt to fetch plugin docs files - const docsMdxFiles = pluginEntry.files - const mdxFilesByComponent = docsMdxFiles.reduce((acc, mdxFile) => { - const componentType = mdxFile.filePath.split("/")[1]; - if (!acc[componentType]) acc[componentType] = []; - acc[componentType].push(mdxFile); - return acc; - }, {}); - console.log(`${COLOR_GREEN}Found valid docs:${COLOR_RESET}`); - Object.keys(mdxFilesByComponent).forEach((component) => { - const componentFiles = mdxFilesByComponent[component]; - console.log(` ${component}`); - componentFiles.forEach(({ filePath }) => { - const pathFromComponent = filePath.split("/").slice(2).join("/"); - console.log(` ├── ${pathFromComponent}`); - }); - }); - } catch (err) { - console.log(`${COLOR_RED}${err}${COLOR_RESET}`); - failureMessages.push(`\n${COLOR_RED}× ${repo}: ${COLOR_RESET}${err}`); - } - } - - if (failureMessages.length === 0) { - console.log( - `\n---\n\n${COLOR_GREEN}Summary: Successfully resolved all plugin docs.` - ); - pluginEntries.forEach((e) => - console.log(`${COLOR_GREEN}✓ ${e.repo}${COLOR_RESET}`) - ); - console.log(""); - } else { - console.log( - `\n---\n\n${COLOR_RED}Summary: Failed to fetch docs for ${failureMessages.length} plugin(s):` - ); - failureMessages.forEach((err) => console.log(err)); - console.log(""); - process.exit(1); - } -} - -checkPluginDocs(); diff --git a/.github/workflows/check-plugin-docs.yml b/.github/workflows/check-plugin-docs.yml deleted file mode 100644 index 233f2688108..00000000000 --- a/.github/workflows/check-plugin-docs.yml +++ /dev/null @@ -1,34 +0,0 @@ -# -# This GitHub action checks plugin repositories for valid docs. -# -# This provides a quick assessment on PRs of whether -# there might be issues with docs in plugin repositories. -# -# This is intended to help debug Vercel build issues, which -# may or may not be related to docs in plugin repositories. - -name: "website: Check plugin docs" -on: - pull_request: - paths: - - "website/**" - schedule: - - cron: "45 0 * * *" - -permissions: - contents: read - -jobs: - check-plugin-docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '16.x' - - name: Install Dependencies - run: npm i @hashicorp/platform-packer-plugins - - name: Fetch and validate plugin docs - run: node .github/workflows/check-plugin-docs.js diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml new file mode 100644 index 00000000000..8eb406e3acf --- /dev/null +++ b/.github/workflows/create-release-branch.yml @@ -0,0 +1,10 @@ +name: Create a release branch +on: [workflow_dispatch] +jobs: + create-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: hashicorp/actions-create-release-branch@v1 + with: + token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 89ea8f2a1a0..d9da6ff7469 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -5,7 +5,12 @@ name: "Go Test" -on: [ workflow_dispatch, push ] +on: + push: + branches: + - 'main' + - release/** + pull_request: env: PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -14,30 +19,47 @@ permissions: contents: read jobs: + get-go-version: + runs-on: ubuntu-latest + outputs: + go-version: ${{ steps.get-go-version.outputs.go-version }} + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: 'Determine Go version' + id: get-go-version + run: | + echo "Found Go $(cat .go-version)" + echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT linux-go-tests: + needs: + - get-go-version runs-on: ubuntu-latest name: Linux go tests steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci darwin-go-tests: + needs: + - get-go-version runs-on: macos-latest name: Darwin go tests steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic windows-go-tests: + needs: + - get-go-version runs-on: windows-latest name: Windows go tests steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic diff --git a/.github/workflows/go-validate.yml b/.github/workflows/go-validate.yml index bacc02dae47..a6264a7d1c0 100644 --- a/.github/workflows/go-validate.yml +++ b/.github/workflows/go-validate.yml @@ -4,50 +4,74 @@ name: "Go Validate" -on: [ workflow_dispatch, push ] +on: + push: + branches: + - 'main' + - release/** + pull_request: permissions: contents: read jobs: + get-go-version: + runs-on: ubuntu-latest + outputs: + go-version: ${{ steps.get-go-version.outputs.go-version }} + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: 'Determine Go version' + id: get-go-version + run: | + echo "Found Go $(cat .go-version)" + echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT check-mod-tidy: + needs: + - get-go-version runs-on: ubuntu-latest name: Go Mod Tidy steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go mod tidy check-lint: + needs: + - get-go-version runs-on: ubuntu-latest name: Lint steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: echo "$GITHUB_SHA" - run: git fetch --all - run: echo $(git merge-base origin/main $GITHUB_SHA) - run: make ci-lint check-fmt: + needs: + - get-go-version runs-on: ubuntu-latest name: Fmt check steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make fmt-check check-generate: + needs: + - get-go-version runs-on: ubuntu-latest name: Generate check steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.18' + go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make generate-check diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml index 72ca61e925b..a74693b7178 100644 --- a/.github/workflows/issue-comment-created.yml +++ b/.github/workflows/issue-comment-created.yml @@ -12,10 +12,11 @@ jobs: permissions: contents: read # for actions/checkout to fetch code issues: write # for actions-ecosystem/action-remove-labels to remove issue labels + if: ${{contains(github.event.issue.labels.*.name, 'waiting-reply') || contains(github.event.issue.labels.*.name, 'stale')}} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-ecosystem/action-remove-labels@v1 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 with: github_token: "${{ secrets.GITHUB_TOKEN }}" labels: | diff --git a/.github/workflows/issue-migrator.yml b/.github/workflows/issue-migrator.yml index c9e579b407c..719cfa44f2f 100644 --- a/.github/workflows/issue-migrator.yml +++ b/.github/workflows/issue-migrator.yml @@ -12,7 +12,7 @@ jobs: if: startsWith(github.event.label.name, 'remote-plugin/') runs-on: ubuntu-latest steps: - - uses: bflad/action-migrate-issue@main + - uses: bflad/action-migrate-issue@2e049d822b08e67d25b938343227051518f14d9a # v1.0.2 with: source-issue-comment: | This issue has been migrated to {target-issue-url} due to the [Packer Plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index b9304f2746b..b3894b9082f 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -13,44 +13,45 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: github/issue-labeler@v2.5 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml enable-versioned-regex: 0 - add-to-project: - name: Add issue to request queue - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@main - with: - project-url: https://github.com/orgs/hashicorp/projects/105 - github-token: ${{ secrets.PACKER_PROJ_BOARD_TOKEN }} - labeled: bug, enhancement - label-operator: OR label-question: name: Redirect to discuss permissions: contents: read - issues: write # for actions-ecosystem/action-create-comment to create comments + issues: write # for actions/github-script to create comments and add labels if: contains(github.event.issue.labels.*.name, 'question') runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-create-comment@v1.0.2 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - body: | - Hi 👋 thanks for reaching out. + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ` + Hi 👋 thanks for reaching out. + + For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. + As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. + We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. + If no activity is taken on this question within 30 days it will be automatically closed. - For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. - As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. - We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. - If no activity is taken on this question within 30 days it will be automatically closed. + If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue.` + }) - If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. - - uses: actions-ecosystem/action-add-labels@v1.1.3 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: needs-reply + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['needs-reply'] + }) diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index 9ce02890f08..4225f5f4aac 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -11,11 +11,11 @@ jobs: sync: name: Sync to JIRA permissions: - issues: write # for actions-ecosytem/action-create-comment + issues: write # for actions/github-script to create comments runs-on: ubuntu-latest steps: - name: Login - uses: atlassian/gajira-login@v3.0.1 + uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # v3.0.1 env: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} @@ -24,7 +24,7 @@ jobs: - name: Search if: github.event.action == 'labeled' id: search - uses: tomhjp/gh-action-jira-search@v0.2.1 + uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2 with: # cf[10089] is Issue Link (use JIRA API to retrieve) jql: 'project = "HPR" AND cf[10089] = "${{ github.event.issue.html_url }}"' @@ -35,21 +35,21 @@ jobs: run: | # Questions are not tracked in JIRA at this time. if [[ "${{ contains(github.event.issue.labels.*.name, 'question') }}" == "true" ]]; then - echo "::set-output name=type::Invalid" + echo "type=Invalid" >> $GITHUB_OUTPUT else # Properly labeled GH issues are assigned the standard "GH Issue" type upon creation. - echo "::set-output name=type::GH Issue" + echo "type=GH Issue" >> $GITHUB_OUTPUT fi - name: Set labels id: set-ticket-labels run: | if [[ "${{ contains(github.event.issue.labels.*.name, 'bug') }}" == "true" ]]; then - echo "::set-output name=labels::[\"bug\"]" + echo "labels=[\"bug\"]" >> $GITHUB_OUTPUT elif [[ "${{ contains(github.event.issue.labels.*.name, 'enhancement') }}" == "true" ]]; then - echo "::set-output name=labels::[\"enhancement\"]" + echo "labels=[\"enhancement\"]" >> $GITHUB_OUTPUT else - echo "::set-output name=labels::[]" + echo "labels=[]" >> $GITHUB_OUTPUT fi - name: Validate ticket @@ -61,26 +61,26 @@ jobs: - name: Create ticket id: create-ticket if: steps.search.outputs.issue == '' && github.event.label.name == 'sync to jira' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: atlassian/gajira-create@v3.0.1 + uses: atlassian/gajira-create@59e177c4f6451399df5b4911c2211104f171e669 # v3.0.1 with: project: HPR issuetype: "${{ steps.set-ticket-type.outputs.type }}" summary: "${{ github.event.repository.name }}: ${{ github.event.issue.title }}" description: "${{ github.event.issue.body }}\n\n_Created from GitHub by ${{ github.actor }}._" # The field customfield_10089 refers to the Issue Link field in JIRA. - fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", - "components": [{ "name": "OSS" }], - "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' + fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", "components": [{ "name": "core" }], "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' - name: Add tracking comment if: steps.create-ticket.outputs.issue != '' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: actions-ecosystem/action-create-comment@v1.0.0 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - body: | - This issue has been synced to JIRA for planning. - - JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}}) - - + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ` + This issue has been synced to JIRA for planning. + JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}})` + }) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 1ae51ba4756..7cbfe6c6c30 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v4 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: github-token: ${{ github.token }} issue-comment: > diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index b3276a92df6..6a1696da0b8 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -24,9 +24,9 @@ jobs: needs: build-artifacts runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Download built artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: path: out/ # Set BUILD_OUTPUT_LIST to out\-.\*,out\... @@ -38,12 +38,12 @@ jobs: echo "BUILD_OUTPUT_LIST=$(cat tmp2.txt | tr '\n' ',' | perl -ple 'chop')" >> $GITHUB_ENV rm -rf tmp.txt && rm -rf tmp2.txt - name: Advance nightly tag - uses: actions/github-script@v3 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | try { - await github.git.deleteRef({ + await github.rest.git.deleteRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "tags/nightly" @@ -51,7 +51,7 @@ jobs: } catch (e) { console.log("Warning: The nightly tag doesn't exist yet, so there's nothing to do. Trace: " + e) } - await github.git.createRef({ + await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "refs/tags/nightly", @@ -61,7 +61,8 @@ jobs: # If a release with this name already exists, it will overwrite the existing data - name: Create a nightly GitHub prerelease id: create_prerelease - uses: ncipollo/release-action@v1 + continue-on-error: true + uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 with: name: nightly artifacts: "${{ env.BUILD_OUTPUT_LIST }}" @@ -72,12 +73,39 @@ jobs: removeArtifacts: true draft: false token: ${{ secrets.GITHUB_TOKEN }} + - name: Store GitHub Release ID + if: steps.create_prerelease.outcome == 'success' + run: | + echo "prerelease_id=${{ steps.create_prerelease.outputs.id }}" >> $GITHUB_ENV + - name: Sleep before retry + id: sleep_before_retry + if: steps.create_prerelease.outcome == 'failure' + run : sleep 30m + shell: bash + - name: Retry failed nightly GitHub prerelease + id: create_prerelease_retry + if: steps.create_prerelease.outcome == 'failure' + uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 + with: + name: nightly + artifacts: "${{ env.BUILD_OUTPUT_LIST }}" + tag: nightly + bodyFile: ".github/workflows/nightly-release-readme.md" + prerelease: true + allowUpdates: true + removeArtifacts: true + draft: false + token: ${{ secrets.GITHUB_TOKEN }} + - name: Store Updated GitHub Release ID + if: steps.create_prerelease_retry.outcome == 'success' + run: | + echo "prerelease_id=${{ steps.create_prerelease_retry.outputs.id }}" >> $GITHUB_ENV - name: Publish nightly GitHub prerelease - uses: eregon/publish-release@v1 + uses: eregon/publish-release@01df127f5e9a3c26935118e22e738d95b59d10ce # v1.0.6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - release_id: ${{ steps.create_prerelease.outputs.id }} + release_id: ${{ env.prerelease_id }} # Send a slack notification if either job defined above fails slack-notify: permissions: @@ -89,7 +117,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@v1.23.0 + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: payload: | { diff --git a/.go-version b/.go-version index cafc0b7add4..428abfd24fb 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.18.9 +1.21.8 diff --git a/.golangci.yml b/.golangci.yml index 946fbc0ef64..83039d08ba1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + issues: # List of regexps of issue texts to exclude, empty list by default. # But independently from this option we use default exclude patterns, @@ -24,10 +27,17 @@ issues: # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + exclude-files: + - ".*\\.hcl2spec\\.go$" + # - lib/bad.go + linters: disable-all: true enable: - - deadcode - errcheck - goimports - gosimple @@ -36,7 +46,6 @@ linters: - staticcheck - unconvert - unused - - varcheck fast: true # options for analysis running @@ -69,14 +78,6 @@ run: # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ skip-dirs-use-default: true - # which files to skip: they will be analyzed, but issues from them - # won't be reported. Default value is empty list, but there is - # no need to include all autogenerated files, we confidently recognize - # autogenerated files. If it's not please let us know. - skip-files: - - ".*\\.hcl2spec\\.go$" - # - lib/bad.go - # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes @@ -90,7 +91,7 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: colored-line-number # print lines of code with issue, default is true print-issued-lines: true diff --git a/.release/ci.hcl b/.release/ci.hcl index 258c485905b..b69f9ba2520 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + schema = "1" project "packer" { @@ -9,7 +12,8 @@ project "packer" { organization = "hashicorp" repository = "packer" release_branches = [ - "main" + "main", + "release/**" ] } } @@ -28,146 +32,14 @@ event "build" { } } -event "upload-dev" { +event "prepare" { depends = ["build"] - action "upload-dev" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "upload-dev" - depends = ["build"] - } - - notification { - on = "fail" - } -} - -event "quality-tests" { - depends = ["upload-dev"] - action "quality-tests" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "quality-tests" - } - - notification { - on = "fail" - } -} - -event "security-scan-binaries" { - depends = ["upload-dev"] - action "security-scan-binaries" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "security-scan-binaries" - config = "security-scan.hcl" - } - - notification { - on = "fail" - } -} -event "security-scan-containers" { - depends = ["security-scan-binaries"] - action "security-scan-containers" { + action "prepare" { organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "security-scan-containers" - config = "security-scan.hcl" - } - - notification { - on = "fail" - } -} - -event "notarize-darwin-amd64" { - depends = ["security-scan-containers"] - action "notarize-darwin-amd64" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "notarize-darwin-amd64" - } - - notification { - on = "fail" - } -} - -event "notarize-windows-386" { - depends = ["notarize-darwin-amd64"] - action "notarize-windows-386" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "notarize-windows-386" - } - - notification { - on = "fail" - } -} - -event "notarize-windows-amd64" { - depends = ["notarize-windows-386"] - action "notarize-windows-amd64" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "notarize-windows-amd64" - } - - notification { - on = "fail" - } -} - -event "sign" { - depends = ["notarize-windows-amd64"] - action "sign" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "sign" - } - - notification { - on = "fail" - } -} - -event "sign-linux-rpms" { - depends = ["sign"] - action "sign-linux-rpms" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "sign-linux-rpms" - } - - notification { - on = "fail" - } -} - -event "verify" { - depends = ["sign-linux-rpms"] - action "verify" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "verify" - } - - notification { - on = "fail" - } -} - -event "promote-dev-docker" { - depends = ["verify"] - action "promote-dev-docker" { - organization = "hashicorp" - repository = "crt-workflows-common" - workflow = "promote-dev-docker" - depends = ["verify"] + repository = "crt-workflows-common" + workflow = "prepare" + depends = ["build"] } notification { diff --git a/.release/docker/README.md b/.release/docker/README.md index 4fdf9272958..8178630a5b3 100644 --- a/.release/docker/README.md +++ b/.release/docker/README.md @@ -1,37 +1,50 @@ # Packer Docker Container -The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `official` docker image is built using the official binaries from releases.hashicorp.com. +The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `light` and `full` docker images are built using the official binaries from releases.hashicorp.com. -## Build +## License + +This image is licensed under (BUSL-1.1)[https://github.com/hashicorp/packer/blob/main/LICENSE]. -See the Makefile targets in the root of this repository for building Packer images in either -development or release modes: +## Build - - `make docker-dev` - - `make docker-official` - - `make docker-multiarch-official` - - `make docker` +Refer to the Makefile of this repository, especially the `docker` and `docker-dev` targets to build a local version of the dev image based on the sources available. ### Usage This repository automatically builds containers for using the -[`packer`](https://packer.io) command line program. It contains two distinct -varieties of build, an `official` version, aka `light`, which just contains the binary. -It also contains a `dev` version, aka `full`, which compiles the binary from source +[`packer`](https://developer.hashicorp.com/packer) command line program. It contains three distinct +varieties of build: a `light` version, which just contains the binary, +a `full` build, which contains the Packer binary with pre-installed plugins, +and a `dev` version, which compiles the binary from source inside the container before exposing it for use. -##### `official` +##### `light` -The `official` version of this container will copy the current stable version of +The `light` version of this container will copy the current stable version of the binary, taken from releases.hashicorp.com, into the container. It will also -set it for use as the default entrypoint. This will be the best option for most uses, -especially if you are just looking to run the binary from a container. This image -is tagged as both `official` and `light`. +set it for use as the default entrypoint. This will be the best option for most uses, +especially if you are just looking to run the binary from a container. The `latest` tag on DockerHub also points to this version. You can use this version with the following: ```shell -docker run hashicorp/packer:official +docker run hashicorp/packer:light +``` + +##### `full` + +The `full` version of the container builds upon `light` and pre-installs +the plugins officially maintained by HashiCorp. + +You can use this version with the following: +```shell +docker run hashicorp/packer:full +``` + +You can view the list of pre-installed plugins with the following: +```shell +docker run hashicorp/packer:full plugins installed ``` ##### `dev` @@ -41,7 +54,7 @@ the current ref of this [repository](https://github.com/hashicorp/packer). Using official `golang` image](https://hub.docker.com/_/golang/) as a base, this container will copy the source from the current branch, build the binary, and expose it for running. Because all build artifacts are included, it should be quite a bit larger than -the `official` image. This version of the container is most useful for development or +the `light` image. This version of the container is most useful for development or debugging. You can use this version with the following: @@ -64,8 +77,8 @@ docker run \ ~> **Note**: packer init is available from Packer v1.7.0 and later -The command will mount the working directory (`pwd`) to `workspace`, which is the working directory (`-w`) inside the container. -Any plugin installed with `packer init` will be installed under the directory specified under the `PACKER_PLUGIN_PATH` environment variable. `PACKER_PLUGIN_PATH` must be set to a path inside the volume mount so that plugins can become available at `packer build`. +The command will mount the working directory (`pwd`) to `workspace`, which is the working directory (`-w`) inside the container. +Any plugin installed with `packer init` will be installed under the directory specified under the `PACKER_PLUGIN_PATH` environment variable. `PACKER_PLUGIN_PATH` must be set to a path inside the volume mount so that plugins can become available at `packer build`. Running `packer build` ```shell diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 1679cba3653..05d0b9f3a81 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/packer" url_docker_registry_ecr = "https://gallery.ecr.aws/hashicorp/packer" url_license = "https://github.com/hashicorp/packer/blob/main/LICENSE" diff --git a/.release/security-scan.hcl b/.release/security-scan.hcl index d47f9634c77..12ef1d53388 100644 --- a/.release/security-scan.hcl +++ b/.release/security-scan.hcl @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + container { dependencies = false alpine_secdb = true diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a4873cd1d..a62efc7d4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,663 @@ +## 1.11.0 (Upcoming) + +### NOTES: +* **Breaking Change**: Support for loading single-component plugins has been removed from Packer. [GH-12785](https://github.com/hashicorp/packer/pull/12785) + +* **Breaking Change**: Support for loading plugin binaries following + the naming convention of packer-plugin-name has been dropped. Packer will now only load + plugins stored under PACKER_PLUGIN_PATH using the expected namespaced + directory and CHECKSUM files. This change drops support for loading plugin + binaries in Packer's executable directory or a template's current working + directory. [GH-12828](https://github.com/hashicorp/packer/pull/12828) + +```shell +/Users/dev/.packer.d/plugins +└── github.com + └── hashicorp + └── happycloud + ├── packer-plugin-happycloud_v0.0.1_x5.0_darwin_arm64 + └── packer-plugin-happycloud_v0.0.1_x5.0_darwin_arm64_SHA256SUM +``` + +### FEATURES: +* core: Add `-ignore-prerelease-plugins` flag to disable the use of development + plugin binaries for the `build` and `validate` commands development plugin + binaries. [GH-12828](https://github.com/hashicorp/packer/pull/12828) + +### BUG FIXES: +* core: fix plugin version ordering to not be lexicographic. This fixes an issue + with how plugins are discovered by Packer, and ensures proper version ordering. + This means that with this change, versions that are semantically greater, + but lexicographically inferior will be loaded. + Ex: 1.0.9 vs. 1.0.10; `1.0.9 > 1.0.10` lexicographically, but semantically + `1.0.10 > 1.0.9` + +### IMPROVEMENTS: +* core: Move to predictable plugin loading schema - Packer will now only load + plugins stored under PACKER_PLUGIN_PATH using the expected namespaced + directory and CHECKSUM files. + [GH-12828](https://github.com/hashicorp/packer/pull/12828) +* core: Remove support loading single-component plugins. + [GH-12785](https://github.com/hashicorp/packer/pull/12785) +* core: Rename internal `packer plugin` command to `packer execute` to avoid user confusion with + the plugins subcommand. + [GH-12865](https://github.com/hashicorp/packer/pull/12865) +* core: Packer now considers development binaries when evaluating plugin + version constraints. This work allows users to use binaries with versions + reported as "x.y.z-dev" to be used with the Packer `required_plugins` + block. [GH-12828](https://github.com/hashicorp/packer/pull/12828) +* core: Packer now supports local paths to plugins for the `packer plugins remove` + command. This addition makes it possible to pipe commands like + `packer plugins installed` with it for speedy cleanup of installed plugins. + [GH-12886](https://github.com/hashicorp/packer/pull/12886) +* core: Version metadata support for plugins. Plugins may now formally have metadata + in their versions, Packer supports it, and applies the semver recommendations on + them, i.e. they are ignored for comparison/sorting purposes, but allowed for + adding extra information about a plugin. + [GH-12888](https://github.com/hashicorp/packer/pull/12888) + +Given the specified version constraint only versions greater than or equal to 1.1.0 will be considered. + +```hcl +amazon = { + source = "github.com/hashicorp/amazon" + version = ">= 1.1.0" +} +``` +If a development binary is installed, Packer will use it if: + +1. It is the highest compatible version installed. +2. There is no final plugin version with the same version number installed alongside it. + +```shell +/Users/dev/.packer.d/plugins +└─ github.com + └─ hashicorp + └── amazon + ├── packer-plugin-amazon_v1.1.0_x5.0_darwin_arm64 + ├── packer-plugin-amazon_v1.1.0_x5.0_darwin_arm64_SHA256SUM + ├── packer-plugin-amazon_v1.1.1-dev_x5.0_darwin_arm64 + └── packer-plugin-amazon_v1.1.1-dev_x5.0_darwin_arm64_SHA256SUM +``` + +Version 1.1.1-dev of the Amazon plugin will match the specified version constraint and be used for executing the Packer build. + +If, however, a 1.1.1 release version of the plugin is available, it will have precedence over the development binary. + +```shell +/Users/dev/.packer.d/plugins +└─ github.com + └─ hashicorp + └── amazon + ├── packer-plugin-amazon_v1.1.1-dev_x5.0_darwin_arm64 + ├── packer-plugin-amazon_v1.1.1-dev_x5.0_darwin_arm64_SHA256SUM + ├── packer-plugin-amazon_v1.1.1_x5.0_darwin_arm64 + └── packer-plugin-amazon_v1.1.1_x5.0_darwin_arm64_SHA256SUM +``` + +## 1.10.3 (April 22, 2024) + +### NOTES +* A LICENSE.txt file has been added to the Packer release artifacts. + [GH-12981](https://github.com/hashicorp/packer/pull/12931) + +### FEATURES +* Packer users can now track Packer version and plugin versions used for each + build artifact in HCP Packer. + [GH-12891](https://github.com/hashicorp/packer/pull/12891) + [GH-12910](https://github.com/hashicorp/packer/pull/12910) + [GH-12923](https://github.com/hashicorp/packer/pull/12923) + [GH-12926](https://github.com/hashicorp/packer/pull/12926) + +### SECURITY +* Bump github.com/go-jose/go-jose/v3 to address GHSA-c5q2-7r4c-mv6g. + [GH-12928](https://github.com/hashicorp/packer/pull/12928) +* Bump golang.org/x/net to v0.24.0 to address GO-2024-2687. + [GH-12924](https://github.com/hashicorp/packer/pull/12924) + +### BUG FIXES +* cmd/fmt: Display information error when Packer `fmt` fails due to HCL2 + parsing error. [GH-12870](https://github.com/hashicorp/packer/pull/12870) + + +## 1.10.2 (March 6, 2024) + +### NOTES: +* Continuing the work in in Packer v1.10.0 we introduced the ability to install + a locally sourced plugin using packer `plugins install --path`, this + release extends support to development plugin binaries - binaries that + report "dev" as part of their plugin version. Instead of manually placing a + downloaded binary into the executable or current working directory we + encourage you to run the command `packer plugins install –path github.com/hashicorp/happycloud` to install + the binary into a Packer compatible path. + [GH-12855](https://github.com/hashicorp/packer/pull/12855) + +### IMPROVEMENTS: +* cmd/plugins: Add support for installing local development binaries to `packer plugins install`. + [GH-12855](https://github.com/hashicorp/packer/pull/12855) +* core: Validate bucket name when using `hcp_packer_registry` block. + [GH-12820](https://github.com/hashicorp/packer/pull/12820) +* core: Update github.com/hashicorp/hcp-sdk-go from 0.83.0 to 0.85.0. + [GH-12850](https://github.com/hashicorp/packer/pull/12850) + [GH-12827](https://github.com/hashicorp/packer/pull/12827) + +### BUG FIXES: +* core/hcp: HCP Packer build failures properly distinguish between incompatible + plugins and general publishing errors. + [GH-12854](https://github.com/hashicorp/packer/pull/12854) + [GH-12835](https://github.com/hashicorp/packer/pull/12835) + +## 1.10.1 (January 30, 2024) + +### NOTES: +* **HCP Packer** has been updated to follow an artifact-agnostic approach for + publishing and consuming built artifacts. To best support the new approach, HCP Packer components within Packer have + been updated to use the v2 nomenclature when publishing build metadata to + HCP Packer. These changes include data source components for consuming HCP + Packer stored artifacts. The data source components [hcp-packer-version](https://developer.hashicorp.com/packer/docs/datasources/hcp/hcp-packer-version) + and [hcp-packer-artifact](https://developer.hashicorp.com/packer/docs/datasources/hcp/hcp-packer-artifact) respectively replace, the now deprecated, + [hcp-packer-iteration](https://developer.hashicorp.com/packer/docs/datasources/hcp/hcp-packer-iteration) + and [hcp-packer-image](https://developer.hashicorp.com/packer/docs/datasources/hcp/hcp-packer-image) + component data sources. The added changes are compatible with all existing HCP Packer workflows and do not warrant any + immediate template changes by the user. However, we encourage all HCP Packer users to visit the updated + HCP Packer [CHANGELOG](https://developer.hashicorp.com/hcp/docs/changelog) to familiarize themselves with the nomenclature changes. + [GH-12794](https://github.com/hashicorp/packer/pull/12794) [GH-12799](https://github.com/hashicorp/packer/pull/12799) +* The `hcp-packer-image` data source has been deprecated, please use HCP Packer + Artifact data source instead. + [GH-12794](https://github.com/hashicorp/packer/pull/12794) +* The `hcp-packer-iteration` data source has been deprecated, please use HCP + Packer Version data source instead. + [GH-12794](https://github.com/hashicorp/packer/pull/12794) +* The contextual variable `packer.iterationID` has been deprecated, please use + the new contextual variable `packer.versionFingerprint`. The iterationID + represents the HCP Packer iteration that build metadata has been publish + to, with this release an Iteration is now referred to as a Version and the + ID has been replaced by the Version Fingerprint. + [GH-12803](https://github.com/hashicorp/packer/pull/12803) + +### FEATURES: +* **New Data source** `hcp-packer-artifact` The HCP Packer Artifact Data Source + retrieves information about an artifact from the HCP Packer Registry. + [GH-12794](https://github.com/hashicorp/packer/pull/12794) +* **New Data source** `hcp-packer-version` The HCP Packer Version Data Source + retrieves information about HCP Packer Version from the HCP Packer. + Registry. [GH-12794](https://github.com/hashicorp/packer/pull/12794) + +### SECURITY: +* core: Bump Go dependencies to address various CVEs. [GH-12777](https://github.com/hashicorp/packer/pull/12777) +* core: Bump github.com/cloudflare/circl to address GHSA-9763-4f94-gfch. [GH-12781](https://github.com/hashicorp/packer/pull/12781) + +### IMPROVEMENTS: +* core: Bump github.com/hashicorp/hcp-sdk-go from 0.79.0 to 0.81.0 + [GH-12792](https://github.com/hashicorp/packer/pull/12792) + [GH-12764](https://github.com/hashicorp/packer/pull/12764) +* core: Update error messaging for HCP incompatible plugin builds. + [GH-12800](https://github.com/hashicorp/packer/pull/12800) +* core: Update HCP Packer integration to use HCP Packer v2 nomenclature, with + this change HCP Packer iterations are now referred to as Versions, and + Images are now referred to as Artifacts. The data sources for interacting + with HCP Packer have been respectively renamed to align with the terminology + of Version and Artifact. + [GH-12794](https://github.com/hashicorp/packer/pull/12794) + [GH-12799](https://github.com/hashicorp/packer/pull/12799) +* core: Update spacing for flags within Help text. + [GH-12742](https://github.com/hashicorp/packer/pull/12742) + [GH-12743](https://github.com/hashicorp/packer/pull/12743) + + +## 1.10.0 (December 5, 2023) + +### NOTES: +This release contains breaking changes for practitioner relying on plugins + previously bundled into Packer. As specified in the [Bundled Plugins Removal announcement](https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer) + HashiCorp maintained plugins will no longer be shipped with Packer. + Users are encouraged to use `packer init` or `packer plugins [...]` when managing required plugins + needed for executing their builds. + [GH-12660](https://github.com/hashicorp/packer/pull/12660) + +The affected plugins include: +* [packer-plugin-amazon](https://github.com/hashicorp/packer-plugin-amazon) +* [packer-plugin-ansible](https://github.com/hashicorp/packer-plugin-ansible) +* [packer-plugin-azure](https://github.com/hashicorp/packer-plugin-azure) +* [packer-plugin-docker](https://github.com/hashicorp/packer-plugin-docker) +* [packer-plugin-googlecompute](https://github.com/hashicorp/packer-plugin-googlecompute) +* [packer-plugin-qemu](https://github.com/hashicorp/packer-plugin-qemu) +* [packer-plugin-vagrant](https://github.com/hashicorp/packer-plugin-vagrant) +* [packer-plugin-virtualbox](https://github.com/hashicorp/packer-plugin-virtualbox) +* [packer-plugin-vmware](https://github.com/hashicorp/packer-plugin-vmware) +* [packer-plugin-vsphere](https://github.com/hashicorp/packer-plugin-vsphere) + +### SECURITY: +* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. There have been + no reported issues with Packer but we are bumping given that it is a + secondary + dependency. [GH-12723](https://github.com/hashicorp/packer/pull/12723) +* Bump Go to 1.20.10 to Address CVE-2023-44487 / CVE-2023-39325. + [GH-12661](https://github.com/hashicorp/packer/pull/12661) +* Bump Go to 1.20.11 CVE-2023-45283. There have been no reported issues with + Packer but we are bumping given its usage of the path/filepath pkg. + [GH-12690](https://github.com/hashicorp/packer/pull/12690) +* Bump Packer Plugin SDK to v0.5.2. + [GH-12717](https://github.com/hashicorp/packer/pull/12717) + +### PLUGINS: + +* Removed all HashiCorp vendored plugins from being bundled into the Packer binary. +[GH-12660](https://github.com/hashicorp/packer/pull/12660), [GH-12720](https://github.com/hashicorp/packer/pull/12720) +* packer-plugin-hcloud: The Hetzner Cloud plugin has been handed over to the + Hetzner integrations team. New releases for this plugin are available at + https://github.com/hetznercloud/packer-plugin-hcloud. Existing references + to the plugin will continue to work but users are advised to update the + `required_plugins` block to use the new plugin source address. + ``` + required_plugins { + parallels = { + source = "github.com/hetznercloud/hcloud" + version = "~> 1" + } + } + ``` +### IMPROVEMENTS: +* cmd/init: Warn users running `packer init` on configuration templates with a + missing `required_plugins` blocks. + [GH-12638](https://github.com/hashicorp/packer/pull/12638) +* cmd/plugins: Add `--path` flag to `packer plugins install` subcommand to + support installation of plugins from a local binary rather than from + GitHub. [GH-12643](https://github.com/hashicorp/packer/pull/12643) +* cmd/plugins: Install SHA256SUM file with 0644 perms. + [GH-12665](https://github.com/hashicorp/packer/pull/12665) +* cmd/plugins: Remove SHA256SUM file on plugin removal. + [GH-12666](https://github.com/hashicorp/packer/pull/12666) +* cmd/plugins: Remove will error if it fails to find the plugin being selected + for removal. [GH-12669](https://github.com/hashicorp/packer/pull/12669) +* core/hcl2: Remove empty source file reference on unset variable errors. + [GH-12712](https://github.com/hashicorp/packer/pull/12712) +* core/hcl: Improve the recursive execution of data sources with other data + source dependencies. + [GH-12608](https://github.com/hashicorp/packer/pull/12608) +* core: Bump github.com/hashicorp/hcp-sdk-go from 0.73.0 to 0.74.0 - + [GH-12704](https://github.com/hashicorp/packer/pull/12704) +* core: Bump Packer Plugin SDK to v0.5.2. + [GH-12717](https://github.com/hashicorp/packer/pull/12717) +* core: Provide integration link as hint in error message if a plugin component + is unknown. [GH-12705](https://github.com/hashicorp/packer/pull/12705) +* core: Update version output for `packer -v` and `packer --version` to match + `packer version`. + [GH-12569](https://github.com/hashicorp/packer/pull/12569) +* docs: Update plugin installation guides with supported methods for 1.10.0 and + above. [GH-12713](https://github.com/hashicorp/packer/pull/12713) + +### BUG FIXES: + +* cmd/plugins: Update `packer plugin installed` to show all installed plugin + binaries, including any duplicate versions or binaries copied from a + different source URI. + [GH-12731](https://github.com/hashicorp/packer/pull/12731) + +## 1.9.5 (December 4, 2023) + +### SECURITY + +* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. + [GH-12723](https://github.com/hashicorp/packer/pull/12723) + +### BUG FIXES: + +* Add VirtualBox as known plugin prefix to prevent endless bundled plugin warning. + [GH-12719](https://github.com/hashicorp/packer/pull/12719) + +## 1.9.4 (August 18, 2023) + +### BUG FIXES: + +* core: When invoking Packer with the CHECKPOINT_DISABLE environment variable the telemetry + reporter is left uninitialized in order to disable telemetry reporting. + Any method calls on the nil reporter is expected to check if the reporter is active or in + NOOP mode. The SetBundledUsage function, introduced in Packer 1.9.2, failed to perform a nil + check before attempting to modify an attribute, causing Packer to fail when telemetry is + disabled. This release fixes this issue by introducing such a check. + +## 1.9.3 (August 17, 2023) + +### NOTES: +* **New Docker Image**: As part of the bundled plugin removal effort, a new + Docker target called `release-full` has been added to the Packer release + artifacts. The release-full image includes Packer and all the official + plugins pre-installed in its environment. This image is being offered as an + alternative option for those users who may still be relying on the plugin + versions bundled into the Packer binary. + [GH-12532](https://github.com/hashicorp/packer/pull/12532) + +### IMPROVEMENTS: +* core/docs: Clarify the expected usage of the `packer init` command for HCL2 + template builds.[GH-12535](https://github.com/hashicorp/packer/pull/12535) +* core/hcp: Add support for project-level service principals. A user connecting + with a project level service principals must provide a valid HCP_PROJECT_ID + in order to connect. + [GH-12520](https://github.com/hashicorp/packer/pull/12520) + [GH-12576](https://github.com/hashicorp/packer/pull/12576) +* core: A new Docker image `packer:release-full` has been added for all + supported architectures. The release-full image includes Packer and all the + official plugins pre-installed in its environment. + [GH-12532](https://github.com/hashicorp/packer/pull/12532) +* core: Add enhanced support to Packer telemetry for bundle plugins usage. + [GH-12536](https://github.com/hashicorp/packer/pull/12536) + +### BUG FIXES: + +* core: Bump golang.org/x/net to v0.13.0 to address CVE GO-2023-1988. Packer + itself is not vulnerable to the CVE as we don't render web pages, but + security checks do point it as an issue that needs to be addressed. + [GH-12561](https://github.com/hashicorp/packer/pull/12561) +* core: Fix custom plugin loading in current working directory regression. + [GH-12544](https://github.com/hashicorp/packer/pull/12544) + + +## 1.9.2 (July 19, 2023) + +### NOTES: + +* Vendored plugins within Packer have not been updated. Plugin releases occur on + a regular basis to address issues and feature requests. + Please note that in an upcoming version of Packer, we will remove the last + bundled plugins from Packer. Users are encouraged to use `packer init` for HCL2 templates or + `packer plugins install` with legacy JSON templates for installing external + plugins. + +* Packer will now warn when using bundled plugins. This feature will be removed in + a future version of the tool, so this warning is meant to bring awareness of the + upcoming change, and help users update their templates. + [GH-12495](https://github.com/hashicorp/packer/pull/12495) + +### BUG FIXES: + +* Fixed a bug with how Packer was discovering plugins: in order to load + plugins, Packer would recursively scan all the known directories in which + we could have installed plugins. This caused unnecessary directory + walks and slowdowns upon invocation. Packer will now only check + for nested plugins within the directories used by commands such as `packer + init`, or `packer plugins install`, or as defined in PACKER_PLUGIN_PATH. + Refer to + [Packer's plugin directory documentation](https://developer.hashicorp.com/packer/docs/configure#packer-s-plugin-directory) + for details on how loading works. + [GH-12414](https://github.com/hashicorp/packer/pull/12414) + +* The `packer init` subcommand now bundles all the missing installed plugins into one + condensed warning, as opposed to one warning per missing plugin. + [GH-12506](https://github.com/hashicorp/packer/pull/12506) + +### PLUGINS: + +* packer-plugin-parallels: The Parallels plugin has been handed over to the Parallels + team. New releases for this plugin are available at + https://github.com/parallels/packer-plugin-parallels. This plugin is no longer + being bundled in the Packer binary release. Existing references to the + plugin will continue to work but users are advised to update the + `required_plugins` block to use the new plugin source address. + [GH-12476](https://github.com/hashicorp/packer/pull/12476) + ``` + required_plugins { + parallels = { + source = "github.com/parallels/parallels" + version = "~> 1" + } + } + ``` + +### IMPROVEMENTS: + +* The `hcl2_upgrade` sub-command will now add `required_plugins` to the template + generated from JSON for [official plugins](https://developer.hashicorp.com/packer/plugins#tiers-and-namespaces). + [GH-12504](https://github.com/hashicorp/packer/pull/12504) + +## 1.9.1 (June 1, 2023) + +### BUG FIXES: + +* On May 16th 2023, HCP introduced multi-project support to the platform. + In order to use multiple projects in your organization, you will need to update Packer + to version 1.9.1 or above. Starting with 1.9.1, you may specify a project ID to push + builds to with the `HCP_PROJECT_ID` environment variable. If no project ID is specified, + Packer will pick the project with the oldest creation date. Older versions of Packer are + incompatible with multi-project support on HCP, and builds will fail for HCP + organizations with multiple projects on versions before 1.9.1. + [GH-12453](https://github.com/hashicorp/packer/pull/12453) + +## 1.9.0 (May 31, 2023) + +### NOTES: + +* **Breaking Change**: Iteration fingerprints used to be computed from the Git SHA of the + repository where the template is located when running packer build. This + changes with this release, and now fingerprints are automatically generated + as a ULID. This implies that continuing an existing iteration will require + users to define the fingerprint in the environment manually in order to + adopt this behaviour, otherwise, by default, a new iteration will be + created. This does not impact workflows where the fingerprint was defined + through the `HCP_PACKER_ITERATION_FINGERPRINT` environment variable, and + these builds will work exactly as they did before. + [GH-12172](https://github.com/hashicorp/packer/pull/12172) + +* **Breaking Change**: Community-maintained plugins bundled with the Packer binary have been removed. + These external plugin components are released independently of Packer core and can be installed + directly by the user. Users relying on the external plugin components listed below should refer + to the `packer plugins` sub-command and, if using HCL2, a `required_plugins` block to define a + list of plugins for building a template. + +### PLUGINS + +* Remove provisioner plugins for Chef, Converge, Puppet, Salt, and Inspec as + vendored plugins. These plugins have been previously archived and not + updated in release since being archived. These plugins can be installed + using `packer init` or with the Packer plugins sub-command `packer plugins install github.com/hashicorp/chef`. + [GH-12374](https://github.com/hashicorp/packer/pull/12374) + +* The following community plugins won't be bundled with Packer anymore: + + * [Alicloud](https://github.com/hashicorp/packer-plugin-alicloud) + * [CloudStack](https://github.com/hashicorp/packer-plugin-cloudstack) + * [HCloud](https://github.com/hashicorp/packer-plugin-hcloud) + * [HyperOne](https://github.com/hashicorp/packer-plugin-hyperone) + * [Hyper-V](https://github.com/hashicorp/packer-plugin-hyperv) + * [JDCloud](https://github.com/hashicorp/packer-plugin-jdcloud) + * [LXC](https://github.com/hashicorp/packer-plugin-lxc) + * [LXD](https://github.com/hashicorp/packer-plugin-lxd) + * [NCloud](https://github.com/hashicorp/packer-plugin-ncloud) + * [OpenStack](https://github.com/hashicorp/packer-plugin-openstack) + * [Proxmox](https://github.com/hashicorp/packer-plugin-proxmox) + * [TencentCloud](https://github.com/hashicorp/packer-plugin-tencentcloud) + * [Triton](https://github.com/hashicorp/packer-plugin-triton) + * [Yandex](https://github.com/hashicorp/packer-plugin-yandex) + + [GH-12436](https://github.com/hashicorp/packer/pull/12436) + +Users relying on these external plugin components should refer to the `packer plugins` sub-command and, +if using HCL2, a `required_plugins` block to define a list of plugins to use for building a template. + +### IMPROVEMENTS: + +* core/hcp: Now, fingerprints used by HCP Packer are randomly generated ULIDs + instead of a Git SHA, and a new one is always generated, unless one is + specified in the environment. + [GH-12172](https://github.com/hashicorp/packer/pull/12172) + +### BUG FIXES: + +* Fix LDFLAGS for release pipelines: Between Packer 1.8.5 and Packer 1.8.7, changes + to the LDFLAGS in use for building the binaries for Packer had mistakenly + removed some compilation flags, leading to the final binaries not being stripped. + This change raised the size of the built binaries by as much as 45%. + In this release, we fixed the LDFLAGS during compilation, yielding leaner binaries. + +* Bumped gopsutil to v3. This fixes a macOS intermittent crash reported by the community + [GH-12430](https://github.com/hashicorp/packer/issues/12430) + +### HCP Packer -- Multi project support advisory + +If using HCP Packer to store metadata on your builds, please be aware that Packer +does not support this feature yet, and as such, having multiple projects in your +organization will make it impossible to use HCP Packer in this release. + +We are actively working on supporting this feature, which will be available in a +subsequent release. + +## 1.8.7 (May 4, 2023) + +### NOTES: +* Vendored plugins within Packer have not been updated. Plugin releases occur on + a regular basis to address issues and feature requests. Users are encouraged + to use `packer init` for HCL2 templates or `packer plugins install` with + legacy JSON templates for installing external plugins. + +* packer-plugin-digitalocean: The Digital Ocean Packer plugin has been handed + over to the Digital Ocean team. New releases for this plugin are available + at https://github.com/digitalocean/packer-plugin-digitalocean. + ``` + required_plugins { + digitalocean = { + source = "github.com/digitalocean/digitalocean" + version = ">=1.1.1" + } + } + ``` +* packer-plugin-linode: The Linode plugin has been handed over to the Linode + team. New releases for this plugin are available at + https://github.com/linode/packer-plugin-linode. This plugin is is no longer + being bundled in the Packer binary release. Existing references to the + plugin will continue to work but users are advised to update the + `required_plugins` block to use the new plugin source address. + [GH-12329](https://github.com/hashicorp/packer/pull/12329) + ``` + required_plugins { + linode = { + source = "github.com/linode/linode" + version = ">=1.0.5" + } + } + ``` +* packer-plugin-ucloud: The UCloud plugin has been handed over to the UCloud + team. New releases for this plugin are available at + https://github.com/ucloud/packer-plugin-ucloud. This plugin is is no longer + being bundled in the Packer binary release. Existing references to the + plugin will continue to work but users are advised to update the + `required_plugins` block to use the new plugin source address. + [GH-12335](https://github.com/hashicorp/packer/pull/12335) + ``` + required_plugins { + ucloud = { + source = "github.com/ucloud/ucloud" + version = ">=1.0.8" + } + } + ``` +* packer-plugin-profitbricks: The Profitbricks plugin has been removed as a + bundled plugin in Packer. New releases for this plugin are available at + https://github.com/hashicorp/packer-plugin-profitbricks. This plugin is is + no longer being bundled in the Packer binary release. Existing references + to the plugin will continue to work but users are advised to update the + `required_plugins` block to use the new plugin source address. + [GH-12385](https://github.com/hashicorp/packer/pull/12385) + ``` + required_plugins { + ucloud = { + source = "github.com/hashicorp/profitbricks" + version = ">=1.0.2" + } + } + ``` + +### PLUGINS +* core: Migrate external Linode plugin to linode/packer-plugin-linode. + [GH-12329](https://github.com/hashicorp/packer/pull/12329) +* core: Migrate external UCloud plugin to ucloud/packer-plugin-ucloud. + [GH-12335](https://github.com/hashicorp/packer/pull/12335) +* core: Remove external plugin for Digital Ocean as a vendored plugin. + [GH-12376](https://github.com/hashicorp/packer/pull/12376) +* core: Remove external plugins for Profitbricks and 1&1 as vendored plugins. + [GH-12385](https://github.com/hashicorp/packer/pull/12385) +* docs: Add HCP Ready label to Oracle builder components. + [GH-12217](https://github.com/hashicorp/packer/pull/12217) + + +### IMPROVEMENTS +* cmd/console: Add config-type flag to command help. + [GH-12360](https://github.com/hashicorp/packer/pull/12360) +* core: Add enhanced support to Packer telemetry for HCL2. + [GH-12319](https://github.com/hashicorp/packer/pull/12319) +* Enhance zsh completion for the Packer command. + [GH-12356](https://github.com/hashicorp/packer/pull/12356), + [GH-12366](https://github.com/hashicorp/packer/pull/12366) + +### BUG FIXES +* cmd/hcl2_upgrade: Fix a crash when running the hcl2_upgrade command against a + legacy JSON template containing user variables with an undefined variables + block. [GH-12257](https://github.com/hashicorp/packer/pull/12257) +* core: Bump github.com/hashicorp/hcp-sdk-go to 0.36.0. + [GH-12292](https://github.com/hashicorp/packer/pull/12292) +* core: Bump github.com/hashicorp/packer-plugin-sdk to 0.4.0 to address + CVE-2023-0475, CVE-2022-41723. + [GH-12306](https://github.com/hashicorp/packer/pull/12306) +* core: Bump Go module version to 1.20 + [GH-12380](https://github.com/hashicorp/packer/pull/12380) +* core: Fix regression introduced in 1.8.6, where legacy JSON templates with + custom builder names are outputted to STDOUT as uninterpolated user + variables. [GH-12290](https://github.com/hashicorp/packer/pull/12290) + + +## 1.8.6 (February 15, 2023) + +### NOTES: +* core: Users will see some changes in how names are displayed during a Packer + build for JSON templates. Previously only the builder type or the builder + name, if it was set, would be displayed. Now for named builders + (`"name":"mybuilder"`) the builder's type and name will be displayed (i.e + ".mybuilder". This does not impact the behavior of options such as + only or except, they will continue to work as they did before.) + +### PLUGINS: +The following external plugins have been updated and pinned to address open + issues. Please see their respective changelogs for details on plugin + specific bug fixes and improvements. + +* alicloud@v1.0.7 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-alicloud/releases/tag/v1.0.7) +* amazon@v1.2.1 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-amazon/releases/tag/v1.2.1) +* azure@v1.4.0 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-azure/releases/tag/v1.4.0) +* googlecompute@v1.1.0 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-googlecompute/releases/tag/v1.1.0) +* proxmox@v1.1.1 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-proxmox/releases/tag/v1.1.1) +* tencentcloud@v1.0.6 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-tencentcloud/releases/tag/v1.0.6) +* qemu@v1.0.9 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-qemu/releases/tag/v1.0.9) + + +### IMPROVEMENTS: +* Bump bundled plugins to latest available version. + [GH-12274](https://github.com/hashicorp/packer/pull/12274) +* bump github.com/hashicorp/hcp-sdk-go from 0.28.0 to 0.29.0 + [GH-12163](https://github.com/hashicorp/packer/pull/12163) +* Bump github.com/hashicorp/hcp-sdk-go from 0.33.0 to 0.34.0 + [GH-12275](https://github.com/hashicorp/packer/pull/12275) +* core/hcl2: Packer will no longer warn on excluded post-processors when using + `-only/exlude` filters for running select builds. + [GH-12187](https://github.com/hashicorp/packer/pull/12187) + +### BUG FIXES: +* cmd/hcl2_upgrade: Fix crash when variables block is undefined. + [GH-12250](https://github.com/hashicorp/packer/pull/12250) +* core/hcl2: Templates with build blocks referencing an unknown source block + would display an empty string for the template filename at line 0, which + made it difficult to identify the broken build block. Packer has been + updated to display the proper filename and line number where the unknown + reference resides. + [GH-12167](https://github.com/hashicorp/packer/pull/12167) +* core: Linux packages now have vendor label and set the default label to + HashiCorp. This fix is implemented for any future releases, but will not be + updated for historical releases. + [GH-12252](https://github.com/hashicorp/packer/pull/12252) +* core/hcp: The bucket's description was not properly set in the bucket + object sent to HCP Packer leaving all newly created buckets with an empty + description. [GH-12235] + [GH-12235](https://github.com/hashicorp/packer/pull/12235) + ## 1.8.5 (December 12, 2022) ### NOTES: @@ -21,7 +681,7 @@ The following external plugins have been updated and pinned to address open * alicloud@v1.0.5 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-alicloud/releases/tag/v1.0.5) * amazon@v1.1.6 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-amazon/releases/tag/v1.1.6) * proxmox@v1.1.0 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-proxmox/releases/tag/v1.1.0) -* vsphere@v1.0.7 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-vsphere/releases/tag/v1.0.7) +* vsphere@v1.1.1 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-vsphere/releases/tag/v1.1.1) * qemu@v1.0.8 - [CHANGELOG](https://github.com/hashicorp/packer-plugin-qemu/releases/tag/v1.0.8) ### IMPROVEMENTS: @@ -184,7 +844,7 @@ required_plugins { advised to install the latest version of the plugin by running `packer plugins install github.com/outscale/outscale`. [GH-11912](https://github.com/hashicorp/packer/pull/11912) -* packer-plugin-outscale: The Scaleway Packer plugin managed by the Scaleway +* packer-plugin-scaleway: The Scaleway Packer plugin managed by the Scaleway team, since Packer 1.7.7, has been removed from the Packer binary. Users are advised to install the latest version of the plugin by running `packer plugins install github.com/scaleway/scaleway`. [GH-11912](https://github.com/hashicorp/packer/pull/11912) diff --git a/CODEOWNERS b/CODEOWNERS index 0efb6b1ac47..b92152c7348 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,5 +2,3 @@ # release configuration -/.release/ @hashicorp/release-engineering -/.github/workflows/build.yml @hashicorp/release-engineering diff --git a/Dockerfile b/Dockerfile index 3b653930182..e7146a888f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + # ======================================================================== -# +# # This Dockerfile contains multiple targets. # Use 'docker build --target= .' to build one. # e.g. `docker build --target=release-light .` # -# All non-dev targets have a PRODUCT_VERSION argument that must be provided -# via --build-arg=PRODUCT_VERSION= when building. +# All non-dev targets have a PRODUCT_VERSION argument that must be provided +# via --build-arg=PRODUCT_VERSION= when building. # e.g. --build-arg PRODUCT_VERSION=1.11.2 # # For local dev and testing purposes, please build and use the `dev` docker image. @@ -24,59 +27,8 @@ COPY bin/packer /bin/packer ENTRYPOINT ["/bin/packer"] - -# Official docker image that includes binaries from releases.hashicorp.com. -# This downloads the release from releases.hashicorp.com and therefore requires that -# the release is published before building the Docker image. -FROM docker.mirror.hashicorp.services/alpine:latest as official - -# This is the release of Packer to pull in. -ARG PRODUCT_VERSION - -LABEL name="Packer" \ - maintainer="HashiCorp Packer Team " \ - vendor="HashiCorp" \ - version=$PRODUCT_VERSION \ - release=$PRODUCT_VERSION \ - summary="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration." \ - description="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. Please submit issues to https://github.com/hashicorp/packer/issues" - -# This is the location of the releases. -ENV HASHICORP_RELEASES=https://releases.hashicorp.com - -RUN set -eux && \ - apk add --no-cache git bash wget openssl gnupg xorriso && \ - gpg --keyserver keyserver.ubuntu.com --recv-keys C874011F0AB405110D02105534365D9472D7468F && \ - mkdir -p /tmp/build && \ - cd /tmp/build && \ - apkArch="$(apk --print-arch)" && \ - case "${apkArch}" in \ - aarch64) packerArch='arm64' ;; \ - armhf) packerArch='arm' ;; \ - x86) packerArch='386' ;; \ - x86_64) packerArch='amd64' ;; \ - *) echo >&2 "error: unsupported architecture: ${apkArch} (see ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/)" && exit 1 ;; \ - esac && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_linux_${packerArch}.zip && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_SHA256SUMS && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_SHA256SUMS.sig && \ - gpg --batch --verify packer_${PRODUCT_VERSION}_SHA256SUMS.sig packer_${PRODUCT_VERSION}_SHA256SUMS && \ - grep packer_${PRODUCT_VERSION}_linux_${packerArch}.zip packer_${PRODUCT_VERSION}_SHA256SUMS | sha256sum -c && \ - unzip -d /tmp/build packer_${PRODUCT_VERSION}_linux_${packerArch}.zip && \ - cp /tmp/build/packer /bin/packer && \ - cd /tmp && \ - rm -rf /tmp/build && \ - gpgconf --kill all && \ - apk del gnupg openssl && \ - rm -rf /root/.gnupg && \ - # Tiny smoke test to ensure the binary we downloaded runs - packer version - -ENTRYPOINT ["/bin/packer"] - - # Light docker image which can be used to run the binary from a container. -# This image builds from the locally generated binary in ./bin/, and from CI-built binaries within CI. +# This image builds from the locally generated binary in ./bin/, and from CI-built binaries within CI. # To generate the local binary, run `make dev`. # This image is published to DockerHub under the `light`, `light-$VERSION`, and `latest` tags. FROM docker.mirror.hashicorp.services/alpine:latest as release-light @@ -93,14 +45,35 @@ LABEL name="Packer" \ version=$PRODUCT_VERSION \ release=$PRODUCT_VERSION \ summary="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration." \ - description="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. Please submit issues to https://github.com/hashicorp/packer/issues" + description="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. Please submit issues to https://github.com/hashicorp/packer/issues" \ + org.opencontainers.image.licenses="BUSL-1.1" RUN apk add --no-cache git bash wget openssl gnupg xorriso COPY dist/$TARGETOS/$TARGETARCH/$BIN_NAME /bin/ +RUN mkdir -p /usr/share/doc/Packer +COPY LICENSE /usr/share/doc/Packer/LICENSE.txt ENTRYPOINT ["/bin/packer"] +# Full docker image which can be used to run the binary from a container. +# This image is essentially the same as the `release-light` one, but embeds +# the official plugins in it. +FROM release-light as release-full + +# Install the latest version of the official plugins +RUN /bin/packer plugins install "github.com/hashicorp/amazon" && \ + /bin/packer plugins install "github.com/hashicorp/ansible" && \ + /bin/packer plugins install "github.com/hashicorp/azure" && \ + /bin/packer plugins install "github.com/hashicorp/docker" && \ + /bin/packer plugins install "github.com/hashicorp/googlecompute" && \ + /bin/packer plugins install "github.com/hashicorp/qemu" && \ + /bin/packer plugins install "github.com/hashicorp/vagrant" && \ + /bin/packer plugins install "github.com/hashicorp/virtualbox" && \ + /bin/packer plugins install "github.com/hashicorp/vmware" && \ + /bin/packer plugins install "github.com/hashicorp/vsphere" + +ENTRYPOINT ["/bin/packer"] # Set default target to 'dev'. FROM dev diff --git a/LICENSE b/LICENSE index c96665ef71f..91ed1781f82 100644 --- a/LICENSE +++ b/LICENSE @@ -1,375 +1,92 @@ -Copyright (c) 2013 HashiCorp, Inc. - -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. +License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +Parameters + +Licensor: HashiCorp, Inc. +Licensed Work: Packer Version 1.10.0 or later. The Licensed Work is (c) 2024 + HashiCorp, Inc. +Additional Use Grant: You may make production use of the Licensed Work, provided + Your use does not include offering the Licensed Work to third + parties on a hosted or embedded basis in order to compete with + HashiCorp's paid version(s) of the Licensed Work. For purposes + of this license: + + A "competitive offering" is a Product that is offered to third + parties on a paid basis, including through paid support + arrangements, that significantly overlaps with the capabilities + of HashiCorp's paid version(s) of the Licensed Work. If Your + Product is not a competitive offering when You first make it + generally available, it will not become a competitive offering + later due to HashiCorp releasing a new version of the Licensed + Work with additional capabilities. In addition, Products that + are not provided on a paid basis are not competitive. + + "Product" means software that is offered to end users to manage + in their own environments or offered as a service on a hosted + basis. + + "Embedded" means including the source code or executable code + from the Licensed Work in a competitive offering. "Embedded" + also means packaging the competitive offering in such a way + that the Licensed Work must be accessed or downloaded for the + competitive offering to operate. + + Hosting or using the Licensed Work(s) for internal purposes + within an organization is not considered a competitive + offering. HashiCorp considers your organization to include all + of your affiliates under common control. + + For binding interpretive guidance on using HashiCorp products + under the Business Source License, please visit our FAQ. + (https://www.hashicorp.com/license-faq) +Change Date: Four years from the date the Licensed Work is published. +Change License: MPL 2.0 + +For information about alternative licensing arrangements for the Licensed Work, +please contact licensing@hashicorp.com. + +Notice + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. diff --git a/Makefile b/Makefile index c6f145f3c1f..bf4cf578172 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,6 @@ GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) GOPATH=$(shell go env GOPATH) -EXECUTABLE_FILES=$(shell find . -type f -executable | egrep -v '^\./(website/[vendor|tmp]|vendor/|\.git|bin/|scripts/|pkg/)' | egrep -v '.*(\.sh|\.bats|\.git)' | egrep -v './provisioner/(ansible|inspec)/test-fixtures/exit1') - # Get the git commit GIT_DIRTY=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true) GIT_COMMIT=$(shell git rev-parse --short HEAD) @@ -57,7 +55,7 @@ install-gen-deps: ## Install dependencies for code generation install-lint-deps: ## Install linter dependencies @echo "==> Updating linter dependencies..." - @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.46.0 + @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.58.0 dev: ## Build and install a development build @grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \ @@ -73,41 +71,22 @@ dev: ## Build and install a development build # Docker build variables and targets REGISTRY_NAME?=docker.io/hashicorp IMAGE_NAME=packer -VERSION?=1.7.10 -IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION) -IMAGE_TAG_DEV=$(REGISTRY_NAME)/$(IMAGE_NAME):latest-$(shell git rev-parse --short HEAD) - -docker: docker-official -docker-light: docker-official - -# Builds from the releases.hashicorp.com official binary -docker-official: - docker build \ - --tag $(IMAGE_TAG) \ - --tag hashicorp/packer:latest \ - --target=official \ - --build-arg VERSION=$(VERSION) \ - . +IMAGE_TAG_DEV=$(REGISTRY_NAME)/$(IMAGE_NAME):latest-$(GIT_COMMIT) -# Builds multiarch from the releases.hashicorp.com official binary -docker-multiarch-official: - docker buildx build \ - --tag $(IMAGE_TAG) \ - --tag hashicorp/packer:latest \ - --target=official \ - --build-arg VERSION=$(VERSION) \ - --platform linux/amd64,linux/arm64 \ - . +docker: docker-dev # Builds from the locally generated binary in ./bin/ # To generate the local binary, run `make dev` -docker-dev: export GOOS=linux -docker-dev: export GOARCH=amd64 -docker-dev: dev +docker-dev: + @GOOS=linux \ + GOARCH=amd64 \ + CGO_ENABLED=0 \ + go build -ldflags '$(GOLDFLAGS)' -o bin/packer . @docker build \ --tag $(IMAGE_TAG_DEV) \ --target=dev \ . + @rm -f bin/packer # Clean up the Linux/amd64 binary to avoid conficts on other OS/archs lint: install-lint-deps ## Lint Go code @if [ ! -z $(PKG_NAME) ]; then \ @@ -133,15 +112,6 @@ fmt-check: fmt ## Check go code formatting exit 1; \ fi -mode-check: ## Check that only certain files are executable - @echo "==> Checking that only certain files are executable..." - @if [ ! -z "$(EXECUTABLE_FILES)" ]; then \ - echo "These files should not be executable or they must be white listed in the Makefile:"; \ - echo "$(EXECUTABLE_FILES)" | xargs -n1; \ - exit 1; \ - else \ - echo "Check passed."; \ - fi fmt-docs: @find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \; @@ -166,7 +136,7 @@ generate-check: generate ## Check go code generation is on par exit 1; \ fi -test: mode-check vet ## Run unit tests +test: vet ## Run unit tests @go test -count $(COUNT) $(TEST) $(TESTARGS) -timeout=3m # acctest runs provisioners acceptance tests @@ -178,7 +148,7 @@ testacc: # install-build-deps generate ## Run acceptance tests @echo "WARN: Acceptance tests will take a long time to run and may cost money. Ctrl-C if you want to cancel." PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) $(TESTARGS) -timeout=120m -testrace: mode-check vet ## Test with race detection enabled +testrace: vet ## Test with race detection enabled @go test -count $(COUNT) -race $(TEST) $(TESTARGS) -timeout=3m -p=8 # Runs code coverage and open a html page with report @@ -196,6 +166,3 @@ vet: ## Vet Go code help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -# This is used for release builds by .github/workflows/build.yml -version: - @$(CURDIR)/scripts/version.sh version/version.go diff --git a/README.md b/README.md index af75e1ed95b..05a280b2b85 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,8 @@ # Packer - +[![License: BUSL-1.1](https://img.shields.io/badge/License-BUSL--1.1-yellow.svg)](LICENSE) [![Build Status](https://github.com/hashicorp/packer/actions/workflows/build.yml/badge.svg)](https://github.com/hashicorp/packer/actions/workflows/build.yml) [![Discuss](https://img.shields.io/badge/discuss-packer-3d89ff?style=flat)](https://discuss.hashicorp.com/c/packer) -[![PkgGoDev](https://pkg.go.dev/badge/github.com/hashicorp/packer)](https://pkg.go.dev/github.com/hashicorp/packer) -[![GoReportCard][report-badge]][report] - -[github-badge]: https://github.com/hashicorp/packer/actions/workflows/build.yml/badge.svg -[appveyor-badge]: https://ci.appveyor.com/api/projects/status/miavlgnp989e5obc/branch/master?svg=true -[godoc-badge]: https://godoc.org/github.com/hashicorp/packer?status.svg -[godoc]: https://godoc.org/github.com/hashicorp/packer -[report-badge]: https://goreportcard.com/badge/github.com/hashicorp/packer -[report]: https://goreportcard.com/report/github.com/hashicorp/packer +===

@@ -23,79 +15,31 @@ from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer -comes out of the box with support for many platforms, the full list of which can -be found at https://www.packer.io/docs/builders. - -Support for other platforms can be added via plugins. +supports various platforms through external plugin integrations, the full list of which can +be found at https://developer.hashicorp.com/packer/integrations. -The images that Packer creates can easily be turned into -[Vagrant](http://www.vagrantup.com) boxes. +The images that Packer creates can easily be turned into [Vagrant](http://www.vagrantup.com) boxes. ## Quick Start -**Note:** There is a great -[introduction and getting started guide](https://learn.hashicorp.com/tutorials/packer/get-started-install-cli) -for those with a bit more patience. Otherwise, the quick start below -will get you up and running quickly, at the sacrifice of not explaining some -key points. - -First, [download a pre-built Packer -binary](https://www.packer.io/downloads.html) for your operating system or -[compile Packer -yourself](https://github.com/hashicorp/packer/blob/master/.github/CONTRIBUTING.md#setting-up-go-to-work-on-packer). - -After Packer is installed, create your first template, which tells Packer -what platforms to build images for and how you want to build them. In our -case, we'll create a simple AMI that has Redis pre-installed. - -Save this file as `quick-start.pkr.hcl`. Export your AWS credentials as the -`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables. - -```hcl -variable "access_key" { - type = string - default = "${env("AWS_ACCESS_KEY_ID")}" -} - -variable "secret_key" { - type = string - default = "${env("AWS_SECRET_ACCESS_KEY")}" - sensitive = true -} - -locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } - -source "amazon-ebs" "quick-start" { - access_key = "${var.access_key}" - ami_name = "packer-example ${local.timestamp}" - instance_type = "t2.micro" - region = "us-east-1" - secret_key = "${var.secret_key}" - source_ami = "ami-af22d9b9" - ssh_username = "ubuntu" -} - -build { - sources = ["source.amazon-ebs.quick-start"] -} -``` - -Next, tell Packer to build the image: - -``` -$ packer build quick-start.pkr.hcl -... -``` - -Packer will build an AMI according to the "quick-start" template. The AMI -will be available in your AWS account. To delete the AMI, you must manually -delete it using the [AWS console](https://console.aws.amazon.com/). Packer -builds your images, it does not manage their lifecycle. Where they go, how -they're run, etc., is up to you. +### Packer + +There is a great [introduction and getting started guide](https://learn.hashicorp.com/tutorials/packer/get-started-install-cli) +for building a Docker image on your local machine without using any paid cloud resources. + +Alternatively, you can refer to [getting started with AWS](https://developer.hashicorp.com/packer/tutorials/aws-get-started) to +learn how to build a machine image for an external cloud provider. + +### HCP Packer + +HCP Packer registry stores Packer image metadata, enabling you to track your image lifecycle. + +To get started with building an AWS machine image to HCP Packer for referencing in Terraform refer +to the collection of [HCP Packer Tutorials](https://developer.hashicorp.com/packer/tutorials/hcp-get-started). ## Documentation -Comprehensive documentation is viewable on the Packer website at https://www.packer.io/docs. +Comprehensive documentation is viewable on the Packer website at https://developer.hashicorp.com/packer/docs. ## Contributing to Packer @@ -118,3 +62,4 @@ What does **unmaintained** mean? If you are interested in maintaining an unmaintained or archived plugin, please reach out to us at packer@hashicorp.com. + diff --git a/acctest/plugin/component_acc_test.go b/acctest/plugin/component_acc_test.go index e0d070ed8ba..14d0e5702d0 100644 --- a/acctest/plugin/component_acc_test.go +++ b/acctest/plugin/component_acc_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // component_acc_test.go should contain acceptance tests for plugin components // to make sure all component types can be discovered and started. package plugin @@ -5,12 +8,11 @@ package plugin import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "testing" - amazonacc "github.com/hashicorp/packer-plugin-amazon/builder/ebs/acceptance" "github.com/hashicorp/packer-plugin-sdk/acctest" "github.com/hashicorp/packer/hcl2template/addrs" ) @@ -20,22 +22,13 @@ var basicAmazonAmiDatasourceHCL2Template string func TestAccInitAndBuildBasicAmazonAmiDatasource(t *testing.T) { plugin := addrs.Plugin{ - Hostname: "github.com", - Namespace: "hashicorp", - Type: "amazon", + Source: "github.com/hashicorp/amazon", } testCase := &acctest.PluginTestCase{ Name: "amazon-ami_basic_datasource_test", Setup: func() error { return cleanupPluginInstallation(plugin) }, - Teardown: func() error { - helper := amazonacc.AMIHelper{ - Region: "us-west-2", - Name: "packer-amazon-ami-test", - } - return helper.CleanUpAmi() - }, Template: basicAmazonAmiDatasourceHCL2Template, Type: "amazon-ami", Init: true, @@ -51,7 +44,7 @@ func TestAccInitAndBuildBasicAmazonAmiDatasource(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } diff --git a/acctest/plugin/plugin_acc_test.go b/acctest/plugin/plugin_acc_test.go index b0eb24be172..c9eec1fbc2b 100644 --- a/acctest/plugin/plugin_acc_test.go +++ b/acctest/plugin/plugin_acc_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // plugin_acc_test.go should contain acceptance tests for features related to // installing, discovering and running plugins. package plugin @@ -5,18 +8,17 @@ package plugin import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" "regexp" "testing" - amazonacc "github.com/hashicorp/packer-plugin-amazon/builder/ebs/acceptance" "github.com/hashicorp/packer-plugin-sdk/acctest" "github.com/hashicorp/packer-plugin-sdk/acctest/testutils" "github.com/hashicorp/packer/hcl2template/addrs" - "github.com/mitchellh/go-homedir" + "github.com/hashicorp/packer/packer" ) //go:embed test-fixtures/basic-amazon-ebs.pkr.hcl @@ -24,22 +26,13 @@ var basicAmazonEbsHCL2Template string func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { plugin := addrs.Plugin{ - Hostname: "github.com", - Namespace: "hashicorp", - Type: "amazon", + Source: "github.com/hashicorp/amazon", } testCase := &acctest.PluginTestCase{ Name: "amazon-ebs_basic_plugin_init_and_build_test", Setup: func() error { return cleanupPluginInstallation(plugin) }, - Teardown: func() error { - helper := amazonacc.AMIHelper{ - Region: "us-east-1", - Name: "packer-plugin-amazon-ebs-test", - } - return helper.CleanUpAmi() - }, Template: basicAmazonEbsHCL2Template, Type: "amazon-ebs", Init: true, @@ -55,7 +48,7 @@ func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } @@ -74,27 +67,22 @@ func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { acctest.TestPlugin(t, testCase) } -func cleanupPluginInstallation(plugin addrs.Plugin) error { - home, err := homedir.Dir() +func pluginDirectory(plugin addrs.Plugin) (string, error) { + pluginDir, err := packer.PluginFolder() if err != nil { - return err + return "", err } - pluginPath := filepath.Join(home, - ".packer.d", - "plugins", - plugin.Hostname, - plugin.Namespace, - plugin.Type) - if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" { - pluginPath = filepath.Join(xdgConfigHome, - "packer", - "plugins", - plugin.Hostname, - plugin.Namespace, - plugin.Type) - } + pluginParts := []string{pluginDir} + pluginParts = append(pluginParts, plugin.Parts()...) + return filepath.Join(pluginParts...), nil +} +func cleanupPluginInstallation(plugin addrs.Plugin) error { + pluginPath, err := pluginDirectory(plugin) + if err != nil { + return err + } testutils.CleanupFiles(pluginPath) return nil } @@ -105,27 +93,11 @@ func checkPluginInstallation(initOutput string, plugin addrs.Plugin) error { return fmt.Errorf("logs doesn't contain expected foo value %q", initOutput) } - home, err := homedir.Dir() + pluginPath, err := pluginDirectory(plugin) if err != nil { return err } - pluginPath := filepath.Join(home, - ".packer.d", - "plugins", - plugin.Hostname, - plugin.Namespace, - plugin.Type) - - if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" { - pluginPath = filepath.Join(xdgConfigHome, - "packer", - "plugins", - plugin.Hostname, - plugin.Namespace, - plugin.Type) - } - if !testutils.FileExists(pluginPath) { return fmt.Errorf("%s plugin installation not found", plugin.String()) } diff --git a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl index b3c4696024d..207530aa26f 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl @@ -1,7 +1,7 @@ packer { required_plugins { amazon = { - version = ">= 0.0.1" + version = "~>1" source = "github.com/hashicorp/amazon" } } @@ -9,7 +9,7 @@ packer { data "amazon-ami" "test" { filters = { - name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*" + name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } @@ -25,6 +25,7 @@ source "amazon-ebs" "basic-example" { communicator = "ssh" instance_type = "t2.micro" ssh_username = "ubuntu" + skip_create_ami = true } build { diff --git a/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl b/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl index aa9399a9239..daaec2feb7f 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl @@ -1,18 +1,19 @@ packer { required_plugins { amazon = { - version = ">= 0.0.1" - source = "github.com/hashicorp/amazon" + version = "~> 1" + source = "github.com/hashicorp/amazon" } } } source "amazon-ebs" "basic-test" { - region = "us-east-1" - instance_type = "m3.medium" - source_ami = "ami-76b2a71e" - ssh_username = "ubuntu" - ami_name = "packer-plugin-amazon-ebs-test" + region = "us-east-1" + instance_type = "m3.medium" + source_ami = "ami-76b2a71e" + ssh_username = "ubuntu" + ami_name = "packer-plugin-amazon-ebs-test" + skip_create_ami = true } build { diff --git a/acctest/testing.go b/acctest/testing.go index 2a9d3bca7c2..f88d2dde3e9 100644 --- a/acctest/testing.go +++ b/acctest/testing.go @@ -1,9 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package acctest import ( "context" "fmt" - "io/ioutil" + "io" "log" "os" "strings" @@ -133,6 +136,9 @@ func Test(t TestT, c TestCase) { Components: packer.ComponentFinder{ PluginConfig: &packer.PluginConfig{ Builders: TestBuilderSet{ + BuilderSet: packersdk.MapOfBuilder{ + "test": func() (packersdk.Builder, error) { return c.Builder, nil }, + }, StartFn: func(n string) (packersdk.Builder, error) { if n == "test" { return c.Builder, nil @@ -179,8 +185,8 @@ func Test(t TestT, c TestCase) { log.Printf("[DEBUG] Running 'test' build") ui := &packersdk.BasicUi{ Reader: os.Stdin, - Writer: ioutil.Discard, - ErrorWriter: ioutil.Discard, + Writer: io.Discard, + ErrorWriter: io.Discard, PB: &packersdk.NoopProgressTracker{}, } artifacts, err := build.Run(context.Background(), ui) diff --git a/acctest/testing_test.go b/acctest/testing_test.go index 2ea0031b2fc..85364bd1154 100644 --- a/acctest/testing_test.go +++ b/acctest/testing_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package acctest import ( diff --git a/background_check.go b/background_check.go index 2c4bb66c11a..30a0a65e2d5 100644 --- a/background_check.go +++ b/background_check.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build !openbsd // +build !openbsd @@ -6,7 +9,7 @@ package main import ( "fmt" - "github.com/shirou/gopsutil/process" + "github.com/shirou/gopsutil/v3/process" ) func checkProcess(currentPID int) (bool, error) { diff --git a/background_check_openbsd.go b/background_check_openbsd.go index b3186ddd71a..0fc5574ba9c 100644 --- a/background_check_openbsd.go +++ b/background_check_openbsd.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/builder/file/artifact.go b/builder/file/artifact.go index 1a7442370d0..4c33f6d45a3 100644 --- a/builder/file/artifact.go +++ b/builder/file/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file import ( diff --git a/builder/file/artifact_test.go b/builder/file/artifact_test.go index 3d37f811646..02df6c2ae4e 100644 --- a/builder/file/artifact_test.go +++ b/builder/file/artifact_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file import ( diff --git a/builder/file/builder.go b/builder/file/builder.go index 82ddd095951..0f79c958fe8 100644 --- a/builder/file/builder.go +++ b/builder/file/builder.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file /* @@ -9,7 +12,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "path/filepath" @@ -74,7 +76,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) } else { // We're going to write Contents; if it's empty we'll just create an // empty file. - err := ioutil.WriteFile(b.config.Target, []byte(b.config.Content), 0600) + err := os.WriteFile(b.config.Target, []byte(b.config.Content), 0600) if err != nil { return nil, err } diff --git a/builder/file/builder_test.go b/builder/file/builder_test.go index ea8669240da..5248318a4dc 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file import ( "fmt" - "io/ioutil" + "os" "testing" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -30,7 +33,7 @@ func TestBuilderFileAcc_copy(t *testing.T) { } func checkContent(artifacts []packersdk.Artifact) error { - content, err := ioutil.ReadFile("contentTest.txt") + content, err := os.ReadFile("contentTest.txt") if err != nil { return err } @@ -42,7 +45,7 @@ func checkContent(artifacts []packersdk.Artifact) error { } func checkCopy(artifacts []packersdk.Artifact) error { - content, err := ioutil.ReadFile("copyTest.txt") + content, err := os.ReadFile("copyTest.txt") if err != nil { return err } diff --git a/builder/file/config.go b/builder/file/config.go index b784400c1b5..244490a36da 100644 --- a/builder/file/config.go +++ b/builder/file/config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package file diff --git a/builder/file/config_test.go b/builder/file/config_test.go index a701b9609ec..b6692495b9d 100644 --- a/builder/file/config_test.go +++ b/builder/file/config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file import ( diff --git a/builder/file/version/version.go b/builder/file/version/version.go index 3b26a6e5553..2136829ae88 100644 --- a/builder/file/version/version.go +++ b/builder/file/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/builder/null/artifact_export.go b/builder/null/artifact_export.go index e8d5dd0a66b..5a685629072 100644 --- a/builder/null/artifact_export.go +++ b/builder/null/artifact_export.go @@ -1,8 +1,9 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( - "fmt" - registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" ) @@ -23,7 +24,7 @@ func (*NullArtifact) Id() string { } func (a *NullArtifact) String() string { - return fmt.Sprintf("Did not export anything. This is the null builder") + return "Did not export anything. This is the null builder" } func (a *NullArtifact) State(name string) interface{} { diff --git a/builder/null/artifact_export_test.go b/builder/null/artifact_export_test.go index 77eeeced80d..265b8d36781 100644 --- a/builder/null/artifact_export_test.go +++ b/builder/null/artifact_export_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( diff --git a/builder/null/builder.go b/builder/null/builder.go index 5e2a7d369dc..a9a53dbd7e8 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( diff --git a/builder/null/builder_test.go b/builder/null/builder_test.go index f710f1dfd6f..fdb52031d7a 100644 --- a/builder/null/builder_test.go +++ b/builder/null/builder_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( diff --git a/builder/null/config.go b/builder/null/config.go index 39bec200a9e..24ee61ed6fb 100644 --- a/builder/null/config.go +++ b/builder/null/config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package null diff --git a/builder/null/config_test.go b/builder/null/config_test.go index 47e023312b8..67d35f66972 100644 --- a/builder/null/config_test.go +++ b/builder/null/config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( diff --git a/builder/null/ssh.go b/builder/null/ssh.go index 730ebe5fbbf..fbffbb13a3c 100644 --- a/builder/null/ssh.go +++ b/builder/null/ssh.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package null import ( diff --git a/builder/null/version/version.go b/builder/null/version/version.go index 5e2659824a4..27e53e312d1 100644 --- a/builder/null/version/version.go +++ b/builder/null/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/checkpoint.go b/checkpoint.go index e1b519e910c..380cdd6bf29 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/cmd/generate-fixer-deprecations/main.go b/cmd/generate-fixer-deprecations/main.go index 034ca12e974..4316a1605a0 100644 --- a/cmd/generate-fixer-deprecations/main.go +++ b/cmd/generate-fixer-deprecations/main.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/cmd/ssh-keygen/main.go b/cmd/ssh-keygen/main.go index 1eca73d47fd..c29edf76e7e 100644 --- a/cmd/ssh-keygen/main.go +++ b/cmd/ssh-keygen/main.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( "flag" - "io/ioutil" "log" "os" "os/user" @@ -71,12 +73,12 @@ func main() { log.Fatalf("%s already exists.", cla.Filename) } log.Printf("Saving private key to %s", cla.Filename) - if err := ioutil.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { + if err := os.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { log.Fatal(err) } publicFilename := cla.Filename + ".pub" log.Printf("Saving public key to %s", publicFilename) - if err := ioutil.WriteFile(publicFilename, keypair.Public, 0644); err != nil { + if err := os.WriteFile(publicFilename, keypair.Public, 0644); err != nil { log.Fatal(err) } } diff --git a/command/build.go b/command/build.go index 1cf9cdd61cc..330e05e643b 100644 --- a/command/build.go +++ b/command/build.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -22,6 +25,10 @@ import ( "github.com/posener/complete" ) +const ( + hcpReadyIntegrationURL = "https://developer.hashicorp.com/packer/integrations?flags=hcp-ready" +) + type BuildCommand struct { Meta } @@ -40,7 +47,7 @@ func (c *BuildCommand) Run(args []string) int { func (c *BuildCommand) ParseArgs(args []string) (*BuildArgs, int) { var cfg BuildArgs - flags := c.Meta.FlagSet("build", FlagSetBuildFilter|FlagSetVars) + flags := c.Meta.FlagSet("build") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -79,35 +86,48 @@ func writeDiags(ui packersdk.Ui, files map[string]*hcl.File, diags hcl.Diagnosti } func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int { + // Set the release only flag if specified as argument + // + // This deactivates the capacity for Packer to load development binaries. + c.CoreConfig.Components.PluginConfig.ReleasesOnly = cla.ReleaseOnly + packerStarter, ret := c.GetConfig(&cla.MetaArgs) if ret != 0 { return ret } - diags := packerStarter.Initialize(packer.InitializeOptions{}) + diags := packerStarter.DetectPluginBinaries() + ret = writeDiags(c.Ui, nil, diags) + if ret != 0 { + return ret + } + + diags = packerStarter.Initialize(packer.InitializeOptions{}) ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret } - hcpRegistry, diags := registry.New(packerStarter) + hcpRegistry, diags := registry.New(packerStarter, c.Ui) ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret } - err := hcpRegistry.PopulateIteration(buildCtx) + defer hcpRegistry.VersionStatusSummary() + + err := hcpRegistry.PopulateVersion(buildCtx) if err != nil { return writeDiags(c.Ui, nil, hcl.Diagnostics{ &hcl.Diagnostic{ - Summary: "HCP: populating iteration failed", + Summary: "HCP: populating version failed", Severity: hcl.DiagError, Detail: err.Error(), }, }) } - builds, hcpMap, diags := packerStarter.GetBuilds(packer.GetBuildsOptions{ + builds, diags := packerStarter.GetBuilds(packer.GetBuildsOptions{ Only: cla.Only, Except: cla.Except, Debug: cla.Debug, @@ -191,6 +211,7 @@ func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int m map[string]error }{m: make(map[string]error)} limitParallel := semaphore.NewWeighted(cla.ParallelBuilds) + for i := range builds { if err := buildCtx.Err(); err != nil { log.Println("Interrupted, not going to start any more builds.") @@ -219,7 +240,7 @@ func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int defer limitParallel.Release(1) - err := hcpRegistry.StartBuild(buildCtx, hcpMap[name]) + err := hcpRegistry.StartBuild(buildCtx, b) // Seems odd to require this error check here. Now that it is an error we can just exit with diag if err != nil { // If the build is already done, we skip without a warning @@ -249,19 +270,33 @@ func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int runArtifacts, hcperr := hcpRegistry.CompleteBuild( buildCtx, - hcpMap[name], + b, runArtifacts, err) if hcperr != nil { - writeDiags(c.Ui, nil, hcl.Diagnostics{ - &hcl.Diagnostic{ - Summary: fmt.Sprintf( - "failed to complete HCP-enabled build %q", - name), - Severity: hcl.DiagError, - Detail: hcperr.Error(), - }, - }) + if _, ok := hcperr.(*registry.NotAHCPArtifactError); ok { + writeDiags(c.Ui, nil, hcl.Diagnostics{ + &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("The %q builder produced an artifact that cannot be pushed to HCP Packer", b.Name()), + Detail: fmt.Sprintf( + `%s +Check that you are using an HCP Ready integration before trying again: +%s`, + hcperr, hcpReadyIntegrationURL), + }, + }) + } else { + writeDiags(c.Ui, nil, hcl.Diagnostics{ + &hcl.Diagnostic{ + Summary: fmt.Sprintf( + "publishing build metadata to HCP Packer for %q failed", + name), + Severity: hcl.DiagError, + Detail: hcperr.Error(), + }, + }) + } } if err != nil { @@ -402,6 +437,7 @@ Options: -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables, can be used multiple times. -warn-on-undeclared-var Display warnings for user variable files containing undeclared variables. + -ignore-prerelease-plugins Disable the loading of prerelease plugin binaries (x.y.z-dev). ` return strings.TrimSpace(helpText) diff --git a/command/build_cancellation_test.go b/command/build_cancellation_test.go index a81c057dbfa..0ada639074a 100644 --- a/command/build_cancellation_test.go +++ b/command/build_cancellation_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -50,6 +53,7 @@ func TestBuildCommand_RunContext_CtxCancel(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() b := NewParallelTestBuilder(tt.parallelPassingTests) diff --git a/command/build_cleanup_script_test.go b/command/build_cleanup_script_test.go index 87e28d451ca..35639a4f4a9 100644 --- a/command/build_cleanup_script_test.go +++ b/command/build_cleanup_script_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/build_parallel_test.go b/command/build_parallel_test.go index 960b5608ec2..4bebc65cee8 100644 --- a/command/build_parallel_test.go +++ b/command/build_parallel_test.go @@ -1,9 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( "bytes" "context" - "fmt" "path/filepath" "sync" "testing" @@ -98,7 +100,7 @@ func TestBuildParallel_1(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=10"), + "-parallel-builds=10", filepath.Join(testFixture("parallel"), "1lock-5wg.json"), } @@ -127,7 +129,7 @@ func TestBuildParallel_2(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=3"), + "-parallel-builds=3", filepath.Join(testFixture("parallel"), "2lock-4wg.json"), } @@ -156,7 +158,7 @@ func TestBuildParallel_Timeout(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=3"), + "-parallel-builds=3", filepath.Join(testFixture("parallel"), "2lock-timeout.json"), } diff --git a/command/build_test.go b/command/build_test.go index a306fbde252..de476fdb0c4 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( "fmt" - "io/ioutil" "math" "os" "path/filepath" @@ -1006,9 +1008,9 @@ func (fc fileCheck) verify(t *testing.T, dir string) { } } for file, expectedContent := range fc.expectedContent { - content, err := ioutil.ReadFile(filepath.Join(dir, file)) + content, err := os.ReadFile(filepath.Join(dir, file)) if err != nil { - t.Fatalf("ioutil.ReadFile: %v", err) + t.Fatalf("os.ReadFile: %v", err) } if diff := cmp.Diff(expectedContent, string(content)); diff != "" { t.Errorf("content of %s differs: %s", file, diff) @@ -1113,6 +1115,137 @@ func TestBuildCommand_ParseArgs(t *testing.T) { } } +// TestProvisionerOnlyExcept checks that only/except blocks in provisioners/post-processors behave as expected +func TestProvisionerAndPostProcessorOnlyExcept(t *testing.T) { + tests := []struct { + name string + args []string + expectedCode int + outputCheck func(string, string) error + }{ + { + "json - only named build", + []string{ + "-only", "packer", + testFixture("provisioners", "provisioner-only-except.json"), + }, + 0, + func(out, _ string) error { + if !strings.Contains(out, "packer provisioner packer and null") { + return fmt.Errorf("missing expected provisioner output") + } + + if !strings.Contains(out, "packer post-processor packer and null") { + return fmt.Errorf("missing expected post-processor output") + } + + if strings.Contains(out, "null post-processor") || strings.Contains(out, "null provisioner") { + return fmt.Errorf("found traces of unnamed provisioner/post-processor, should not") + } + + return nil + }, + }, + { + "json - only unnamed build", + []string{ + "-only", "null", + testFixture("provisioners", "provisioner-only-except.json"), + }, + 0, + func(out, _ string) error { + if !strings.Contains(out, "null provisioner null and null") { + return fmt.Errorf("missing expected provisioner output") + } + + if !strings.Contains(out, "null post-processor null and null") { + return fmt.Errorf("missing expected post-processor output") + } + + if strings.Contains(out, "packer post-processor") || strings.Contains(out, "packer provisioner") { + return fmt.Errorf("found traces of named provisioner/post-processor, should not") + } + + return nil + }, + }, + { + "hcl - only one source build", + []string{ + "-only", "null.packer", + testFixture("provisioners", "provisioner-only-except.pkr.hcl"), + }, + 0, + func(out, _ string) error { + if !strings.Contains(out, "packer provisioner packer and null") { + return fmt.Errorf("missing expected provisioner output") + } + + if !strings.Contains(out, "packer post-processor packer and null") { + return fmt.Errorf("missing expected post-processor output") + } + + if strings.Contains(out, "other post-processor") || strings.Contains(out, "other provisioner") { + return fmt.Errorf("found traces of other provisioner/post-processor, should not") + } + + return nil + }, + }, + { + "hcl - only other build", + []string{ + "-only", "null.other", + testFixture("provisioners", "provisioner-only-except.pkr.hcl"), + }, + 0, + func(out, _ string) error { + if !strings.Contains(out, "other provisioner other and null") { + return fmt.Errorf("missing expected provisioner output") + } + + if !strings.Contains(out, "other post-processor other and null") { + return fmt.Errorf("missing expected post-processor output") + } + + if strings.Contains(out, "packer post-processor") || strings.Contains(out, "packer provisioner") { + return fmt.Errorf("found traces of \"packer\" source provisioner/post-processor, should not") + } + + return nil + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &BuildCommand{ + Meta: TestMetaFile(t), + } + + exitCode := c.Run(tt.args) + if exitCode != tt.expectedCode { + t.Errorf("process exit code mismatch: expected %d, got %d", + tt.expectedCode, + exitCode) + } + + out, stderr := GetStdoutAndErrFromTestMeta(t, c.Meta) + err := tt.outputCheck(out, stderr) + if err != nil { + if len(out) != 0 { + t.Logf("command stdout: %q", out) + } + + if len(stderr) != 0 { + t.Logf("command stderr: %q", stderr) + } + t.Error(err.Error()) + } + }) + } +} + // TestBuildCmd aims to test the build command, with output validation func TestBuildCmd(t *testing.T) { tests := []struct { @@ -1187,6 +1320,27 @@ func TestBuildCmd(t *testing.T) { return fmt.Errorf("error: missing context for error message") } + return nil + }, + }, + { + name: "hcl - exclude post-processor, expect no warning", + args: []string{ + "-except", "manifest", + testFixture("hcl", "test_except_manifest.pkr.hcl"), + }, + expectedCode: 0, + outputCheck: func(out, err string) error { + for _, stream := range []string{out, err} { + if strings.Contains(stream, "Warning: an 'except' option was passed, but did not match any build") { + return fmt.Errorf("Unexpected warning for build no match with except") + } + + if strings.Contains(stream, "Running post-processor:") { + return fmt.Errorf("Should not run post-processors, but found one") + } + } + return nil }, }, diff --git a/command/build_timeout_test.go b/command/build_timeout_test.go index ca774a56639..d97485b3490 100644 --- a/command/build_timeout_test.go +++ b/command/build_timeout_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/build_windows_test.go b/command/build_windows_test.go index 9978bfea06c..b18f4e3153a 100644 --- a/command/build_windows_test.go +++ b/command/build_windows_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import "strings" diff --git a/command/cli.go b/command/cli.go index e1eb1ffbceb..0cd82c2749a 100644 --- a/command/cli.go +++ b/command/cli.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -87,6 +90,9 @@ func (ba *BuildArgs) AddFlagSets(flags *flag.FlagSet) { flags.Var(flagOnError, "on-error", "") flags.BoolVar(&ba.MetaArgs.WarnOnUndeclaredVar, "warn-on-undeclared-var", false, "Show warnings for variable files containing undeclared variables.") + + flags.BoolVar(&ba.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-dev).") + ba.MetaArgs.AddFlagSets(flags) } @@ -97,10 +103,12 @@ type BuildArgs struct { Color, TimestampUi, MachineReadable bool ParallelBuilds int64 OnError string + ReleaseOnly bool } func (ia *InitArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&ia.Upgrade, "upgrade", false, "upgrade any present plugin to the highest allowed version.") + flags.BoolVar(&ia.Force, "force", false, "force installation of a plugin, even if already installed") ia.MetaArgs.AddFlagSets(flags) } @@ -109,6 +117,7 @@ func (ia *InitArgs) AddFlagSets(flags *flag.FlagSet) { type InitArgs struct { MetaArgs Upgrade bool + Force bool } // PluginsRequiredArgs represents a parsed cli line for a `packer plugins required ` @@ -137,6 +146,7 @@ func (va *ValidateArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&va.SyntaxOnly, "syntax-only", false, "check syntax only") flags.BoolVar(&va.NoWarnUndeclaredVar, "no-warn-undeclared-var", false, "Ignore warnings for variable files containing undeclared variables.") flags.BoolVar(&va.EvaluateDatasources, "evaluate-datasources", false, "evaluate datasources for validation (HCL2 only, may incur costs)") + flags.BoolVar(&va.ReleaseOnly, "ignore-prerelease-plugins", false, "Disable the loading of prerelease plugin binaries (x.y.z-dev).") va.MetaArgs.AddFlagSets(flags) } @@ -146,6 +156,7 @@ type ValidateArgs struct { MetaArgs SyntaxOnly, NoWarnUndeclaredVar bool EvaluateDatasources bool + ReleaseOnly bool } func (va *InspectArgs) AddFlagSets(flags *flag.FlagSet) { diff --git a/command/command_test.go b/command/command_test.go index a4505c61116..712e9300496 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( "bytes" - "io/ioutil" + "os" "path/filepath" "testing" @@ -24,7 +27,7 @@ func fatalCommand(t *testing.T, m Meta) { func testFixtureContent(n ...string) string { path := filepath.Join(append([]string{fixturesDir}, n...)...) - b, err := ioutil.ReadFile(path) + b, err := os.ReadFile(path) if err != nil { panic(err) } diff --git a/command/config_file_unix.go b/command/config_file_unix.go index fa62867cccd..ec3932f9e0b 100644 --- a/command/config_file_unix.go +++ b/command/config_file_unix.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build darwin || freebsd || linux || netbsd || openbsd || solaris // +build darwin freebsd linux netbsd openbsd solaris diff --git a/command/config_file_windows.go b/command/config_file_windows.go index 667f955acc6..ede0a618687 100644 --- a/command/config_file_windows.go +++ b/command/config_file_windows.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build windows // +build windows diff --git a/command/configtype_enumer.go b/command/configtype_enumer.go index 5d02f035855..c7a5cf52a32 100644 --- a/command/configtype_enumer.go +++ b/command/configtype_enumer.go @@ -1,6 +1,5 @@ // Code generated by "enumer -type configType -trimprefix ConfigType -transform snake"; DO NOT EDIT. -// package command import ( diff --git a/command/console.go b/command/console.go index b6f82c59b2b..da24a06150e 100644 --- a/command/console.go +++ b/command/console.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -40,7 +43,7 @@ func (c *ConsoleCommand) Run(args []string) int { func (c *ConsoleCommand) ParseArgs(args []string) (*ConsoleArgs, int) { var cfg ConsoleArgs - flags := c.Meta.FlagSet("console", FlagSetVars) + flags := c.Meta.FlagSet("console") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -82,6 +85,7 @@ Usage: packer console [options] [TEMPLATE] Options: -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables. + -config-type Set to 'hcl2' to run in HCL2 mode when no file is passed. Defaults to json. ` return strings.TrimSpace(helpText) diff --git a/command/console_test.go b/command/console_test.go index bfc5fd65cae..7b4bbc7d7b8 100644 --- a/command/console_test.go +++ b/command/console_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/enumflag/flag.go b/command/enumflag/flag.go index ab6dce29b90..c50e70b0714 100644 --- a/command/enumflag/flag.go +++ b/command/enumflag/flag.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package enumflag import "fmt" diff --git a/command/exec_test.go b/command/exec_test.go index 7a13201f3fa..debb2dacbf9 100644 --- a/command/exec_test.go +++ b/command/exec_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -8,7 +11,6 @@ import ( "runtime" "testing" - "github.com/hashicorp/packer-plugin-amazon/builder/ebs" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/null" @@ -118,10 +120,8 @@ func getBareComponentFinder() packer.ComponentFinder { return packer.ComponentFinder{ PluginConfig: &packer.PluginConfig{ Builders: packer.MapOfBuilder{ - "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, - "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, - "amazon-ebs": func() (packersdk.Builder, error) { return &ebs.Builder{}, nil }, - "azure-arm": func() (packersdk.Builder, error) { return &ebs.Builder{}, nil }, + "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, + "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, }, Provisioners: packer.MapOfProvisioner{ "shell-local": func() (packersdk.Provisioner, error) { return &shell_local.Provisioner{}, nil }, diff --git a/command/plugin.go b/command/execute.go similarity index 89% rename from command/plugin.go rename to command/execute.go index 50699654918..7ad74f314d4 100644 --- a/command/plugin.go +++ b/command/execute.go @@ -15,8 +15,10 @@ import ( filebuilder "github.com/hashicorp/packer/builder/file" nullbuilder "github.com/hashicorp/packer/builder/null" + hcppackerartifactdatasource "github.com/hashicorp/packer/datasource/hcp-packer-artifact" hcppackerimagedatasource "github.com/hashicorp/packer/datasource/hcp-packer-image" hcppackeriterationdatasource "github.com/hashicorp/packer/datasource/hcp-packer-iteration" + hcppackerversiondatasource "github.com/hashicorp/packer/datasource/hcp-packer-version" httpdatasource "github.com/hashicorp/packer/datasource/http" nulldatasource "github.com/hashicorp/packer/datasource/null" artificepostprocessor "github.com/hashicorp/packer/post-processor/artifice" @@ -34,7 +36,7 @@ import ( windowsshellprovisioner "github.com/hashicorp/packer/provisioner/windows-shell" ) -type PluginCommand struct { +type ExecuteCommand struct { Meta } @@ -63,28 +65,30 @@ var PostProcessors = map[string]packersdk.PostProcessor{ } var Datasources = map[string]packersdk.Datasource{ + "hcp-packer-artifact": new(hcppackerartifactdatasource.Datasource), "hcp-packer-image": new(hcppackerimagedatasource.Datasource), "hcp-packer-iteration": new(hcppackeriterationdatasource.Datasource), + "hcp-packer-version": new(hcppackerversiondatasource.Datasource), "http": new(httpdatasource.Datasource), "null": new(nulldatasource.Datasource), } var pluginRegexp = regexp.MustCompile("packer-(builder|post-processor|provisioner|datasource)-(.+)") -func (c *PluginCommand) Run(args []string) int { +func (c *ExecuteCommand) Run(args []string) int { // This is an internal call (users should not call this directly) so we're // not going to do much input validation. If there's a problem we'll often // just crash. Error handling should be added to facilitate debugging. log.Printf("args: %#v", args) if len(args) != 1 { - c.Ui.Error("Wrong number of args") + c.Ui.Error(c.Help()) return 1 } // Plugin will match something like "packer-builder-amazon-ebs" parts := pluginRegexp.FindStringSubmatch(args[0]) if len(parts) != 3 { - c.Ui.Error(fmt.Sprintf("Error parsing plugin argument [DEBUG]: %#v", parts)) + c.Ui.Error(c.Help()) return 1 } pluginType := parts[1] // capture group 1 (builder|post-processor|provisioner) @@ -132,9 +136,9 @@ func (c *PluginCommand) Run(args []string) int { return 0 } -func (*PluginCommand) Help() string { +func (*ExecuteCommand) Help() string { helpText := ` -Usage: packer plugin PLUGIN +Usage: packer execute PLUGIN Runs an internally-compiled version of a plugin from the packer binary. @@ -144,6 +148,6 @@ Usage: packer plugin PLUGIN return strings.TrimSpace(helpText) } -func (c *PluginCommand) Synopsis() string { +func (c *ExecuteCommand) Synopsis() string { return "internal plugin command" } diff --git a/command/fix.go b/command/fix.go index db5f62fc409..07bc8021e80 100644 --- a/command/fix.go +++ b/command/fix.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -33,7 +36,7 @@ func (c *FixCommand) Run(args []string) int { func (c *FixCommand) ParseArgs(args []string) (*FixArgs, int) { var cfg FixArgs - flags := c.Meta.FlagSet("fix", FlagSetNone) + flags := c.Meta.FlagSet("fix") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { diff --git a/command/fix_test.go b/command/fix_test.go index d4ae5ca07b4..1c916b56b2a 100644 --- a/command/fix_test.go +++ b/command/fix_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/flag-kv/flag.go b/command/flag-kv/flag.go index 0bf4b0086e1..4361545ab2f 100644 --- a/command/flag-kv/flag.go +++ b/command/flag-kv/flag.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-kv/flag_json.go b/command/flag-kv/flag_json.go index 9af9fe1da7d..290bb4aa837 100644 --- a/command/flag-kv/flag_json.go +++ b/command/flag-kv/flag_json.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-kv/flag_json_test.go b/command/flag-kv/flag_json_test.go index df5a99e641a..d22f3545fd5 100644 --- a/command/flag-kv/flag_json_test.go +++ b/command/flag-kv/flag_json_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-kv/flag_strings.go b/command/flag-kv/flag_strings.go index 2d63af9fa25..f99122ec971 100644 --- a/command/flag-kv/flag_strings.go +++ b/command/flag-kv/flag_strings.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-kv/flag_strings_test.go b/command/flag-kv/flag_strings_test.go index 48de4bb1880..721265d1e52 100644 --- a/command/flag-kv/flag_strings_test.go +++ b/command/flag-kv/flag_strings_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-kv/flag_test.go b/command/flag-kv/flag_test.go index 9f81d519262..5aed4ef33db 100644 --- a/command/flag-kv/flag_test.go +++ b/command/flag-kv/flag_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package kvflag import ( diff --git a/command/flag-slice/flag.go b/command/flag-slice/flag.go index 587b674fab1..7f8b9db269c 100644 --- a/command/flag-slice/flag.go +++ b/command/flag-slice/flag.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package sliceflag import "strings" diff --git a/command/flag-slice/flag_test.go b/command/flag-slice/flag_test.go index 61d8682b202..fd225889284 100644 --- a/command/flag-slice/flag_test.go +++ b/command/flag-slice/flag_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package sliceflag import ( diff --git a/command/fmt.go b/command/fmt.go index 2cab9bec094..3a70bcf187d 100644 --- a/command/fmt.go +++ b/command/fmt.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -25,7 +28,7 @@ func (c *FormatCommand) Run(args []string) int { func (c *FormatCommand) ParseArgs(args []string) (*FormatArgs, int) { var cfg FormatArgs - flags := c.Meta.FlagSet("format", FlagSetNone) + flags := c.Meta.FlagSet("format") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { diff --git a/command/fmt_test.go b/command/fmt_test.go index 0a9c0a6e75a..36497bc80dd 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -1,9 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -125,7 +127,7 @@ func TestFmt_Recursive(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tempDirectory := mustString(ioutil.TempDir(testDir, "test-dir-*")) + tempDirectory := mustString(os.MkdirTemp(testDir, "test-dir-*")) defer os.RemoveAll(tempDirectory) createFiles(tempDirectory, tt.alreadyPresentContent) @@ -175,3 +177,18 @@ func Test_fmt_pipe(t *testing.T) { }) } } + +const malformedTemplate = "test-fixtures/fmt_errs/malformed.pkr.hcl" + +func TestFmtParseError(t *testing.T) { + p := helperCommand(t, "fmt", malformedTemplate) + outs, err := p.CombinedOutput() + if err == nil { + t.Errorf("Expected failure to format file, but command did not fail") + } + strLogs := string(outs) + + if !strings.Contains(strLogs, "An argument or block definition is required here.") { + t.Errorf("Expected some diags about parse error, found none") + } +} diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index e149e1af0b2..08ffa767e99 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -26,42 +29,6 @@ import ( "github.com/zclconf/go-cty/cty" ) -type HCL2UpgradeCommand struct { - Meta -} - -func (c *HCL2UpgradeCommand) Run(args []string) int { - ctx, cleanup := handleTermInterrupt(c.Ui) - defer cleanup() - - cfg, ret := c.ParseArgs(args) - if ret != 0 { - return ret - } - - return c.RunContext(ctx, cfg) -} - -func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { - var cfg HCL2UpgradeArgs - flags := c.Meta.FlagSet("hcl2_upgrade", FlagSetNone) - flags.Usage = func() { c.Ui.Say(c.Help()) } - cfg.AddFlagSets(flags) - if err := flags.Parse(args); err != nil { - return &cfg, 1 - } - args = flags.Args() - if len(args) != 1 { - flags.Usage() - return &cfg, 1 - } - cfg.Path = args[0] - if cfg.OutputFile == "" { - cfg.OutputFile = cfg.Path + ".pkr.hcl" - } - return &cfg, 0 -} - const ( hcl2UpgradeFileHeader = `# This file was autogenerated by the 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We @@ -127,6 +94,60 @@ var ( strftime = false ) +// knownPlugins represent the HashiCorp maintained plugins the we can confidently +// construct a required plugins block for. +var knownPlugins = map[string]string{ + "amazon": "github.com/hashicorp/amazon", + "ansible": "github.com/hashicorp/ansible", + "azure": "github.com/hashicorp/azure", + "docker": "github.com/hashicorp/docker", + "googlecompute": "github.com/hashicorp/googlecompute", + "qemu": "github.com/hashicorp/qemu", + "vagrant": "github.com/hashicorp/vagrant", + "virtualbox": "github.com/hashicorp/virtualbox", + "vmware": "github.com/hashicorp/vmware", + "vsphere": "github.com/hashicorp/vsphere", +} + +// unknownPluginName represents any plugin not in knownPlugins or bundled into Packer +const unknownPluginName string = "unknown" + +type HCL2UpgradeCommand struct { + Meta +} + +func (c *HCL2UpgradeCommand) Run(args []string) int { + ctx, cleanup := handleTermInterrupt(c.Ui) + defer cleanup() + + cfg, ret := c.ParseArgs(args) + if ret != 0 { + return ret + } + + return c.RunContext(ctx, cfg) +} + +func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { + var cfg HCL2UpgradeArgs + flags := c.Meta.FlagSet("hcl2_upgrade") + flags.Usage = func() { c.Ui.Say(c.Help()) } + cfg.AddFlagSets(flags) + if err := flags.Parse(args); err != nil { + return &cfg, 1 + } + args = flags.Args() + if len(args) != 1 { + flags.Usage() + return &cfg, 1 + } + cfg.Path = args[0] + if cfg.OutputFile == "" { + cfg.OutputFile = cfg.Path + ".pkr.hcl" + } + return &cfg, 0 +} + type BlockParser interface { Parse(*template.Template) error Write(*bytes.Buffer) @@ -166,7 +187,6 @@ func (c *HCL2UpgradeCommand) RunContext(_ context.Context, cla *HCL2UpgradeArgs) tpl := core.Template // Parse blocks - packerBlock := &PackerParser{ WithAnnotations: cla.WithAnnotations, } @@ -794,16 +814,93 @@ type PackerParser struct { } func (p *PackerParser) Parse(tpl *template.Template) error { + reqPlugins, err := p.generateRequiredPluginsBlock(tpl) + if err != nil { + return err + } + + if tpl.MinVersion == "" && reqPlugins == nil { + return nil + } + + fileContent := hclwrite.NewEmptyFile() + body := fileContent.Body() + packerBody := body.AppendNewBlock("packer", nil).Body() + if tpl.MinVersion != "" { - fileContent := hclwrite.NewEmptyFile() - body := fileContent.Body() - packerBody := body.AppendNewBlock("packer", nil).Body() packerBody.SetAttributeValue("required_version", cty.StringVal(fmt.Sprintf(">= %s", tpl.MinVersion))) - p.out = fileContent.Bytes() } + + if reqPlugins != nil { + packerBody.AppendBlock(reqPlugins) + } + + p.out = fileContent.Bytes() + return nil } +func gatherPluginsFromTemplate(tpl *template.Template) []string { + plugins := map[string]struct{}{} + + for _, b := range tpl.Builders { + name := knownPluginComponent(b.Type) + if name == unknownPluginName { + continue + } + plugins[knownPlugins[name]] = struct{}{} + } + + for _, p := range tpl.Provisioners { + name := knownPluginComponent(p.Type) + if name == unknownPluginName { + continue + } + plugins[knownPlugins[name]] = struct{}{} + } + + for _, pps := range tpl.PostProcessors { + for _, pp := range pps { + name := knownPluginComponent(pp.Type) + if name == unknownPluginName { + continue + } + plugins[knownPlugins[name]] = struct{}{} + } + } + + if len(plugins) == 0 { + return nil + } + + retPlugins := make([]string, 0, len(plugins)) + for plugin := range plugins { + retPlugins = append(retPlugins, plugin) + } + + sort.Strings(retPlugins) + + return retPlugins +} + +func (p *PackerParser) generateRequiredPluginsBlock(tpl *template.Template) (*hclwrite.Block, error) { + plugins := gatherPluginsFromTemplate(tpl) + if len(plugins) == 0 { + return nil, nil + } + + reqPlugins := hclwrite.NewBlock("required_plugins", nil) + for _, plugin := range plugins { + pluginBlock := cty.ObjectVal(map[string]cty.Value{ + "source": cty.StringVal(plugin), + "version": cty.StringVal("~> 1"), + }) + reqPlugins.Body().SetAttributeValue(strings.Replace(plugin, "github.com/hashicorp/", "", 1), pluginBlock) + } + + return reqPlugins, nil +} + func (p *PackerParser) Write(out *bytes.Buffer) { if len(p.out) > 0 { if p.WithAnnotations { @@ -870,6 +967,9 @@ func (p *VariableParser) Parse(tpl *template.Template) error { p.localsOut = []byte{} } + if len(tpl.Variables) == 0 { + tpl.Variables = make(map[string]*template.Variable) + } // JSON supports variable declaration via var-files. // User variables that might be defined in a var-file // but not in the actual JSON template should be accounted for. @@ -1099,18 +1199,17 @@ type SourceParser struct { } func (p *SourceParser) Parse(tpl *template.Template) error { - var unknownBuilders []string if p.out == nil { p.out = []byte{} } + + var unknownBuilders []string for i, builderCfg := range p.Builders { sourcesContent := hclwrite.NewEmptyFile() body := sourcesContent.Body() - body.AppendNewline() - if !p.BuilderPlugins.Has(builderCfg.Type) { + if !p.BuilderPlugins.Has(builderCfg.Type) && knownPluginComponent(builderCfg.Type) == unknownPluginName { unknownBuilders = append(unknownBuilders, builderCfg.Type) - } if builderCfg.Name == "" || builderCfg.Name == builderCfg.Type { builderCfg.Name = fmt.Sprintf("autogenerated_%d", i+1) @@ -1123,9 +1222,11 @@ func (p *SourceParser) Parse(tpl *template.Template) error { p.out = append(p.out, transposeTemplatingCalls(sourcesContent.Bytes())...) } + // TODO update to output to stderr as opposed to having the command exit 1 if len(unknownBuilders) > 0 { return fmt.Errorf("unknown builder type(s): %v\n", unknownBuilders) } + return nil } @@ -1329,3 +1430,12 @@ func fixQuoting(old string) string { return string(body) } + +func knownPluginComponent(component string) string { + for prefix := range knownPlugins { + if strings.HasPrefix(component, prefix) { + return prefix + } + } + return unknownPluginName +} diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index 45da6a1cd59..9a3833f909e 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -1,7 +1,9 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -17,23 +19,25 @@ func Test_hcl2_upgrade(t *testing.T) { exitCode int exitEarly bool }{ - {folder: "unknown_builder", flags: []string{}, exitCode: 1}, - {folder: "complete", flags: []string{"-with-annotations"}}, - {folder: "without-annotations", flags: []string{}}, - {folder: "minimal", flags: []string{"-with-annotations"}}, - {folder: "source-name", flags: []string{"-with-annotations"}}, - {folder: "error-cleanup-provisioner", flags: []string{"-with-annotations"}}, - {folder: "aws-access-config", flags: []string{}}, - {folder: "escaping", flags: []string{}}, - {folder: "vsphere_linux_options_and_network_interface", exitCode: 1, flags: []string{}}, + {folder: "unknown_builder", flags: []string{}, exitCode: 1}, // warn for unknown components not tracked in knownPluginPrefixes + {folder: "complete", flags: []string{"-with-annotations"}, exitCode: 0}, + {folder: "without-annotations", flags: []string{}, exitCode: 0}, + {folder: "minimal", flags: []string{"-with-annotations"}, exitCode: 0}, + {folder: "source-name", flags: []string{"-with-annotations"}, exitCode: 0}, + {folder: "error-cleanup-provisioner", flags: []string{"-with-annotations"}, exitCode: 0}, + {folder: "aws-access-config", flags: []string{}, exitCode: 0}, + {folder: "escaping", flags: []string{}, exitCode: 0}, + {folder: "vsphere_linux_options_and_network_interface", flags: []string{}, exitCode: 0}, //do not warn for known uninstalled plugins components {folder: "nonexistent", flags: []string{}, exitCode: 1, exitEarly: true}, {folder: "placeholders", flags: []string{}, exitCode: 0}, {folder: "ami_test", flags: []string{}, exitCode: 0}, {folder: "azure_shg", flags: []string{}, exitCode: 0}, - {folder: "variables-only", flags: []string{}}, - {folder: "variables-with-variables", flags: []string{}}, - {folder: "complete-variables-with-template-engine", flags: []string{}}, + {folder: "variables-only", flags: []string{}, exitCode: 0}, + {folder: "variables-with-variables", flags: []string{}, exitCode: 0}, + {folder: "complete-variables-with-template-engine", flags: []string{}, exitCode: 0}, {folder: "undeclared-variables", flags: []string{}, exitCode: 0}, + {folder: "varfile-with-no-variables-block", flags: []string{}, exitCode: 0}, + {folder: "bundled-plugin-used", flags: []string{}, exitCode: 0}, } for _, tc := range tc { @@ -59,8 +63,8 @@ func Test_hcl2_upgrade(t *testing.T) { if tc.exitEarly { return } - expected := string(mustBytes(ioutil.ReadFile(expectedPath))) - actual := string(mustBytes(ioutil.ReadFile(outputPath))) + expected := string(mustBytes(os.ReadFile(expectedPath))) + actual := string(mustBytes(os.ReadFile(outputPath))) if diff := cmp.Diff(expected, actual); diff != "" { t.Fatalf("unexpected output: %s", diff) diff --git a/command/init.go b/command/init.go index e4a218d8601..2d8a1937759 100644 --- a/command/init.go +++ b/command/init.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -8,6 +11,7 @@ import ( "runtime" "strings" + gversion "github.com/hashicorp/go-version" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" @@ -34,7 +38,7 @@ func (c *InitCommand) Run(args []string) int { func (c *InitCommand) ParseArgs(args []string) (*InitArgs, int) { var cfg InitArgs - flags := c.Meta.FlagSet("init", 0) + flags := c.Meta.FlagSet("init") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -63,8 +67,16 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { return ret } + if len(reqs) == 0 { + c.Ui.Message(` +No plugins requirement found, make sure you reference a Packer config +containing a packer.required_plugins block. See +https://www.packer.io/docs/templates/hcl_templates/blocks/packer +for more info.`) + } + opts := plugingetter.ListInstallationsOptions{ - FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, + PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, @@ -109,67 +121,30 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { return 1 } - log.Printf("[TRACE] for plugin %s found %d matching installation(s)", pluginRequirement.Identifier, len(installs)) + if len(installs) > 0 { + if !cla.Force && !cla.Upgrade { + continue + } - if len(installs) > 0 && cla.Upgrade == false { - continue + if cla.Force && !cla.Upgrade { + pluginRequirement.VersionConstraints, _ = gversion.NewConstraint(fmt.Sprintf("=%s", installs[len(installs)-1].Version)) + } } newInstall, err := pluginRequirement.InstallLatest(plugingetter.InstallOptions{ - InFolders: opts.FromFolders, + PluginDirectory: opts.PluginDirectory, BinaryInstallationOptions: opts.BinaryInstallationOptions, Getters: getters, + Force: cla.Force, }) if err != nil { - if pluginRequirement.Implicit { - msg := fmt.Sprintf(` -Warning! At least one component used in your config file(s) has moved out of -Packer into the %q plugin. -For that reason, Packer init tried to install the latest version of the %s -plugin. Unfortunately, this failed : -%s`, - pluginRequirement.Identifier, - pluginRequirement.Identifier.Type, - err) - c.Ui.Say(msg) - } else { - c.Ui.Error(fmt.Sprintf("Failed getting the %q plugin:", pluginRequirement.Identifier)) - c.Ui.Error(err.Error()) - ret = 1 - } + c.Ui.Error(fmt.Sprintf("Failed getting the %q plugin:", pluginRequirement.Identifier)) + c.Ui.Error(err.Error()) + ret = 1 } if newInstall != nil { - if pluginRequirement.Implicit { - msg := fmt.Sprintf("Installed implicitly required plugin %s %s in %q", pluginRequirement.Identifier, newInstall.Version, newInstall.BinaryPath) - ui.Say(msg) - - warn := fmt.Sprintf(` -Warning, at least one component used in your config file(s) has moved out of -Packer into the %[2]q plugin and is now being implicitly required. -For more details on implicitly required plugins see https://packer.io/docs/commands/init#implicit-required-plugin - -To avoid any backward incompatible changes with your -config file you may want to lock the plugin version by pasting the following to your config: - -packer { - required_plugins { - %[1]s = { - source = "%[2]s" - version = "~> %[3]s" - } - } -} -`, - pluginRequirement.Identifier.Type, - pluginRequirement.Identifier, - newInstall.Version, - ) - ui.Error(warn) - continue - } msg := fmt.Sprintf("Installed plugin %s %s in %q", pluginRequirement.Identifier, newInstall.Version, newInstall.BinaryPath) ui.Say(msg) - } } return ret @@ -177,7 +152,7 @@ packer { func (*InitCommand) Help() string { helpText := ` -Usage: packer init [options] [config.pkr.hcl|folder/] +Usage: packer init [options] TEMPLATE Install all the missing plugins required in a Packer config. Note that Packer does not have a state. @@ -194,6 +169,8 @@ Options: version, if there is a new higher one. Note that this still takes into consideration the version constraint of the config. + -force Forces reinstallation of plugins, even if already + installed. ` return strings.TrimSpace(helpText) diff --git a/command/init_test.go b/command/init_test.go index 8697075757f..4a0c44be945 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1,3 +1,8 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +//go:build amd64 && (darwin || windows || linux) + package command import ( @@ -5,9 +10,9 @@ import ( "fmt" "log" "os" - "path/filepath" "runtime" "sort" + "strings" "testing" "github.com/google/go-cmp/cmp" @@ -56,71 +61,75 @@ func TestInitCommand_Run(t *testing.T) { cfg := &configDirSingleton{map[string]string{}} tests := []testCaseInit{ + // { + // // here we pre-write plugins with valid checksums, Packer will + // // see those as valid installations it did. + // // the directory hash before and after init should be the same, + // // that's a no-op. This also should do no GH query, so it is best + // // to always run it. + // // + // // Note: cannot work with plugin changes since the fake binary + // // isn't recognised as a potential plugin, so Packer always + // // installs it. + // "already-installed-no-op", + // nil, + // TestMetaFile(t), + // map[string]string{ + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64": "1", + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM": "a23e48324f2d9b912a89354945562b21b0ae99133b31d3132e2e6671aba8e085", + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe": "1.exe", + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM": "f1cf5865b35933b8e5195625ac8be44487b64007f223912cc5c1784e493e62b2", + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64": "1.out", + // "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM": "0a4e4e1d6de28054f64946782a5eb92edc663e980ae0780fcb3a614d27c58506", + // }, + // "h1:jQchMpyaQhkZYn0iguw6E6O4VCWxacYx2aR/RJJNLmo=", + // map[string]string{ + // `cfg.pkr.hcl`: ` + // packer { + // required_plugins { + // comment = { + // source = "github.com/hashicorp/hashicups" + // version = "v1.0.1" + // } + // } + // }`, + // }, + // cfg.dir("1_pkr_config"), + // cfg.dir("1_pkr_user_folder"), + // 0, + // nil, + // "h1:jQchMpyaQhkZYn0iguw6E6O4VCWxacYx2aR/RJJNLmo=", + // []func(t *testing.T, tc testCaseInit){ + // // test that a build will not work since plugins are broken for + // // this tests (they are not binaries). + // testBuild{want: 1}.fn, + // }, + // }, { // here we pre-write plugins with valid checksums, Packer will // see those as valid installations it did. - // the directory hash before and after init should be the same, - // that's a no-op. This also should do no GH query, so it is best - // to always run it. - "already-installed-no-op", - nil, - TestMetaFile(t), - map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", - }, - "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", - map[string]string{ - `cfg.pkr.hcl`: ` - packer { - required_plugins { - comment = { - source = "github.com/sylviamoss/comment" - version = "v0.2.018" - } - } - }`, - }, - cfg.dir("1_pkr_config"), - cfg.dir("1_pkr_user_folder"), - 0, - nil, - "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", - []func(t *testing.T, tc testCaseInit){ - // test that a build will not work since plugins are broken for - // this tests (they are not binaries). - testBuild{want: 1}.fn, - }, - }, - { - // here we pre-write plugins with valid checksums, Packer will - // see those as valid installations it did. - // But because we require version 0.2.19, we will upgrade. + // But because we require version 1.0.2, we will upgrade. "already-installed-upgrade", []func(t *testing.T, tc testCaseInit){ skipInitTestUnlessEnVar(acctest.TestEnvVar).fn, }, TestMetaFile(t), map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64": "1", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM": "a23e48324f2d9b912a89354945562b21b0ae99133b31d3132e2e6671aba8e085", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe": "1.exe", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM": "f1cf5865b35933b8e5195625ac8be44487b64007f223912cc5c1784e493e62b2", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64": "1.out", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM": "0a4e4e1d6de28054f64946782a5eb92edc663e980ae0780fcb3a614d27c58506", }, - "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", + "h1:jQchMpyaQhkZYn0iguw6E6O4VCWxacYx2aR/RJJNLmo=", map[string]string{ `cfg.pkr.hcl`: ` packer { required_plugins { - comment = { - source = "github.com/sylviamoss/comment" - version = "v0.2.019" + hashicups = { + source = "github.com/hashicorp/hashicups" + version = "v1.0.2" } } }`, @@ -131,11 +140,9 @@ func TestInitCommand_Run(t *testing.T) { `, `build.pkr.hcl`: ` build { - sources = ["source.null.test"] - provisioner "comment" { - comment = "Begin ¡" - ui = true - bubble_text = true + sources = ["null.test"] + provisioner "hashicups-toppings" { + toppings = ["sugar"] # Takes 5 seconds in the current state } } `, @@ -144,27 +151,27 @@ func TestInitCommand_Run(t *testing.T) { cfg.dir("2_pkr_user_folder"), 0, []string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM", map[string]string{ - "darwin": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", - "linux": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", - "windows": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", + "darwin": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_darwin_amd64_SHA256SUM", + "linux": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_linux_amd64_SHA256SUM", + "windows": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_windows_amd64.exe_SHA256SUM", }[runtime.GOOS], map[string]string{ - "darwin": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64", - "linux": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", - "windows": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe", + "darwin": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_darwin_amd64", + "linux": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_linux_amd64", + "windows": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_windows_amd64.exe", }[runtime.GOOS], }, map[string]string{ - "darwin": "h1:ORwcCYUx8z/5n/QvuTJo2vrgKpfJA4AxlNg1G9/BCDI=", - "linux": "h1:CGym0+Nd0LEANgzqL0wx/LDjRL8bYwlpZ0HajPJo/hs=", - "windows": "h1:ag0/C1YjP7KoEDYOiJHE0K+lhFgs0tVgjriWCXVT1fg=", + "darwin": "h1:ptsMLvUeLsMMeXDJP2PWKAKIkE+kWVhOkhNYOYPJbSE=", + "linux": "h1:ivCmyQ+/qNXfBsyeccGsa7P5232q7MUZk83B3yl80Ms=", + "windows": "h1:BeqAUnyGiBg9fVuf9Cn9a4h91bgdZ2U4kV7EuQKefcM=", }[runtime.GOOS], []func(t *testing.T, tc testCaseInit){ // test that a build will work as the plugin was just installed @@ -197,100 +204,6 @@ func TestInitCommand_Run(t *testing.T) { "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", nil, }, - { - "manually-installed-single-component-plugin-works", - []func(t *testing.T, tc testCaseInit){ - skipInitTestUnlessEnVar(acctest.TestEnvVar).fn, - initTestGoGetPlugin{ - Src: "https://github.com/azr/packer-provisioner-comment/releases/download/v1.0.0/" + - "packer-provisioner-comment_v1.0.0_" + runtime.GOOS + "_" + runtime.GOARCH + ".zip", - Dst: filepath.Join(cfg.dir("4_pkr_config"), defaultConfigDir, "plugins"), - }.fn, - }, - TestMetaFile(t), - nil, - map[string]string{ - "darwin": "h1:nVebbXToeehPUASRbvV9M4qaA9+UgoR5AMp7LjTrSBk=", - "linux": "h1:/U5vdeMtOpRKNu0ld8+qf4t6WC+BsfCQ6JRo9Dh/khI=", - "windows": "h1:0nkdNCjtTHTgBNkzVKG++/VYmWAvq/o236GGTxrIf/Q=", - }[runtime.GOOS], - map[string]string{ - `source.pkr.hcl`: ` - source "null" "test" { - communicator = "none" - } - `, - `build.pkr.hcl`: ` - build { - sources = ["source.null.test"] - provisioner "comment" { - comment = "Begin ¡" - ui = true - bubble_text = true - } - } - `, - }, - cfg.dir("4_pkr_config"), - cfg.dir("4_pkr_user_folder"), - 0, - nil, - map[string]string{ - "darwin": "h1:nVebbXToeehPUASRbvV9M4qaA9+UgoR5AMp7LjTrSBk=", - "linux": "h1:/U5vdeMtOpRKNu0ld8+qf4t6WC+BsfCQ6JRo9Dh/khI=", - "windows": "h1:0nkdNCjtTHTgBNkzVKG++/VYmWAvq/o236GGTxrIf/Q=", - }[runtime.GOOS], - []func(*testing.T, testCaseInit){ - testBuild{want: 0}.fn, - }, - }, - { - "manually-installed-single-component-plugin-old-api-fails", - []func(t *testing.T, tc testCaseInit){ - skipInitTestUnlessEnVar(acctest.TestEnvVar).fn, - initTestGoGetPlugin{ - Src: "https://github.com/azr/packer-provisioner-comment/releases/download/v0.0.0/" + - "packer-provisioner-comment_v0.0.0_" + runtime.GOOS + "_" + runtime.GOARCH + ".zip", - Dst: filepath.Join(cfg.dir("5_pkr_config"), defaultConfigDir, "plugins"), - }.fn, - }, - TestMetaFile(t), - nil, - map[string]string{ - "darwin": "h1:gW4gzpDXeu3cDrXgHJj9iWAN7Pyak626Gq8Bu2LG1kY=", - "linux": "h1:wQ2H5+J7VXwQzqR9DgpWtjhw9OVEFbcKQL6dgm/+zwo=", - "windows": "h1:BqRdW3c5H1PZ2Q4DOaKWja21v3nDlY5Nn8kqahhHGSw=", - }[runtime.GOOS], - map[string]string{ - `source.pkr.hcl`: ` - source "null" "test" { - communicator = "none" - } - `, - `build.pkr.hcl`: ` - build { - sources = ["source.null.test"] - provisioner "comment" { - comment = "Begin ¡" - ui = true - bubble_text = true - } - } - `, - }, - cfg.dir("5_pkr_config"), - cfg.dir("5_pkr_user_folder"), - 0, - nil, - map[string]string{ - "darwin": "h1:gW4gzpDXeu3cDrXgHJj9iWAN7Pyak626Gq8Bu2LG1kY=", - "linux": "h1:wQ2H5+J7VXwQzqR9DgpWtjhw9OVEFbcKQL6dgm/+zwo=", - "windows": "h1:BqRdW3c5H1PZ2Q4DOaKWja21v3nDlY5Nn8kqahhHGSw=", - }[runtime.GOOS], - []func(*testing.T, testCaseInit){ - testBuild{want: 1}.fn, - }, - }, { "unsupported-non-github-source-address", []func(t *testing.T, tc testCaseInit){ @@ -356,7 +269,7 @@ func TestInitCommand_Run(t *testing.T) { t.Fatalf("Failed to discover plugins: %s", err) } - c.CoreConfig.Components.PluginConfig.KnownPluginFolders = []string{tt.packerConfigDir} + c.CoreConfig.Components.PluginConfig.PluginDirectory = tt.packerConfigDir if got := c.Run(args); got != tt.want { t.Errorf("InitCommand.Run() = %v, want %v", got, tt.want) } @@ -409,3 +322,55 @@ func (opts initTestGoGetPlugin) fn(t *testing.T, _ testCaseInit) { t.Fatalf("get: %v", err) } } + +// TestInitCmd aims to test the init command, with output validation +func TestInitCmd(t *testing.T) { + tests := []struct { + name string + args []string + expectedCode int + outputCheck func(string, string) error + }{ + { + name: "Ensure init warns on template without required_plugin blocks", + args: []string{ + testFixture("hcl", "build-var-in-pp.pkr.hcl"), + }, + expectedCode: 0, + outputCheck: func(stdout, stderr string) error { + if !strings.Contains(stdout, "No plugins requirement found") { + return fmt.Errorf("command should warn about plugin requirements not found, but did not") + } + return nil + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &InitCommand{ + Meta: TestMetaFile(t), + } + + exitCode := c.Run(tt.args) + if exitCode != tt.expectedCode { + t.Errorf("process exit code mismatch: expected %d, got %d", + tt.expectedCode, + exitCode) + } + + out, stderr := GetStdoutAndErrFromTestMeta(t, c.Meta) + err := tt.outputCheck(out, stderr) + if err != nil { + if len(out) != 0 { + t.Logf("command stdout: %q", out) + } + + if len(stderr) != 0 { + t.Logf("command stderr: %q", stderr) + } + t.Error(err.Error()) + } + }) + } +} diff --git a/command/inspect.go b/command/inspect.go index a930c6ee678..7e5ed316650 100644 --- a/command/inspect.go +++ b/command/inspect.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -25,7 +28,7 @@ func (c *InspectCommand) Run(args []string) int { func (c *InspectCommand) ParseArgs(args []string) (*InspectArgs, int) { var cfg InspectArgs - flags := c.Meta.FlagSet("inspect", FlagSetVars) + flags := c.Meta.FlagSet("inspect") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { diff --git a/command/inspect_test.go b/command/inspect_test.go index 4bb594d07f2..f417b4cdc09 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/meta.go b/command/meta.go index 3f166595604..9807df78b5d 100644 --- a/command/meta.go +++ b/command/meta.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -17,16 +20,6 @@ import ( "github.com/hashicorp/packer/version" ) -// FlagSetFlags is an enum to define what flags are present in the -// default FlagSet returned by Meta.FlagSet -type FlagSetFlags uint - -const ( - FlagSetNone FlagSetFlags = 0 - FlagSetBuildFilter FlagSetFlags = 1 << iota - FlagSetVars -) - // Meta contains the meta-options and functionality that nearly every // Packer command inherits. type Meta struct { @@ -67,11 +60,8 @@ func (m *Meta) Core(tpl *template.Template, cla *MetaArgs) (*packer.Core, error) return core, nil } -// FlagSet returns a FlagSet with the common flags that every -// command implements. The exact behavior of FlagSet can be configured -// using the flags as the second parameter, for example to disable -// build settings on the commands that don't handle builds. -func (m *Meta) FlagSet(n string, _ FlagSetFlags) *flag.FlagSet { +// FlagSet returns a FlagSet with Packer SDK Ui support built-in +func (m *Meta) FlagSet(n string) *flag.FlagSet { f := flag.NewFlagSet(n, flag.ContinueOnError) // Create an io.Writer that writes to our Ui properly for errors. @@ -117,9 +107,11 @@ func (m *Meta) GetConfig(cla *MetaArgs) (packer.Handler, int) { switch cfgType { case ConfigTypeHCL2: + packer.CheckpointReporter.SetTemplateType(packer.HCL2Template) // TODO(azr): allow to pass a slice of files here. return m.GetConfigFromHCL(cla) default: + packer.CheckpointReporter.SetTemplateType(packer.JSONTemplate) // TODO: uncomment once we've polished HCL a bit more. // c.Ui.Say(`Legacy JSON Configuration Will Be Used. // The template will be parsed in the legacy configuration style. This style diff --git a/command/plugins.go b/command/plugins.go index 7ec25538115..6bc286dd19c 100644 --- a/command/plugins.go +++ b/command/plugins.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/plugins_install.go b/command/plugins_install.go index a744b7d9ece..59e197a3f6a 100644 --- a/command/plugins_install.go +++ b/command/plugins_install.go @@ -1,20 +1,31 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( + "bytes" "context" "crypto/sha256" + "encoding/json" + "flag" "fmt" + "io" + "os" + "os/exec" + "path/filepath" "runtime" "strings" "github.com/hashicorp/go-version" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/packer-plugin-sdk/plugin" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/hcl2template/addrs" "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" "github.com/hashicorp/packer/packer/plugin-getter/github" pkrversion "github.com/hashicorp/packer/version" - "github.com/mitchellh/cli" ) type PluginsInstallCommand struct { @@ -27,7 +38,7 @@ func (c *PluginsInstallCommand) Synopsis() string { func (c *PluginsInstallCommand) Help() string { helpText := ` -Usage: packer plugins install [] +Usage: packer plugins install [OPTIONS...] [] This command will install the most recent compatible Packer plugin matching version constraint. @@ -35,6 +46,15 @@ Usage: packer plugins install [] installed. Ex: packer plugins install github.com/hashicorp/happycloud v1.2.3 + packer plugins install --path ./packer-plugin-happycloud "github.com/hashicorp/happycloud" + +Options: + -path Install the plugin from a locally-sourced plugin binary. + This installs the plugin where a normal invocation would, but will + not try to download it from a remote location, and instead + install the binary in the Packer plugins path. This option cannot + be specified with a version constraint. + -force Forces reinstallation of plugins, even if already installed. ` return strings.TrimSpace(helpText) @@ -44,16 +64,64 @@ func (c *PluginsInstallCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() - return c.RunContext(ctx, args) + cmdArgs, ret := c.ParseArgs(args) + if ret != 0 { + return ret + } + + return c.RunContext(ctx, cmdArgs) } -func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []string) int { +type PluginsInstallArgs struct { + MetaArgs + PluginIdentifier string + PluginPath string + Version string + Force bool +} + +func (pa *PluginsInstallArgs) AddFlagSets(flags *flag.FlagSet) { + flags.StringVar(&pa.PluginPath, "path", "", "install the binary specified by path as a Packer plugin.") + flags.BoolVar(&pa.Force, "force", false, "force installation of the specified plugin, even if already installed.") + pa.MetaArgs.AddFlagSets(flags) +} + +func (c *PluginsInstallCommand) ParseArgs(args []string) (*PluginsInstallArgs, int) { + pa := &PluginsInstallArgs{} + + flags := c.Meta.FlagSet("plugins install") + flags.Usage = func() { c.Ui.Say(c.Help()) } + pa.AddFlagSets(flags) + err := flags.Parse(args) + if err != nil { + c.Ui.Error(fmt.Sprintf("Failed to parse options: %s", err)) + return pa, 1 + } + + args = flags.Args() if len(args) < 1 || len(args) > 2 { - return cli.RunResultHelp + c.Ui.Error(fmt.Sprintf("Invalid arguments, expected either 1 or 2 positional arguments, got %d", len(args))) + flags.Usage() + return pa, 1 + } + + if len(args) == 2 { + pa.Version = args[1] } + if pa.Path != "" && pa.Version != "" { + c.Ui.Error("Invalid arguments: a version cannot be specified when using --path to install a local plugin binary") + flags.Usage() + return pa, 1 + } + + pa.PluginIdentifier = args[0] + return pa, 0 +} + +func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *PluginsInstallArgs) int { opts := plugingetter.ListInstallationsOptions{ - FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, + PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, @@ -64,21 +132,29 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []stri }, }, } + if runtime.GOOS == "windows" { + opts.BinaryInstallationOptions.Ext = ".exe" + } - plugin, diags := addrs.ParsePluginSourceString(args[0]) + plugin, diags := addrs.ParsePluginSourceString(args.PluginIdentifier) if diags.HasErrors() { c.Ui.Error(diags.Error()) return 1 } + // If we did specify a binary to install the plugin from, we ignore + // the Github-based getter in favour of installing it directly. + if args.PluginPath != "" { + return c.InstallFromBinary(opts, plugin, args) + } + // a plugin requirement that matches them all pluginRequirement := plugingetter.Requirement{ Identifier: plugin, - Implicit: false, } - if len(args) > 1 { - constraints, err := version.NewConstraint(args[1]) + if args.Version != "" { + constraints, err := version.NewConstraint(args.Version) if err != nil { c.Ui.Error(err.Error()) return 1 @@ -86,10 +162,6 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []stri pluginRequirement.VersionConstraints = constraints } - if runtime.GOOS == "windows" && opts.Ext == "" { - opts.BinaryInstallationOptions.Ext = ".exe" - } - getters := []plugingetter.Getter{ &github.Getter{ // In the past some terraform plugins downloads were blocked from a @@ -104,9 +176,10 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []stri } newInstall, err := pluginRequirement.InstallLatest(plugingetter.InstallOptions{ - InFolders: opts.FromFolders, + PluginDirectory: opts.PluginDirectory, BinaryInstallationOptions: opts.BinaryInstallationOptions, Getters: getters, + Force: args.Force, }) if err != nil { @@ -126,3 +199,161 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []stri return 0 } + +func (c *PluginsInstallCommand) InstallFromBinary(opts plugingetter.ListInstallationsOptions, pluginIdentifier *addrs.Plugin, args *PluginsInstallArgs) int { + pluginDir := opts.PluginDirectory + + var err error + + args.PluginPath, err = filepath.Abs(args.PluginPath) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to transform path", + Detail: fmt.Sprintf("Failed to transform the given path to an absolute one: %s", err), + }}) + } + + s, err := os.Stat(args.PluginPath) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unable to find plugin to promote", + Detail: fmt.Sprintf("The plugin %q failed to be opened because of an error: %s", args.PluginIdentifier, err), + }}) + } + + if s.IsDir() { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Plugin to promote cannot be a directory", + Detail: "The packer plugin promote command can only install binaries, not directories", + }}) + } + + describeCmd, err := exec.Command(args.PluginPath, "describe").Output() + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to describe the plugin", + Detail: fmt.Sprintf("Packer failed to run %s describe: %s", args.PluginPath, err), + }}) + } + + var desc plugin.SetDescription + if err := json.Unmarshal(describeCmd, &desc); err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to decode plugin describe info", + Detail: fmt.Sprintf("'%s describe' produced information that Packer couldn't decode: %s", args.PluginPath, err), + }}) + } + + semver, err := version.NewSemver(desc.Version) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid version", + Detail: fmt.Sprintf("Plugin's reported version (%q) is not semver-compatible: %s", desc.Version, err), + }}) + } + if semver.Prerelease() != "" && semver.Prerelease() != "dev" { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid version", + Detail: fmt.Sprintf("Packer can only install plugin releases with this command (ex: 1.0.0) or development pre-releases (ex: 1.0.0-dev), the binary's reported version is %q", desc.Version), + }}) + } + + pluginBinary, err := os.Open(args.PluginPath) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to open plugin binary", + Detail: fmt.Sprintf("Failed to open plugin binary from %q: %s", args.PluginPath, err), + }}) + } + + pluginContents := bytes.Buffer{} + _, err = io.Copy(&pluginContents, pluginBinary) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to read plugin binary's contents", + Detail: fmt.Sprintf("Failed to read plugin binary from %q: %s", args.PluginPath, err), + }}) + } + _ = pluginBinary.Close() + + // At this point, we know the provided binary behaves correctly with + // describe, so it's very likely to be a plugin, let's install it. + installDir := filepath.Join( + pluginDir, + filepath.Join(pluginIdentifier.Parts()...), + ) + err = os.MkdirAll(installDir, 0755) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to create output directory", + Detail: fmt.Sprintf("The installation directory %q failed to be created because of an error: %s", installDir, err), + }}) + } + + // Remove metadata from plugin path + noMetaVersion := semver.Core().String() + if semver.Prerelease() != "" { + noMetaVersion = fmt.Sprintf("%s-%s", noMetaVersion, semver.Prerelease()) + } + + outputPrefix := fmt.Sprintf( + "packer-plugin-%s_v%s_%s", + pluginIdentifier.Name(), + noMetaVersion, + desc.APIVersion, + ) + binaryPath := filepath.Join( + installDir, + outputPrefix+opts.BinaryInstallationOptions.FilenameSuffix(), + ) + + outputPlugin, err := os.OpenFile(binaryPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to create plugin binary", + Detail: fmt.Sprintf("Failed to create plugin binary at %q: %s", binaryPath, err), + }}) + } + defer outputPlugin.Close() + + _, err = outputPlugin.Write(pluginContents.Bytes()) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to copy plugin binary's contents", + Detail: fmt.Sprintf("Failed to copy plugin binary from %q to %q: %s", args.PluginPath, binaryPath, err), + }}) + } + + // We'll install the SHA256SUM file alongside the plugin, based on the + // contents of the plugin being passed. + shasum := sha256.New() + _, _ = shasum.Write(pluginContents.Bytes()) + + shasumPath := fmt.Sprintf("%s_SHA256SUM", binaryPath) + shaFile, err := os.OpenFile(shasumPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0644) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to create plugin SHA256SUM file", + Detail: fmt.Sprintf("Failed to create SHA256SUM file at %q: %s", shasumPath, err), + }}) + } + defer shaFile.Close() + + fmt.Fprintf(shaFile, "%x", shasum.Sum([]byte{})) + c.Ui.Say(fmt.Sprintf("Successfully installed plugin %s from %s to %s", args.PluginIdentifier, args.PluginPath, binaryPath)) + + return 0 +} diff --git a/command/plugins_install_test.go b/command/plugins_install_test.go index 24239218076..2df9e7a1da9 100644 --- a/command/plugins_install_test.go +++ b/command/plugins_install_test.go @@ -1,3 +1,8 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +//go:build amd64 && (darwin || windows || linux) + package command import ( @@ -8,7 +13,6 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/mitchellh/cli" "golang.org/x/mod/sumdb/dirhash" ) @@ -33,57 +37,57 @@ func TestPluginsInstallCommand_Run(t *testing.T) { name: "already-installed-no-op", Meta: TestMetaFile(t), inPluginFolder: map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64": "1", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe": "1.exe", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64": "1.out", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", }, - expectedPackerConfigDirHashBeforeInstall: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", + expectedPackerConfigDirHashBeforeInstall: "h1:sxhWsXwLkxCO1fm86oO2QIg7ImLdfw9pmXa0hKHIeUw=", packerConfigDir: cfg.dir("1_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.18"}, + pluginSourceArgs: []string{"github.com/hashicorp/hashicups", "v1.0.1"}, want: 0, dirFiles: nil, - expectedPackerConfigDirHashAfterInstall: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", + expectedPackerConfigDirHashAfterInstall: "h1:sxhWsXwLkxCO1fm86oO2QIg7ImLdfw9pmXa0hKHIeUw=", }, { name: "install-newer-version", Meta: TestMetaFile(t), inPluginFolder: map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64": "1", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe": "1.exe", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64": "1.out", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", }, - expectedPackerConfigDirHashBeforeInstall: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", + expectedPackerConfigDirHashBeforeInstall: "h1:sxhWsXwLkxCO1fm86oO2QIg7ImLdfw9pmXa0hKHIeUw=", packerConfigDir: cfg.dir("2_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.19"}, + pluginSourceArgs: []string{"github.com/hashicorp/hashicups", "v1.0.2"}, want: 0, dirFiles: []string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_darwin_amd64_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_linux_amd64_SHA256SUM", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe", + "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.1_x5.0_windows_amd64.exe_SHA256SUM", map[string]string{ - "darwin": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", - "linux": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", - "windows": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", + "darwin": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_darwin_amd64_SHA256SUM", + "linux": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_linux_amd64_SHA256SUM", + "windows": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_windows_amd64.exe_SHA256SUM", }[runtime.GOOS], map[string]string{ - "darwin": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64", - "linux": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", - "windows": "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe", + "darwin": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_darwin_amd64", + "linux": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_linux_amd64", + "windows": "github.com/hashicorp/hashicups/packer-plugin-hashicups_v1.0.2_x5.0_windows_amd64.exe", }[runtime.GOOS], }, expectedPackerConfigDirHashAfterInstall: map[string]string{ - "darwin": "h1:ORwcCYUx8z/5n/QvuTJo2vrgKpfJA4AxlNg1G9/BCDI=", - "linux": "h1:CGym0+Nd0LEANgzqL0wx/LDjRL8bYwlpZ0HajPJo/hs=", - "windows": "h1:ag0/C1YjP7KoEDYOiJHE0K+lhFgs0tVgjriWCXVT1fg=", + "darwin": "h1:itQ7rZfZarDHmnajkzfxBVMxZ0wBou4I6FNX/ysHggA=", + "linux": "h1:+zgZKpRpVofVgjny13tZNonPBcNNxWF741iYdTE9UCg=", + "windows": "h1:scuTEDpGEWJ0LaKL7ETZ8o7wdW6dJUzV+eg/2shQ+tQ=", }[runtime.GOOS], }, { @@ -92,7 +96,7 @@ func TestPluginsInstallCommand_Run(t *testing.T) { inPluginFolder: nil, expectedPackerConfigDirHashBeforeInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("3_pkr_plugins_config"), - pluginSourceArgs: []string{"example.com/sylviamoss/comment", "v0.2.19"}, + pluginSourceArgs: []string{"example.com/hashicorp/hashicups", "v0.2.19"}, want: 1, dirFiles: nil, expectedPackerConfigDirHashAfterInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", @@ -103,8 +107,8 @@ func TestPluginsInstallCommand_Run(t *testing.T) { inPluginFolder: nil, expectedPackerConfigDirHashBeforeInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("4_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.18", "github.com/sylviamoss/comment", "v0.2.19"}, - want: cli.RunResultHelp, + pluginSourceArgs: []string{"github.com/hashicorp/hashicups", "v0.2.18", "github.com/hashicorp/hashicups", "v0.2.19"}, + want: 1, dirFiles: nil, expectedPackerConfigDirHashAfterInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", }, @@ -115,7 +119,7 @@ func TestPluginsInstallCommand_Run(t *testing.T) { expectedPackerConfigDirHashBeforeInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("5_pkr_plugins_config"), pluginSourceArgs: []string{}, - want: cli.RunResultHelp, + want: 1, dirFiles: nil, expectedPackerConfigDirHashAfterInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", }, @@ -147,7 +151,7 @@ func TestPluginsInstallCommand_Run(t *testing.T) { t.Fatalf("Failed to discover plugins: %s", err) } - c.CoreConfig.Components.PluginConfig.KnownPluginFolders = []string{tt.packerConfigDir} + c.CoreConfig.Components.PluginConfig.PluginDirectory = tt.packerConfigDir if got := c.Run(tt.pluginSourceArgs); got != tt.want { t.Errorf("PluginsInstallCommand.Run() = %v, want %v", got, tt.want) } diff --git a/command/plugins_installed.go b/command/plugins_installed.go index 96ddc65d89c..9652572da2f 100644 --- a/command/plugins_installed.go +++ b/command/plugins_installed.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -40,7 +43,7 @@ func (c *PluginsInstalledCommand) Run(args []string) int { func (c *PluginsInstalledCommand) RunContext(buildCtx context.Context) int { opts := plugingetter.ListInstallationsOptions{ - FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, + PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, @@ -61,7 +64,6 @@ func (c *PluginsInstalledCommand) RunContext(buildCtx context.Context) int { Accessor: "", VersionConstraints: nil, Identifier: nil, - Implicit: false, } installations, err := allPlugins.ListInstallations(opts) diff --git a/command/plugins_remove.go b/command/plugins_remove.go index a0258ee522f..1fc17416a8e 100644 --- a/command/plugins_remove.go +++ b/command/plugins_remove.go @@ -1,14 +1,22 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( "context" "crypto/sha256" + "fmt" + "log" "os" + "path/filepath" "runtime" "strings" "github.com/hashicorp/go-version" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template/addrs" + "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" "github.com/mitchellh/cli" ) @@ -25,11 +33,19 @@ func (c *PluginsRemoveCommand) Help() string { helpText := ` Usage: packer plugins remove [] - This command will remove all Packer plugins matching the version constraint - for the current OS and architecture. - When the version is omitted all installed versions will be removed. + This command will remove one or more installed Packer plugins. + + To remove a plugin matching a version contraint for the current OS and architecture. + + packer plugins remove github.com/hashicorp/happycloud v1.2.3 + + To remove all versions of a plugin for the current OS and architecture omit the version constraint. + + packer plugins remove github.com/hashicorp/happycloud - Ex: packer plugins remove github.com/hashicorp/happycloud v1.2.3 + To remove a single plugin binary from the Packer plugin directory specify the absolute path to an installed binary. This syntax does not allow for version matching. + + packer plugins remove ~/.config/plugins/github.com/hashicorp/happycloud/packer-plugin-happycloud_v1.0.0_x5.0_linux_amd64 ` return strings.TrimSpace(helpText) @@ -42,13 +58,77 @@ func (c *PluginsRemoveCommand) Run(args []string) int { return c.RunContext(ctx, args) } +// deletePluginBinary removes a local plugin binary, and its related checksum file. +func deletePluginBinary(pluginPath string) error { + if err := os.Remove(pluginPath); err != nil { + return err + } + shasumFile := fmt.Sprintf("%s_SHA256SUM", pluginPath) + + if _, err := os.Stat(shasumFile); err != nil { + log.Printf("[INFO] No SHA256SUM file to remove for the plugin, ignoring.") + return nil + } + + return os.Remove(shasumFile) +} + func (c *PluginsRemoveCommand) RunContext(buildCtx context.Context, args []string) int { if len(args) < 1 || len(args) > 2 { return cli.RunResultHelp } + pluginDir, err := packer.PluginFolder() + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{ + &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to get the plugin directory", + Detail: fmt.Sprintf( + "The directory in which plugins are installed could not be fetched from the environment. This is likely a Packer bug. Error: %s", + err), + }, + }) + } + + if filepath.IsAbs(args[0]) { + if len(args) != 1 { + c.Ui.Error("Unsupported: no version constraint may be specified with a local plugin path.\n") + return cli.RunResultHelp + } + + if !strings.Contains(args[0], pluginDir) { + return writeDiags(c.Ui, nil, hcl.Diagnostics{ + &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid plugin location", + Detail: fmt.Sprintf( + "The path %q is not under the plugin directory inferred by Packer (%s) and will not be removed.", + args[0], + pluginDir), + }, + }) + } + + log.Printf("will delete plugin located at %q", args[0]) + err := deletePluginBinary(args[0]) + if err != nil { + return writeDiags(c.Ui, nil, hcl.Diagnostics{ + &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to delete plugin", + Detail: fmt.Sprintf("The plugin %q failed to be deleted with the following error: %q", args[0], err), + }, + }) + } + + c.Ui.Say(args[0]) + + return 0 + } + opts := plugingetter.ListInstallationsOptions{ - FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, + PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, @@ -71,7 +151,6 @@ func (c *PluginsRemoveCommand) RunContext(buildCtx context.Context, args []strin // a plugin requirement that matches them all pluginRequirement := plugingetter.Requirement{ Identifier: plugin, - Implicit: false, } if len(args) > 1 { @@ -89,12 +168,22 @@ func (c *PluginsRemoveCommand) RunContext(buildCtx context.Context, args []strin return 1 } for _, installation := range installations { - if err := os.Remove(installation.BinaryPath); err != nil { - c.Ui.Error(err.Error()) - return 1 + err := deletePluginBinary(installation.BinaryPath) + if err != nil { + c.Ui.Error(fmt.Sprintf("Failed to remove plugin %q: %q", installation.BinaryPath, err)) + continue } c.Ui.Message(installation.BinaryPath) } + if len(installations) == 0 { + errMsg := fmt.Sprintf("No installed plugin found matching the plugin constraints %s", args[0]) + if len(args) == 2 { + errMsg = fmt.Sprintf("%s %s", errMsg, args[1]) + } + c.Ui.Error(errMsg) + return 1 + } + return 0 } diff --git a/command/plugins_remove_test.go b/command/plugins_remove_test.go deleted file mode 100644 index 6c5872b52a9..00000000000 --- a/command/plugins_remove_test.go +++ /dev/null @@ -1,219 +0,0 @@ -package command - -import ( - "log" - "os" - "runtime" - "sort" - "testing" - - "github.com/google/go-cmp/cmp" - "golang.org/x/mod/sumdb/dirhash" -) - -type testCasePluginsRemove struct { - name string - Meta Meta - inPluginFolder map[string]string - expectedPackerConfigDirHashBeforeRemove string - packerConfigDir string - pluginSourceArgs []string - want int - dirFiles []string - expectedPackerConfigDirHashAfterRemove string -} - -func TestPluginsRemoveCommand_Run(t *testing.T) { - - cfg := &configDirSingleton{map[string]string{}} - - tests := []testCasePluginsRemove{ - { - name: "version-not-installed-no-op", - Meta: TestMetaFile(t), - inPluginFolder: map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", - }, - expectedPackerConfigDirHashBeforeRemove: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", - packerConfigDir: cfg.dir("1_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.19"}, - want: 0, - dirFiles: nil, - expectedPackerConfigDirHashAfterRemove: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", - }, - { - name: "remove-specific-version", - Meta: TestMetaFile(t), - inPluginFolder: map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", - }, - expectedPackerConfigDirHashBeforeRemove: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", - packerConfigDir: cfg.dir("2_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.18"}, - want: 0, - dirFiles: map[string][]string{ - "darwin": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - }, - "linux": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - }, - "windows": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - }, - }[runtime.GOOS], - expectedPackerConfigDirHashAfterRemove: map[string]string{ - "darwin": "h1:IMsWPgJZzRhn80t78zE45003gFKN6EXq562/wjaCrKE=", - "linux": "h1:Ez7SU1GZLvNGJmoTm9PeFIwHv9fvEgzZAZTMl6874iM=", - "windows": "h1:RrXlhy9tG9Bi3c2aOzjx/FLLyVNQolcY+MAr4V1etRI=", - }[runtime.GOOS], - }, - { - name: "remove-all-installed-versions", - Meta: TestMetaFile(t), - inPluginFolder: map[string]string{ - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64": "1", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe": "1.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM": "07d8453027192ee0c4120242e6e84e2ca2328b8e0f506e2f818a1a5b82790a0b", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64": "1.out", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM": "59031c50e0dfeedfde2b4e9445754804dce3f29e4efa737eead0ca9b4f5b85a5", - }, - expectedPackerConfigDirHashBeforeRemove: "h1:IEvr6c46+Uk776Hnzy04PuXqnyHGKnnEvIJ713cv0iU=", - packerConfigDir: cfg.dir("2_pkr_plugins_config"), - pluginSourceArgs: []string{"github.com/sylviamoss/comment"}, - want: 0, - dirFiles: map[string][]string{ - "darwin": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", - }, - "linux": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", - }, - "windows": { - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", - "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", - }, - }[runtime.GOOS], - expectedPackerConfigDirHashAfterRemove: map[string]string{ - "darwin": "h1:FBBGQ1SKngN9PvF98awv8TZcKaS+CKzJmQoS7vuSXqY=", - "linux": "h1:F8lN4Q3sv45ig8r1BLOS/wFuQQy6tSfmuIJf3fnbD5k=", - "windows": "h1:DOfH6WR1eJNLJcaL8ar8j1xu2WB7Jcn6oG7LGEvNBZI=", - }[runtime.GOOS], - }, - { - name: "no-installed-binaries", - Meta: TestMetaFile(t), - inPluginFolder: nil, - expectedPackerConfigDirHashBeforeRemove: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - packerConfigDir: cfg.dir("3_pkr_plugins_config"), - pluginSourceArgs: []string{"example.com/sylviamoss/comment", "v0.2.19"}, - want: 0, - dirFiles: nil, - expectedPackerConfigDirHashAfterRemove: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - log.Printf("starting %s", tt.name) - log.Printf("%#v", tt) - t.Cleanup(func() { - _ = os.RemoveAll(tt.packerConfigDir) - }) - t.Setenv("PACKER_CONFIG_DIR", tt.packerConfigDir) - createFiles(tt.packerConfigDir, tt.inPluginFolder) - - hash, err := dirhash.HashDir(tt.packerConfigDir, "", dirhash.DefaultHash) - if err != nil { - t.Fatalf("HashDir: %v", err) - } - if diff := cmp.Diff(tt.expectedPackerConfigDirHashBeforeRemove, hash); diff != "" { - t.Errorf("unexpected dir hash before plugins remove: +found -expected %s", diff) - } - - c := &PluginsRemoveCommand{ - Meta: tt.Meta, - } - - c.CoreConfig.Components.PluginConfig.KnownPluginFolders = []string{tt.packerConfigDir} - if got := c.Run(tt.pluginSourceArgs); got != tt.want { - t.Errorf("PluginsRemoveCommand.Run() = %v, want %v", got, tt.want) - } - - if tt.dirFiles != nil { - dirFiles, err := dirhash.DirFiles(tt.packerConfigDir, "") - if err != nil { - t.Fatalf("DirFiles: %v", err) - } - sort.Strings(tt.dirFiles) - sort.Strings(dirFiles) - if diff := cmp.Diff(tt.dirFiles, dirFiles); diff != "" { - t.Errorf("found files differ: %v", diff) - } - } - - hash, err = dirhash.HashDir(tt.packerConfigDir, "", dirhash.DefaultHash) - if err != nil { - t.Fatalf("HashDir: %v", err) - } - if diff := cmp.Diff(tt.expectedPackerConfigDirHashAfterRemove, hash); diff != "" { - t.Errorf("unexpected dir hash after plugins remove: %s", diff) - } - }) - } -} diff --git a/command/plugins_required.go b/command/plugins_required.go index f3573f1ed07..7ba301dcfcf 100644 --- a/command/plugins_required.go +++ b/command/plugins_required.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -51,7 +54,7 @@ func (c *PluginsRequiredCommand) Run(args []string) int { func (c *PluginsRequiredCommand) ParseArgs(args []string) (*PluginsRequiredArgs, int) { var cfg PluginsRequiredArgs - flags := c.Meta.FlagSet("plugins required", 0) + flags := c.Meta.FlagSet("plugins required") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -81,7 +84,7 @@ func (c *PluginsRequiredCommand) RunContext(buildCtx context.Context, cla *Plugi } opts := plugingetter.ListInstallationsOptions{ - FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, + PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, diff --git a/command/signal.go b/command/signal.go index f8eb2b18d73..a47ac58aa22 100644 --- a/command/signal.go +++ b/command/signal.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/test-fixtures/fmt_errs/malformed.pkr.hcl b/command/test-fixtures/fmt_errs/malformed.pkr.hcl new file mode 100644 index 00000000000..78bff46e974 --- /dev/null +++ b/command/test-fixtures/fmt_errs/malformed.pkr.hcl @@ -0,0 +1,14 @@ +variable "region" { + type =string +} + +invalid + +source "amazon-ebs" "example" { + region = var.region +} + +build { + sources = ["source.amazon-ebs.example"] +} + diff --git a/command/test-fixtures/hcl/test_except_manifest.pkr.hcl b/command/test-fixtures/hcl/test_except_manifest.pkr.hcl new file mode 100644 index 00000000000..bf9f7ad29ad --- /dev/null +++ b/command/test-fixtures/hcl/test_except_manifest.pkr.hcl @@ -0,0 +1,9 @@ +source "null" "test" { + communicator = "none" +} + +build { + sources = ["null.test"] + + post-processor "manifest" {} +} diff --git a/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl index 72ccb20383c..8a72f3551b0 100644 --- a/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } +} source "amazon-ebs" "autogenerated_1" { run_tags = { diff --git a/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl index 9ccbe9dc2fc..8c34e4735b3 100644 --- a/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl @@ -1,5 +1,11 @@ packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } variable "aws_access_key" { diff --git a/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl index 089ce80a781..15d5a4ad33e 100644 --- a/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + azure = { + source = "github.com/hashicorp/azure" + version = "~> 1" + } + } +} source "azure-arm" "autogenerated_1" { shared_image_gallery { diff --git a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl new file mode 100644 index 00000000000..cce175b01bd --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl @@ -0,0 +1,29 @@ +packer { + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + ansible = { + source = "github.com/hashicorp/ansible" + version = "~> 1" + } + googlecompute = { + source = "github.com/hashicorp/googlecompute" + version = "~> 1" + } + } +} + +source "amazon-ebs" "autogenerated_1" { +} + +build { + sources = ["source.amazon-ebs.autogenerated_1"] + + provisioner "ansible-local" { + } + + post-processor "googlecompute-import" { + } +} diff --git a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json new file mode 100644 index 00000000000..917c7105e5a --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json @@ -0,0 +1,11 @@ +{ + "builders": [{ + "type": "amazon-ebs" + }], + "provisioners": [{ + "type": "ansible-local" + }], + "post-processors": [{ + "type": "googlecompute-import" + }] +} diff --git a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl index bcc669b6438..a6800c67210 100644 --- a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl index 2802e8e18b0..316293c39e7 100644 --- a/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl index b5adf8ef55b..c4145f7d145 100644 --- a/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/expected.pkr.hcl new file mode 100644 index 00000000000..c2e5767f86a --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/expected.pkr.hcl @@ -0,0 +1,33 @@ + +variable "ssh_host" { + type = string +} + +variable "ssh_password" { + type = string +} + +variable "ssh_username" { + type = string +} + +variable "version_tag" { + type = string +} + +source "null" "autogenerated_1" { + communicator = "ssh" + ssh_host = "${var.ssh_host}" + ssh_password = "${var.ssh_password}" + ssh_username = "${var.ssh_username}" +} + +build { + sources = ["source.null.autogenerated_1"] + + provisioner "shell-local" { + inline = ["echo ${var.version_tag} > provision.txt"] + pause_before = "20s" + } + +} diff --git a/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/input.json b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/input.json new file mode 100644 index 00000000000..bb901d095d9 --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/input.json @@ -0,0 +1,18 @@ +{ + "builders": [ + { + "type": "null", + "communicator": "ssh", + "ssh_host": "{{ user `ssh_host` }}", + "ssh_password": "{{ user `ssh_password` }}", + "ssh_username": "{{ user `ssh_username` }}" + } + ], + "provisioners": [ + { + "pause_before": "20s", + "type": "shell-local", + "inline": [ "echo {{ user `version_tag` }} > provision.txt" ] + } + ] +} diff --git a/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/variables.json b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/variables.json new file mode 100644 index 00000000000..4e4b93c64b8 --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/varfile-with-no-variables-block/variables.json @@ -0,0 +1,6 @@ +{ + "version_tag": "1.0.0", + "ssh_host": "localhost", + "ssh_username": "packer", + "ssh_password": "packer" +} diff --git a/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl index a160d0c9eed..16c3c21ca24 100644 --- a/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + vsphere = { + source = "github.com/hashicorp/vsphere" + version = "~> 1" + } + } +} source "vsphere-clone" "autogenerated_1" { RAM_reserve_all = false diff --git a/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl index e332c21e08f..414ebc55a96 100644 --- a/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl @@ -1,5 +1,11 @@ packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } variable "aws_access_key" { diff --git a/command/test-fixtures/provisioners/provisioner-only-except.json b/command/test-fixtures/provisioners/provisioner-only-except.json new file mode 100644 index 00000000000..6eee4238795 --- /dev/null +++ b/command/test-fixtures/provisioners/provisioner-only-except.json @@ -0,0 +1,37 @@ +{ + "builders": [ + { + "type": "null", + "communicator": "none" + }, + { + "type": "null", + "name": "packer", + "communicator": "none" + } + ], + "provisioners": [ + { + "type": "shell-local", + "inline": ["echo packer provisioner {{build_name}} and {{build_type}}"], + "only": ["packer"] + }, + { + "type": "shell-local", + "inline": ["echo null provisioner {{build_name}} and {{build_type}}"], + "except": ["packer"] + } + ], + "post-processors": [ + { + "type": "shell-local", + "inline": ["echo packer post-processor {{build_name}} and {{build_type}}"], + "only": ["packer"] + }, + { + "type": "shell-local", + "inline": ["echo null post-processor {{build_name}} and {{build_type}}"], + "except": ["packer"] + } + ] +} diff --git a/command/test-fixtures/provisioners/provisioner-only-except.pkr.hcl b/command/test-fixtures/provisioners/provisioner-only-except.pkr.hcl new file mode 100644 index 00000000000..81189653877 --- /dev/null +++ b/command/test-fixtures/provisioners/provisioner-only-except.pkr.hcl @@ -0,0 +1,31 @@ +source "null" "packer" { + communicator = "none" +} + +source "null" "other" { + communicator = "none" +} + +build { + sources = ["sources.null.packer", "null.other"] + + provisioner "shell-local" { + inline = ["echo packer provisioner {{build_name}} and {{build_type}}"] + only = ["null.packer"] + } + + provisioner "shell-local" { + inline = ["echo other provisioner {{build_name}} and {{build_type}}"] + except = ["null.packer"] + } + + post-processor "shell-local" { + inline = ["echo packer post-processor {{build_name}} and {{build_type}}"] + only = ["null.packer"] + } + + post-processor "shell-local" { + inline = ["echo other post-processor {{build_name}} and {{build_type}}"] + except = ["null.packer"] + } +} diff --git a/command/test_utils.go b/command/test_utils.go index 9ad5f6111a2..852343085cc 100644 --- a/command/test_utils.go +++ b/command/test_utils.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/utils.go b/command/utils.go index 1123a2f0a6a..359a96b9726 100644 --- a/command/utils.go +++ b/command/utils.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/utils_test.go b/command/utils_test.go index dfb0a036b42..cf5e2dbe3e7 100644 --- a/command/utils_test.go +++ b/command/utils_test.go @@ -1,7 +1,9 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( - "io/ioutil" "log" "os" "path/filepath" @@ -20,7 +22,7 @@ func createFiles(dir string, content map[string]string) { if err := os.MkdirAll(filepath.Dir(contentPath), 0777); err != nil { panic(err) } - if err := ioutil.WriteFile(contentPath, []byte(content), 0666); err != nil { + if err := os.WriteFile(contentPath, []byte(content), 0666); err != nil { panic(err) } log.Printf("created tmp file: %s", contentPath) @@ -36,7 +38,7 @@ func (c *configDirSingleton) dir(key string) string { if v, exists := c.dirs[key]; exists { return v } - c.dirs[key] = mustString(ioutil.TempDir("", "pkr-test-cfg-dir-"+key)) + c.dirs[key] = mustString(os.MkdirTemp("", "pkr-test-cfg-dir-"+key)) return c.dirs[key] } diff --git a/command/validate.go b/command/validate.go index 657d71ebc7d..47d88a901ba 100644 --- a/command/validate.go +++ b/command/validate.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( @@ -28,7 +31,7 @@ func (c *ValidateCommand) Run(args []string) int { func (c *ValidateCommand) ParseArgs(args []string) (*ValidateArgs, int) { var cfg ValidateArgs - flags := c.Meta.FlagSet("validate", FlagSetBuildFilter|FlagSetVars) + flags := c.Meta.FlagSet("validate") flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -45,6 +48,11 @@ func (c *ValidateCommand) ParseArgs(args []string) (*ValidateArgs, int) { } func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int { + // Set the release only flag if specified as argument + // + // This deactivates the capacity for Packer to load development binaries. + c.CoreConfig.Components.PluginConfig.ReleasesOnly = cla.ReleaseOnly + // By default we want to inform users of undeclared variables when validating but not during build time. cla.MetaArgs.WarnOnUndeclaredVar = true if cla.NoWarnUndeclaredVar { @@ -62,7 +70,13 @@ func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int return 0 } - diags := packerStarter.Initialize(packer.InitializeOptions{ + diags := packerStarter.DetectPluginBinaries() + ret = writeDiags(c.Ui, nil, diags) + if ret != 0 { + return ret + } + + diags = packerStarter.Initialize(packer.InitializeOptions{ SkipDatasourcesExecution: !cla.EvaluateDatasources, }) ret = writeDiags(c.Ui, nil, diags) @@ -70,7 +84,7 @@ func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int return ret } - _, _, diags = packerStarter.GetBuilds(packer.GetBuildsOptions{ + _, diags = packerStarter.GetBuilds(packer.GetBuildsOptions{ Only: cla.Only, Except: cla.Except, }) @@ -109,6 +123,7 @@ Options: -var-file=path JSON or HCL2 file containing user variables, can be used multiple times. -no-warn-undeclared-var Disable warnings for user variable files containing undeclared variables. -evaluate-datasources Evaluate data sources during validation (HCL2 only, may incur costs); Defaults to false. + -ignore-prerelease-plugins Disable the loading of prerelease plugin binaries (x.y.z-dev). ` return strings.TrimSpace(helpText) diff --git a/command/validate_test.go b/command/validate_test.go index 3a2c6b20abf..5b9da04d78b 100644 --- a/command/validate_test.go +++ b/command/validate_test.go @@ -1,6 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( + "fmt" "path/filepath" "testing" @@ -341,3 +345,42 @@ func TestValidateCommand_VarFilesDisableWarnOnUndeclared(t *testing.T) { }) } } + +func TestValidateCommand_ShowLineNumForMissing(t *testing.T) { + tt := []struct { + path string + exitCode int + extraArgs []string + }{ + {path: filepath.Join(testFixture("validate-invalid"), "missing_build_block.pkr.hcl"), exitCode: 1}, + } + + for _, tc := range tt { + t.Run(tc.path, func(t *testing.T) { + c := &ValidateCommand{ + Meta: TestMetaFile(t), + } + tc := tc + args := tc.extraArgs + args = append(args, tc.path) + if code := c.Run(args); code != tc.exitCode { + fatalCommand(t, c.Meta) + } + + stdout, stderr := GetStdoutAndErrFromTestMeta(t, c.Meta) + expected := fmt.Sprintf(`Error: Unknown source file.cho + + on %s line 6: + (source code not available) + +Known: [file.chocolate] + + +`, tc.path) + if diff := cmp.Diff(expected, stderr); diff != "" { + t.Errorf("Unexpected output: %s", diff) + } + t.Log(stdout) + }) + } +} diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go deleted file mode 100644 index 5ddf9edc1f1..00000000000 --- a/command/vendored_plugins.go +++ /dev/null @@ -1,203 +0,0 @@ -package command - -import ( - packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - - // Previously core-bundled components, split into their own plugins but - // still vendored with Packer for now. Importing as library instead of - // forcing use of packer init, until packer v1.8.0 - - digitaloceanbuilder "github.com/digitalocean/packer-plugin-digitalocean/builder/digitalocean" - digitaloceanimportpostprocessor "github.com/digitalocean/packer-plugin-digitalocean/post-processor/digitalocean-import" - alicloudecsbuilder "github.com/hashicorp/packer-plugin-alicloud/builder/ecs" - alicloudimportpostprocessor "github.com/hashicorp/packer-plugin-alicloud/post-processor/alicloud-import" - amazonchrootbuilder "github.com/hashicorp/packer-plugin-amazon/builder/chroot" - amazonebsbuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebs" - amazonebssurrogatebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebssurrogate" - amazonebsvolumebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebsvolume" - amazoninstancebuilder "github.com/hashicorp/packer-plugin-amazon/builder/instance" - amazonamidatasource "github.com/hashicorp/packer-plugin-amazon/datasource/ami" - amazonsecretsmanagerdatasource "github.com/hashicorp/packer-plugin-amazon/datasource/secretsmanager" - anazibimportpostprocessor "github.com/hashicorp/packer-plugin-amazon/post-processor/import" - ansibleprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible" - ansiblelocalprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible-local" - azurearmbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/arm" - azurechrootbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/chroot" - azuredtlbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/dtl" - azuredtlartifactprovisioner "github.com/hashicorp/packer-plugin-azure/provisioner/azure-dtlartifact" - chefclientprovisioner "github.com/hashicorp/packer-plugin-chef/provisioner/chef-client" - chefsoloprovisioner "github.com/hashicorp/packer-plugin-chef/provisioner/chef-solo" - cloudstackbuilder "github.com/hashicorp/packer-plugin-cloudstack/builder/cloudstack" - convergeprovisioner "github.com/hashicorp/packer-plugin-converge/provisioner/converge" - dockerbuilder "github.com/hashicorp/packer-plugin-docker/builder/docker" - dockerimportpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-import" - dockerpushpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-push" - dockersavepostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-save" - dockertagpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag" - googlecomputebuilder "github.com/hashicorp/packer-plugin-googlecompute/builder/googlecompute" - googlecomputeexportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-export" - googlecomputeimportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-import" - hcloudbuilder "github.com/hashicorp/packer-plugin-hcloud/builder/hcloud" - hyperonebuilder "github.com/hashicorp/packer-plugin-hyperone/builder/hyperone" - hypervisobuilder "github.com/hashicorp/packer-plugin-hyperv/builder/hyperv/iso" - hypervvmcxbuilder "github.com/hashicorp/packer-plugin-hyperv/builder/hyperv/vmcx" - inspecprovisioner "github.com/hashicorp/packer-plugin-inspec/provisioner/inspec" - jdcloudbuilder "github.com/hashicorp/packer-plugin-jdcloud/builder/jdcloud" - linodebuilder "github.com/hashicorp/packer-plugin-linode/builder/linode" - lxcbuilder "github.com/hashicorp/packer-plugin-lxc/builder/lxc" - lxdbuilder "github.com/hashicorp/packer-plugin-lxd/builder/lxd" - ncloudbuilder "github.com/hashicorp/packer-plugin-ncloud/builder/ncloud" - oneandonebuilder "github.com/hashicorp/packer-plugin-oneandone/builder/oneandone" - openstackbuilder "github.com/hashicorp/packer-plugin-openstack/builder/openstack" - parallelsisobuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/iso" - parallelspvmbuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/pvm" - profitbricksbuilder "github.com/hashicorp/packer-plugin-profitbricks/builder/profitbricks" - proxmoxclone "github.com/hashicorp/packer-plugin-proxmox/builder/proxmox/clone" - proxmoxiso "github.com/hashicorp/packer-plugin-proxmox/builder/proxmox/iso" - puppetmasterlessprovisioner "github.com/hashicorp/packer-plugin-puppet/provisioner/puppet-masterless" - puppetserverprovisioner "github.com/hashicorp/packer-plugin-puppet/provisioner/puppet-server" - qemubuilder "github.com/hashicorp/packer-plugin-qemu/builder/qemu" - saltmasterlessprovisioner "github.com/hashicorp/packer-plugin-salt/provisioner/salt-masterless" - tencentcloudcvmbuilder "github.com/hashicorp/packer-plugin-tencentcloud/builder/tencentcloud/cvm" - tritonbuilder "github.com/hashicorp/packer-plugin-triton/builder/triton" - uclouduhostbuilder "github.com/hashicorp/packer-plugin-ucloud/builder/ucloud/uhost" - ucloudimportpostprocessor "github.com/hashicorp/packer-plugin-ucloud/post-processor/ucloud-import" - vagrantbuilder "github.com/hashicorp/packer-plugin-vagrant/builder/vagrant" - vagrantpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant" - vagrantcloudpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant-cloud" - virtualboxisobuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/iso" - virtualboxovfbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/ovf" - virtualboxvmbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/vm" - vmwareisobuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso" - vmwarevmxbuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx" - vsphereclonebuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone" - vsphereisobuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso" - vspherepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" - vspheretemplatepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template" - yandexbuilder "github.com/hashicorp/packer-plugin-yandex/builder/yandex" - yandexexportpostprocessor "github.com/hashicorp/packer-plugin-yandex/post-processor/yandex-export" - yandeximportpostprocessor "github.com/hashicorp/packer-plugin-yandex/post-processor/yandex-import" -) - -// VendoredDatasources are datasource components that were once bundled with the -// Packer core, but are now being imported from their counterpart plugin repos -var VendoredDatasources = map[string]packersdk.Datasource{ - "amazon-ami": new(amazonamidatasource.Datasource), - "amazon-secretsmanager": new(amazonsecretsmanagerdatasource.Datasource), -} - -// VendoredBuilders are builder components that were once bundled with the -// Packer core, but are now being imported from their counterpart plugin repos -var VendoredBuilders = map[string]packersdk.Builder{ - "alicloud-ecs": new(alicloudecsbuilder.Builder), - "amazon-ebs": new(amazonebsbuilder.Builder), - "amazon-chroot": new(amazonchrootbuilder.Builder), - "amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder), - "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), - "amazon-instance": new(amazoninstancebuilder.Builder), - "azure-arm": new(azurearmbuilder.Builder), - "azure-chroot": new(azurechrootbuilder.Builder), - "azure-dtl": new(azuredtlbuilder.Builder), - "cloudstack": new(cloudstackbuilder.Builder), - "digitalocean": new(digitaloceanbuilder.Builder), - "docker": new(dockerbuilder.Builder), - "googlecompute": new(googlecomputebuilder.Builder), - "hcloud": new(hcloudbuilder.Builder), - "hyperv-iso": new(hypervisobuilder.Builder), - "hyperv-vmcx": new(hypervvmcxbuilder.Builder), - "hyperone": new(hyperonebuilder.Builder), - "jdcloud": new(jdcloudbuilder.Builder), - "linode": new(linodebuilder.Builder), - "lxc": new(lxcbuilder.Builder), - "lxd": new(lxdbuilder.Builder), - "ncloud": new(ncloudbuilder.Builder), - "oneandone": new(oneandonebuilder.Builder), - "openstack": new(openstackbuilder.Builder), - "profitbricks": new(profitbricksbuilder.Builder), - "proxmox": new(proxmoxiso.Builder), - "proxmox-iso": new(proxmoxiso.Builder), - "proxmox-clone": new(proxmoxclone.Builder), - "parallels-iso": new(parallelsisobuilder.Builder), - "parallels-pvm": new(parallelspvmbuilder.Builder), - "qemu": new(qemubuilder.Builder), - "tencentcloud-cvm": new(tencentcloudcvmbuilder.Builder), - "triton": new(tritonbuilder.Builder), - "ucloud-uhost": new(uclouduhostbuilder.Builder), - "vagrant": new(vagrantbuilder.Builder), - "vsphere-clone": new(vsphereclonebuilder.Builder), - "vsphere-iso": new(vsphereisobuilder.Builder), - "virtualbox-iso": new(virtualboxisobuilder.Builder), - "virtualbox-ovf": new(virtualboxovfbuilder.Builder), - "virtualbox-vm": new(virtualboxvmbuilder.Builder), - "vmware-iso": new(vmwareisobuilder.Builder), - "vmware-vmx": new(vmwarevmxbuilder.Builder), - "yandex": new(yandexbuilder.Builder), -} - -// VendoredProvisioners are provisioner components that were once bundled with the -// Packer core, but are now being imported from their counterpart plugin repos -var VendoredProvisioners = map[string]packersdk.Provisioner{ - "azure-dtlartifact": new(azuredtlartifactprovisioner.Provisioner), - "ansible": new(ansibleprovisioner.Provisioner), - "ansible-local": new(ansiblelocalprovisioner.Provisioner), - "chef-client": new(chefclientprovisioner.Provisioner), - "chef-solo": new(chefsoloprovisioner.Provisioner), - "converge": new(convergeprovisioner.Provisioner), - "inspec": new(inspecprovisioner.Provisioner), - "puppet-masterless": new(puppetmasterlessprovisioner.Provisioner), - "puppet-server": new(puppetserverprovisioner.Provisioner), - "salt-masterless": new(saltmasterlessprovisioner.Provisioner), -} - -// VendoredPostProcessors are post-processor components that were once bundled with the -// Packer core, but are now being imported from their counterpart plugin repos -var VendoredPostProcessors = map[string]packersdk.PostProcessor{ - "alicloud-import": new(alicloudimportpostprocessor.PostProcessor), - "amazon-import": new(anazibimportpostprocessor.PostProcessor), - "digitalocean-import": new(digitaloceanimportpostprocessor.PostProcessor), - "docker-import": new(dockerimportpostprocessor.PostProcessor), - "docker-push": new(dockerpushpostprocessor.PostProcessor), - "docker-save": new(dockersavepostprocessor.PostProcessor), - "docker-tag": new(dockertagpostprocessor.PostProcessor), - "googlecompute-export": new(googlecomputeexportpostprocessor.PostProcessor), - "googlecompute-import": new(googlecomputeimportpostprocessor.PostProcessor), - "ucloud-import": new(ucloudimportpostprocessor.PostProcessor), - "vagrant": new(vagrantpostprocessor.PostProcessor), - "vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor), - "vsphere-template": new(vspheretemplatepostprocessor.PostProcessor), - "vsphere": new(vspherepostprocessor.PostProcessor), - "yandex-export": new(yandexexportpostprocessor.PostProcessor), - "yandex-import": new(yandeximportpostprocessor.PostProcessor), -} - -// Upon init lets load up any plugins that were vendored manually into the default -// set of plugins. -func init() { - for k, v := range VendoredDatasources { - if _, ok := Datasources[k]; ok { - continue - } - Datasources[k] = v - } - - for k, v := range VendoredBuilders { - if _, ok := Builders[k]; ok { - continue - } - Builders[k] = v - } - - for k, v := range VendoredProvisioners { - if _, ok := Provisioners[k]; ok { - continue - } - Provisioners[k] = v - } - - for k, v := range VendoredPostProcessors { - if _, ok := PostProcessors[k]; ok { - continue - } - PostProcessors[k] = v - } -} diff --git a/command/version.go b/command/version.go index b5f3ad523a6..976221efed5 100644 --- a/command/version.go +++ b/command/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/command/version_test.go b/command/version_test.go index 2a645690faf..60f97f4f38e 100644 --- a/command/version_test.go +++ b/command/version_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package command import ( diff --git a/commands.go b/commands.go index 631b943c2cc..5891eba84ee 100644 --- a/commands.go +++ b/commands.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( @@ -26,6 +29,12 @@ func init() { }, nil }, + "execute": func() (cli.Command, error) { + return &command.ExecuteCommand{ + Meta: *CommandMeta, + }, nil + }, + "fix": func() (cli.Command, error) { return &command.FixCommand{ Meta: *CommandMeta, @@ -56,12 +65,6 @@ func init() { }, nil }, - "plugin": func() (cli.Command, error) { - return &command.PluginCommand{ - Meta: *CommandMeta, - }, nil - }, - "plugins": func() (cli.Command, error) { return &command.PluginsCommand{ Meta: *CommandMeta, @@ -104,5 +107,36 @@ func init() { CheckFunc: commandVersionCheck, }, nil }, + + // plugin is essentially an alias to the plugins command + // + // It is not meant to be documented or used outside of simple + // typos, as it's easy to write plugin instead of plugins, so + // we opted not to error, but silently alias the two writings. + "plugin": func() (cli.Command, error) { + return &command.PluginsCommand{ + Meta: *CommandMeta, + }, nil + }, + "plugin installed": func() (cli.Command, error) { + return &command.PluginsInstalledCommand{ + Meta: *CommandMeta, + }, nil + }, + "plugin install": func() (cli.Command, error) { + return &command.PluginsInstallCommand{ + Meta: *CommandMeta, + }, nil + }, + "plugin remove": func() (cli.Command, error) { + return &command.PluginsRemoveCommand{ + Meta: *CommandMeta, + }, nil + }, + "plugin required": func() (cli.Command, error) { + return &command.PluginsRequiredCommand{ + Meta: *CommandMeta, + }, nil + }, } } diff --git a/config.go b/config.go index e352de0fb89..c28d7931bb1 100644 --- a/config.go +++ b/config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( @@ -150,7 +153,7 @@ func (c *config) discoverInternalComponents() error { for builder := range command.Builders { builder := builder if !c.Plugins.Builders.Has(builder) { - bin := fmt.Sprintf("%s%splugin%spacker-builder-%s", + bin := fmt.Sprintf("%s%sexecute%spacker-builder-%s", packerPath, PACKERSPACE, PACKERSPACE, builder) c.Plugins.Builders.Set(builder, func() (packersdk.Builder, error) { return c.Plugins.Client(bin).Builder() @@ -161,7 +164,7 @@ func (c *config) discoverInternalComponents() error { for provisioner := range command.Provisioners { provisioner := provisioner if !c.Plugins.Provisioners.Has(provisioner) { - bin := fmt.Sprintf("%s%splugin%spacker-provisioner-%s", + bin := fmt.Sprintf("%s%sexecute%spacker-provisioner-%s", packerPath, PACKERSPACE, PACKERSPACE, provisioner) c.Plugins.Provisioners.Set(provisioner, func() (packersdk.Provisioner, error) { return c.Plugins.Client(bin).Provisioner() @@ -172,7 +175,7 @@ func (c *config) discoverInternalComponents() error { for postProcessor := range command.PostProcessors { postProcessor := postProcessor if !c.Plugins.PostProcessors.Has(postProcessor) { - bin := fmt.Sprintf("%s%splugin%spacker-post-processor-%s", + bin := fmt.Sprintf("%s%sexecute%spacker-post-processor-%s", packerPath, PACKERSPACE, PACKERSPACE, postProcessor) c.Plugins.PostProcessors.Set(postProcessor, func() (packersdk.PostProcessor, error) { return c.Plugins.Client(bin).PostProcessor() @@ -183,7 +186,7 @@ func (c *config) discoverInternalComponents() error { for dataSource := range command.Datasources { dataSource := dataSource if !c.Plugins.DataSources.Has(dataSource) { - bin := fmt.Sprintf("%s%splugin%spacker-datasource-%s", + bin := fmt.Sprintf("%s%sexecute%spacker-datasource-%s", packerPath, PACKERSPACE, PACKERSPACE, dataSource) c.Plugins.DataSources.Set(dataSource, func() (packersdk.Datasource, error) { return c.Plugins.Client(bin).Datasource() diff --git a/config_test.go b/config_test.go index 9224b259c16..ac101010c3c 100644 --- a/config_test.go +++ b/config_test.go @@ -1,9 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -119,7 +121,7 @@ func TestLoadExternalComponentsFromConfig_onlyProvisioner(t *testing.T) { func TestLoadSingleComponent(t *testing.T) { // .exe will work everyone for testing purpose, but mostly here to help Window's test runs. - tmpFile, err := ioutil.TempFile(".", "packer-builder-*.exe") + tmpFile, err := os.CreateTemp(".", "packer-builder-*.exe") if err != nil { t.Fatalf("failed to create test file with error: %s", err) } @@ -157,7 +159,7 @@ func TestLoadSingleComponent(t *testing.T) { } func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { - dir, err := ioutil.TempDir("", dirname) + dir, err := os.MkdirTemp("", dirname) if err != nil { return "", nil, nil, fmt.Errorf("failed to create temporary test directory: %v", err) } @@ -185,7 +187,9 @@ func generateFakePlugins(dirname string, pluginNames []string) (string, []string return dir, plugins, cleanUpFunc, nil } -/* generateFakePackerConfigData creates a collection of mock plugins along with a basic packerconfig. +/* + generateFakePackerConfigData creates a collection of mock plugins along with a basic packerconfig. + The return packerConfigData is a valid packerconfig file that can be used for configuring external plugins, cleanUpFunc is a function that should be called for cleaning up any generated mock data. This function will only clean up if there is an error, on successful runs the caller is responsible for cleaning up the data via cleanUpFunc(). diff --git a/contrib/zsh-completion/_packer b/contrib/zsh-completion/_packer index 7653991ea67..4b361b4aaf7 100644 --- a/contrib/zsh-completion/_packer +++ b/contrib/zsh-completion/_packer @@ -3,8 +3,13 @@ _packer () { local -a sub_commands && sub_commands=( 'build:Build image(s) from template' + 'console:Creates a console for testing variable interpolation' 'fix:Fixes templates from old versions of packer' + 'fmt:Rewrites HCL2 config files to canonical format' + 'hcl2_upgrade:Transform a JSON template into an HCL2 configuration' + 'init:Install missing plugins or upgrade plugins' 'inspect:See components of a template' + 'plugins:Interact with Packer plugins and catalog' 'validate:Check that a template is valid' 'version:Prints the Packer version' ) @@ -19,14 +24,39 @@ _packer () { '-only=[(foo,bar,baz) Only build the given builds by name.]' '-parallel=[(false) Disable parallelization. (Default: false)]' '-parallel-builds=[(0) Number of builds to run in parallel. (Defaults to infinite: 0)]' + '-timestamp-ui[Enable prefixing of each ui output with an RFC3339 timestamp]' '-var[("key=value") Variable for templates, can be used multiple times.]' '-var-file=[(path) JSON or HCL2 file containing user variables.]' + '-warn-on-undeclared-var[Display warnings for user variable files containing undeclared variables.]' + '(-)*:files:_files -g "*pkr.{hcl,json}"' + ) + + local -a console_arguments && console_arguments=( + '-var[("key=value") Variable for templates, can be used multiple times.]' + '-var-file=[(path) JSON or HCL2 file containing user variables.]' + '(-)*:files:_files -g "*pkr.{hcl,json}"' + ) + + local -a fix_arguments && fix_arguments=( '(-)*:files:_files -g "*.json"' ) + local -a fmt_arguments && fmt_arguments=( + '-check[Check if the input is formatted. Exit status 0 = properly formatted, non-zero otherwise.]' + '-diff[Display diffs of formatting change]' + '-write=[(false) Don not write to source files (always disabled if using -check)]' + '-recursive[Also process files in subdirectories. By default cwd only]' + '(-)*:files:_files -g "*pkr.{hcl,json}"' + ) + + local -a init_arguments && init_arguments=( + '-upgrade[on top also update plugins to latest]' + '(-)*:files:_files -g "*pkr.{hcl,json}"' + ) + local -a inspect_arguments && inspect_arguments=( '-machine-readable[Machine-readable output]' - '(-)*:files:_files -g "*.json"' + '(-)*:files:_files -g "*pkr.{hcl,json}"' ) local -a validate_arguments && validate_arguments=( @@ -35,7 +65,9 @@ _packer () { '-only=[(foo,bar,baz) Validate only these builds.]' '-var[("key=value") Variable for templates, can be used multiple times.]' '-var-file=[(path) JSON or HCL2 file containing user variables.]' - '(-)*:files:_files -g "*.json"' + '-no-warn-undeclared-var[Disable warnings for user variable files containing undeclared variables.]' + '-evaluate-datasources[(false) Evaluate data sources during validation (HCL2 only, may incur costs).]' + '(-)*:files:_files -g "*pkr.{hcl,json}"' ) _arguments -C \ @@ -49,6 +81,14 @@ _packer () { case $line[1] in build) _arguments -s -S : $build_arguments ;; + console) + _arguments -s -S : $console_arguments ;; + fix) + _arguments -s -S : $fix_arguments ;; + fmt) + _arguments -s -S : $fmt_arguments ;; + init) + _arguments -s -S : $init_arguments ;; inspect) _arguments -s -S : $inspect_arguments ;; validate) diff --git a/datasource/hcp-packer-artifact/data.go b/datasource/hcp-packer-artifact/data.go new file mode 100644 index 00000000000..f148c3a35d2 --- /dev/null +++ b/datasource/hcp-packer-artifact/data.go @@ -0,0 +1,251 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +//go:generate packer-sdc struct-markdown +//go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config +package hcp_packer_artifact + +import ( + "context" + "errors" + "fmt" + "log" + + "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/hcl/v2/hcldec" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/hcl2helper" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + hcpapi "github.com/hashicorp/packer/internal/hcp/api" +) + +type Datasource struct { + config Config +} + +type Config struct { + common.PackerConfig `mapstructure:",squash"` + + // The name of the bucket your artifact is in. + BucketName string `mapstructure:"bucket_name" required:"true"` + + // The name of the channel to use when retrieving your artifact. + // Either `channel_name` or `version_fingerprint` MUST be set. + // If using several artifacts from a single version, you may prefer sourcing a version first, + // and referencing it for subsequent uses, as every `hcp_packer_artifact` with the channel set will generate a + // potentially billable HCP Packer request, but if several `hcp_packer_artifact`s use a shared `hcp_packer_version` + // that will only generate one potentially billable request. + ChannelName string `mapstructure:"channel_name" required:"true"` + + // The fingerprint of the version to use when retrieving your artifact. + // Either this or `channel_name` MUST be set. + // Mutually exclusive with `channel_name` + VersionFingerprint string `mapstructure:"version_fingerprint" required:"true"` + + // The name of the platform that your artifact is for. + // For example, "aws", "azure", or "gce". + Platform string `mapstructure:"platform" required:"true"` + + // The name of the region your artifact is in. + // For example "us-east-1". + Region string `mapstructure:"region" required:"true"` + + // The specific Packer builder used to create the artifact. + // For example, "amazon-ebs.example" + ComponentType string `mapstructure:"component_type" required:"false"` +} + +func (d *Datasource) ConfigSpec() hcldec.ObjectSpec { + return d.config.FlatMapstructure().HCL2Spec() +} + +func (d *Datasource) Configure(raws ...interface{}) error { + err := config.Decode(&d.config, nil, raws...) + if err != nil { + return err + } + + var errs *packersdk.MultiError + + if d.config.BucketName == "" { + errs = packersdk.MultiErrorAppend( + errs, fmt.Errorf("the `bucket_name` must be specified"), + ) + } + + // Ensure either channel_name or version_fingerprint is set, and not both at the same time. + if d.config.ChannelName == "" && d.config.VersionFingerprint == "" { + errs = packersdk.MultiErrorAppend(errs, errors.New( + "`version_fingerprint` or `channel_name` must be specified", + )) + } + if d.config.ChannelName != "" && d.config.VersionFingerprint != "" { + errs = packersdk.MultiErrorAppend(errs, errors.New( + "`version_fingerprint` and `channel_name` cannot be specified together", + )) + } + + if d.config.Region == "" { + errs = packersdk.MultiErrorAppend(errs, + fmt.Errorf("the `region` must be specified"), + ) + } + + if d.config.Platform == "" { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf( + "the `platform` must be specified", + )) + } + + if errs != nil && len(errs.Errors) > 0 { + return errs + } + return nil +} + +// DatasourceOutput Information from []*hcpPackerModels.HashicorpCloudPacker20230101Artifact with some information +// from the parent []*hcpPackerModels.HashicorpCloudPacker20230101Build included where it seemed +// like it might be relevant. Need to copy so we can generate +type DatasourceOutput struct { + // The name of the platform that the artifact exists in. + // For example, "aws", "azure", or "gce". + Platform string `mapstructure:"platform"` + + // The specific Packer builder or post-processor used to create the artifact. + ComponentType string `mapstructure:"component_type"` + + // The date and time at which the artifact was created. + CreatedAt string `mapstructure:"created_at"` + + // The ID of the build that created the artifact. This is a ULID, which is a + // unique identifier similar to a UUID. It is created by the HCP Packer + // Registry when a build is first created, and is unique to this build. + BuildID string `mapstructure:"build_id"` + + // The version ID. This is a ULID, which is a unique identifier similar + // to a UUID. It is created by the HCP Packer Registry when a version is + // first created, and is unique to this version. + VersionID string `mapstructure:"version_id"` + + // The ID of the channel used to query the version. This value will be empty if the `version_fingerprint` was used + // directly instead of a channel. + ChannelID string `mapstructure:"channel_id"` + + // The UUID associated with the Packer run that created this artifact. + PackerRunUUID string `mapstructure:"packer_run_uuid"` + + // Identifier or URL of the remote artifact as given by a build. + // For example, ami-12345. + ExternalIdentifier string `mapstructure:"external_identifier"` + + // The region as given by `packer build`. eg. "ap-east-1". + // For locally managed clouds, this may map instead to a cluster, server or datastore. + Region string `mapstructure:"region"` + + // The key:value metadata labels associated with this build. + Labels map[string]string `mapstructure:"labels"` +} + +func (d *Datasource) OutputSpec() hcldec.ObjectSpec { + return (&DatasourceOutput{}).FlatMapstructure().HCL2Spec() +} + +func (d *Datasource) Execute() (cty.Value, error) { + ctx := context.TODO() + + cli, err := hcpapi.NewClient() + if err != nil { + return cty.NullVal(cty.EmptyObject), err + } + + var version *hcpPackerModels.HashicorpCloudPacker20230101Version + var channelID string + if d.config.VersionFingerprint != "" { + log.Printf( + "[INFO] Reading info from HCP Packer Registry (%s) "+ + "[project_id=%s, organization_id=%s, version_fingerprint=%s]", + d.config.BucketName, cli.ProjectID, cli.OrganizationID, d.config.VersionFingerprint, + ) + + version, err = cli.GetVersion(ctx, d.config.BucketName, d.config.VersionFingerprint) + if err != nil { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "error retrieving version from HCP Packer Registry: %s", err, + ) + } + } else { + log.Printf( + "[INFO] Reading info from HCP Packer Registry (%s) "+ + "[project_id=%s, organization_id=%s, channel=%s]", + d.config.BucketName, cli.ProjectID, cli.OrganizationID, d.config.ChannelName, + ) + + var channel *hcpPackerModels.HashicorpCloudPacker20230101Channel + channel, err = cli.GetChannel(ctx, d.config.BucketName, d.config.ChannelName) + if err != nil { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "error retrieving channel from HCP Packer Registry: %s", err.Error(), + ) + } + + if channel.Version == nil { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "there is no version associated with the channel %s", d.config.ChannelName, + ) + } + channelID = channel.ID + version = channel.Version + } + + if *version.Status == hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "the version %s is revoked and can not be used on Packer builds", version.ID, + ) + } + + var output DatasourceOutput + + cloudAndRegions := map[string][]string{} + for _, build := range version.Builds { + if build.Platform != d.config.Platform { + continue + } + for _, artifact := range build.Artifacts { + cloudAndRegions[build.Platform] = append(cloudAndRegions[build.Platform], artifact.Region) + if artifact.Region == d.config.Region && filterBuildByComponentType(build, d.config.ComponentType) { + // This is the desired artifact. + output = DatasourceOutput{ + Platform: build.Platform, + ComponentType: build.ComponentType, + CreatedAt: artifact.CreatedAt.String(), + BuildID: build.ID, + VersionID: build.VersionID, + ChannelID: channelID, + PackerRunUUID: build.PackerRunUUID, + ExternalIdentifier: artifact.ExternalIdentifier, + Region: artifact.Region, + Labels: build.Labels, + } + return hcl2helper.HCL2ValueFromConfig(output, d.OutputSpec()), nil + } + } + } + + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "could not find a build result matching "+ + "[region=%q, platform=%q, component_type=%q]. Available: %v ", + d.config.Region, d.config.Platform, d.config.ComponentType, cloudAndRegions, + ) +} + +func filterBuildByComponentType(build *hcpPackerModels.HashicorpCloudPacker20230101Build, componentType string) bool { + // optional field is not specified, passthrough + if componentType == "" { + return true + } + // if specified, only the matched artifact metadata is returned by this effect + return build.ComponentType == componentType +} diff --git a/datasource/hcp-packer-artifact/data.hcl2spec.go b/datasource/hcp-packer-artifact/data.hcl2spec.go new file mode 100644 index 00000000000..5c34c556b5d --- /dev/null +++ b/datasource/hcp-packer-artifact/data.hcl2spec.go @@ -0,0 +1,98 @@ +// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT. + +package hcp_packer_artifact + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + BucketName *string `mapstructure:"bucket_name" required:"true" cty:"bucket_name" hcl:"bucket_name"` + ChannelName *string `mapstructure:"channel_name" required:"true" cty:"channel_name" hcl:"channel_name"` + VersionFingerprint *string `mapstructure:"version_fingerprint" required:"true" cty:"version_fingerprint" hcl:"version_fingerprint"` + Platform *string `mapstructure:"platform" required:"true" cty:"platform" hcl:"platform"` + Region *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"` + ComponentType *string `mapstructure:"component_type" required:"false" cty:"component_type" hcl:"component_type"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "bucket_name": &hcldec.AttrSpec{Name: "bucket_name", Type: cty.String, Required: false}, + "channel_name": &hcldec.AttrSpec{Name: "channel_name", Type: cty.String, Required: false}, + "version_fingerprint": &hcldec.AttrSpec{Name: "version_fingerprint", Type: cty.String, Required: false}, + "platform": &hcldec.AttrSpec{Name: "platform", Type: cty.String, Required: false}, + "region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false}, + "component_type": &hcldec.AttrSpec{Name: "component_type", Type: cty.String, Required: false}, + } + return s +} + +// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatDatasourceOutput struct { + Platform *string `mapstructure:"platform" cty:"platform" hcl:"platform"` + ComponentType *string `mapstructure:"component_type" cty:"component_type" hcl:"component_type"` + CreatedAt *string `mapstructure:"created_at" cty:"created_at" hcl:"created_at"` + BuildID *string `mapstructure:"build_id" cty:"build_id" hcl:"build_id"` + VersionID *string `mapstructure:"version_id" cty:"version_id" hcl:"version_id"` + ChannelID *string `mapstructure:"channel_id" cty:"channel_id" hcl:"channel_id"` + PackerRunUUID *string `mapstructure:"packer_run_uuid" cty:"packer_run_uuid" hcl:"packer_run_uuid"` + ExternalIdentifier *string `mapstructure:"external_identifier" cty:"external_identifier" hcl:"external_identifier"` + Region *string `mapstructure:"region" cty:"region" hcl:"region"` + Labels map[string]string `mapstructure:"labels" cty:"labels" hcl:"labels"` +} + +// FlatMapstructure returns a new FlatDatasourceOutput. +// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatDatasourceOutput) +} + +// HCL2Spec returns the hcl spec of a DatasourceOutput. +// This spec is used by HCL to read the fields of DatasourceOutput. +// The decoded values from this spec will then be applied to a FlatDatasourceOutput. +func (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "platform": &hcldec.AttrSpec{Name: "platform", Type: cty.String, Required: false}, + "component_type": &hcldec.AttrSpec{Name: "component_type", Type: cty.String, Required: false}, + "created_at": &hcldec.AttrSpec{Name: "created_at", Type: cty.String, Required: false}, + "build_id": &hcldec.AttrSpec{Name: "build_id", Type: cty.String, Required: false}, + "version_id": &hcldec.AttrSpec{Name: "version_id", Type: cty.String, Required: false}, + "channel_id": &hcldec.AttrSpec{Name: "channel_id", Type: cty.String, Required: false}, + "packer_run_uuid": &hcldec.AttrSpec{Name: "packer_run_uuid", Type: cty.String, Required: false}, + "external_identifier": &hcldec.AttrSpec{Name: "external_identifier", Type: cty.String, Required: false}, + "region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false}, + "labels": &hcldec.AttrSpec{Name: "labels", Type: cty.Map(cty.String), Required: false}, + } + return s +} diff --git a/datasource/hcp-packer-image/data.go b/datasource/hcp-packer-image/data.go index 4e109afe42d..6b72366ea1d 100644 --- a/datasource/hcp-packer-image/data.go +++ b/datasource/hcp-packer-image/data.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config package hcp_packer_image @@ -12,7 +15,7 @@ import ( "github.com/zclconf/go-cty/cty" "github.com/hashicorp/hcl/v2/hcldec" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" + hcpPackerDeprecatedModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" "github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/hcl2helper" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -33,9 +36,9 @@ type Config struct { // Mutually exclusive with `iteration_id`. // If using several images from a single iteration, you may prefer // sourcing an iteration first, and referencing it for subsequent uses, - // as every `hcp_packer_image` with the channel set will generate a + // as every `hcp-packer-image` with the channel set will generate a // potentially billable HCP Packer request, but if several - // `hcp_packer_image`s use a shared `hcp_packer_iteration` that will + // `hcp-packer-image`s use a shared `hcp-packer-iteration` that will // only generate one potentially billable request. Channel string `mapstructure:"channel" required:"true"` // The ID of the iteration to use when retrieving your image @@ -98,8 +101,8 @@ func (d *Datasource) Configure(raws ...interface{}) error { return nil } -// DatasourceOutput Information from []*models.HashicorpCloudPackerImage with some information -// from the parent []*models.HashicorpCloudPackerBuild included where it seemed +// DatasourceOutput Information from []*hcpPackerDeprecatedModels.HashicorpCloudPackerImage with some information +// from the parent []*hcpPackerDeprecatedModels.HashicorpCloudPackerBuild included where it seemed // like it might be relevant. Need to copy so we can generate type DatasourceOutput struct { // The name of the cloud provider that the image exists in. For example, @@ -137,14 +140,16 @@ func (d *Datasource) OutputSpec() hcldec.ObjectSpec { } func (d *Datasource) Execute() (cty.Value, error) { + log.Printf("[WARN] Deprecation: `hcp-packer-image` datasource has been deprecated. " + + "Please use `hcp-packer-artifact` datasource instead.") ctx := context.TODO() - cli, err := hcpapi.NewClient() + cli, err := hcpapi.NewDeprecatedClient() if err != nil { return cty.NullVal(cty.EmptyObject), err } - var iteration *models.HashicorpCloudPackerIteration + var iteration *hcpPackerDeprecatedModels.HashicorpCloudPackerIteration var channelID string if d.config.IterationID != "" { log.Printf("[INFO] Reading info from HCP Packer registry (%s) [project_id=%s, organization_id=%s, iteration_id=%s]", @@ -216,7 +221,7 @@ func (d *Datasource) Execute() (cty.Value, error) { d.config.Region, d.config.CloudProvider, d.config.ComponentType, cloudAndRegions) } -func filterBuildByComponentType(build *models.HashicorpCloudPackerBuild, componentType string) bool { +func filterBuildByComponentType(build *hcpPackerDeprecatedModels.HashicorpCloudPackerBuild, componentType string) bool { // optional field is not specified, passthrough if componentType == "" { return true diff --git a/datasource/hcp-packer-iteration/data.go b/datasource/hcp-packer-iteration/data.go index 4ed7fd39c63..abe92722cfb 100644 --- a/datasource/hcp-packer-iteration/data.go +++ b/datasource/hcp-packer-iteration/data.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config package hcp_packer_iteration @@ -97,9 +100,11 @@ func (d *Datasource) OutputSpec() hcldec.ObjectSpec { } func (d *Datasource) Execute() (cty.Value, error) { + log.Printf("[WARN] Deprecation: `hcp-packer-iteration` datasource has been deprecated. " + + "Please use `hcp-packer-version` datasource instead.") ctx := context.TODO() - cli, err := hcpapi.NewClient() + cli, err := hcpapi.NewDeprecatedClient() if err != nil { return cty.NullVal(cty.EmptyObject), err } diff --git a/datasource/hcp-packer-iteration/data_acc_test.go b/datasource/hcp-packer-iteration/data_acc_test.go index dab9bd38f08..fbb7176768d 100644 --- a/datasource/hcp-packer-iteration/data_acc_test.go +++ b/datasource/hcp-packer-iteration/data_acc_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcp_packer_iteration import ( @@ -5,6 +8,7 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "testing" "github.com/hashicorp/packer-plugin-sdk/acctest" @@ -14,27 +18,42 @@ import ( //go:embed test-fixtures/template.pkr.hcl var testDatasourceBasic string +//go:embed test-fixtures/hcp-setup-build.pkr.hcl +var testHCPBuild string + // Acceptance tests for data sources. // -// To be successful, the HCP project you're providing credentials for must -// contain a bucket named "hardened-ubuntu-16-04", with a channel named -// "packer-acc-test". It must contain a build that references an image in AWS -// region "us-east-1". Your HCP credentials must be provided through your -// runtime environment because the template this test uses does not set them. -// -// TODO: update this acceptance to create and clean up the HCP resources this -// data source queries, to prevent plugin developers from having to have images -// as defined above. - +// Your HCP credentials must be provided through your runtime +// environment because the template this test uses does not set them. func TestAccDatasource_HCPPackerIteration(t *testing.T) { if os.Getenv(env.HCPClientID) == "" && os.Getenv(env.HCPClientSecret) == "" { t.Skipf(fmt.Sprintf("Acceptance tests skipped unless envs %q and %q are set", env.HCPClientID, env.HCPClientSecret)) return } - testCase := &acctest.PluginTestCase{ + tmpFile := filepath.Join(t.TempDir(), "hcp-target-file") + testSetup := acctest.PluginTestCase{ + Template: fmt.Sprintf(testHCPBuild, tmpFile), + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 0 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + return nil + }, + } + acctest.TestPlugin(t, &testSetup) + + testCase := acctest.PluginTestCase{ Name: "hcp_packer_iteration_datasource_basic_test", - Template: testDatasourceBasic, + Template: fmt.Sprintf(testDatasourceBasic, filepath.Dir(tmpFile)), + Setup: func() error { + if _, err := os.Stat(tmpFile); os.IsNotExist(err) { + return err + } + return nil + }, // TODO have acc test write iteration id to a file and check it to make // sure it isn't empty. Check: func(buildCommand *exec.Cmd, logfile string) error { @@ -46,5 +65,5 @@ func TestAccDatasource_HCPPackerIteration(t *testing.T) { return nil }, } - acctest.TestPlugin(t, testCase) + acctest.TestPlugin(t, &testCase) } diff --git a/datasource/hcp-packer-iteration/test-fixtures/hcp-setup-build.pkr.hcl b/datasource/hcp-packer-iteration/test-fixtures/hcp-setup-build.pkr.hcl new file mode 100644 index 00000000000..f9b203496fb --- /dev/null +++ b/datasource/hcp-packer-iteration/test-fixtures/hcp-setup-build.pkr.hcl @@ -0,0 +1,16 @@ +variable "target" { + type = string + default = %q +} + +source "file" "test" { + content = "Lorem ipsum dolor sit amet" + target = var.target +} + +build { + hcp_packer_registry { + bucket_name = "simple-deprecated" + } + sources = ["source.file.test"] +} diff --git a/datasource/hcp-packer-iteration/test-fixtures/template.pkr.hcl b/datasource/hcp-packer-iteration/test-fixtures/template.pkr.hcl index 52bac83ee7b..931fb023168 100644 --- a/datasource/hcp-packer-iteration/test-fixtures/template.pkr.hcl +++ b/datasource/hcp-packer-iteration/test-fixtures/template.pkr.hcl @@ -3,20 +3,20 @@ source "null" "example" { } data "hcp-packer-iteration" "hardened-source" { - bucket_name = "hardened-ubuntu-16-04" - channel = "packer-acc-test" + bucket_name = "simple-deprecated" + channel = "latest" } -data "hcp-packer-image" "aws" { - bucket_name = "hardened-ubuntu-16-04" +data "hcp-packer-image" "file" { + bucket_name = "simple-deprecated" iteration_id = "${data.hcp-packer-iteration.hardened-source.id}" - cloud_provider = "aws" - region = "us-east-1" + cloud_provider = "packer.file" + region = %q } locals { foo = "${data.hcp-packer-iteration.hardened-source.id}" - bar = "${data.hcp-packer-image.aws.id}" + bar = "${data.hcp-packer-image.file.id}" } build { diff --git a/datasource/hcp-packer-version/data.go b/datasource/hcp-packer-version/data.go new file mode 100644 index 00000000000..a5dcf753f6c --- /dev/null +++ b/datasource/hcp-packer-version/data.go @@ -0,0 +1,149 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +//go:generate packer-sdc struct-markdown +//go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config +package hcp_packer_version + +import ( + "context" + "fmt" + "log" + + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/hashicorp/packer-plugin-sdk/common" + "github.com/hashicorp/packer-plugin-sdk/hcl2helper" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/template/config" + hcpapi "github.com/hashicorp/packer/internal/hcp/api" +) + +type Datasource struct { + config Config +} + +type Config struct { + common.PackerConfig `mapstructure:",squash"` + // The bucket name in the HCP Packer Registry. + BucketName string `mapstructure:"bucket_name" required:"true"` + // The channel name in the given bucket to use for retrieving the version. + ChannelName string `mapstructure:"channel_name" required:"true"` +} + +func (d *Datasource) ConfigSpec() hcldec.ObjectSpec { + return d.config.FlatMapstructure().HCL2Spec() +} + +func (d *Datasource) Configure(raws ...interface{}) error { + err := config.Decode(&d.config, nil, raws...) + if err != nil { + return err + } + + var errs *packersdk.MultiError + + if d.config.BucketName == "" { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("the `bucket_name` must be specified")) + } + if d.config.ChannelName == "" { + errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("the `channel_name` must be specified")) + } + + if errs != nil && len(errs.Errors) > 0 { + return errs + } + return nil +} + +// DatasourceOutput is essentially a copy of []*models.HashicorpCloudPacker20230101Version, but without +// the build and ancestry details +type DatasourceOutput struct { + // Name of the author who created this version. + AuthorID string `mapstructure:"author_id"` + + // The name of the bucket that this version is associated with. + BucketName string `mapstructure:"bucket_name"` + + // Current state of the version. + Status string `mapstructure:"status"` + + // The date the version was created. + CreatedAt string `mapstructure:"created_at"` + + // The fingerprint of the version; this is a unique identifier set by the Packer build + // that created this version. + Fingerprint string `mapstructure:"fingerprint"` + + // The version ID. This is a ULID, which is a unique identifier similar + // to a UUID. It is created by the HCP Packer Registry when a version is + // first created, and is unique to this version. + ID string `mapstructure:"id"` + + // The version name is created by the HCP Packer Registry once a version is + // "complete". Incomplete or failed versions currently default to having a name "v0". + Name string `mapstructure:"name"` + + // The date when this version was last updated. + UpdatedAt string `mapstructure:"updated_at"` + + // The ID of the channel used to query this version. + ChannelID string `mapstructure:"channel_id"` +} + +func (d *Datasource) OutputSpec() hcldec.ObjectSpec { + return (&DatasourceOutput{}).FlatMapstructure().HCL2Spec() +} + +func (d *Datasource) Execute() (cty.Value, error) { + ctx := context.TODO() + + cli, err := hcpapi.NewClient() + if err != nil { + return cty.NullVal(cty.EmptyObject), err + } + log.Printf( + "[INFO] Reading HCP Packer Version info from HCP Packer Registry (%s) "+ + "[project_id=%s, organization_id=%s, channel=%s]", + d.config.BucketName, cli.ProjectID, cli.OrganizationID, d.config.ChannelName, + ) + + channel, err := cli.GetChannel(ctx, d.config.BucketName, d.config.ChannelName) + if err != nil { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "error retrieving HCP Packer Version from HCP Packer Registry: %s", + err.Error(), + ) + } + if channel.Version == nil { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "there is no HCP Packer Version associated with the channel %s", + d.config.ChannelName, + ) + } + + version := channel.Version + + if *version.Status == hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED { + return cty.NullVal(cty.EmptyObject), fmt.Errorf( + "the HCP Packer Version associated with the channel %s is revoked and can not be used on Packer builds", + d.config.ChannelName, + ) + } + + output := DatasourceOutput{ + AuthorID: version.AuthorID, + BucketName: version.BucketName, + Status: string(*version.Status), + CreatedAt: version.CreatedAt.String(), + Fingerprint: version.Fingerprint, + ID: version.ID, + Name: version.Name, + UpdatedAt: version.UpdatedAt.String(), + ChannelID: channel.ID, + } + + return hcl2helper.HCL2ValueFromConfig(output, d.OutputSpec()), nil +} diff --git a/datasource/hcp-packer-version/data.hcl2spec.go b/datasource/hcp-packer-version/data.hcl2spec.go new file mode 100644 index 00000000000..20e8e6a1ec7 --- /dev/null +++ b/datasource/hcp-packer-version/data.hcl2spec.go @@ -0,0 +1,88 @@ +// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT. + +package hcp_packer_version + +import ( + "github.com/hashicorp/hcl/v2/hcldec" + "github.com/zclconf/go-cty/cty" +) + +// FlatConfig is an auto-generated flat version of Config. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatConfig struct { + PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` + PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` + PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` + PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` + PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` + PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` + PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` + PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` + BucketName *string `mapstructure:"bucket_name" required:"true" cty:"bucket_name" hcl:"bucket_name"` + ChannelName *string `mapstructure:"channel_name" required:"true" cty:"channel_name" hcl:"channel_name"` +} + +// FlatMapstructure returns a new FlatConfig. +// FlatConfig is an auto-generated flat version of Config. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatConfig) +} + +// HCL2Spec returns the hcl spec of a Config. +// This spec is used by HCL to read the fields of Config. +// The decoded values from this spec will then be applied to a FlatConfig. +func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, + "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, + "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, + "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, + "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, + "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, + "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, + "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, + "bucket_name": &hcldec.AttrSpec{Name: "bucket_name", Type: cty.String, Required: false}, + "channel_name": &hcldec.AttrSpec{Name: "channel_name", Type: cty.String, Required: false}, + } + return s +} + +// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. +// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. +type FlatDatasourceOutput struct { + AuthorID *string `mapstructure:"author_id" cty:"author_id" hcl:"author_id"` + BucketName *string `mapstructure:"bucket_name" cty:"bucket_name" hcl:"bucket_name"` + Status *string `mapstructure:"status" cty:"status" hcl:"status"` + CreatedAt *string `mapstructure:"created_at" cty:"created_at" hcl:"created_at"` + Fingerprint *string `mapstructure:"fingerprint" cty:"fingerprint" hcl:"fingerprint"` + ID *string `mapstructure:"id" cty:"id" hcl:"id"` + Name *string `mapstructure:"name" cty:"name" hcl:"name"` + UpdatedAt *string `mapstructure:"updated_at" cty:"updated_at" hcl:"updated_at"` + ChannelID *string `mapstructure:"channel_id" cty:"channel_id" hcl:"channel_id"` +} + +// FlatMapstructure returns a new FlatDatasourceOutput. +// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. +// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. +func (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { + return new(FlatDatasourceOutput) +} + +// HCL2Spec returns the hcl spec of a DatasourceOutput. +// This spec is used by HCL to read the fields of DatasourceOutput. +// The decoded values from this spec will then be applied to a FlatDatasourceOutput. +func (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec { + s := map[string]hcldec.Spec{ + "author_id": &hcldec.AttrSpec{Name: "author_id", Type: cty.String, Required: false}, + "bucket_name": &hcldec.AttrSpec{Name: "bucket_name", Type: cty.String, Required: false}, + "status": &hcldec.AttrSpec{Name: "status", Type: cty.String, Required: false}, + "created_at": &hcldec.AttrSpec{Name: "created_at", Type: cty.String, Required: false}, + "fingerprint": &hcldec.AttrSpec{Name: "fingerprint", Type: cty.String, Required: false}, + "id": &hcldec.AttrSpec{Name: "id", Type: cty.String, Required: false}, + "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, + "updated_at": &hcldec.AttrSpec{Name: "updated_at", Type: cty.String, Required: false}, + "channel_id": &hcldec.AttrSpec{Name: "channel_id", Type: cty.String, Required: false}, + } + return s +} diff --git a/datasource/hcp-packer-version/data_acc_test.go b/datasource/hcp-packer-version/data_acc_test.go new file mode 100644 index 00000000000..e1b54240279 --- /dev/null +++ b/datasource/hcp-packer-version/data_acc_test.go @@ -0,0 +1,69 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package hcp_packer_version + +import ( + _ "embed" + "fmt" + "os" + "os/exec" + "path/filepath" + "testing" + + "github.com/hashicorp/packer-plugin-sdk/acctest" + "github.com/hashicorp/packer/internal/hcp/env" +) + +//go:embed test-fixtures/template.pkr.hcl +var testDatasourceBasic string + +//go:embed test-fixtures/hcp-setup-build.pkr.hcl +var testHCPBuild string + +// Acceptance tests for data sources. +// +// Your HCP credentials must be provided through your runtime +// environment because the template this test uses does not set them. +func TestAccDatasource_HCPPackerVersion(t *testing.T) { + if os.Getenv(env.HCPClientID) == "" && os.Getenv(env.HCPClientSecret) == "" { + t.Skipf(fmt.Sprintf("Acceptance tests skipped unless envs %q and %q are set", env.HCPClientID, env.HCPClientSecret)) + return + } + + tmpFile := filepath.Join(t.TempDir(), "hcp-target-file") + testSetup := acctest.PluginTestCase{ + Template: fmt.Sprintf(testHCPBuild, tmpFile), + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 0 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + return nil + }, + } + acctest.TestPlugin(t, &testSetup) + + testCase := acctest.PluginTestCase{ + Name: "hcp_packer_version_datasource_basic_test", + Template: fmt.Sprintf(testDatasourceBasic, filepath.Dir(tmpFile)), + Setup: func() error { + if _, err := os.Stat(tmpFile); os.IsNotExist(err) { + return err + } + return nil + }, + // TODO have acc test write version id to a file and check it to make + // sure it isn't empty. + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 0 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + return nil + }, + } + acctest.TestPlugin(t, &testCase) +} diff --git a/datasource/hcp-packer-version/test-fixtures/hcp-setup-build.pkr.hcl b/datasource/hcp-packer-version/test-fixtures/hcp-setup-build.pkr.hcl new file mode 100644 index 00000000000..6f4f6cbfbf7 --- /dev/null +++ b/datasource/hcp-packer-version/test-fixtures/hcp-setup-build.pkr.hcl @@ -0,0 +1,16 @@ +variable "target" { + type = string + default = %q +} + +source "file" "test" { + content = "Lorem ipsum dolor sit amet" + target = var.target +} + +build { + hcp_packer_registry { + bucket_name = "simple" + } + sources = ["source.file.test"] +} diff --git a/datasource/hcp-packer-version/test-fixtures/template.pkr.hcl b/datasource/hcp-packer-version/test-fixtures/template.pkr.hcl new file mode 100644 index 00000000000..099679b2410 --- /dev/null +++ b/datasource/hcp-packer-version/test-fixtures/template.pkr.hcl @@ -0,0 +1,33 @@ +source "null" "example" { + communicator = "none" +} + +data "hcp-packer-version" "hardened-source" { + bucket_name = "simple" + channel_name = "latest" +} + +data "hcp-packer-artifact" "file" { + bucket_name = "simple" + version_fingerprint = "${data.hcp-packer-version.hardened-source.fingerprint}" + platform = "packer.file" + region = %q +} + +locals { + foo = "${data.hcp-packer-version.hardened-source.id}" + bar = "${data.hcp-packer-artifact.file.external_identifier}" +} + +build { + name = "mybuild" + sources = [ + "source.null.example" + ] + provisioner "shell-local" { + inline = [ + "echo data is ${local.foo}", + "echo data is ${local.bar}" + ] + } +} diff --git a/datasource/http/data.go b/datasource/http/data.go index e94e153ad93..58dec04c35b 100644 --- a/datasource/http/data.go +++ b/datasource/http/data.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config package http @@ -5,7 +8,7 @@ package http import ( "context" "fmt" - "io/ioutil" + "io" "mime" "net/http" "regexp" @@ -134,7 +137,7 @@ func (d *Datasource) Execute() (cty.Value, error) { fmt.Println("If the content is binary data, Packer may not properly handle the contents of the response.") } - bytes, err := ioutil.ReadAll(resp.Body) + bytes, err := io.ReadAll(resp.Body) // TODO: How to make test case for this? if err != nil { fmt.Println("Error processing response body of call") diff --git a/datasource/http/data_acc_test.go b/datasource/http/data_acc_test.go index b6b1f83ac27..fdf680b8298 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -1,9 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package http import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "regexp" @@ -81,7 +84,7 @@ func TestHttpDataSource(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } diff --git a/datasource/null/data.go b/datasource/null/data.go index 3756c6a3e2a..90c8064aefd 100644 --- a/datasource/null/data.go +++ b/datasource/null/data.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config package null diff --git a/fix/fixer.go b/fix/fixer.go index 7634a287ca4..3fd30cacf11 100644 --- a/fix/fixer.go +++ b/fix/fixer.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix // A Fixer is something that can perform a fix operation on a template. diff --git a/fix/fixer_amazon_enhanced_networking.go b/fix/fixer_amazon_enhanced_networking.go index dd713317153..f5c0aa15ed0 100644 --- a/fix/fixer_amazon_enhanced_networking.go +++ b/fix/fixer_amazon_enhanced_networking.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_enhanced_networking_test.go b/fix/fixer_amazon_enhanced_networking_test.go index 78b58d58271..c92293d96dd 100644 --- a/fix/fixer_amazon_enhanced_networking_test.go +++ b/fix/fixer_amazon_enhanced_networking_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_private_ip.go b/fix/fixer_amazon_private_ip.go index 7a6c483ff21..f2ca9a26948 100644 --- a/fix/fixer_amazon_private_ip.go +++ b/fix/fixer_amazon_private_ip.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_private_ip_test.go b/fix/fixer_amazon_private_ip_test.go index 55b2104a67a..7d78e396b7b 100644 --- a/fix/fixer_amazon_private_ip_test.go +++ b/fix/fixer_amazon_private_ip_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_shutdown_behavior.go b/fix/fixer_amazon_shutdown_behavior.go index b73c67e1f4b..b779fc10766 100644 --- a/fix/fixer_amazon_shutdown_behavior.go +++ b/fix/fixer_amazon_shutdown_behavior.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_shutdown_behavior_test.go b/fix/fixer_amazon_shutdown_behavior_test.go index 50718372fa2..5af1f59c5cd 100644 --- a/fix/fixer_amazon_shutdown_behavior_test.go +++ b/fix/fixer_amazon_shutdown_behavior_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_spot_price_product.go b/fix/fixer_amazon_spot_price_product.go index ad0f6481548..7c49afeb9ce 100644 --- a/fix/fixer_amazon_spot_price_product.go +++ b/fix/fixer_amazon_spot_price_product.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_temporary_security_group_cidrs.go b/fix/fixer_amazon_temporary_security_group_cidrs.go index eccfe855ef3..bd9a9b019b8 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_amazon_temporary_security_group_cidrs_test.go b/fix/fixer_amazon_temporary_security_group_cidrs_test.go index 1a17e3f1837..28dac694904 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs_test.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_azure_exclude_from_latest.go b/fix/fixer_azure_exclude_from_latest.go index dad0ed690a7..b85f1da6d67 100644 --- a/fix/fixer_azure_exclude_from_latest.go +++ b/fix/fixer_azure_exclude_from_latest.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_azure_exclude_from_latest_test.go b/fix/fixer_azure_exclude_from_latest_test.go index 27e10d57ff8..e7e16e9bde8 100644 --- a/fix/fixer_azure_exclude_from_latest_test.go +++ b/fix/fixer_azure_exclude_from_latest_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_clean_image_name.go b/fix/fixer_clean_image_name.go index 5ba1a3a3c64..981e2e36f41 100644 --- a/fix/fixer_clean_image_name.go +++ b/fix/fixer_clean_image_name.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_clean_image_name_test.go b/fix/fixer_clean_image_name_test.go index 21799ba5f17..7a95ac2a0f1 100644 --- a/fix/fixer_clean_image_name_test.go +++ b/fix/fixer_clean_image_name_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_comm_config.go b/fix/fixer_comm_config.go index 09781a04a88..3d02fcdac33 100644 --- a/fix/fixer_comm_config.go +++ b/fix/fixer_comm_config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_comm_config_test.go b/fix/fixer_comm_config_test.go index 1d2b7b9f6e5..c0e22bb7e06 100644 --- a/fix/fixer_comm_config_test.go +++ b/fix/fixer_comm_config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_createtime.go b/fix/fixer_createtime.go index eda513ffc19..345ec750242 100644 --- a/fix/fixer_createtime.go +++ b/fix/fixer_createtime.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_createtime_test.go b/fix/fixer_createtime_test.go index ae91c6c2242..9c78b525ac0 100644 --- a/fix/fixer_createtime_test.go +++ b/fix/fixer_createtime_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_docker_email.go b/fix/fixer_docker_email.go index 17a1a130020..6a644210cef 100644 --- a/fix/fixer_docker_email.go +++ b/fix/fixer_docker_email.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import "github.com/mitchellh/mapstructure" diff --git a/fix/fixer_galaxy_command.go b/fix/fixer_galaxy_command.go index c819dc69ed0..df36558275b 100644 --- a/fix/fixer_galaxy_command.go +++ b/fix/fixer_galaxy_command.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_galaxy_command_test.go b/fix/fixer_galaxy_command_test.go index c052a10c93e..125039240c8 100644 --- a/fix/fixer_galaxy_command_test.go +++ b/fix/fixer_galaxy_command_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_hyperv_cpu_and_ram_naming.go b/fix/fixer_hyperv_cpu_and_ram_naming.go index c4516c020ce..3c655bb2ecd 100644 --- a/fix/fixer_hyperv_cpu_and_ram_naming.go +++ b/fix/fixer_hyperv_cpu_and_ram_naming.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_hyperv_deprecations.go b/fix/fixer_hyperv_deprecations.go index 3b9582ff5cd..191a8f0d8df 100644 --- a/fix/fixer_hyperv_deprecations.go +++ b/fix/fixer_hyperv_deprecations.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_hyperv_deprecations_test.go b/fix/fixer_hyperv_deprecations_test.go index 8c90bff9b34..1f9672d42ed 100644 --- a/fix/fixer_hyperv_deprecations_test.go +++ b/fix/fixer_hyperv_deprecations_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_hyperv_vmxc_typo.go b/fix/fixer_hyperv_vmxc_typo.go index 2063fae4004..c2c57fe8071 100644 --- a/fix/fixer_hyperv_vmxc_typo.go +++ b/fix/fixer_hyperv_vmxc_typo.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_hyperv_vmxc_typo_test.go b/fix/fixer_hyperv_vmxc_typo_test.go index dbbea7072f0..c88a1d40d8b 100644 --- a/fix/fixer_hyperv_vmxc_typo_test.go +++ b/fix/fixer_hyperv_vmxc_typo_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_iso_checksum_type_and_url.go b/fix/fixer_iso_checksum_type_and_url.go index 07aaf662118..df61844fa61 100644 --- a/fix/fixer_iso_checksum_type_and_url.go +++ b/fix/fixer_iso_checksum_type_and_url.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_iso_checksum_type_and_url_test.go b/fix/fixer_iso_checksum_type_and_url_test.go index 11be8fec6d1..556ab966391 100644 --- a/fix/fixer_iso_checksum_type_and_url_test.go +++ b/fix/fixer_iso_checksum_type_and_url_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_iso_md5.go b/fix/fixer_iso_md5.go index 6aa69a7c7e4..3d6acb86aa5 100644 --- a/fix/fixer_iso_md5.go +++ b/fix/fixer_iso_md5.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_iso_md5_test.go b/fix/fixer_iso_md5_test.go index 0c0e989b5ca..106fff6096c 100644 --- a/fix/fixer_iso_md5_test.go +++ b/fix/fixer_iso_md5_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_parallels_deprecations.go b/fix/fixer_parallels_deprecations.go index cf8dd001b0c..b287f58f003 100644 --- a/fix/fixer_parallels_deprecations.go +++ b/fix/fixer_parallels_deprecations.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_parallels_deprecations_test.go b/fix/fixer_parallels_deprecations_test.go index 22f78c1222f..584129693d5 100644 --- a/fix/fixer_parallels_deprecations_test.go +++ b/fix/fixer_parallels_deprecations_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_parallels_headless.go b/fix/fixer_parallels_headless.go index d1e0d2fc6a3..cd645df1181 100644 --- a/fix/fixer_parallels_headless.go +++ b/fix/fixer_parallels_headless.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_parallels_headless_test.go b/fix/fixer_parallels_headless_test.go index c6c92e98181..62f5654bb27 100644 --- a/fix/fixer_parallels_headless_test.go +++ b/fix/fixer_parallels_headless_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_powershell_escapes.go b/fix/fixer_powershell_escapes.go index 4fa06ff6dcd..a96bc35fd99 100644 --- a/fix/fixer_powershell_escapes.go +++ b/fix/fixer_powershell_escapes.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_pp_docker_tag_tags.go b/fix/fixer_pp_docker_tag_tags.go index 1673ec7b742..e21a9c26dfb 100644 --- a/fix/fixer_pp_docker_tag_tags.go +++ b/fix/fixer_pp_docker_tag_tags.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_pp_docker_tag_tags_test.go b/fix/fixer_pp_docker_tag_tags_test.go index 150db3dfa79..97b600bbc3a 100644 --- a/fix/fixer_pp_docker_tag_tags_test.go +++ b/fix/fixer_pp_docker_tag_tags_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_pp_manifest_filename.go b/fix/fixer_pp_manifest_filename.go index d6ad6a9a458..a9447d74050 100644 --- a/fix/fixer_pp_manifest_filename.go +++ b/fix/fixer_pp_manifest_filename.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_pp_manifest_filename_test.go b/fix/fixer_pp_manifest_filename_test.go index ac7d14d6a35..95eaeae68a3 100644 --- a/fix/fixer_pp_manifest_filename_test.go +++ b/fix/fixer_pp_manifest_filename_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_pp_vagrant_override.go b/fix/fixer_pp_vagrant_override.go index fec17f4baf8..c70ab1f5929 100644 --- a/fix/fixer_pp_vagrant_override.go +++ b/fix/fixer_pp_vagrant_override.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import "github.com/mitchellh/mapstructure" diff --git a/fix/fixer_pp_vagrant_override_test.go b/fix/fixer_pp_vagrant_override_test.go index f58099565fc..29f7edba658 100644 --- a/fix/fixer_pp_vagrant_override_test.go +++ b/fix/fixer_pp_vagrant_override_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_proxmox_type.go b/fix/fixer_proxmox_type.go index 93db4a5e86a..5c08a35631b 100644 --- a/fix/fixer_proxmox_type.go +++ b/fix/fixer_proxmox_type.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_proxmox_type_test.go b/fix/fixer_proxmox_type_test.go index c66ab25bb69..53b9d855c8e 100644 --- a/fix/fixer_proxmox_type_test.go +++ b/fix/fixer_proxmox_type_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_qemu_disk_size.go b/fix/fixer_qemu_disk_size.go index ef6b8459fe1..5fd4184e571 100644 --- a/fix/fixer_qemu_disk_size.go +++ b/fix/fixer_qemu_disk_size.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_qemu_disk_size_test.go b/fix/fixer_qemu_disk_size_test.go index 6381dc68dc9..a05e6f75239 100644 --- a/fix/fixer_qemu_disk_size_test.go +++ b/fix/fixer_qemu_disk_size_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_qemu_host_port.go b/fix/fixer_qemu_host_port.go index a1cb5645309..1b92b04b316 100644 --- a/fix/fixer_qemu_host_port.go +++ b/fix/fixer_qemu_host_port.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_qemu_host_port_test.go b/fix/fixer_qemu_host_port_test.go index e2ec753c580..7a9bf529c00 100644 --- a/fix/fixer_qemu_host_port_test.go +++ b/fix/fixer_qemu_host_port_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_scaleway_access_key.go b/fix/fixer_scaleway_access_key.go index cad7ec65b93..cf9e173928a 100644 --- a/fix/fixer_scaleway_access_key.go +++ b/fix/fixer_scaleway_access_key.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_scaleway_access_key_test.go b/fix/fixer_scaleway_access_key_test.go index 61ff7eed8e6..a91f1886cad 100644 --- a/fix/fixer_scaleway_access_key_test.go +++ b/fix/fixer_scaleway_access_key_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_ssh_timeout.go b/fix/fixer_ssh_timeout.go index bb5f4a4e2b0..d73b47d66e8 100644 --- a/fix/fixer_ssh_timeout.go +++ b/fix/fixer_ssh_timeout.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_ssh_timeout_test.go b/fix/fixer_ssh_timeout_test.go index 3c69839d898..0c89b7cf7b3 100644 --- a/fix/fixer_ssh_timeout_test.go +++ b/fix/fixer_ssh_timeout_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_sshdisableagent.go b/fix/fixer_sshdisableagent.go index 833bca027d6..aa36504f010 100644 --- a/fix/fixer_sshdisableagent.go +++ b/fix/fixer_sshdisableagent.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_sshdisableagent_test.go b/fix/fixer_sshdisableagent_test.go index c38f9c58136..1c5ecc38c87 100644 --- a/fix/fixer_sshdisableagent_test.go +++ b/fix/fixer_sshdisableagent_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_sshkeypath.go b/fix/fixer_sshkeypath.go index 9b376261ddd..6c2f8ee0367 100644 --- a/fix/fixer_sshkeypath.go +++ b/fix/fixer_sshkeypath.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_sshkeypath_test.go b/fix/fixer_sshkeypath_test.go index 865f8c1deed..561db0ef788 100644 --- a/fix/fixer_sshkeypath_test.go +++ b/fix/fixer_sshkeypath_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_test.go b/fix/fixer_test.go index e6a01fcf58d..2b09611521b 100644 --- a/fix/fixer_test.go +++ b/fix/fixer_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_virtualbox_gaattach.go b/fix/fixer_virtualbox_gaattach.go index 8e2a85e85a8..5fc0834c72b 100644 --- a/fix/fixer_virtualbox_gaattach.go +++ b/fix/fixer_virtualbox_gaattach.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_virtualbox_gaattach_test.go b/fix/fixer_virtualbox_gaattach_test.go index b88e9325f89..62aa5b159a8 100644 --- a/fix/fixer_virtualbox_gaattach_test.go +++ b/fix/fixer_virtualbox_gaattach_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_virtualbox_rename.go b/fix/fixer_virtualbox_rename.go index 2f118e3fbf5..86d53fd1ff4 100644 --- a/fix/fixer_virtualbox_rename.go +++ b/fix/fixer_virtualbox_rename.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_virtualbox_rename_test.go b/fix/fixer_virtualbox_rename_test.go index 355e5276a95..932975bd0a6 100644 --- a/fix/fixer_virtualbox_rename_test.go +++ b/fix/fixer_virtualbox_rename_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vmware_compaction.go b/fix/fixer_vmware_compaction.go index dfb1d13547c..cc833186dd1 100644 --- a/fix/fixer_vmware_compaction.go +++ b/fix/fixer_vmware_compaction.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vmware_compaction_test.go b/fix/fixer_vmware_compaction_test.go index 25a87e170d3..eb5494a3159 100644 --- a/fix/fixer_vmware_compaction_test.go +++ b/fix/fixer_vmware_compaction_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vmware_rename.go b/fix/fixer_vmware_rename.go index 726e8030ca1..c81e01b8577 100644 --- a/fix/fixer_vmware_rename.go +++ b/fix/fixer_vmware_rename.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vmware_rename_test.go b/fix/fixer_vmware_rename_test.go index 059b73ad15a..4c2cb095dc3 100644 --- a/fix/fixer_vmware_rename_test.go +++ b/fix/fixer_vmware_rename_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vsphere_network_storage.go b/fix/fixer_vsphere_network_storage.go index 5c04ab1a37d..f82bc20463e 100644 --- a/fix/fixer_vsphere_network_storage.go +++ b/fix/fixer_vsphere_network_storage.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/fixer_vsphere_network_storage_test.go b/fix/fixer_vsphere_network_storage_test.go index fdc764ad332..59e4bbf1c62 100644 --- a/fix/fixer_vsphere_network_storage_test.go +++ b/fix/fixer_vsphere_network_storage_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix import ( diff --git a/fix/helpers.go b/fix/helpers.go index 6866c12ea61..d4d01b22123 100644 --- a/fix/helpers.go +++ b/fix/helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package fix // PP is a convenient way to interact with the post-processors within a fixer diff --git a/go b/go new file mode 100644 index 00000000000..e69de29bb2d diff --git a/go.mod b/go.mod index 64ef1a202fc..025eeea49ca 100644 --- a/go.mod +++ b/go.mod @@ -1,270 +1,195 @@ module github.com/hashicorp/packer -go 1.18 - require ( - cloud.google.com/go v0.104.0 // indirect + cloud.google.com/go v0.110.8 // indirect github.com/biogo/hts v1.4.3 github.com/cheggaaa/pb v1.0.27 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/dsnet/compress v0.0.1 - github.com/go-git/go-git/v5 v5.4.2 - github.com/go-openapi/runtime v0.19.24 + github.com/go-git/go-git/v5 v5.11.0 + github.com/go-openapi/runtime v0.26.2 github.com/gobwas/glob v0.2.3 github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.6.0 github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69 github.com/google/go-querystring v1.1.0 // indirect github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 - github.com/hashicorp/go-getter/v2 v2.1.0 + github.com/hashicorp/go-getter/v2 v2.2.1 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/go-uuid v1.0.2 - github.com/hashicorp/go-version v1.4.0 - github.com/hashicorp/hcl/v2 v2.14.1 - github.com/hashicorp/hcp-sdk-go v0.28.0 - github.com/hashicorp/packer-plugin-amazon v1.1.6 - github.com/hashicorp/packer-plugin-sdk v0.3.2 + github.com/hashicorp/go-uuid v1.0.3 + github.com/hashicorp/go-version v1.6.0 + github.com/hashicorp/hcl/v2 v2.19.1 + github.com/hashicorp/hcp-sdk-go v0.93.0 + github.com/hashicorp/packer-plugin-amazon v1.2.1 + github.com/hashicorp/packer-plugin-sdk v0.5.3 github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/pgzip v1.2.5 github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0 github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 - github.com/mitchellh/cli v1.1.2 + github.com/mitchellh/cli v1.1.5 github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/panicwrap v1.0.0 github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db // indirect - github.com/pierrec/lz4 v2.6.1+incompatible github.com/pkg/sftp v1.13.2 // indirect github.com/posener/complete v1.2.3 - github.com/shirou/gopsutil v3.21.11+incompatible - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.4 github.com/ulikunitz/xz v0.5.10 - github.com/zclconf/go-cty v1.10.0 + github.com/zclconf/go-cty v1.13.3 github.com/zclconf/go-cty-yaml v1.0.1 - golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 - golang.org/x/net v0.4.0 - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect - golang.org/x/tools v0.1.12 - google.golang.org/api v0.97.0 // indirect - google.golang.org/grpc v1.49.0 + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/mod v0.13.0 + golang.org/x/net v0.24.0 + golang.org/x/oauth2 v0.15.0 + golang.org/x/sync v0.4.0 + 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/tools v0.14.0 + google.golang.org/api v0.128.0 // indirect + google.golang.org/grpc v1.59.0 ) require ( - github.com/digitalocean/packer-plugin-digitalocean v1.1.1 - github.com/hashicorp/packer-plugin-alicloud v1.0.5 - github.com/hashicorp/packer-plugin-ansible v1.0.3 - github.com/hashicorp/packer-plugin-azure v1.3.1 - github.com/hashicorp/packer-plugin-chef v1.0.2 - github.com/hashicorp/packer-plugin-cloudstack v1.0.2 - github.com/hashicorp/packer-plugin-converge v1.0.1 - github.com/hashicorp/packer-plugin-docker v1.0.8 - github.com/hashicorp/packer-plugin-googlecompute v1.0.16 - github.com/hashicorp/packer-plugin-hcloud v1.0.5 - github.com/hashicorp/packer-plugin-hyperone v1.0.1 - github.com/hashicorp/packer-plugin-hyperv v1.0.4 - github.com/hashicorp/packer-plugin-inspec v1.0.0 - github.com/hashicorp/packer-plugin-jdcloud v1.0.1 - github.com/hashicorp/packer-plugin-linode v1.0.3 - github.com/hashicorp/packer-plugin-lxc v1.0.2 - github.com/hashicorp/packer-plugin-lxd v1.0.1 - github.com/hashicorp/packer-plugin-ncloud v1.0.3 - github.com/hashicorp/packer-plugin-oneandone v1.0.1 - github.com/hashicorp/packer-plugin-openstack v1.0.1 - github.com/hashicorp/packer-plugin-parallels v1.0.3 - github.com/hashicorp/packer-plugin-profitbricks v1.0.2 - github.com/hashicorp/packer-plugin-proxmox v1.1.0 - github.com/hashicorp/packer-plugin-puppet v1.0.1 - github.com/hashicorp/packer-plugin-qemu v1.0.8 - github.com/hashicorp/packer-plugin-salt v1.0.0 - github.com/hashicorp/packer-plugin-tencentcloud v1.0.5 - github.com/hashicorp/packer-plugin-triton v1.0.2 - github.com/hashicorp/packer-plugin-ucloud v1.0.1 - github.com/hashicorp/packer-plugin-vagrant v1.0.3 - github.com/hashicorp/packer-plugin-virtualbox v1.0.4 - github.com/hashicorp/packer-plugin-vmware v1.0.7 - github.com/hashicorp/packer-plugin-vsphere v1.1.1 - github.com/hashicorp/packer-plugin-yandex v1.1.2 + github.com/go-openapi/strfmt v0.21.10 + github.com/oklog/ulid v1.3.1 + github.com/pierrec/lz4/v4 v4.1.18 + github.com/shirou/gopsutil/v3 v3.23.4 ) require ( - cloud.google.com/go/compute v1.7.0 // indirect - cloud.google.com/go/iam v0.3.0 // indirect - cloud.google.com/go/storage v1.27.0 // indirect - github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 // indirect - github.com/Azure/azure-sdk-for-go v64.0.0+incompatible // indirect - github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.11.19 // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect - github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect - github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect - github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect - github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect - github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect - github.com/Azure/go-autorest/logger v0.2.1 // indirect - github.com/Azure/go-autorest/tracing v0.6.0 // indirect + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v1.1.2 // indirect + cloud.google.com/go/storage v1.30.1 // indirect + dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect - github.com/Microsoft/go-winio v0.4.16 // indirect - github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.7 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/Telmate/proxmox-api-go v0.0.0-20220107223401-b9c909d83a3b // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.1 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/agext/levenshtein v1.2.3 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.62.108 // indirect - github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible // indirect - github.com/antihax/optional v1.0.0 // indirect - github.com/apache/cloudstack-go/v2 v2.12.0 // indirect github.com/apparentlymart/go-cidr v1.0.1 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/armon/go-metrics v0.3.9 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go v1.44.110 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/aws/aws-sdk-go v1.44.114 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bmatcuk/doublestar v1.1.5 // indirect - github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1 // indirect - github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001 // indirect - github.com/digitalocean/godo v1.82.0 // indirect - github.com/dimchansky/utfbom v1.1.1 // indirect + github.com/chzyer/test v1.0.0 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dylanmei/iso8601 v0.1.0 // indirect - github.com/emirpasic/gods v1.12.0 // indirect - github.com/fatih/color v1.12.0 // indirect - github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-git/gcfg v1.5.0 // indirect - github.com/go-git/go-billy/v5 v5.3.1 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/fatih/color v1.14.1 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-jose/go-jose/v3 v3.0.3 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/analysis v0.20.0 // indirect - github.com/go-openapi/errors v0.20.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect - github.com/go-openapi/loads v0.20.2 // indirect - github.com/go-openapi/spec v0.20.3 // indirect - github.com/go-openapi/strfmt v0.21.3 // indirect - github.com/go-openapi/swag v0.19.14 // indirect - github.com/go-openapi/validate v0.20.2 // indirect - github.com/go-resty/resty/v2 v2.6.0 // indirect + github.com/go-openapi/analysis v0.21.5 // indirect + github.com/go-openapi/errors v0.21.0 // indirect + github.com/go-openapi/jsonpointer v0.20.1 // indirect + github.com/go-openapi/jsonreference v0.20.3 // indirect + github.com/go-openapi/loads v0.21.3 // indirect + github.com/go-openapi/spec v0.20.12 // indirect + github.com/go-openapi/swag v0.22.5 // indirect + github.com/go-openapi/validate v0.22.4 // indirect github.com/gofrs/uuid v4.0.0+incompatible // indirect - github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect - github.com/golang-jwt/jwt/v4 v4.2.0 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.0.1 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect - github.com/googleapis/gax-go/v2 v2.5.1 // indirect - github.com/gophercloud/gophercloud v0.12.0 // indirect - github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/s2a-go v0.1.4 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/hashicorp/aws-sdk-go-base v0.7.1 // indirect - github.com/hashicorp/consul/api v1.10.1 // indirect + github.com/hashicorp/consul/api v1.25.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-azure-helpers v0.16.5 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter/gcs/v2 v2.1.0 // indirect - github.com/hashicorp/go-getter/s3/v2 v2.1.0 // indirect - github.com/hashicorp/go-hclog v0.16.2 // indirect + github.com/hashicorp/go-getter/gcs/v2 v2.2.1 // indirect + github.com/hashicorp/go-getter/s3/v2 v2.2.1 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect + github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/serf v0.9.5 // indirect - github.com/hashicorp/vault/api v1.1.1 // indirect - github.com/hashicorp/vault/sdk v0.2.1 // indirect - github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493 // indirect - github.com/hetznercloud/hcloud-go v1.25.0 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/hashicorp/vault/api v1.10.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/xstrings v1.3.2 // indirect - github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/joyent/triton-go v1.8.5 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kr/fs v0.1.0 // indirect - github.com/linode/linodego v0.30.0 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect - github.com/matryer/is v1.4.0 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/iochan v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/oklog/ulid v1.3.1 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sergi/go-diff v1.1.0 // indirect - github.com/sirupsen/logrus v1.4.2 // indirect + github.com/shoenig/go-m1cpu v0.1.5 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/skeema/knownhosts v1.2.1 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.367 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.366 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.366 // indirect - github.com/tklauser/go-sysconf v0.3.9 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect - github.com/ucloud/ucloud-sdk-go v0.20.2 // indirect - github.com/ufilesdk-dev/ufile-gosdk v1.0.1 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect github.com/ugorji/go/codec v1.2.6 // indirect - github.com/vmware/govmomi v0.29.0 // indirect - github.com/xanzy/ssh-agent v0.3.0 // indirect - github.com/yandex-cloud/go-genproto v0.0.0-20211202135052-789603780fb2 // indirect - github.com/yandex-cloud/go-sdk v0.0.0-20211206101223-7c4e7926bf53 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.mongodb.org/mongo-driver v1.11.0 // indirect - go.opencensus.io v0.23.0 // indirect - golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/otel v1.17.0 // indirect + go.opentelemetry.io/otel/metric v1.17.0 // indirect + go.opentelemetry.io/otel/trace v1.17.0 // indirect + golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006 // indirect - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect - gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/hashicorp/packer-plugin-sdk => github.com/inloco/packer-plugin-sdk v0.3.2-incognia.3 +go 1.21 + +replace github.com/zclconf/go-cty => github.com/nywilken/go-cty v1.13.3 // added by packer-sdc fix as noted in github.com/hashicorp/packer-plugin-sdk/issues/187 \ No newline at end of file diff --git a/go.sum b/go.sum index b385dc79a45..c7e88627789 100644 --- a/go.sum +++ b/go.sum @@ -1,110 +1,18 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.104.0 h1:gSmWO7DY1vOm0MVU6DNXM11BWHHsTUmsC5cv1fuW5X8= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= +cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= +cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 h1:RMTyvS5bjvSWiUcfqfr/E2pxHEMrALvU+E12n6biymg= -github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1/go.mod h1:61apmbkVJH4kg+38ftT+/l0XxdUCVnHggqcOTqZRSEE= -github.com/Azure/azure-sdk-for-go v51.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v64.0.0+incompatible h1:WAA77WBDWYtNfCC95V70VvkdzHe+wM/r2MQ9mG7fnQs= -github.com/Azure/azure-sdk-for-go v64.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest v0.11.19 h1:7/IqD2fEYVha1EPeaiytVKhzmPV223pfkRIQUGOK2IE= -github.com/Azure/go-autorest/autorest v0.11.19/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= -github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= -github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= -github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= @@ -114,89 +22,52 @@ github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nu github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns= github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.7 h1:Kpnbe19WkzVPpLLdAus4LkpNJ+pzLpfAViOUuvPcCqA= -github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.7/go.mod h1:P+3VS0ETiQPyWOx3vB/oeC8J3qd7jnVZLYAFwWgGRt8= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Telmate/proxmox-api-go v0.0.0-20220107223401-b9c909d83a3b h1:EzGVAEAffdZqkKpI4wC9dzR81v/uBB4yYuXf1wU3fZk= -github.com/Telmate/proxmox-api-go v0.0.0-20220107223401-b9c909d83a3b/go.mod h1:keBhXWLa+UBajvf79xvKcfiqeIc7vZL9wOqxuy1CBGw= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.1 h1:n6EPaDyLSvCEa3frruQvAiHuNp2dhBlMSmkEr+HuzGc= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.108 h1:bQ1VT+mvjnNiUVnQpIBStbLD/qeFjr0KL+vr/mOVuE0= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.108/go.mod h1:Api2AkmMgGaSUAhmk76oaFObkoeCPc/bKAqcyplPODs= -github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible h1:hLUNPbx10wawWW7DeNExvTrlb90db3UnnNTFKHZEFhE= -github.com/aliyun/aliyun-oss-go-sdk v2.1.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= +github.com/antchfx/xmlquery v1.3.5 h1:I7TuBRqsnfFuL11ruavGm911Awx9IqSdiU6W/ztSmVw= +github.com/antchfx/xmlquery v1.3.5/go.mod h1:64w0Xesg2sTaawIdNqMB+7qaW/bSqkQm+ssPaCMWNnc= github.com/antchfx/xpath v1.1.11 h1:WOFtK8TVAjLm3lbgqeP0arlHpvCEeTANeWZ/csPpJkQ= -github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0 h1:JaCC8jz0zdMLk2m+qCCVLLLM/PL93p84w4pK3aJWj60= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antchfx/xpath v1.1.11/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/cloudstack-go/v2 v2.12.0 h1:IqJjFt1/bc29+8OZtzMijZGgHfUUNZ8R4Zjx091iFnU= -github.com/apache/cloudstack-go/v2 v2.12.0/go.mod h1:2mPSVR6kkM3u1i9L3mmR+Du1f+QBwFKYOSI2XQEyhj4= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/approvals/go-approval-tests v0.0.0-20210131072903-38d0b0ec12b1 h1:uroQ0JaeVom9Ffv9xFtc7DcqrpGmyQeZCRzHD9FqPBg= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= -github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.30.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/aws-sdk-go v1.44.110 h1:unno3l2FYQo6p0wYCp9gUk8YNzhOxqSktM0Y1vukl9k= -github.com/aws/aws-sdk-go v1.44.110/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= +github.com/aws/aws-sdk-go v1.44.114 h1:plIkWc/RsHr3DXBj4MEw9sEW4CcL/e2ryokc+CKyq1I= +github.com/aws/aws-sdk-go v1.44.114/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -209,302 +80,125 @@ github.com/biogo/hts v1.4.3 h1:vir2yUTiRkPvtp6ZTpzh9lWTKQJZXJKZ563rpAQAsRM= github.com/biogo/hts v1.4.3/go.mod h1:eW40HJ1l2ExK9C+yvvoRSftInqWsf3ue+zAEjzCGWjA= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= -github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2 h1:t8KYCwSKsOEZBFELI4Pn/phbp38iJ1RRAkDFNin1aak= -github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200709052629-daa8e1ccc0bc/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1 h1:j6vGflaQ2T7yOWqVgPdiRF73j/U2Zmpbbzab8nyDCRQ= -github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1/go.mod h1:QS1XzqZLcDniNYrN7EZefq3wIyb/M2WmJbql4ZKoc1Q= -github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001 h1:WAg57gnaAWWjMAELcwHjc2xy0PoXQ5G+vn3+XS6s1jI= -github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001/go.mod h1:IetBE52JfFxK46p2n2Rqm+p5Gx1gpu2hRHsrbnPOWZQ= -github.com/digitalocean/godo v1.82.0 h1:lqAit46H1CqJGjh7LDbsamng/UMBME5rvmfH3Vb5Yy8= -github.com/digitalocean/godo v1.82.0/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew= -github.com/digitalocean/packer-plugin-digitalocean v1.1.1 h1:/Ki8nKK/b38L5uu7VqZVf9sNkqm5Qot+AE36zpoXfj0= -github.com/digitalocean/packer-plugin-digitalocean v1.1.1/go.mod h1:87IUPejfcIvtQYqIA7u19+Rk1mpwIM8ny+OyJm8L+X4= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08 h1:0bp6/GrNOrTDtSXe9YYGCwf8jp5Fb/b+4a6MTRm4qzY= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/dylanmei/winrmtest v0.0.0-20210303004826-fbc9ae56efb6 h1:zWydSUQBJApHwpQ4guHi+mGyQN/8yN6xbKWdDtL3ZNM= +github.com/dylanmei/winrmtest v0.0.0-20210303004826-fbc9ae56efb6/go.mod h1:6BLLhzn1VEiJ4veuAGhINBTrBlV889Wd+aU4auxKOww= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE= -github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= +github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= -github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= -github.com/go-openapi/analysis v0.20.0 h1:UN09o0kNhleunxW7LR+KnltD0YrJ8FF03pSqvAN3Vro= -github.com/go-openapi/analysis v0.20.0/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= -github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= -github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= -github.com/go-openapi/loads v0.20.2 h1:z5p5Xf5wujMxS1y8aP+vxwW5qYT2zdJBbXKmQUG3lcc= -github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4= -github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= -github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= -github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= -github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= -github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= -github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= -github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= -github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-openapi/validate v0.20.2 h1:AhqDegYV3J3iQkMPJSXkvzymHKMTw0BST3RK3hTT4ts= -github.com/go-openapi/validate v0.20.2/go.mod h1:e7OJoKNgd0twXZwIn0A43tHbvIcr/rZIVCbJBpTUoY0= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= -github.com/go-resty/resty/v2 v2.6.0 h1:joIR5PNLM2EFqqESUjCMGXrWmXNHEU9CEiK813oKYS4= -github.com/go-resty/resty/v2 v2.6.0/go.mod h1:PwvJS6hvaPkjtjNg9ph+VrSD92bi5Zq73w/BIH7cC3Q= +github.com/go-openapi/analysis v0.21.5 h1:3tHfEBh6Ia8eKc4M7khOGjPOAlWKJ10d877Cr9teujI= +github.com/go-openapi/analysis v0.21.5/go.mod h1:25YcZosX9Lwz2wBsrFrrsL8bmjjXdlyP6zsr2AMy29M= +github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY= +github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho= +github.com/go-openapi/jsonpointer v0.20.1 h1:MkK4VEIEZMj4wT9PmjaUmGflVBr9nvud4Q4UVFbDoBE= +github.com/go-openapi/jsonpointer v0.20.1/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.3 h1:EjGcjTW8pD1mRis6+w/gmoBdqv5+RbE9B85D1NgDOVQ= +github.com/go-openapi/jsonreference v0.20.3/go.mod h1:FviDZ46i9ivh810gqzFLl5NttD5q3tSlMLqLr6okedM= +github.com/go-openapi/loads v0.21.3 h1:8sSH2FIm/SnbDUGv572md4YqVMFne/a9Eubvcd3anew= +github.com/go-openapi/loads v0.21.3/go.mod h1:Y3aMR24iHbKHppOj91nQ/SHc0cuPbAr4ndY4a02xydc= +github.com/go-openapi/runtime v0.26.2 h1:elWyB9MacRzvIVgAZCBJmqTi7hBzU0hlKD4IvfX0Zl0= +github.com/go-openapi/runtime v0.26.2/go.mod h1:O034jyRZ557uJKzngbMDJXkcKJVzXJiymdSfgejrcRw= +github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI= +github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4= +github.com/go-openapi/strfmt v0.21.10 h1:JIsly3KXZB/Qf4UzvzJpg4OELH/0ASDQsyk//TTBDDk= +github.com/go-openapi/strfmt v0.21.10/go.mod h1:vNDMwbilnl7xKiO/Ve/8H8Bb2JIInBnH+lqiw6QWgis= +github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys= +github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= +github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= +github.com/go-openapi/validate v0.22.4/go.mod h1:qm6O8ZIcPVdSY5219468Jv7kBdGvkiZLPOmqnqTUZ2A= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4= -github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -514,105 +208,55 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69 h1:zL0/Ug5CMhV0XRb3A6vnK1SQ9kJM3VIyRxPQ5t9w8Bg= github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1 h1:kBRZU0PSuI7PspsSb/ChWoVResUcwNVIdpB049pKTiw= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gophercloud/gophercloud v0.6.1-0.20191122030953-d8ac278c1c9d/go.mod h1:ozGNgr9KYOVATV5jsgHl/ceCDXGuguqOZAzoQ/2vcNM= -github.com/gophercloud/gophercloud v0.12.0 h1:mZrie07npp6ODiwHZolTicr5jV8Ogn43AvAsSMm6Ork= -github.com/gophercloud/gophercloud v0.12.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss= -github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c h1:iawx2ojEQA7c+GmkaVO5sN+k8YONibXyDO8RlsC+1bs= -github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.4 h1:uGy6JWR/uMIILU8wbf+OkstIrNiMjGpEIyhx8f6W7s4= +github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= -github.com/hashicorp/consul/api v1.10.1 h1:MwZJp86nlnL+6+W1Zly4JUuVn9YHhMggBirMpHGD7kw= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-azure-helpers v0.16.5 h1:rhcpg2Nk1Li6173KTHNnj/i+MGXYNjvYKIdNlg6q3RU= -github.com/hashicorp/go-azure-helpers v0.16.5/go.mod h1:kR7+sTDEb9TOp/O80ss1UEJg1t4/BHLD/U8wHLS4BGQ= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -621,272 +265,149 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 h1:kgvybwEeu0SXktbB2y3uLHX9lklLo+nzUwh59A3jzQc= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA= -github.com/hashicorp/go-getter/gcs/v2 v2.1.0 h1:1S1hvWgHrhUihP/Y4FVbjCWwE7EwxpksKoRcC7g+Hgs= -github.com/hashicorp/go-getter/gcs/v2 v2.1.0/go.mod h1:dVyTnX1BynHAjbumB4Pk14GoJ+v3VbDUJtbI7G0oOlU= -github.com/hashicorp/go-getter/s3/v2 v2.1.0 h1:8uwuP97zEQ7y7H4bLzRqiN4T8vmpXeJthigqSEjX+08= -github.com/hashicorp/go-getter/s3/v2 v2.1.0/go.mod h1:rwzJPQaBuc5riYOucPx84DOE74xIhKENOWgBjK3XVEs= -github.com/hashicorp/go-getter/v2 v2.1.0 h1:MsLbi7yFKGFPVmpK+un4/k5HFry0tqvo9JppsCmIutU= -github.com/hashicorp/go-getter/v2 v2.1.0/go.mod h1:w65fE5glbccYjndAuj1kA5lnVBGZYEaH0e5qA1kpIks= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-getter/gcs/v2 v2.2.1 h1:yZgDXYy5m4xogJV8hXzX5S/fM/rjJnBz+EzTeFrfLEM= +github.com/hashicorp/go-getter/gcs/v2 v2.2.1/go.mod h1:xzT3sNmGRipCRMpWz24fYHMvgb4MRn/smg5k2mhJ7Bo= +github.com/hashicorp/go-getter/s3/v2 v2.2.1 h1:Psuhz6iuCxJOd3kGinK46x+4BzcJgwff8BId7CuGPYU= +github.com/hashicorp/go-getter/s3/v2 v2.2.1/go.mod h1:KDqfEPgpwZIy+1sAplFX231CE+M6wdL5Q/j6OMbKSnw= +github.com/hashicorp/go-getter/v2 v2.2.1 h1:2JXqPZs1Jej67RtdTi0YZaEB2hEFB3fkBA4cPYKQwFQ= +github.com/hashicorp/go-getter/v2 v2.2.1/go.mod h1:EcJx6oZE8hmGuRR1l38QrfnyiujQbwsEAn11eHv6l2M= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= -github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= -github.com/hashicorp/hcp-sdk-go v0.28.0 h1:QO03avWHSp2wkZMYR0ma7kjMkHC70eziz75qJGiuSNU= -github.com/hashicorp/hcp-sdk-go v0.28.0/go.mod h1:BRtYrm9RwAAtnuGU/rwTeAyzKTNH/d4WlHa6eNvcEHQ= +github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hcp-sdk-go v0.93.0 h1:Ddo261pU9mnHIK5+ncRqSfRqMkkCJsmGyoMHoatAdFg= +github.com/hashicorp/hcp-sdk-go v0.93.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/packer-plugin-alicloud v1.0.5 h1:SMateqh9nrGWXSii95cokvwt4RjBsw7EsvMHa3m4zco= -github.com/hashicorp/packer-plugin-alicloud v1.0.5/go.mod h1:+dx3QSoBC+6IOBP647xdcHNzD39uStAtp92/9k8QSTU= -github.com/hashicorp/packer-plugin-amazon v1.1.6 h1:tKhnBLbKh1MCV1KocG7XqP+2td7sRlNig/+6/0Hlk4k= -github.com/hashicorp/packer-plugin-amazon v1.1.6/go.mod h1:zsmzji+RsT+YH/K+CyEw4Q+C5EizbuspcQ/4mTvRf+8= -github.com/hashicorp/packer-plugin-ansible v1.0.3 h1:XjltQVPYnnZdNyBjwHr1QthR413SjZxTtRrmM0sM3VI= -github.com/hashicorp/packer-plugin-ansible v1.0.3/go.mod h1:N4OZtNDq2FSRBknuNU/GSoKtllfxQnHCYYaJUD1p1MA= -github.com/hashicorp/packer-plugin-azure v1.3.1 h1:oXkgxZEKhkPwVnAKhc1Z45U+vpgM9n3is/tC2eWY+Eo= -github.com/hashicorp/packer-plugin-azure v1.3.1/go.mod h1:R38/vpe/hQ9rPLuv4IRkGFb5Awp/4pubo/0rT0ICMdM= -github.com/hashicorp/packer-plugin-chef v1.0.2 h1:hkVhBuglBc5wY4cNfFObW7hzJuT+VdWMAu/gQ9nDNOI= -github.com/hashicorp/packer-plugin-chef v1.0.2/go.mod h1:RWNaO+NprfeW4mdZDAGaLPJE3hUR8f/poSw1MNTt+NA= -github.com/hashicorp/packer-plugin-cloudstack v1.0.2 h1:JsT2AuCcZGajbFL0w/sQ5yzoWLwOPyETboDR+Ws0xbo= -github.com/hashicorp/packer-plugin-cloudstack v1.0.2/go.mod h1:WCX3zX0P6ubg3QoErIFu/b7UwzxVli2WVa82wfbPqa0= -github.com/hashicorp/packer-plugin-converge v1.0.1 h1:LNjhWQCaPNHSgeKGj/vXwqlEuqz3lA4P7gD7YQ1XsNA= -github.com/hashicorp/packer-plugin-converge v1.0.1/go.mod h1:iXfr0QvDEOmSIK2ry53KCfztK3QaeQuTo8eHqzWMlVI= -github.com/hashicorp/packer-plugin-docker v1.0.8 h1:UWPG/pl+1RFsaNQVhEuowCeOZuES6/mqy5R6FTyMeQo= -github.com/hashicorp/packer-plugin-docker v1.0.8/go.mod h1:4U3gHULbUw3okSqqZgQZD5ptyJKs0S7LfOOt2U3V4Jk= -github.com/hashicorp/packer-plugin-googlecompute v1.0.16 h1:YF67aspuId/ewm8p7b0fNjRpDKHgf8WvJ5kXmAXPIvM= -github.com/hashicorp/packer-plugin-googlecompute v1.0.16/go.mod h1:k2iAHNsaoWCIwW5Zc/T2q7SjstdMTsXRAbq+3HZJmMw= -github.com/hashicorp/packer-plugin-hcloud v1.0.5 h1:GNYz2jZzjqRDP38YEVyEEgk3SzvjKXDxOV1L9H9xj/I= -github.com/hashicorp/packer-plugin-hcloud v1.0.5/go.mod h1:FiFFtzIjF30UMdrYG9hJ6MyJNdNROeytfqvUV5YLiqw= -github.com/hashicorp/packer-plugin-hyperone v1.0.1 h1:rTxnbFE8UDnzWG3prHQZpWmCpFHMd1GmE7M8jW8Fuq4= -github.com/hashicorp/packer-plugin-hyperone v1.0.1/go.mod h1:tT5g5xjFRuFX28w0NhpiwMum/JQDjboJwfa3Zt3ND+Q= -github.com/hashicorp/packer-plugin-hyperv v1.0.4 h1:SHdo60jfrmeSz+T25Aa2BuSWBioFOWe4hKmp7W6lIUs= -github.com/hashicorp/packer-plugin-hyperv v1.0.4/go.mod h1:8kHew9yWRaKYojmOMj1FYVlhOrdtiIZX2Z8RM+sHxJE= -github.com/hashicorp/packer-plugin-inspec v1.0.0 h1:6qRgH90Q+L3HSzo5UvuSozzS4VzU+ckkwJi9pMHYW1M= -github.com/hashicorp/packer-plugin-inspec v1.0.0/go.mod h1:SsVyBs8b/g1wMC+4HgZQWT01kqxrwprA7dKxHAIRFKw= -github.com/hashicorp/packer-plugin-jdcloud v1.0.1 h1:qgecywtT8EqGiHdvopC36eBz1lSZs336w7X2q+y+UY0= -github.com/hashicorp/packer-plugin-jdcloud v1.0.1/go.mod h1:1i/cCievlQE+grHJWUxhwi5nzwSXt9n0WmcHpFVMt5I= -github.com/hashicorp/packer-plugin-linode v1.0.3 h1:CHE4G5GsgT8CEiMn7FBsckBFsfwUF+0i0b/t+a0PyEs= -github.com/hashicorp/packer-plugin-linode v1.0.3/go.mod h1:zxEZrwpN8X1L1P3QlRvaT5asH33xdx62/qPIVnqycbA= -github.com/hashicorp/packer-plugin-lxc v1.0.2 h1:JvIkbSynft+9JAi1uPEVHesIe02OX2yL9rPj1Ud0kM8= -github.com/hashicorp/packer-plugin-lxc v1.0.2/go.mod h1:kirXCLekY6h0YPbWaue2YRqKqiumyDnbwwww/TGjGjE= -github.com/hashicorp/packer-plugin-lxd v1.0.1 h1:sqdaEdip0y/wC7x99CQHIbakJSmZY2kI3LfFT0FvYVo= -github.com/hashicorp/packer-plugin-lxd v1.0.1/go.mod h1:IZJTYWyGxlNZm0GKUgVejCPrXAU/cTlIpRiFgeQCCn4= -github.com/hashicorp/packer-plugin-ncloud v1.0.3 h1:+LCQ404nhWM871dy8oLuspFgTAt6qpx1fXZj9e4GcZY= -github.com/hashicorp/packer-plugin-ncloud v1.0.3/go.mod h1:5KQwE5s6GG8rAjwmzmWbjwQH7/nrn/hmJ/aZJIn4i+Q= -github.com/hashicorp/packer-plugin-oneandone v1.0.1 h1:6rnqSWSve4XB+im1MYfgdGnyDCFJuEKCORw3aLsYkfk= -github.com/hashicorp/packer-plugin-oneandone v1.0.1/go.mod h1:9alSvlih9aE4Pebnnw7CmfmOyKKjnAxbxXZN9yFCCsE= -github.com/hashicorp/packer-plugin-openstack v1.0.1 h1:R4Iw0Vx/o14e2GRbKypwsR1B21z6CkaISX+KqwtLuTo= -github.com/hashicorp/packer-plugin-openstack v1.0.1/go.mod h1:i5qn9aUabJM9mjhpXS81hFSuDjJYA2kOi0vLlo3VGsE= -github.com/hashicorp/packer-plugin-parallels v1.0.3 h1:smypphUCEj3arCdlvbNtZvGC1ujsUSRtN1MBvZHt/w8= -github.com/hashicorp/packer-plugin-parallels v1.0.3/go.mod h1:Q842nvosVmP5FnYozk8ZZj93HGIan19jHTxGeteBCb0= -github.com/hashicorp/packer-plugin-profitbricks v1.0.2 h1:wAlTRm1A39T9hferxFtKaLCDmlsqA9cU7dTQtMLcvKQ= -github.com/hashicorp/packer-plugin-profitbricks v1.0.2/go.mod h1:Gpg/h6A0UcTYzLwDw2GrUJjlPUmL5QaxGBJWH0NMx0g= -github.com/hashicorp/packer-plugin-proxmox v1.1.0 h1:ewqOLx1CbEpG0SIET6tcWP9Ijgc86/tAEjUhZfH3QAI= -github.com/hashicorp/packer-plugin-proxmox v1.1.0/go.mod h1:8SBMRM813mDvsFSfTC7S0cta9RVbXp8hQEphvJORW+A= -github.com/hashicorp/packer-plugin-puppet v1.0.1 h1:/obGvsyiKiO2hX9TxRTJ7Y+/44K4WqKJlzg4xHAyIoY= -github.com/hashicorp/packer-plugin-puppet v1.0.1/go.mod h1:avMyKLTT/6SVR/hEgJk92SMziK3nwlNJ00kOYgwIDMk= -github.com/hashicorp/packer-plugin-qemu v1.0.8 h1:7RBToKsCH50vo7H+gviuYR+3dknIQhtrtMcJpKNBm70= -github.com/hashicorp/packer-plugin-qemu v1.0.8/go.mod h1:BpWIpVpOoPFV9Ppmzq4DP/S0QNoh1R+7DUCqxHdXc+Y= -github.com/hashicorp/packer-plugin-salt v1.0.0 h1:bLGdlDG2nLyOzjp/5d2rmZ9XVxDeDUGejOK3wayqEL4= -github.com/hashicorp/packer-plugin-salt v1.0.0/go.mod h1:onggPITzeB6LPSW8XlSobu8eI6yj3IMUi5cS6vWnL7s= -github.com/hashicorp/packer-plugin-tencentcloud v1.0.5 h1:L0OWx9fSu785mCoCA9dr15WTup6ILNFAYV6HTld0OXQ= -github.com/hashicorp/packer-plugin-tencentcloud v1.0.5/go.mod h1:XRfZLgzsf6aFgE5W5W5rHadjVLIbI36e904aiGkJyTI= -github.com/hashicorp/packer-plugin-triton v1.0.2 h1:Yla93I7Jl/WXCuCRWYYR0J8/57X4puGLZ07wBn+QS9w= -github.com/hashicorp/packer-plugin-triton v1.0.2/go.mod h1:4eeTOUPYYD1B9iNF0FMqfVczqhTRuL9bXn3AqJa2N9Y= -github.com/hashicorp/packer-plugin-ucloud v1.0.1 h1:zHNRpIwXZLGZymj7Jf752Hs0lhywJFiEF1jbCAP0bd0= -github.com/hashicorp/packer-plugin-ucloud v1.0.1/go.mod h1:Blwxt0UxAdXQWZJntwlGkFQ/C1ftxi7L6WSB3namT1U= -github.com/hashicorp/packer-plugin-vagrant v1.0.3 h1:IUfEdYuAjSjGsgJI2rnZ1qEo5rI0UWoueJ+yq9ysx4M= -github.com/hashicorp/packer-plugin-vagrant v1.0.3/go.mod h1:Ymg8LJrT8N2Dclu91G3ZhXpE67jL7hfbtyDVKeNsKTc= -github.com/hashicorp/packer-plugin-virtualbox v1.0.4 h1:mceFO34yhBU4BUMmCcQAB6KQ98GPjBIXTG3eS22RmZM= -github.com/hashicorp/packer-plugin-virtualbox v1.0.4/go.mod h1:rnDkWJpkbcFPBmsMZcoImWDd9kLjTiXiN0sfHypuHac= -github.com/hashicorp/packer-plugin-vmware v1.0.7 h1:cnc6XRNAkE+P5EoiI4VLXmIUeb2VAqW6zdNFmIW11YY= -github.com/hashicorp/packer-plugin-vmware v1.0.7/go.mod h1:AGeNk9f/qKUP8yGoiofMqvBw8TJLtdhsZgvqannZQS4= -github.com/hashicorp/packer-plugin-vsphere v1.1.1 h1:X4PtYV7TGPqoudjfvHpI2qRl9pAGf1SfkiJ7sMCKAEU= -github.com/hashicorp/packer-plugin-vsphere v1.1.1/go.mod h1:kLbvU4EwRISjhvY3c5pVisCKE0Usn+pOMRkIPnwcPfU= -github.com/hashicorp/packer-plugin-yandex v1.1.2 h1:fFkFgpFb0C+vsinAi7qvhGNcPsFgfURkYAN4nYQwYmM= -github.com/hashicorp/packer-plugin-yandex v1.1.2/go.mod h1:h762Fyh6efQ02jr5kmbeS8OTPlbwqoUpqWuCQKec6m0= -github.com/hashicorp/serf v0.9.5 h1:EBWvyu9tcRszt3Bxp3KNssBMP1KuHWyO51lz9+786iM= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE= -github.com/hashicorp/vault/api v1.1.1 h1:907ld+Z9cALyvbZK2qUX9cLwvSaEQsMVQB3x2KE8+AI= -github.com/hashicorp/vault/api v1.1.1/go.mod h1:29UXcn/1cLOPHQNMWA7bCz2By4PSd0VKPAydKXS5yN0= -github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= -github.com/hashicorp/vault/sdk v0.2.1 h1:S4O6Iv/dyKlE9AUTXGa7VOvZmsCvg36toPKgV4f2P4M= -github.com/hashicorp/vault/sdk v0.2.1/go.mod h1:WfUiO1vYzfBkz1TmoE4ZGU7HD0T0Cl/rZwaxjBkgN4U= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493 h1:brI5vBRUlAlM34VFmnLPwjnCL/FxAJp9XvOdX6Zt+XE= -github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hetznercloud/hcloud-go v1.25.0 h1:QAaFKtGKWRxjwjKJWBGMxGYUxVEQmIkb35j/WXrsazY= -github.com/hetznercloud/hcloud-go v1.25.0/go.mod h1:2C5uMtBiMoFr3m7lBFPf7wXTdh33CevmZpQIIDPGYJI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/packer-plugin-amazon v1.2.1 h1:0Xqr8KsTJJhIo0vvjqPYrVMgyVxNRuYH4DeB5m/WAtw= +github.com/hashicorp/packer-plugin-amazon v1.2.1/go.mod h1:qlp0h5TWVGgcPzN9mSxPiEAwOUOW3XU/zep0pGd0ZsM= +github.com/hashicorp/packer-plugin-sdk v0.5.3 h1:rWQuRgUUnkf1O3UYymQZz/nJErLh4NFkuarOVEQK+Rs= +github.com/hashicorp/packer-plugin-sdk v0.5.3/go.mod h1:ntdZSJnc1LGGdMEXsYOxopZL1311QOTIbzVZH2EbN0U= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= +github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 h1:mSmyzhwBeQt2TlHbsXYLona9pwjWAvYGwQJ2Cq/k3VE= -github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4/go.mod h1:yNUVHSleURKSaYUKq4Wx0i/vjCen2aq7CvPyHd/Vj2Q= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inloco/packer-plugin-sdk v0.3.2-incognia.3 h1:labIWBZ2KCewUK0Qid+W1nhFaDau+urrUd7k5Wkc7kw= -github.com/inloco/packer-plugin-sdk v0.3.2-incognia.3/go.mod h1:XZRvL9kRqJJtB6rf9Lu2zWLJbf2/4ImWXDjp9O9UQGE= -github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= -github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 h1:a2/K4HRhg31A5vafiz5yYiGMjaCxwRpyjJStfVquKds= -github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961/go.mod h1:UrKjuULIWLjHFlG6aSPunArE5QX57LftMmStAZJBEX8= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/joyent/triton-go v1.8.5 h1:AXc1BJP3YGAvQXIdhdJt/PiARN5arHNXWK6Q6FeBing= -github.com/joyent/triton-go v1.8.5/go.mod h1:meGUPVGmmm+vhjIsOzfmJtuKpapVfWXJhUSLsr7Sv40= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kortschak/utter v0.0.0-20190412033250-50fe362e6560/go.mod h1:oDr41C7kH9wvAikWyFhr6UFr8R7nelpmCF5XR5rL7I8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/linode/linodego v0.30.0 h1:r9Sujfeo4FfEn/KdOjYegMP5sNCXL5rZUc4zNcDa+2E= -github.com/linode/linodego v0.30.0/go.mod h1:BR0gVkCJffEdIGJSl6bHR80Ty+Uvg/2jkjmrWaFectM= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0 h1:KqYuDbSr8I2X8H65InN8SafDEa0UaLRy6WEmxDqd0F0= github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0/go.mod h1:l31LCh9VvG43RJ83A5JLkFPjuz48cZAxBSLQLaIn1p8= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= -github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 h1:8YAWbq7rJqfbc6IaAvA2eCQuOQvf6Bs4vHKcOyWw//E= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -894,25 +415,16 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1 github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff h1:bFJ74ac7ZK/jyislqiWdzrnENesFt43sNEBRh1xk/+g= github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff/go.mod h1:g7SZj7ABpStq3tM4zqHiVEG5un/DZ1+qJJKO7qx1EvU= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed h1:FI2NIv6fpef6BQl2u3IZX/Cj20tfypRF4yd+uaHOMtI= -github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -924,136 +436,88 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/nywilken/go-cty v1.13.3 h1:03U99oXf3j3g9xgqAE3YGpixCjM8Mg09KZ0Ji9LzX0o= +github.com/nywilken/go-cty v1.13.3/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20180130162743-b8a9be070da4/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= -github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db h1:9uViuKtx1jrlXLBW/pMnhOfzn3iSEdLase/But/IZRU= github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.2 h1:taJnKntsWgU+qae21Rx52lIwndAdKrj0mfUNQsz1z4Q= github.com/pkg/sftp v1.13.2/go.mod h1:LzqnAvaD5TWeNBsZpfKxSYn1MbjWwOsCIAFFJbpIsK8= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible h1:ZoVHH6voxW9Onzo6z2yLtocVoN6mBocyDoqoyAMHokE= -github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible/go.mod h1:T3/WrziK7fYH3C8ilAFAHe99R452/IzIG3YYkqaOFeQ= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rs/zerolog v1.4.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/conswriter v0.0.0-20180208195008-f5ae3917a627/go.mod h1:7zjs06qF79/FKAJpBvFx3P8Ww4UTIMAe+lpNXDHziac= -github.com/sean-/pager v0.0.0-20180208200047-666be9bf53b5/go.mod h1:BeybITEsBEg6qbIiqJ6/Bqeq25bCLbL7YFmpaFfJDuM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/shirou/gopsutil/v3 v3.23.4 h1:hZwmDxZs7Ewt75DV81r4pFMqbq+di2cbt9FsQBqLD2o= +github.com/shirou/gopsutil/v3 v3.23.4/go.mod h1:ZcGxyfzAMRevhUR2+cfhXDH6gQdFYE/t8j1nsU4mPI8= +github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLrQ= +github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= +github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= +github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -1064,637 +528,236 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.366/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.367 h1:wZpJtVV05zBriiyAMZtHF7wSgBFUdDiXdnzD/Ecj7Ds= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.367/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.366 h1:NJm4RjeL2btX3alWLQvyzObmlDtGC0pCFCoeqWw2Veg= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.366/go.mod h1:x9QV7qu6FpnSdVyGQoirhjKsPd1dEpWnr9RL75DpgJ4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.366 h1:7wbTvCCJ41Hx9KWO9pcmvOFWFS1A9iPs0jtQJLwe++U= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.366/go.mod h1:TcIZ64TWquVpU7SmDHScoRUkx4P3Jm/lWq4BYs6IEN8= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= -github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= -github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= -github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ucloud/ucloud-sdk-go v0.20.2 h1:ZNB38C7oZ2imCHEC79mVFvVT+ASkbryriOkZ+q2E0XI= -github.com/ucloud/ucloud-sdk-go v0.20.2/go.mod h1:dyLmFHmUfgb4RZKYQP9IArlvQ2pxzFthfhwxRzOEPIw= -github.com/ufilesdk-dev/ufile-gosdk v1.0.1 h1:TNtFN3vO8ghuxLKBwQqSELllHYP4rggvXCox8JtVV0Y= -github.com/ufilesdk-dev/ufile-gosdk v1.0.1/go.mod h1:R5FMQxkQ+QK/9Vz+jfnJP4rZIktYrRcWmuAnbOSkROI= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmware/govmomi v0.29.0 h1:SHJQ7DUc4fltFZv16znJNGHR1/XhiDK5iKxm2OqwkuU= -github.com/vmware/govmomi v0.29.0/go.mod h1:F7adsVewLNHsW/IIm7ziFURaXDaHEwcc+ym4r3INMdY= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yandex-cloud/go-genproto v0.0.0-20211202135052-789603780fb2 h1:NOMh7Oy10aaqHWDajqN1whPrFD2RViJOqsWeAOtW7fQ= -github.com/yandex-cloud/go-genproto v0.0.0-20211202135052-789603780fb2/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= -github.com/yandex-cloud/go-sdk v0.0.0-20211206101223-7c4e7926bf53 h1:SOTpRQ+mqmu3IbemdahJSev3Srp7CYNUzjDbFlBPeHU= -github.com/yandex-cloud/go-sdk v0.0.0-20211206101223-7c4e7926bf53/go.mod h1:fjnP1VWobOVjfhIfeOZvq+zxhdTbqsddVXUm4psPkRU= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= -github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= -github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.11.0 h1:FZKhBSTydeuffHj9CBjXlR8vQLee1cQyTWYPA6/tqiE= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= +go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= +go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= +go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= +go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= +go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= +go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= +go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1 h1:t3ZHqovedSY8DEAUmZA99fPJhUhOb176PLACYA1sJ8Y= -golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1/go.mod h1:jFTmtFYCV0MFtXBU+J5V/+5AUeVS0ON/0WkE/KSrl6E= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.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-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.21.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.97.0 h1:x/vEL1XDF/2V4xzdNgFPaKHluRESo2aTsL7QzHnBtGQ= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= +google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006 h1:mmbq5q8M1t7dhkLw320YK4PsOXm6jdnUAkErImaIqOg= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1703,63 +766,31 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= \ No newline at end of file diff --git a/hcl2template/addrs/doc.go b/hcl2template/addrs/doc.go index 13c300030cc..783284822ba 100644 --- a/hcl2template/addrs/doc.go +++ b/hcl2template/addrs/doc.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package addrs contains types that represent "addresses", which are // references to specific objects within a Packer configuration. // diff --git a/hcl2template/addrs/input_variable.go b/hcl2template/addrs/input_variable.go index ad4370bb860..9ffbf6fb0a4 100644 --- a/hcl2template/addrs/input_variable.go +++ b/hcl2template/addrs/input_variable.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package addrs // InputVariable is the address of an input variable. diff --git a/hcl2template/addrs/parse_ref.go b/hcl2template/addrs/parse_ref.go index ee3f238ef0b..3f6c7320179 100644 --- a/hcl2template/addrs/parse_ref.go +++ b/hcl2template/addrs/parse_ref.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package addrs import ( diff --git a/hcl2template/addrs/plugin.go b/hcl2template/addrs/plugin.go index 8fae626209f..2baae570365 100644 --- a/hcl2template/addrs/plugin.go +++ b/hcl2template/addrs/plugin.go @@ -1,7 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package addrs import ( "fmt" + "net/url" + "path" "strings" "github.com/hashicorp/hcl/v2" @@ -10,21 +15,31 @@ import ( // Plugin encapsulates a single plugin type. type Plugin struct { - Hostname string - Namespace string - Type string + Source string } -func (p Plugin) RealRelativePath() string { - return p.Namespace + "/packer-plugin-" + p.Type +// Parts returns the list of components of the source URL, starting with the +// host, and ending with the name of the plugin. +// +// This will correspond more or less to the filesystem hierarchy where +// the plugin is installed. +func (p Plugin) Parts() []string { + return strings.FieldsFunc(p.Source, func(r rune) bool { + return r == '/' + }) } -func (p Plugin) Parts() []string { - return []string{p.Hostname, p.Namespace, p.Type} +// Name returns the raw name of the plugin from its source +// +// Exemples: +// - "github.com/hashicorp/amazon" -> "amazon" +func (p Plugin) Name() string { + parts := p.Parts() + return parts[len(parts)-1] } func (p Plugin) String() string { - return strings.Join(p.Parts(), "/") + return p.Source } // ParsePluginPart processes an addrs.Plugin namespace or type string @@ -94,67 +109,67 @@ func IsPluginPartNormalized(str string) (bool, error) { // This is intended primarily to parse the FQN-like strings // // The following are valid source string formats: -// name -// namespace/name -// hostname/namespace/name +// +// namespace/name +// hostname/namespace/name func ParsePluginSourceString(str string) (*Plugin, hcl.Diagnostics) { - ret := &Plugin{ - Hostname: "", - Namespace: "", - } var diags hcl.Diagnostics - // split the source string into individual components - parts := strings.Split(str, "/") - if len(parts) != 3 { - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid plugin source string", - Detail: `The "source" attribute must be in the format "hostname/namespace/name"`, - }) - return nil, diags + var errs []string + + if strings.HasPrefix(str, "/") { + errs = append(errs, "A source URL must not start with a '/' character.") } - // check for an invalid empty string in any part - for i := range parts { - if parts[i] == "" { - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid plugin source string", - Detail: `The "source" attribute must be in the format "hostname/namespace/name"`, - }) - return nil, diags - } + if strings.HasSuffix(str, "/") { + errs = append(errs, "A source URL must not end with a '/' character.") } - // check the 'name' portion, which is always the last part - givenName := parts[len(parts)-1] - name, err := ParsePluginPart(givenName) + if !strings.Contains(str, "/") { + errs = append(errs, "A source URL must at least contain a host and a path.") + } + + url, err := url.Parse(str) if err != nil { - diags = diags.Append(&hcl.Diagnostic{ + errs = append(errs, fmt.Sprintf("Failed to parse source URL: %s", err)) + } + + if url != nil && url.Scheme != "" { + errs = append(errs, "A source URL must not contain a scheme (e.g. https://).") + } + + if url != nil && url.RawQuery != "" { + errs = append(errs, "A source URL must not contain a query (e.g. ?var=val)") + } + + if url != nil && url.Fragment != "" { + errs = append(errs, "A source URL must not contain a fragment (e.g. #anchor).") + } + + if errs != nil { + errsMsg := &strings.Builder{} + for _, err := range errs { + fmt.Fprintf(errsMsg, "* %s\n", err) + } + + return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, - Summary: "Invalid plugin type", - Detail: fmt.Sprintf(`Invalid plugin type %q in source %q: %s"`, givenName, str, err), + Summary: "Malformed source URL", + Detail: fmt.Sprintf("The provided source URL %q is invalid. The following errors have been discovered:\n%s\nA valid source looks like \"github.com/hashicorp/happycloud\"", str, errsMsg), }) - return nil, diags } - ret.Type = name - // the namespace is always the second-to-last part - givenNamespace := parts[len(parts)-2] - namespace, err := ParsePluginPart(givenNamespace) + // check the 'name' portion, which is always the last part + _, givenName := path.Split(str) + _, err = ParsePluginPart(givenName) if err != nil { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, - Summary: "Invalid plugin namespace", - Detail: fmt.Sprintf(`Invalid plugin namespace %q in source %q: %s"`, namespace, str, err), + Summary: "Invalid plugin type", + Detail: fmt.Sprintf(`Invalid plugin type %q in source %q: %s"`, givenName, str, err), }) return nil, diags } - ret.Namespace = namespace - - // the hostname is always the first part in a three-part source string - ret.Hostname = parts[0] // Due to how plugin executables are named and plugin git repositories // are conventionally named, it's a reasonable and @@ -167,8 +182,8 @@ func ParsePluginSourceString(str string) (*Plugin, hcl.Diagnostics) { // packer-plugin- prefix to help them self-correct. const redundantPrefix = "packer-" const userErrorPrefix = "packer-plugin-" - if strings.HasPrefix(ret.Type, redundantPrefix) { - if strings.HasPrefix(ret.Type, userErrorPrefix) { + if strings.HasPrefix(givenName, redundantPrefix) { + if strings.HasPrefix(givenName, userErrorPrefix) { // Likely user error. We only return this specialized error if // whatever is after the prefix would otherwise be a // syntactically-valid plugin type, so we don't end up advising @@ -177,32 +192,33 @@ func ParsePluginSourceString(str string) (*Plugin, hcl.Diagnostics) { // (This is mainly just for robustness, because the validation // we already did above should've rejected most/all ways for // the suggestedType to end up invalid here.) - suggestedType := ret.Type[len(userErrorPrefix):] + suggestedType := strings.Replace(givenName, userErrorPrefix, "", -1) if _, err := ParsePluginPart(suggestedType); err == nil { - suggestedAddr := ret - suggestedAddr.Type = suggestedType - diags = diags.Append(&hcl.Diagnostic{ + return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid plugin type", Detail: fmt.Sprintf("Plugin source %q has a type with the prefix %q, which isn't valid. "+ "Although that prefix is often used in the names of version control repositories for Packer plugins, "+ "plugin source strings should not include it.\n"+ - "\nDid you mean %q?", ret, userErrorPrefix, suggestedAddr), + "\nDid you mean %q?", str, userErrorPrefix, suggestedType), }) - return nil, diags } } // Otherwise, probably instead an incorrectly-named plugin, perhaps // arising from a similar instinct to what causes there to be // thousands of Python packages on PyPI with "python-"-prefixed // names. - diags = diags.Append(&hcl.Diagnostic{ + return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid plugin type", - Detail: fmt.Sprintf("Plugin source %q has a type with the prefix %q, which isn't allowed because it would be redundant to name a Packer plugin with that prefix. If you are the author of this plugin, rename it to not include the prefix.", ret, redundantPrefix), + Detail: fmt.Sprintf("Plugin source %q has a type with the prefix %q, which isn't allowed "+ + "because it would be redundant to name a Packer plugin with that prefix. "+ + "If you are the author of this plugin, rename it to not include the prefix.", + str, redundantPrefix), }) - return nil, diags } - return ret, diags + return &Plugin{ + Source: str, + }, diags } diff --git a/hcl2template/addrs/plugin_test.go b/hcl2template/addrs/plugin_test.go index 191f103fad4..60af038bedd 100644 --- a/hcl2template/addrs/plugin_test.go +++ b/hcl2template/addrs/plugin_test.go @@ -1,31 +1,114 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package addrs import ( "reflect" "testing" + + "github.com/google/go-cmp/cmp" ) -func TestParsePluginSourceString(t *testing.T) { - type args struct { - str string - } +func TestPluginParseSourceString(t *testing.T) { tests := []struct { - args args + name string + source string want *Plugin wantDiags bool }{ - {args{"potato"}, nil, true}, - {args{"hashicorp/azr"}, nil, true}, - {args{"github.com/hashicorp/azr"}, &Plugin{"github.com", "hashicorp", "azr"}, false}, + {"invalid: only one component, rejected", "potato", nil, true}, + {"valid: two components in name", "hashicorp/azr", &Plugin{"hashicorp/azr"}, false}, + {"valid: three components, nothing superfluous", "github.com/hashicorp/azr", &Plugin{"github.com/hashicorp/azr"}, false}, + {"invalid: trailing slash", "github.com/hashicorp/azr/", nil, true}, + {"invalid: reject because scheme specified", "https://github.com/hashicorp/azr", nil, true}, + {"invalid: reject because query non nil", "github.com/hashicorp/azr?arg=1", nil, true}, + {"invalid: reject because fragment present", "github.com/hashicorp/azr#anchor", nil, true}, + {"invalid: leading and trailing slashes are removed", "/github.com/hashicorp/azr/", nil, true}, + {"invalid: leading slashes are removed", "/github.com/hashicorp/azr", nil, true}, + {"invalid: plugin name contains packer-", "/github.com/hashicorp/packer-azr", nil, true}, + {"invalid: plugin name contains packer-plugin-", "/github.com/hashicorp/packer-plugin-azr", nil, true}, } for _, tt := range tests { - t.Run(tt.args.str, func(t *testing.T) { - got, gotDiags := ParsePluginSourceString(tt.args.str) + t.Run(tt.name, func(t *testing.T) { + got, gotDiags := ParsePluginSourceString(tt.source) if !reflect.DeepEqual(got, tt.want) { t.Errorf("ParsePluginSourceString() got = %v, want %v", got, tt.want) } - if tt.wantDiags == (len(gotDiags) == 0) { - t.Errorf("Unexpected diags %s", gotDiags) + if tt.wantDiags && len(gotDiags) == 0 { + t.Errorf("Expected diags, but got none") + } + if !tt.wantDiags && len(gotDiags) != 0 { + t.Errorf("Unexpected diags: %s", gotDiags) + } + }) + } +} + +func TestPluginName(t *testing.T) { + tests := []struct { + name string + pluginString string + expectName string + }{ + { + "valid minimal name", + "github.com/hashicorp/amazon", + "amazon", + }, + { + // Technically we can call `Name` on a plugin created manually + // but this is invalid as the Source's Name should not contain + // `packer-plugin-`. + "invalid name with prefix", + "github.com/hashicorp/packer-plugin-amazon", + "packer-plugin-amazon", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + plug := &Plugin{ + Source: tt.pluginString, + } + + name := plug.Name() + if name != tt.expectName { + t.Errorf("Expected plugin %q to have %q as name, got %q", tt.pluginString, tt.expectName, name) + } + }) + } +} + +func TestPluginParts(t *testing.T) { + tests := []struct { + name string + pluginSource string + expectedParts []string + }{ + { + "valid with two parts", + "factiartory.com/packer", + []string{"factiartory.com", "packer"}, + }, + { + "valid with four parts", + "factiartory.com/hashicrop/fields/packer", + []string{"factiartory.com", "hashicrop", "fields", "packer"}, + }, + { + "valid, with double-slashes in the name", + "factiartory.com/hashicrop//fields/packer//", + []string{"factiartory.com", "hashicrop", "fields", "packer"}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + plugin := &Plugin{tt.pluginSource} + diff := cmp.Diff(plugin.Parts(), tt.expectedParts) + if diff != "" { + t.Errorf("Difference found between expected and computed parts: %s", diff) } }) } diff --git a/hcl2template/addrs/referenceable.go b/hcl2template/addrs/referenceable.go index 8caec1241ca..2b11d6008bc 100644 --- a/hcl2template/addrs/referenceable.go +++ b/hcl2template/addrs/referenceable.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package addrs // Referenceable is an interface implemented by all address types that can diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index d94cf945a25..831ce5d3596 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -106,7 +109,7 @@ func testParse(t *testing.T, tests []parseTest) { return } - gotBuilds, _, gotDiags := gotCfg.GetBuilds(packer.GetBuildsOptions{}) + gotBuilds, gotDiags := gotCfg.GetBuilds(packer.GetBuildsOptions{}) if tt.getBuildsWantDiags == (gotDiags == nil) { t.Fatalf("Parser.getBuilds() unexpected diagnostics. %s", gotDiags) } @@ -364,6 +367,15 @@ var cmpOpts = []cmp.Option{ cmpopts.IgnoreFields(VariableAssignment{}, "Expr", // its an interface ), + cmpopts.IgnoreFields(packer.CoreBuild{}, + "HCLConfig", + ), + cmpopts.IgnoreFields(packer.CoreBuildProvisioner{}, + "HCLConfig", + ), + cmpopts.IgnoreFields(packer.CoreBuildPostProcessor{}, + "HCLConfig", + ), cmpopts.IgnoreTypes(hcl2template.MockBuilder{}), cmpopts.IgnoreTypes(HCL2Ref{}), cmpopts.IgnoreTypes([]*LocalBlock{}), diff --git a/hcl2template/components.go b/hcl2template/components.go index b2063cd3885..e83f8b3768d 100644 --- a/hcl2template/components.go +++ b/hcl2template/components.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template // ComponentKind helps enumerate what kind of components exist in this Package. diff --git a/hcl2template/decode.go b/hcl2template/decode.go index fe3de6ac9fc..1dcd34c55ce 100644 --- a/hcl2template/decode.go +++ b/hcl2template/decode.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/docs.go b/hcl2template/docs.go index cce348abdf1..cf970f2e8e1 100644 --- a/hcl2template/docs.go +++ b/hcl2template/docs.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package hcl2template defines code to parse hcl2 template files. // // In order to configure a packer builder,provisioner, and post processor. // // Checkout the files in testdata/complete/ to see what a packer config could // look like. -// package hcl2template diff --git a/hcl2template/formatter.go b/hcl2template/formatter.go index 700e0c40bfd..3835aea8b55 100644 --- a/hcl2template/formatter.go +++ b/hcl2template/formatter.go @@ -1,15 +1,18 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "bytes" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" "strings" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/hcl/v2/hclwrite" @@ -73,7 +76,7 @@ func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) { return f.formatFile(path, diags, bytesModified) } - fileInfos, err := ioutil.ReadDir(path) + fileInfos, err := os.ReadDir(path) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -126,14 +129,14 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { } } - inSrc, err := ioutil.ReadAll(in) + inSrc, err := io.ReadAll(in) if err != nil { return nil, fmt.Errorf("failed to read %s: %s", filename, err) } _, diags := f.parser.ParseHCL(inSrc, filename) if diags.HasErrors() { - return nil, fmt.Errorf("failed to parse HCL %s", filename) + return nil, multierror.Append(nil, diags.Errs()...) } outSrc := hclwrite.Format(inSrc) @@ -155,7 +158,7 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { if filename == "-" { _, _ = f.Output.Write(outSrc) } else { - if err := ioutil.WriteFile(filename, outSrc, 0644); err != nil { + if err := os.WriteFile(filename, outSrc, 0644); err != nil { return nil, err } } @@ -175,14 +178,14 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { // bytesDiff returns the unified diff of b1 and b2 // Shamelessly copied from Terraform's fmt command. func bytesDiff(b1, b2 []byte, path string) (data []byte, err error) { - f1, err := ioutil.TempFile("", "") + f1, err := os.CreateTemp("", "") if err != nil { return } defer os.Remove(f1.Name()) defer f1.Close() - f2, err := ioutil.TempFile("", "") + f2, err := os.CreateTemp("", "") if err != nil { return } diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 13930888284..8cb909292a9 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "bytes" - "io/ioutil" "os" "os/exec" "strings" @@ -45,12 +47,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { f.Output = &buf f.Write = true - unformattedData, err := ioutil.ReadFile("testdata/format/unformatted.pkr.hcl") + unformattedData, err := os.ReadFile("testdata/format/unformatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the unformatted fixture %s", err) } - tf, err := ioutil.TempFile("", "*.pkr.hcl") + tf, err := os.CreateTemp("", "*.pkr.hcl") if err != nil { t.Fatalf("failed to create tempfile for test %s", err) } @@ -65,12 +67,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { } //lets re-read the tempfile which should now be formatted - data, err := ioutil.ReadFile(tf.Name()) + data, err := os.ReadFile(tf.Name()) if err != nil { t.Fatalf("failed to open the newly formatted fixture %s", err) } - formattedData, err := ioutil.ReadFile("testdata/format/formatted.pkr.hcl") + formattedData, err := os.ReadFile("testdata/format/formatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the formatted fixture %s", err) } diff --git a/hcl2template/function/Consul.go b/hcl2template/function/Consul.go index ae22404d846..e1e51b2299b 100644 --- a/hcl2template/function/Consul.go +++ b/hcl2template/function/Consul.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/aws_secretetkey.go b/hcl2template/function/aws_secretetkey.go index e5bec51b2fe..4684c9bf2d2 100644 --- a/hcl2template/function/aws_secretetkey.go +++ b/hcl2template/function/aws_secretetkey.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/datetime.go b/hcl2template/function/datetime.go index 8f9804ad08f..a2b0cc9d17c 100644 --- a/hcl2template/function/datetime.go +++ b/hcl2template/function/datetime.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( @@ -9,19 +12,20 @@ import ( "github.com/zclconf/go-cty/cty/function" ) -// InitTime is the UTC time when this package was initialized. It is +// initTime is the UTC time when this package was initialized. It is // used as the timestamp for all configuration templates so that they // match for a single build. -var InitTime time.Time +var initTime time.Time func init() { - InitTime = time.Now().UTC() + initTime = time.Now().UTC() } // TimestampFunc constructs a function that returns a string representation of the current date and time. var TimestampFunc = function.New(&function.Spec{ - Params: []function.Parameter{}, - Type: function.StaticReturnType(cty.String), + Params: []function.Parameter{}, + Type: function.StaticReturnType(cty.String), + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(time.Now().UTC().Format(time.RFC3339)), nil }, @@ -37,42 +41,46 @@ func Timestamp() (cty.Value, error) { } // LegacyIsotimeFunc constructs a function that returns a string representation -// of the current date and time using golang's datetime formatting. +// of the current date and time using the Go language datetime formatting syntax. var LegacyIsotimeFunc = function.New(&function.Spec{ Params: []function.Parameter{}, VarParam: &function.Parameter{ Name: "format", Type: cty.String, }, - Type: function.StaticReturnType(cty.String), + Type: function.StaticReturnType(cty.String), + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { if len(args) > 1 { return cty.StringVal(""), fmt.Errorf("too many values, 1 needed: %v", args) - } else if len(args) == 0 { - return cty.StringVal(InitTime.Format(time.RFC3339)), nil + } + if len(args) == 0 { + return cty.StringVal(initTime.Format(time.RFC3339)), nil } format := args[0].AsString() - return cty.StringVal(InitTime.Format(format)), nil + return cty.StringVal(initTime.Format(format)), nil }, }) // LegacyStrftimeFunc constructs a function that returns a string representation -// of the current date and time using golang's strftime datetime formatting. +// of the current date and time using the Go language strftime datetime formatting syntax. var LegacyStrftimeFunc = function.New(&function.Spec{ Params: []function.Parameter{}, VarParam: &function.Parameter{ Name: "format", Type: cty.String, }, - Type: function.StaticReturnType(cty.String), + Type: function.StaticReturnType(cty.String), + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { if len(args) > 1 { return cty.StringVal(""), fmt.Errorf("too many values, 1 needed: %v", args) - } else if len(args) == 0 { - return cty.StringVal(InitTime.Format(time.RFC3339)), nil + } + if len(args) == 0 { + return cty.StringVal(initTime.Format(time.RFC3339)), nil } format := args[0].AsString() - return cty.StringVal(strftime.Format(format, InitTime)), nil + return cty.StringVal(strftime.Format(format, initTime)), nil }, }) diff --git a/hcl2template/function/datetime_test.go b/hcl2template/function/datetime_test.go index fca279e8400..416b6fa23f3 100644 --- a/hcl2template/function/datetime_test.go +++ b/hcl2template/function/datetime_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/env.go b/hcl2template/function/env.go index 98eac11ccc8..b6c36e68494 100644 --- a/hcl2template/function/env.go +++ b/hcl2template/function/env.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( @@ -18,7 +21,8 @@ var EnvFunc = function.New(&function.Spec{ AllowUnknown: false, }, }, - Type: function.StaticReturnType(cty.String), + Type: function.StaticReturnType(cty.String), + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { key := args[0].AsString() value := os.Getenv(key) diff --git a/hcl2template/function/index.go b/hcl2template/function/index.go index 0cb55a747c1..8aade576ded 100644 --- a/hcl2template/function/index.go +++ b/hcl2template/function/index.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( @@ -20,7 +23,8 @@ var IndexFunc = function.New(&function.Spec{ Type: cty.DynamicPseudoType, }, }, - Type: function.StaticReturnType(cty.Number), + Type: function.StaticReturnType(cty.Number), + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { if !(args[0].Type().IsListType() || args[0].Type().IsTupleType()) { return cty.NilVal, errors.New("argument must be a list or tuple") diff --git a/hcl2template/function/index_test.go b/hcl2template/function/index_test.go index 5695cde7dd0..0a46da34ce8 100644 --- a/hcl2template/function/index_test.go +++ b/hcl2template/function/index_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/length.go b/hcl2template/function/length.go index c1a1e886289..f2b83dad925 100644 --- a/hcl2template/function/length.go +++ b/hcl2template/function/length.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( @@ -26,6 +29,7 @@ var LengthFunc = function.New(&function.Spec{ return cty.Number, errors.New("argument must be a string, a collection type, or a structural type") } }, + RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { coll := args[0] collTy := args[0].Type() diff --git a/hcl2template/function/length_test.go b/hcl2template/function/length_test.go index 5b217a00ada..9bae3886f74 100644 --- a/hcl2template/function/length_test.go +++ b/hcl2template/function/length_test.go @@ -1,7 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( "fmt" + "math" "testing" "github.com/zclconf/go-cty/cty" @@ -66,11 +70,15 @@ func TestLength(t *testing.T) { }, { cty.UnknownVal(cty.List(cty.Bool)), - cty.UnknownVal(cty.Number), + cty.UnknownVal(cty.Number).Refine(). + NotNull(). + NumberRangeLowerBound(cty.Zero, true). + NumberRangeUpperBound(cty.NumberIntVal(math.MaxInt), true). + NewValue(), }, { cty.DynamicVal, - cty.UnknownVal(cty.Number), + cty.UnknownVal(cty.Number).RefineNotNull(), }, { cty.StringVal("hello"), @@ -115,11 +123,10 @@ func TestLength(t *testing.T) { }, { cty.UnknownVal(cty.String), - cty.UnknownVal(cty.Number), - }, - { - cty.DynamicVal, - cty.UnknownVal(cty.Number), + cty.UnknownVal(cty.Number).Refine(). + NotNull(). + NumberRangeLowerBound(cty.Zero, true). + NewValue(), }, } diff --git a/hcl2template/function/refinements.go b/hcl2template/function/refinements.go new file mode 100644 index 00000000000..99314d7ee48 --- /dev/null +++ b/hcl2template/function/refinements.go @@ -0,0 +1,9 @@ +package function + +import ( + "github.com/zclconf/go-cty/cty" +) + +func refineNotNull(b *cty.RefinementBuilder) *cty.RefinementBuilder { + return b.NotNull() +} diff --git a/hcl2template/function/templatefile.go b/hcl2template/function/templatefile.go index d7edf23b20f..0b927cf834a 100644 --- a/hcl2template/function/templatefile.go +++ b/hcl2template/function/templatefile.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/templatefile_test.go b/hcl2template/function/templatefile_test.go index 658d2f368fb..f12967dd3c5 100644 --- a/hcl2template/function/templatefile_test.go +++ b/hcl2template/function/templatefile_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/function/vault.go b/hcl2template/function/vault.go index a62fa33cccc..3b9c092442e 100644 --- a/hcl2template/function/vault.go +++ b/hcl2template/function/vault.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package function import ( diff --git a/hcl2template/functions.go b/hcl2template/functions.go index 33da10257a0..c74754bdf90 100644 --- a/hcl2template/functions.go +++ b/hcl2template/functions.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -24,7 +27,6 @@ import ( // basedir is used with file functions and allows a user to reference a file // using local path. Usually basedir is the directory in which the config file // is located -// func Functions(basedir string) map[string]function.Function { funcs := map[string]function.Function{ diff --git a/hcl2template/internal/mock.go b/hcl2template/internal/mock.go index 2939b3b9464..4d3adb14ae5 100644 --- a/hcl2template/internal/mock.go +++ b/hcl2template/internal/mock.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag package hcl2template diff --git a/hcl2template/parser.go b/hcl2template/parser.go index d2c5a85ecd2..a1d23f640da 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -154,34 +157,20 @@ func (p *Parser) Parse(filename string, varFiles []string, argVars map[string]st // Before we go further, we'll check to make sure this version can read // all files, so we can produce a version-related error message rather than // potentially-confusing downstream errors. - versionDiags := cfg.CheckCoreVersionRequirements(p.CorePackerVersion) + versionDiags := cfg.CheckCoreVersionRequirements(p.CorePackerVersion.Core()) diags = append(diags, versionDiags...) if versionDiags.HasErrors() { return cfg, diags } - // Decode required_plugins blocks and create implicit required_plugins - // blocks. Implicit required_plugins blocks happen when a builder or another - // plugin cannot be found, for example if one uses : - // source "amazon-ebs" "example" { ... } - // And no `amazon-ebs` builder can be found. This will then be the - // equivalent of having : - // packer { - // required_plugins { - // amazon = { - // version = "latest" - // source = "github.com/hashicorp/amazon" - // } - // } + // Decode required_plugins blocks. + // // Note: using `latest` ( or actually an empty string ) in a config file // does not work and packer will ask you to pick a version { for _, file := range files { diags = append(diags, cfg.decodeRequiredPluginsBlock(file)...) } - for _, file := range files { - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlocks(file)...) - } } // Decode variable blocks so that they are available later on. Here locals @@ -305,19 +294,7 @@ func filterVarsFromLogs(inputOrLocal Variables) { } func (cfg *PackerConfig) Initialize(opts packer.InitializeOptions) hcl.Diagnostics { - var diags hcl.Diagnostics - - // enable packer to start plugins requested in required_plugins. - moreDiags := cfg.detectPluginBinaries() - diags = append(diags, moreDiags...) - if moreDiags.HasErrors() { - return diags - } - - moreDiags = cfg.InputVariables.ValidateValues() - diags = append(diags, moreDiags...) - moreDiags = cfg.LocalVariables.ValidateValues() - diags = append(diags, moreDiags...) + diags := cfg.InputVariables.ValidateValues() diags = append(diags, cfg.evaluateDatasources(opts.SkipDatasourcesExecution)...) diags = append(diags, checkForDuplicateLocalDefinition(cfg.LocalBlocks)...) diags = append(diags, cfg.evaluateLocalVariables(cfg.LocalBlocks)...) diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index fb807dadbff..f03e0329224 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -5,6 +8,7 @@ import ( "fmt" "log" "runtime" + "strings" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer-plugin-sdk/didyoumean" @@ -41,7 +45,6 @@ func (cfg *PackerConfig) PluginRequirements() (plugingetter.Requirements, hcl.Di Accessor: name, Identifier: block.Type, VersionConstraints: block.Requirement.Required, - Implicit: block.PluginDependencyReason == PluginDependencyImplicit, }) uniq[name] = block } @@ -51,9 +54,20 @@ func (cfg *PackerConfig) PluginRequirements() (plugingetter.Requirements, hcl.Di return reqs, diags } -func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { +func (cfg *PackerConfig) DetectPluginBinaries() hcl.Diagnostics { + // Do first pass to discover all the installed plugins + err := cfg.parser.PluginConfig.Discover() + if err != nil { + return (hcl.Diagnostics{}).Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to discover installed plugins", + Detail: err.Error(), + }) + } + + // Then we can apply any constraint from the template, if any opts := plugingetter.ListInstallationsOptions{ - FromFolders: cfg.parser.PluginConfig.KnownPluginFolders, + PluginDirectory: cfg.parser.PluginConfig.PluginDirectory, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ OS: runtime.GOOS, ARCH: runtime.GOARCH, @@ -62,6 +76,7 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { Checksummers: []plugingetter.Checksummer{ {Type: "sha256", Hash: sha256.New()}, }, + ReleasesOnly: cfg.parser.PluginConfig.ReleasesOnly, }, } @@ -74,6 +89,8 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { return diags } + uninstalledPlugins := map[string]string{} + for _, pluginRequirement := range pluginReqs { sortedInstalls, err := pluginRequirement.ListInstallations(opts) if err != nil { @@ -85,11 +102,7 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { continue } if len(sortedInstalls) == 0 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("no plugin installed for %s %v", pluginRequirement.Identifier, pluginRequirement.VersionConstraints.String()), - Detail: "Did you run packer init for this project ?", - }) + uninstalledPlugins[pluginRequirement.Identifier.String()] = pluginRequirement.VersionConstraints.String() continue } log.Printf("[TRACE] Found the following %q installations: %v", pluginRequirement.Identifier, sortedInstalls) @@ -105,6 +118,20 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { } } + if len(uninstalledPlugins) > 0 { + detailMessage := &strings.Builder{} + detailMessage.WriteString("The following plugins are required, but not installed:\n\n") + for pluginName, pluginVersion := range uninstalledPlugins { + fmt.Fprintf(detailMessage, "* %s %s\n", pluginName, pluginVersion) + } + detailMessage.WriteString("\nDid you run packer init for this project ?") + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing plugins", + Detail: detailMessage.String(), + }) + } + return diags } @@ -118,10 +145,22 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { // its body. srcUsage := &(build.Sources[i]) if !cfg.parser.PluginConfig.Builders.Has(srcUsage.Type) { + detail := fmt.Sprintf( + "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + buildSourceLabel, + srcUsage.Type, + strings.Split(srcUsage.Type, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(srcUsage.Type, cfg.parser.PluginConfig.Builders.List()); sugg != "" { + detail = fmt.Sprintf("Did you mean to use %q?", sugg) + } diags = append(diags, &hcl.Diagnostic{ Summary: "Unknown " + buildSourceLabel + " type " + srcUsage.Type, Subject: &build.HCL2Ref.DefRange, - Detail: fmt.Sprintf("known builders: %v", cfg.parser.PluginConfig.Builders.List()), + Detail: detail, Severity: hcl.DiagError, }) continue @@ -154,10 +193,23 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { for _, provBlock := range build.ProvisionerBlocks { if !cfg.parser.PluginConfig.Provisioners.Has(provBlock.PType) { + detail := fmt.Sprintf( + "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + buildProvisionerLabel, + provBlock.PType, + strings.Split(provBlock.PType, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(provBlock.PType, cfg.parser.PluginConfig.Provisioners.List()); sugg != "" { + detail = fmt.Sprintf("Did you mean to use %q?", sugg) + } + diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildProvisionerLabel+" type %q", provBlock.PType), Subject: provBlock.HCL2Ref.TypeRange.Ptr(), - Detail: fmt.Sprintf("known "+buildProvisionerLabel+"s: %v", cfg.parser.PluginConfig.Provisioners.List()), + Detail: detail, Severity: hcl.DiagError, }) } @@ -165,10 +217,23 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { if build.ErrorCleanupProvisionerBlock != nil { if !cfg.parser.PluginConfig.Provisioners.Has(build.ErrorCleanupProvisionerBlock.PType) { + detail := fmt.Sprintf( + "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + buildErrorCleanupProvisionerLabel, + build.ErrorCleanupProvisionerBlock.PType, + strings.Split(build.ErrorCleanupProvisionerBlock.PType, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(build.ErrorCleanupProvisionerBlock.PType, cfg.parser.PluginConfig.Provisioners.List()); sugg != "" { + detail = fmt.Sprintf("Did you mean to use %q?", sugg) + } + diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildErrorCleanupProvisionerLabel+" type %q", build.ErrorCleanupProvisionerBlock.PType), Subject: build.ErrorCleanupProvisionerBlock.HCL2Ref.TypeRange.Ptr(), - Detail: fmt.Sprintf("known "+buildErrorCleanupProvisionerLabel+"s: %v", cfg.parser.PluginConfig.Provisioners.List()), + Detail: detail, Severity: hcl.DiagError, }) } @@ -177,10 +242,23 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { for _, ppList := range build.PostProcessorsLists { for _, ppBlock := range ppList { if !cfg.parser.PluginConfig.PostProcessors.Has(ppBlock.PType) { + detail := fmt.Sprintf( + "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + buildPostProcessorLabel, + ppBlock.PType, + strings.Split(ppBlock.PType, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(ppBlock.PType, cfg.parser.PluginConfig.PostProcessors.List()); sugg != "" { + detail = fmt.Sprintf("Did you mean to use %q?", sugg) + } + diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildPostProcessorLabel+" type %q", ppBlock.PType), Subject: ppBlock.HCL2Ref.TypeRange.Ptr(), - Detail: fmt.Sprintf("known "+buildPostProcessorLabel+"s: %v", cfg.parser.PluginConfig.PostProcessors.List()), + Detail: detail, Severity: hcl.DiagError, }) } diff --git a/hcl2template/repl/format.go b/hcl2template/repl/format.go index e302b093e7a..8d99a4392d0 100644 --- a/hcl2template/repl/format.go +++ b/hcl2template/repl/format.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package repl import ( diff --git a/hcl2template/repl/repl.go b/hcl2template/repl/repl.go index d6aed8b4673..eb13353eed0 100644 --- a/hcl2template/repl/repl.go +++ b/hcl2template/repl/repl.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package repl provides the structs and functions necessary to run REPL for // HCL2. The REPL allows experimentation of HCL2 interpolations without having // to run a HCL2 configuration. diff --git a/hcl2template/shim/mock.go b/hcl2template/shim/mock.go index 5ed9ce6b59b..40fdbca4d32 100644 --- a/hcl2template/shim/mock.go +++ b/hcl2template/shim/mock.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag package hcl2shim diff --git a/hcl2template/shim/values.go b/hcl2template/shim/values.go index 600aaedcb17..096c8c23d56 100644 --- a/hcl2template/shim/values.go +++ b/hcl2template/shim/values.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2shim import ( diff --git a/hcl2template/shim/values_test.go b/hcl2template/shim/values_test.go index 45d4d6c4f2f..4449e711bc9 100644 --- a/hcl2template/shim/values_test.go +++ b/hcl2template/shim/values_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2shim import ( diff --git a/hcl2template/testdata/hcp_par/invalid_bucket.pkr.hcl b/hcl2template/testdata/hcp_par/invalid_bucket.pkr.hcl new file mode 100644 index 00000000000..6f2d36afaaa --- /dev/null +++ b/hcl2template/testdata/hcp_par/invalid_bucket.pkr.hcl @@ -0,0 +1,12 @@ +source "null" "test" { + communicator = "none" +} + +build { + name = "bucket-slug" + hcp_packer_registry { + bucket_name = "invalid_bucket" + } + + sources = ["null.test"] +} diff --git a/hcl2template/testdata/hcp_par/long-description.pkr.hcl b/hcl2template/testdata/hcp_par/long-description.pkr.hcl index c20502e1bd8..68abb110ce8 100644 --- a/hcl2template/testdata/hcp_par/long-description.pkr.hcl +++ b/hcl2template/testdata/hcp_par/long-description.pkr.hcl @@ -1,3 +1,7 @@ +source "null" "test" { + communicator = "none" +} + build { name = "bucket-slug" hcp_packer_registry { @@ -7,4 +11,6 @@ super super super super super super super super super super super super super su super super super long description EOT } + + sources = ["null.test"] } diff --git a/hcl2template/testdata/hcp_par/long_bucket.pkr.hcl b/hcl2template/testdata/hcp_par/long_bucket.pkr.hcl new file mode 100644 index 00000000000..1a234647df4 --- /dev/null +++ b/hcl2template/testdata/hcp_par/long_bucket.pkr.hcl @@ -0,0 +1,12 @@ +source "null" "test" { + communicator = "none" +} + +build { + name = "bucket-slug" + hcp_packer_registry { + bucket_name = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + + sources = ["null.test"] +} diff --git a/hcl2template/testdata/hcp_par/ok_bucket.pkr.hcl b/hcl2template/testdata/hcp_par/ok_bucket.pkr.hcl new file mode 100644 index 00000000000..6f2cfbfff68 --- /dev/null +++ b/hcl2template/testdata/hcp_par/ok_bucket.pkr.hcl @@ -0,0 +1,12 @@ +source "null" "test" { + communicator = "none" +} + +build { + name = "bucket-slug" + hcp_packer_registry { + bucket_name = "ok-Bucket-name-1" + } + + sources = ["null.test"] +} diff --git a/hcl2template/testdata/hcp_par/short_bucket.pkr.hcl b/hcl2template/testdata/hcp_par/short_bucket.pkr.hcl new file mode 100644 index 00000000000..734dd8b46bf --- /dev/null +++ b/hcl2template/testdata/hcp_par/short_bucket.pkr.hcl @@ -0,0 +1,12 @@ +source "null" "test" { + communicator = "none" +} + +build { + name = "bucket-slug" + hcp_packer_registry { + bucket_name = "ba" + } + + sources = ["null.test"] +} diff --git a/hcl2template/types.build.from.go b/hcl2template/types.build.from.go index b84b6ffc6e9..fb1544ef53a 100644 --- a/hcl2template/types.build.from.go +++ b/hcl2template/types.build.from.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.build.go b/hcl2template/types.build.go index 3bb54b20c4b..648305ee202 100644 --- a/hcl2template/types.build.go +++ b/hcl2template/types.build.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -87,22 +90,26 @@ type Builds []*BuildBlock // decodeBuildConfig is called when a 'build' block has been detected. It will // load the references to the contents of the build block. func (p *Parser) decodeBuildConfig(block *hcl.Block, cfg *PackerConfig) (*BuildBlock, hcl.Diagnostics) { - build := &BuildBlock{} - body := block.Body - var b struct { Name string `hcl:"name,optional"` Description string `hcl:"description,optional"` FromSources []string `hcl:"sources,optional"` Config hcl.Body `hcl:",remain"` } + + body := block.Body diags := gohcl.DecodeBody(body, cfg.EvalContext(LocalContext, nil), &b) if diags.HasErrors() { return nil, diags } + build := &BuildBlock{ + HCL2Ref: newHCL2Ref(block, b.Config), + } + build.Name = b.Name build.Description = b.Description + build.HCL2Ref.DefRange = block.DefRange // Expose build.name during parsing of pps and provisioners ectx := cfg.EvalContext(BuildContext, nil) diff --git a/hcl2template/types.build.hcp_packer_registry.go b/hcl2template/types.build.hcp_packer_registry.go index e2c76f34277..ba8935b5d6a 100644 --- a/hcl2template/types.build.hcp_packer_registry.go +++ b/hcl2template/types.build.hcp_packer_registry.go @@ -1,7 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "fmt" + "regexp" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" @@ -20,6 +24,8 @@ type HCPPackerRegistryBlock struct { HCL2Ref } +var bucketNameRegexp = regexp.MustCompile("^[a-zA-Z0-9-]{3,36}$") + func (p *Parser) decodeHCPRegistry(block *hcl.Block, cfg *PackerConfig) (*HCPPackerRegistryBlock, hcl.Diagnostics) { par := &HCPPackerRegistryBlock{} body := block.Body @@ -48,6 +54,14 @@ func (p *Parser) decodeHCPRegistry(block *hcl.Block, cfg *PackerConfig) (*HCPPac return nil, diags } + if !bucketNameRegexp.MatchString(b.Slug) { + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("%s.bucket_name can only contain between 3 and 36 ASCII letters, numbers and hyphens", buildHCPPackerRegistryLabel), + Subject: block.DefRange.Ptr(), + }) + } + par.Slug = b.Slug par.Description = b.Description diff --git a/hcl2template/types.build.hcp_packer_registry_test.go b/hcl2template/types.build.hcp_packer_registry_test.go index 288099931dc..b43566d3eba 100644 --- a/hcl2template/types.build.hcp_packer_registry_test.go +++ b/hcl2template/types.build.hcp_packer_registry_test.go @@ -1,10 +1,15 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "path/filepath" "testing" + "github.com/hashicorp/hcl/v2" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer/builder/null" "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -52,6 +57,7 @@ func Test_ParseHCPPackerRegistryBlock(t *testing.T) { Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, + BuilderType: "virtualbox-iso", }, }, false, @@ -105,6 +111,7 @@ func Test_ParseHCPPackerRegistryBlock(t *testing.T) { Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, + BuilderType: "virtualbox-iso", }, }, false, @@ -126,11 +133,121 @@ func Test_ParseHCPPackerRegistryBlock(t *testing.T) { &PackerConfig{ CorePackerVersionString: lockedVersion, Basedir: filepath.Join("testdata", "hcp_par"), + Sources: map[SourceRef]SourceBlock{ + refNull: { + Type: "null", + Name: "test", + block: &hcl.Block{ + Type: "source", + }, + }, + }, + }, + true, true, + nil, + false, + }, + {"bucket name too short", + defaultParser, + parseTestArgs{"testdata/hcp_par/short_bucket.pkr.hcl", nil, nil}, + &PackerConfig{ + CorePackerVersionString: lockedVersion, + Basedir: filepath.Join("testdata", "hcp_par"), + Sources: map[SourceRef]SourceBlock{ + refNull: { + Type: "null", + Name: "test", + block: &hcl.Block{ + Type: "source", + }, + }, + }, + }, + true, true, + nil, + false, + }, + {"bucket name too long", + defaultParser, + parseTestArgs{"testdata/hcp_par/long_bucket.pkr.hcl", nil, nil}, + &PackerConfig{ + CorePackerVersionString: lockedVersion, + Basedir: filepath.Join("testdata", "hcp_par"), + Sources: map[SourceRef]SourceBlock{ + refNull: { + Type: "null", + Name: "test", + block: &hcl.Block{ + Type: "source", + }, + }, + }, + }, + true, true, + nil, + false, + }, + {"bucket name invalid chars", + defaultParser, + parseTestArgs{"testdata/hcp_par/invalid_bucket.pkr.hcl", nil, nil}, + &PackerConfig{ + CorePackerVersionString: lockedVersion, + Basedir: filepath.Join("testdata", "hcp_par"), + Sources: map[SourceRef]SourceBlock{ + refNull: { + Type: "null", + Name: "test", + block: &hcl.Block{ + Type: "source", + }, + }, + }, }, true, true, nil, false, }, + {"bucket name OK", + defaultParser, + parseTestArgs{"testdata/hcp_par/ok_bucket.pkr.hcl", nil, nil}, + &PackerConfig{ + CorePackerVersionString: lockedVersion, + Basedir: filepath.Join("testdata", "hcp_par"), + Sources: map[SourceRef]SourceBlock{ + refNull: { + Type: "null", + Name: "test", + block: &hcl.Block{ + Type: "source", + }, + }, + }, + Builds: Builds{ + { + Name: "bucket-slug", + HCPPackerRegistry: &HCPPackerRegistryBlock{Slug: "ok-Bucket-name-1"}, + Sources: []SourceUseBlock{ + { + SourceRef: refNull, + }, + }, + }, + }, + }, + false, false, + []packersdk.Build{ + &packer.CoreBuild{ + BuildName: "bucket-slug", + Type: "null.test", + Builder: &null.Builder{}, + Provisioners: []packer.CoreBuildProvisioner{}, + PostProcessors: [][]packer.CoreBuildPostProcessor{}, + Prepared: true, + BuilderType: "null", + }, + }, + false, + }, } testParse(t, tests) } diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index da2f6a6a6da..8844eadff11 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index 2c0659be081..b08eca59f63 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.build.provisioners_test.go b/hcl2template/types.build.provisioners_test.go index 0dae85a7103..284651f2cbd 100644 --- a/hcl2template/types.build.provisioners_test.go +++ b/hcl2template/types.build.provisioners_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.build_test.go b/hcl2template/types.build_test.go index 17cd8086109..d94dee4f82f 100644 --- a/hcl2template/types.build_test.go +++ b/hcl2template/types.build_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -280,6 +283,7 @@ func TestParse_build(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, @@ -314,6 +318,7 @@ func TestParse_build(t *testing.T) { }, &packer.CoreBuild{ Type: "amazon-ebs.aws-ubuntu-16.04", + BuilderType: "amazon-ebs", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, @@ -394,9 +399,10 @@ func TestParse_build(t *testing.T) { false, false, []packersdk.Build{ &packer.CoreBuild{ - Type: "virtualbox-iso.ubuntu-1204", - Prepared: true, - Builder: emptyMockBuilder, + Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", + Prepared: true, + Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", @@ -424,9 +430,10 @@ func TestParse_build(t *testing.T) { PostProcessors: [][]packer.CoreBuildPostProcessor{}, }, &packer.CoreBuild{ - Type: "amazon-ebs.aws-ubuntu-16.04", - Prepared: true, - Builder: emptyMockBuilder, + Type: "amazon-ebs.aws-ubuntu-16.04", + BuilderType: "amazon-ebs", + Prepared: true, + Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "file", @@ -483,9 +490,10 @@ func TestParse_build(t *testing.T) { false, false, []packersdk.Build{ &packer.CoreBuild{ - Type: "virtualbox-iso.ubuntu-1204", - Prepared: true, - Builder: emptyMockBuilder, + Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", + Prepared: true, + Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", @@ -547,6 +555,7 @@ func TestParse_build(t *testing.T) { &packer.CoreBuild{ BuildName: "build-name", Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, @@ -601,6 +610,7 @@ func TestParse_build(t *testing.T) { &packer.CoreBuild{ BuildName: "test-build", Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, @@ -656,10 +666,11 @@ func TestParse_build(t *testing.T) { false, false, []packersdk.Build{ &packer.CoreBuild{ - BuildName: "build-name-test", - Type: "virtualbox-iso.ubuntu-1204", - Prepared: true, - Builder: emptyMockBuilder, + BuildName: "build-name-test", + Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", + Prepared: true, + Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PName: "build-name-test", diff --git a/hcl2template/types.datasource.go b/hcl2template/types.datasource.go index 3deab8c7174..23bc7c5900f 100644 --- a/hcl2template/types.datasource.go +++ b/hcl2template/types.datasource.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -7,7 +10,6 @@ import ( "github.com/hashicorp/hcl/v2/hclsyntax" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" - "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -42,7 +44,7 @@ func (ds *Datasources) Values() (map[string]cty.Value, hcl.Diagnostics) { for ref, datasource := range *ds { if datasource.value == (cty.Value{}) { diags = append(diags, &hcl.Diagnostic{ - Summary: fmt.Sprintf("empty value"), + Summary: "empty value", Subject: &datasource.block.DefRange, Severity: hcl.DiagError, }) @@ -62,23 +64,25 @@ func (ds *Datasources) Values() (map[string]cty.Value, hcl.Diagnostics) { return res, diags } -func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, ref DatasourceRef, secondaryEvaluation bool) (packersdk.Datasource, hcl.Diagnostics) { +func (cfg *PackerConfig) startDatasource(ds DatasourceBlock) (packersdk.Datasource, hcl.Diagnostics) { var diags hcl.Diagnostics - block := cfg.Datasources[ref].block + block := ds.block + + dataSourceStore := cfg.parser.PluginConfig.DataSources if dataSourceStore == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, Subject: block.LabelRanges[0].Ptr(), - Detail: fmt.Sprintf("packer does not currently know any data source."), + Detail: "packer does not currently know any data source.", Severity: hcl.DiagError, }) return nil, diags } - if !dataSourceStore.Has(ref.Type) { + if !dataSourceStore.Has(ds.Type) { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known data sources: %v", dataSourceStore.List()), Severity: hcl.DiagError, @@ -86,7 +90,7 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, return nil, diags } - datasource, err := dataSourceStore.Start(ref.Type) + datasource, err := dataSourceStore.Start(ds.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: err.Error(), @@ -96,7 +100,7 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, } if datasource == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ref.Type, ref.Name), + Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ds.Type, ds.Name), Subject: &block.DefRange, Severity: hcl.DiagError, }) diff --git a/hcl2template/types.datasource_test.go b/hcl2template/types.datasource_test.go index 26c8c3c45ff..69f6541389c 100644 --- a/hcl2template/types.datasource_test.go +++ b/hcl2template/types.datasource_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -54,6 +57,7 @@ func TestParse_datasource(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -131,6 +135,7 @@ func TestParse_datasource(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index 21627e4d993..b9d200758de 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index 61ba775ab61..b607a0092a2 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.hcl_ref.go b/hcl2template/types.hcl_ref.go index 1c30e1a1821..f3e6176dbf1 100644 --- a/hcl2template/types.hcl_ref.go +++ b/hcl2template/types.hcl_ref.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 8325d0e908b..d21d10edeae 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -1,13 +1,15 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "fmt" - "log" "sort" "strings" "github.com/gobwas/glob" - hcl "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/hcl/v2/hclsyntax" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -107,10 +109,6 @@ func (cfg *PackerConfig) EvalContext(ctx BlockContext, variables map[string]cty. "name": cty.UnknownVal(cty.String), }), buildAccessor: cty.UnknownVal(cty.EmptyObject), - packerAccessor: cty.ObjectVal(map[string]cty.Value{ - "version": cty.StringVal(cfg.CorePackerVersionString), - "iterationID": cty.UnknownVal(cty.String), - }), pathVariablesAccessor: cty.ObjectVal(map[string]cty.Value{ "cwd": cty.StringVal(strings.ReplaceAll(cfg.Cwd, `\`, `/`)), "root": cty.StringVal(strings.ReplaceAll(cfg.Basedir, `\`, `/`)), @@ -118,16 +116,23 @@ func (cfg *PackerConfig) EvalContext(ctx BlockContext, variables map[string]cty. }, } + packerVars := map[string]cty.Value{ + "version": cty.StringVal(cfg.CorePackerVersionString), + "iterationID": cty.UnknownVal(cty.String), + "versionFingerprint": cty.UnknownVal(cty.String), + } + iterID, ok := cfg.HCPVars["iterationID"] if ok { - log.Printf("iterationID set: %q", iterID) - - ectx.Variables[packerAccessor] = cty.ObjectVal(map[string]cty.Value{ - "version": cty.StringVal(cfg.CorePackerVersionString), - "iterationID": iterID, - }) + packerVars["iterationID"] = iterID + } + versionFP, ok := cfg.HCPVars["versionFingerprint"] + if ok { + packerVars["versionFingerprint"] = versionFP } + ectx.Variables[packerAccessor] = cty.ObjectVal(packerVars) + // In the future we'd like to load and execute HCL blocks using a graph // dependency tree, so that any block can use any block whatever the // order. @@ -310,73 +315,26 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics // source in any of its input expressions. If so, skip evaluating it for // now, and add it to a list of datasources to evaluate again, later, // with the datasources in its context. - // This is essentially creating a very primitive DAG just for data - // source interdependencies. - block := ds.block - body := block.Body - attrs, _ := body.JustAttributes() - - skipFirstEval := false - for _, attr := range attrs { - vars := attr.Expr.Variables() - for _, v := range vars { - // check whether the variable is a data source - if v.RootName() == "data" { - // construct, backwards, the data source type and name we - // need to evaluate before this one can be evaluated. - dependsOn := DatasourceRef{ - Type: v[1].(hcl.TraverseAttr).Name, - Name: v[2].(hcl.TraverseAttr).Name, - } - log.Printf("The data source %#v depends on datasource %#v", ref, dependsOn) - if dependencies[ref] != nil { - dependencies[ref] = append(dependencies[ref], dependsOn) - } else { - dependencies[ref] = []DatasourceRef{dependsOn} - } - skipFirstEval = true - } + dependencies[ref] = []DatasourceRef{} + + // Note: when looking at the expressions, we only need to care about + // attributes, as HCL2 expressions are not allowed in a block's labels. + vars := GetVarsByType(ds.block, "data") + for _, v := range vars { + // construct, backwards, the data source type and name we + // need to evaluate before this one can be evaluated. + dependsOn := DatasourceRef{ + Type: v[1].(hcl.TraverseAttr).Name, + Name: v[2].(hcl.TraverseAttr).Name, } + dependencies[ref] = append(dependencies[ref], dependsOn) } - - // Now we have a list of data sources that depend on other data sources. - // Don't evaluate these; only evaluate data sources that we didn't - // mark as having dependencies. - if skipFirstEval { - continue - } - - datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, false) - diags = append(diags, startDiags...) - if diags.HasErrors() { - continue - } - - if skipExecution { - placeholderValue := cty.UnknownVal(hcldec.ImpliedType(datasource.OutputSpec())) - ds.value = placeholderValue - cfg.Datasources[ref] = ds - continue - } - - realValue, err := datasource.Execute() - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Summary: err.Error(), - Subject: &cfg.Datasources[ref].block.DefRange, - Severity: hcl.DiagError, - }) - continue - } - - ds.value = realValue - cfg.Datasources[ref] = ds } // Now that most of our data sources have been started and executed, we can // try to execute the ones that depend on other data sources. for ref := range dependencies { - _, moreDiags, _ := cfg.recursivelyEvaluateDatasources(ref, dependencies, skipExecution, 0) + _, moreDiags := cfg.recursivelyEvaluateDatasources(ref, dependencies, skipExecution, 0) // Deduplicate diagnostics to prevent recursion messes. cleanedDiags := map[string]*hcl.Diagnostic{} for _, diag := range moreDiags { @@ -391,10 +349,9 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics return diags } -func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, dependencies map[DatasourceRef][]DatasourceRef, skipExecution bool, depth int) (map[DatasourceRef][]DatasourceRef, hcl.Diagnostics, bool) { +func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, dependencies map[DatasourceRef][]DatasourceRef, skipExecution bool, depth int) (map[DatasourceRef][]DatasourceRef, hcl.Diagnostics) { var diags hcl.Diagnostics var moreDiags hcl.Diagnostics - shouldContinue := true if depth > 10 { // Add a comment about recursion. @@ -405,8 +362,9 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen "sources. Either your data source depends on more than ten " + "other data sources, or your data sources have a cyclic " + "dependency. Please simplify your config to continue. ", + Subject: &(cfg.Datasources[ref]).block.DefRange, }) - return dependencies, diags, false + return dependencies, diags } ds := cfg.Datasources[ref] @@ -417,45 +375,48 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen // If this dependency is not in the map, it means we've already // launched and executed this datasource. Otherwise, it means // we still need to run it. RECURSION TIME!! - dependencies, moreDiags, shouldContinue = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) + dependencies, moreDiags = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { diags = append(diags, moreDiags...) - return dependencies, diags, shouldContinue + return dependencies, diags } } } // If we've gotten here, then it means ref doesn't seem to have any further // dependencies we need to evaluate first. Evaluate it, with the cfg's full // data source context. - datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, true) + datasource, startDiags := cfg.startDatasource(ds) if startDiags.HasErrors() { diags = append(diags, startDiags...) - return dependencies, diags, shouldContinue + return dependencies, diags } if skipExecution { placeholderValue := cty.UnknownVal(hcldec.ImpliedType(datasource.OutputSpec())) ds.value = placeholderValue cfg.Datasources[ref] = ds - return dependencies, diags, shouldContinue + return dependencies, diags } + opts, _ := decodeHCL2Spec(ds.block.Body, cfg.EvalContext(DatasourceContext, nil), datasource) + sp := packer.CheckpointReporter.AddSpan(ref.Type, "datasource", opts) realValue, err := datasource.Execute() + sp.End(err) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: err.Error(), Subject: &cfg.Datasources[ref].block.DefRange, Severity: hcl.DiagError, }) - return dependencies, diags, shouldContinue + return dependencies, diags } ds.value = realValue cfg.Datasources[ref] = ds // remove ref from the dependencies map. delete(dependencies, ref) - return dependencies, diags, shouldContinue + return dependencies, diags } // getCoreBuildProvisioners takes a list of provisioner block, starts according @@ -486,6 +447,8 @@ func (cfg *PackerConfig) getCoreBuildProvisioner(source SourceUseBlock, pb *Prov return packer.CoreBuildProvisioner{}, diags } + flatProvisionerCfg, _ := decodeHCL2Spec(pb.HCL2Ref.Rest, ectx, provisioner) + // If we're pausing, we wrap the provisioner in a special pauser. if pb.PauseBefore != 0 { provisioner = &packer.PausedProvisioner{ @@ -509,12 +472,13 @@ func (cfg *PackerConfig) getCoreBuildProvisioner(source SourceUseBlock, pb *Prov PType: pb.PType, PName: pb.PName, Provisioner: provisioner, + HCLConfig: flatProvisionerCfg, }, diags } // getCoreBuildProvisioners takes a list of post processor block, starts // according provisioners and sends parsed HCL2 over to it. -func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceUseBlock, blocksList [][]*PostProcessorBlock, ectx *hcl.EvalContext) ([][]packer.CoreBuildPostProcessor, hcl.Diagnostics) { +func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceUseBlock, blocksList [][]*PostProcessorBlock, ectx *hcl.EvalContext, exceptMatches *int) ([][]packer.CoreBuildPostProcessor, hcl.Diagnostics) { var diags hcl.Diagnostics res := [][]packer.CoreBuildPostProcessor{} for _, blocks := range blocksList { @@ -533,6 +497,7 @@ func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceUseBlock, block for _, exceptGlob := range cfg.except { if exceptGlob.Match(name) { exclude = true + *exceptMatches = *exceptMatches + 1 break } } @@ -546,10 +511,13 @@ func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceUseBlock, block continue } + flatPostProcessorCfg, moreDiags := decodeHCL2Spec(ppb.HCL2Ref.Rest, ectx, postProcessor) + pps = append(pps, packer.CoreBuildPostProcessor{ PostProcessor: postProcessor, PName: ppb.PName, PType: ppb.PType, + HCLConfig: flatPostProcessorCfg, KeepInputArtifact: ppb.KeepInputArtifact, }) } @@ -564,20 +532,17 @@ func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceUseBlock, block // GetBuilds returns a list of packer Build based on the HCL2 parsed build // blocks. All Builders, Provisioners and Post Processors will be started and // configured. -func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Build, map[string]string, hcl.Diagnostics) { +func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) { res := []packersdk.Build{} var diags hcl.Diagnostics possibleBuildNames := []string{} - // hcpTranslationMap maps the local name of a Corebuild to its HCP name - hcpTranslationMap := map[string]string{} - cfg.debug = opts.Debug cfg.force = opts.Force cfg.onError = opts.OnError if len(cfg.Builds) == 0 { - return res, hcpTranslationMap, append(diags, &hcl.Diagnostic{ + return res, append(diags, &hcl.Diagnostic{ Summary: "Missing build block", Detail: "A build block with one or more sources is required for executing a build.", Severity: hcl.DiagError, @@ -602,8 +567,6 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu Type: srcUsage.String(), } - hcpTranslationMap[pcb.Name()] = srcUsage.String() - pcb.SetDebug(cfg.debug) pcb.SetForce(cfg.force) pcb.SetOnError(cfg.onError) @@ -615,7 +578,7 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu if len(opts.Only) > 0 { onlyGlobs, diags := convertFilterOption(opts.Only, "only") if diags.HasErrors() { - return nil, nil, diags + return nil, diags } cfg.only = onlyGlobs include := false @@ -635,7 +598,7 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu if len(opts.Except) > 0 { exceptGlobs, diags := convertFilterOption(opts.Except, "except") if diags.HasErrors() { - return nil, nil, diags + return nil, diags } cfg.except = exceptGlobs exclude := false @@ -657,6 +620,10 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu continue } + decoded, _ := decodeHCL2Spec(srcUsage.Body, cfg.EvalContext(BuildContext, nil), builder) + pcb.HCLConfig = decoded + pcb.BuilderType = srcUsage.Type + // If the builder has provided a list of to-be-generated variables that // should be made accessible to provisioners, pass that list into // the provisioner prepare() so that the provisioner can appropriately @@ -678,21 +645,20 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu if moreDiags.HasErrors() { continue } - pps, moreDiags := cfg.getCoreBuildPostProcessors(srcUsage, build.PostProcessorsLists, cfg.EvalContext(BuildContext, variables)) + pps, moreDiags := cfg.getCoreBuildPostProcessors(srcUsage, build.PostProcessorsLists, cfg.EvalContext(BuildContext, variables), &opts.ExceptMatches) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } - if build.ErrorCleanupProvisionerBlock != nil { - if !build.ErrorCleanupProvisionerBlock.OnlyExcept.Skip(srcUsage.String()) { - errorCleanupProv, moreDiags := cfg.getCoreBuildProvisioner(srcUsage, build.ErrorCleanupProvisionerBlock, cfg.EvalContext(BuildContext, variables)) - diags = append(diags, moreDiags...) - if moreDiags.HasErrors() { - continue - } - pcb.CleanupProvisioner = errorCleanupProv + if build.ErrorCleanupProvisionerBlock != nil && + !build.ErrorCleanupProvisionerBlock.OnlyExcept.Skip(srcUsage.String()) { + errorCleanupProv, moreDiags := cfg.getCoreBuildProvisioner(srcUsage, build.ErrorCleanupProvisionerBlock, cfg.EvalContext(BuildContext, variables)) + diags = append(diags, moreDiags...) + if moreDiags.HasErrors() { + continue } + pcb.CleanupProvisioner = errorCleanupProv } pcb.Builder = builder @@ -732,7 +698,7 @@ func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Bu "These could also be matched with a glob pattern like: 'happycloud.*'", possibleBuildNames), }) } - return res, hcpTranslationMap, diags + return res, diags } var PackerConsoleHelp = strings.TrimSpace(` diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index 2ce476c0f39..10a0e73a7a2 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -19,6 +22,7 @@ var ( refVBIsoUbuntu1204 = SourceRef{Type: "virtualbox-iso", Name: "ubuntu-1204"} refAWSEBSUbuntu1604 = SourceRef{Type: "amazon-ebs", Name: "ubuntu-1604"} refAWSV3MyImage = SourceRef{Type: "amazon-v3-ebs", Name: "my-image"} + refNull = SourceRef{Type: "null", Name: "test"} pTrue = pointerToBool(true) ) @@ -204,8 +208,9 @@ func TestParser_complete(t *testing.T) { false, false, []packersdk.Build{ &packer.CoreBuild{ - Type: "virtualbox-iso.ubuntu-1204", - Prepared: true, + Type: "virtualbox-iso.ubuntu-1204", + BuilderType: "virtualbox-iso", + Prepared: true, Builder: &MockBuilder{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ @@ -315,8 +320,9 @@ func TestParser_complete(t *testing.T) { }, }, &packer.CoreBuild{ - Type: "amazon-ebs.ubuntu-1604", - Prepared: true, + Type: "amazon-ebs.ubuntu-1604", + BuilderType: "amazon-ebs", + Prepared: true, Builder: &MockBuilder{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ @@ -468,9 +474,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon", Source: "github.com/hashicorp/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "hashicorp", - Hostname: "github.com", + Source: "github.com/hashicorp/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v0")), @@ -480,9 +484,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon-v1", Source: "github.com/hashicorp/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "hashicorp", - Hostname: "github.com", + Source: "github.com/hashicorp/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v1")), @@ -492,9 +494,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon-v2", Source: "github.com/hashicorp/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "hashicorp", - Hostname: "github.com", + Source: "github.com/hashicorp/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v2")), @@ -504,9 +504,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon-v3", Source: "github.com/hashicorp/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "hashicorp", - Hostname: "github.com", + Source: "github.com/hashicorp/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v3")), @@ -516,9 +514,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon-v3-azr", Source: "github.com/azr/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "azr", - Hostname: "github.com", + Source: "github.com/azr/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v3")), @@ -528,9 +524,7 @@ func TestParser_no_init(t *testing.T) { Name: "amazon-v4", Source: "github.com/hashicorp/amazon", Type: &addrs.Plugin{ - Type: "amazon", - Namespace: "hashicorp", - Hostname: "github.com", + Source: "github.com/hashicorp/amazon", }, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint(">= v4")), @@ -638,13 +632,26 @@ func TestParser_no_init(t *testing.T) { }{ VersionConstraints: nil, RequiredPlugins: []*RequiredPlugins{ - {}, + { + RequiredPlugins: map[string]*RequiredPlugin{ + "amazon": { + Name: "amazon", + Source: "hashicorp/amazon", + Type: &addrs.Plugin{ + Source: "hashicorp/amazon", + }, + Requirement: VersionConstraint{ + Required: mustVersionConstraints(version.NewConstraint(">= v0")), + }, + }, + }, + }, }, }, CorePackerVersionString: lockedVersion, Basedir: filepath.Clean("testdata/init"), }, - true, true, + false, false, []packersdk.Build{}, false, }, diff --git a/hcl2template/types.required_plugins.go b/hcl2template/types.required_plugins.go index f1309f09d28..d5e010345ea 100644 --- a/hcl2template/types.required_plugins.go +++ b/hcl2template/types.required_plugins.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -6,7 +9,6 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template/addrs" - "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -41,127 +43,6 @@ func (cfg *PackerConfig) decodeRequiredPluginsBlock(f *hcl.File) hcl.Diagnostics return diags } -func (cfg *PackerConfig) decodeImplicitRequiredPluginsBlocks(f *hcl.File) hcl.Diagnostics { - // when a plugin is used but not available it should be 'implicitly - // required'. Here we read common configuration blocks to try to guess - // plugin usages. - - // decodeRequiredPluginsBlock needs to be called before - // decodeImplicitRequiredPluginsBlocks; otherwise all required plugins will - // be implicitly required too. - - var diags hcl.Diagnostics - - content, moreDiags := f.Body.Content(configSchema) - diags = append(diags, moreDiags...) - - for _, block := range content.Blocks { - - switch block.Type { - case sourceLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Builder, block)...) - case dataSourceLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Datasource, block)...) - case buildLabel: - content, _, moreDiags := block.Body.PartialContent(buildSchema) - diags = append(diags, moreDiags...) - for _, block := range content.Blocks { - - switch block.Type { - case buildProvisionerLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Provisioner, block)...) - case buildPostProcessorLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(PostProcessor, block)...) - case buildPostProcessorsLabel: - content, _, moreDiags := block.Body.PartialContent(postProcessorsSchema) - diags = append(diags, moreDiags...) - for _, block := range content.Blocks { - - switch block.Type { - case buildPostProcessorLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(PostProcessor, block)...) - } - } - } - } - - } - } - return diags -} - -func (cfg *PackerConfig) decodeImplicitRequiredPluginsBlock(k ComponentKind, block *hcl.Block) hcl.Diagnostics { - if len(block.Labels) == 0 { - // malformed block ? Let's not panic :) - return nil - } - // Currently all block types are `type "component-kind" ["name"] {` - // this makes this simple. - componentName := block.Labels[0] - - store := map[ComponentKind]packer.BasicStore{ - Builder: cfg.parser.PluginConfig.Builders, - PostProcessor: cfg.parser.PluginConfig.PostProcessors, - Provisioner: cfg.parser.PluginConfig.Provisioners, - Datasource: cfg.parser.PluginConfig.DataSources, - }[k] - if store.Has(componentName) { - // If any core or pre-loaded plugin defines the `happycloud-uploader` - // pp, skip. This happens for core and manually installed plugins, as - // they will be listed in the PluginConfig before parsing any HCL. - return nil - } - - redirect := map[ComponentKind]map[string]string{ - Builder: cfg.parser.PluginConfig.BuilderRedirects, - PostProcessor: cfg.parser.PluginConfig.PostProcessorRedirects, - Provisioner: cfg.parser.PluginConfig.ProvisionerRedirects, - Datasource: cfg.parser.PluginConfig.DatasourceRedirects, - }[k][componentName] - - if redirect == "" { - // no known redirect for this component - return nil - } - - redirectAddr, diags := addrs.ParsePluginSourceString(redirect) - if diags.HasErrors() { - // This should never happen, since the map is manually filled. - return diags - } - - for _, req := range cfg.Packer.RequiredPlugins { - if _, found := req.RequiredPlugins[redirectAddr.Type]; found { - // This could happen if a plugin was forked. For example, I forked - // the github.com/hashicorp/happycloud plugin into - // github.com/azr/happycloud that is required in my config file; and - // am using the `happycloud-uploader` pp component from it. In that - // case - and to avoid miss-requires - we won't implicitly import - // any other `happycloud` plugin. - return nil - } - } - - cfg.implicitlyRequirePlugin(redirectAddr) - return nil -} - -func (cfg *PackerConfig) implicitlyRequirePlugin(plugin *addrs.Plugin) { - cfg.Packer.RequiredPlugins = append(cfg.Packer.RequiredPlugins, &RequiredPlugins{ - RequiredPlugins: map[string]*RequiredPlugin{ - plugin.Type: { - Name: plugin.Type, - Source: plugin.String(), - Type: plugin, - Requirement: VersionConstraint{ - Required: nil, // means latest - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }, - }) -} - // RequiredPlugin represents a declaration of a dependency on a particular // Plugin version or source. type RequiredPlugin struct { @@ -174,24 +55,8 @@ type RequiredPlugin struct { Type *addrs.Plugin Requirement VersionConstraint DeclRange hcl.Range - PluginDependencyReason } -// PluginDependencyReason is an enumeration of reasons why a dependency might be -// present. -type PluginDependencyReason int - -const ( - // PluginDependencyExplicit means that there is an explicit - // "required_plugin" block in the configuration. - PluginDependencyExplicit PluginDependencyReason = iota - - // PluginDependencyImplicit means that there is no explicit - // "required_plugin" block but there is at least one resource that uses this - // plugin. - PluginDependencyImplicit -) - type RequiredPlugins struct { RequiredPlugins map[string]*RequiredPlugin DeclRange hcl.Range diff --git a/hcl2template/types.required_plugins_test.go b/hcl2template/types.required_plugins_test.go index fe0869198ff..8a44b6e170e 100644 --- a/hcl2template/types.required_plugins_test.go +++ b/hcl2template/types.required_plugins_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -39,11 +42,10 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, + Type: &addrs.Plugin{Source: "github.com/hashicorp/amazon"}, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, @@ -70,23 +72,17 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/azr/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "azr", Type: "amazon"}, + Type: &addrs.Plugin{Source: "github.com/azr/amazon"}, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, }, }}, {"required_plugin_forked", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, ` + parser: getBasicParser(func(p *Parser) {})}, ` packer { required_plugins { amazon = { @@ -107,23 +103,17 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/azr/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "azr", Type: "amazon"}, + Type: &addrs.Plugin{Source: "github.com/azr/amazon"}, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, }, }}, {"missing-required-plugin-for-pre-defined-builder", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-ebs": "github.com/hashicorp/amazon", - } - }, - )}, + parser: getBasicParser(func(p *Parser) {})}, ` packer { }`, ` @@ -140,202 +130,6 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { RequiredPlugins: nil, }, }}, - {"missing-required-plugin-for-builder", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, - ` - packer { - }`, ` - source "amazon-chroot" "example" { - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon": { - Name: "amazon", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-provisioner", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.ProvisionerRedirects = map[string]string{ - "ansible-local": "github.com/ansible/ansible", - } - }, - )}, - ` - packer { - }`, ` - build { - provisioner "ansible-local" {} - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "ansible": { - Name: "ansible", - Source: "github.com/ansible/ansible", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "ansible", Type: "ansible"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-post-processor", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.PostProcessorRedirects = map[string]string{ - "docker-push": "github.com/hashicorp/docker", - } - }, - )}, - ` - packer { - }`, ` - build { - post-processor "docker-push" {} - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "docker": { - Name: "docker", - Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-nested-post-processor", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.PostProcessorRedirects = map[string]string{ - "docker-push": "github.com/hashicorp/docker", - } - }, - )}, - ` - packer { - }`, ` - build { - post-processors { - post-processor "docker-push" { - } - } - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "docker": { - Name: "docker", - Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - - {"required-plugin-renamed", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, - ` - packer { - required_plugins { - amazon-v1 = { - source = "github.com/hashicorp/amazon" - version = "~> v1.0" - } - } - }`, ` - source "amazon-v1-chroot" "example" { - } - source "amazon-chroot" "example" { - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon-v1": { - Name: "amazon-v1", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: mustVersionConstraints(version.NewConstraint("~> v1.0")), - }, - PluginDependencyReason: PluginDependencyExplicit, - }, - }}, - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon": { - Name: "amazon", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -348,13 +142,10 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { t.Fatal(diags) } - rest, diags := cfg.parser.ParseHCL([]byte(tt.restOfTemplate), "rest.pkr.hcl") + _, diags = cfg.parser.ParseHCL([]byte(tt.restOfTemplate), "rest.pkr.hcl") if len(diags) > 0 { t.Fatal(diags) } - if gotDiags := cfg.decodeImplicitRequiredPluginsBlocks(rest); (len(gotDiags) > 0) != tt.wantDiags { - t.Fatal(gotDiags) - } if diff := cmp.Diff(tt.wantConfig, cfg, cmpOpts...); diff != "" { t.Errorf("PackerConfig.inferImplicitRequiredPluginFromBlocks() unexpected PackerConfig: %v", diff) } diff --git a/hcl2template/types.source.go b/hcl2template/types.source.go index 6c8d7bd9ce8..46b9caac98e 100644 --- a/hcl2template/types.source.go +++ b/hcl2template/types.source.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -64,11 +67,12 @@ func (b *SourceUseBlock) ctyValues() map[string]cty.Value { } // decodeBuildSource reads a used source block from a build: -// build { -// source "type.example" { -// name = "local_name" -// } -// } +// +// build { +// source "type.example" { +// name = "local_name" +// } +// } func (p *Parser) decodeBuildSource(block *hcl.Block) (SourceUseBlock, hcl.Diagnostics) { ref := sourceRefFromString(block.Labels[0]) out := SourceUseBlock{SourceRef: ref} diff --git a/hcl2template/types.source_test.go b/hcl2template/types.source_test.go index e19d921da99..e319163682d 100644 --- a/hcl2template/types.source_test.go +++ b/hcl2template/types.source_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -52,6 +55,7 @@ func TestParse_source(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, diff --git a/hcl2template/types.variables.go b/hcl2template/types.variables.go index 77928747c8d..b3754e8f111 100644 --- a/hcl2template/types.variables.go +++ b/hcl2template/types.variables.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -738,7 +741,6 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F Severity: hcl.DiagError, Summary: "Invalid argument value for -var variable", Detail: fmt.Sprintf("The received arg value for %s is not compatible with the variable's type constraint: %s.", name, err), - Subject: expr.Range().Ptr(), }) val = cty.DynamicVal } diff --git a/hcl2template/types.variables_test.go b/hcl2template/types.variables_test.go index 607862c9080..ecff3677ca2 100644 --- a/hcl2template/types.variables_test.go +++ b/hcl2template/types.variables_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( @@ -126,6 +129,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -290,6 +294,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -376,6 +381,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -439,6 +445,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -480,6 +487,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, @@ -535,9 +543,10 @@ func TestParse_variables(t *testing.T) { }, false, false, []packersdk.Build{&packer.CoreBuild{ - Type: "null.null-builder", - Prepared: true, - Builder: &null.Builder{}, + Type: "null.null-builder", + BuilderType: "null", + Prepared: true, + Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", @@ -624,6 +633,7 @@ func TestParse_variables(t *testing.T) { []packersdk.Build{ &packer.CoreBuild{ Type: "null.test", + BuilderType: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, diff --git a/hcl2template/utils.go b/hcl2template/utils.go index a8bfffbb859..ce9486ed676 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -1,14 +1,17 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/packer/hcl2template/repl" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" "github.com/zclconf/go-cty/cty" @@ -71,7 +74,7 @@ func GetHCL2Files(filename, hclSuffix, jsonSuffix string) (hclFiles, jsonFiles [ return nil, nil, diags } - fileInfos, err := ioutil.ReadDir(filename) + fileInfos, err := os.ReadDir(filename) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -184,3 +187,48 @@ func ConvertPluginConfigValueToHCLValue(v interface{}) (cty.Value, error) { } return buildValue, nil } + +// GetVarsByType walks through a hcl body, and gathers all the Traversals that +// have a root type matching one of the specified top-level labels. +// +// This will only work on finite, expanded, HCL bodies. +func GetVarsByType(block *hcl.Block, topLevelLabels ...string) []hcl.Traversal { + var travs []hcl.Traversal + + switch body := block.Body.(type) { + case *hclsyntax.Body: + travs = getVarsByTypeForHCLSyntaxBody(body) + default: + attrs, _ := body.JustAttributes() + for _, attr := range attrs { + travs = append(travs, attr.Expr.Variables()...) + } + } + + var rets []hcl.Traversal + for _, t := range travs { + varRootname := t.RootName() + for _, lbl := range topLevelLabels { + if varRootname == lbl { + rets = append(rets, t) + break + } + } + } + + return rets +} + +func getVarsByTypeForHCLSyntaxBody(body *hclsyntax.Body) []hcl.Traversal { + var rets []hcl.Traversal + + for _, attr := range body.Attributes { + rets = append(rets, attr.Expr.Variables()...) + } + + for _, block := range body.Blocks { + rets = append(rets, getVarsByTypeForHCLSyntaxBody(block.Body)...) + } + + return rets +} diff --git a/hcl2template/version.go b/hcl2template/version.go index 4a9bb992fb3..f6f584a69a5 100644 --- a/hcl2template/version.go +++ b/hcl2template/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/hcl2template/version_required.go b/hcl2template/version_required.go index 10d50bb82b7..f8c67228bfb 100644 --- a/hcl2template/version_required.go +++ b/hcl2template/version_required.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package hcl2template import ( diff --git a/helper/wrappedreadline/wrappedreadline.go b/helper/wrappedreadline/wrappedreadline.go index 55972c82a32..9d4bd7fcf25 100644 --- a/helper/wrappedreadline/wrappedreadline.go +++ b/helper/wrappedreadline/wrappedreadline.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. // diff --git a/helper/wrappedreadline/wrappedreadline_solaris.go b/helper/wrappedreadline/wrappedreadline_solaris.go index 26c4e6c7b80..55eac364548 100644 --- a/helper/wrappedreadline/wrappedreadline_solaris.go +++ b/helper/wrappedreadline/wrappedreadline_solaris.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package wrappedreadline // getWidth impl for Solaris diff --git a/helper/wrappedreadline/wrappedreadline_unix.go b/helper/wrappedreadline/wrappedreadline_unix.go index 8d2e6d6028c..7d01bb3a99e 100644 --- a/helper/wrappedreadline/wrappedreadline_unix.go +++ b/helper/wrappedreadline/wrappedreadline_unix.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build darwin || dragonfly || freebsd || (linux && !appengine) || netbsd || openbsd // +build darwin dragonfly freebsd linux,!appengine netbsd openbsd diff --git a/helper/wrappedreadline/wrappedreadline_windows.go b/helper/wrappedreadline/wrappedreadline_windows.go index b06a60bf8b6..88d04a06ab8 100644 --- a/helper/wrappedreadline/wrappedreadline_windows.go +++ b/helper/wrappedreadline/wrappedreadline_windows.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build windows // +build windows diff --git a/helper/wrappedstreams/streams.go b/helper/wrappedstreams/streams.go index b3a67c60972..1b18abf1958 100644 --- a/helper/wrappedstreams/streams.go +++ b/helper/wrappedstreams/streams.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. // diff --git a/helper/wrappedstreams/streams_other.go b/helper/wrappedstreams/streams_other.go index 49dc0157c9a..98045b535da 100644 --- a/helper/wrappedstreams/streams_other.go +++ b/helper/wrappedstreams/streams_other.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build !windows // +build !windows diff --git a/helper/wrappedstreams/streams_windows.go b/helper/wrappedstreams/streams_windows.go index 0508cc8db40..5a0d01de4fc 100644 --- a/helper/wrappedstreams/streams_windows.go +++ b/helper/wrappedstreams/streams_windows.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build windows // +build windows diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index f9a97c5efbd..78f8ee37ce1 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -1,13 +1,20 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package api provides access to the HCP Packer Registry API. package api import ( "fmt" + "log" + "net/http" + "os" + "time" - packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" - organizationSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" - projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" - rmmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" + packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + organizationSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service" + projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" + rmmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" "github.com/hashicorp/hcp-sdk-go/httpclient" "github.com/hashicorp/packer/internal/hcp/env" "github.com/hashicorp/packer/version" @@ -37,32 +44,58 @@ func NewClient() (*Client, error) { } } - cl, err := httpclient.New(httpclient.Config{ + hcpClientCfg := httpclient.Config{ SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()), - }) - if err != nil { + } + if err := hcpClientCfg.Canonicalize(); err != nil { return nil, &ClientError{ StatusCode: InvalidClientConfig, Err: err, } } + cl, err := httpclient.New(hcpClientCfg) + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } + } client := &Client{ Packer: packerSvc.New(cl, nil), Organization: organizationSvc.New(cl, nil), Project: projectSvc.New(cl, nil), } + // A client.Config.hcpConfig is set when calling Canonicalize on basic HCP httpclient, as on line 52. + // If a user sets HCP_* env. variables they will be loaded into the client via the SDK and used for any client calls. + // For HCP_ORGANIZATION_ID and HCP_PROJECT_ID if they are both set via env. variables the call to hcpClientCfg.Connicalize() + // will automatically loaded them using the FromEnv configOption. + // + // If both values are set we should have all that we need to continue so we can returned the configured client. + if hcpClientCfg.Profile().OrganizationID != "" && hcpClientCfg.Profile().ProjectID != "" { + client.OrganizationID = hcpClientCfg.Profile().OrganizationID + client.ProjectID = hcpClientCfg.Profile().ProjectID - if err := client.loadOrganizationID(); err != nil { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: err, + return client, nil + } + + if client.OrganizationID == "" { + err := client.loadOrganizationID() + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } } } - if err := client.loadProjectID(); err != nil { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: err, + + if client.ProjectID == "" { + err := client.loadProjectID() + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } } } @@ -70,6 +103,10 @@ func NewClient() (*Client, error) { } func (c *Client) loadOrganizationID() error { + if env.HasOrganizationID() { + c.OrganizationID = os.Getenv(env.HCPOrganizationID) + return nil + } // Get the organization ID. listOrgParams := organizationSvc.NewOrganizationServiceListParams() listOrgResp, err := c.Organization.OrganizationServiceList(listOrgParams, nil) @@ -85,18 +122,81 @@ func (c *Client) loadOrganizationID() error { } func (c *Client) loadProjectID() error { + if env.HasProjectID() { + c.ProjectID = os.Getenv(env.HCPProjectID) + err := c.ValidateRegistryForProject() + if err != nil { + return fmt.Errorf("project validation for id %q responded in error: %v", c.ProjectID, err) + } + return nil + } // Get the project using the organization ID. listProjParams := projectSvc.NewProjectServiceListParams() listProjParams.ScopeID = &c.OrganizationID scopeType := string(rmmodels.HashicorpCloudResourcemanagerResourceIDResourceTypeORGANIZATION) listProjParams.ScopeType = &scopeType listProjResp, err := c.Project.ProjectServiceList(listProjParams, nil) + if err != nil { - return fmt.Errorf("unable to fetch project id: %v", err) + //For permission errors, our service principal may not have the ability + // to see all projects for an Org; this is the case for project-level service principals. + serviceErr, ok := err.(*projectSvc.ProjectServiceListDefault) + if !ok { + return fmt.Errorf("unable to fetch project list: %v", err) + } + if serviceErr.Code() == http.StatusForbidden { + return fmt.Errorf("unable to fetch project\n\n"+ + "If the provided credentials are tied to a specific project try setting the %s environment variable to one you want to use.", env.HCPProjectID) + } } + if len(listProjResp.Payload.Projects) > 1 { - return fmt.Errorf("this version of Packer does not support multiple projects") + log.Printf("[WARNING] Multiple HCP projects found, will pick the oldest one by default\n"+ + "To specify which project to use, set the %s environment variable to the one you want to use.", env.HCPProjectID) + } + + proj, err := getOldestProject(listProjResp.Payload.Projects) + if err != nil { + return err + } + c.ProjectID = proj.ID + return nil +} + +// getOldestProject retrieves the oldest project from a list based on its created_at time. +func getOldestProject(projects []*rmmodels.HashicorpCloudResourcemanagerProject) (*rmmodels.HashicorpCloudResourcemanagerProject, error) { + if len(projects) == 0 { + return nil, fmt.Errorf("no project found") + } + + oldestTime := time.Now() + var oldestProj *rmmodels.HashicorpCloudResourcemanagerProject + for _, proj := range projects { + projTime := time.Time(proj.CreatedAt) + if projTime.Before(oldestTime) { + oldestProj = proj + oldestTime = projTime + } } - c.ProjectID = listProjResp.Payload.Projects[0].ID + return oldestProj, nil +} + +// ValidateRegistryForProject validates that there is an active registry associated to the configured organization and project ids. +// A successful validation will result in a nil response. All other response represent an invalid registry error request or a registry not found error. +func (c *Client) ValidateRegistryForProject() error { + params := packerSvc.NewPackerServiceGetRegistryParams() + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + + resp, err := c.Packer.PackerServiceGetRegistry(params, nil) + if err != nil { + return err + } + + if resp.GetPayload().Registry == nil { + return fmt.Errorf("No active HCP Packer registry was found for the organization %q and project %q", c.OrganizationID, c.ProjectID) + } + return nil + } diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go new file mode 100644 index 00000000000..7868feca440 --- /dev/null +++ b/internal/hcp/api/client_test.go @@ -0,0 +1,83 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package api + +import ( + "testing" + "time" + + "github.com/go-openapi/strfmt" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" +) + +func TestGetOldestProject(t *testing.T) { + testcases := []struct { + Name string + ProjectList []*models.HashicorpCloudResourcemanagerProject + ExpectProjectID string + ExpectErr bool + }{ + { + "Only one project, project exists, success", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-project-exists", + }, + }, + "test-project-exists", + false, + }, + { + "Multiple projects, pick the oldest", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-project-exists", + CreatedAt: strfmt.DateTime(time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + { + ID: "test-oldest-project", + CreatedAt: strfmt.DateTime(time.Date(2022, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + }, + "test-oldest-project", + false, + }, + { + "Multiple projects, different order, pick the oldest", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-oldest-project", + CreatedAt: strfmt.DateTime(time.Date(2022, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + { + ID: "test-project-exists", + CreatedAt: strfmt.DateTime(time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + }, + "test-oldest-project", + false, + }, + { + "No projects, should error", + []*models.HashicorpCloudResourcemanagerProject{}, + "", + true, + }, + } + + for _, tt := range testcases { + t.Run(tt.Name, func(t *testing.T) { + proj, err := getOldestProject(tt.ProjectList) + if (err != nil) != tt.ExpectErr { + t.Errorf("test findProjectByID, expected %t, got %t", + tt.ExpectErr, + err != nil) + } + + if proj != nil && proj.ID != tt.ExpectProjectID { + t.Errorf("expected to select project %q, got %q", tt.ExpectProjectID, proj.ID) + } + }) + } +} diff --git a/internal/hcp/api/deprecated_client.go b/internal/hcp/api/deprecated_client.go new file mode 100644 index 00000000000..6f5c06b89d6 --- /dev/null +++ b/internal/hcp/api/deprecated_client.go @@ -0,0 +1,55 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +// Package api provides access to the HCP Packer Registry API. +package api + +import ( + "fmt" + + packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" + organizationSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service" + projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" + "github.com/hashicorp/hcp-sdk-go/httpclient" + "github.com/hashicorp/packer/version" +) + +// DeprecatedClient is an HCP client capable of making requests on behalf of a service principal +type DeprecatedClient struct { + Packer packerSvc.ClientService + Organization organizationSvc.ClientService + Project projectSvc.ClientService + OrganizationID string + ProjectID string +} + +// NewDeprecatedClient returns an authenticated client to a HCP Packer Registry. +// Client authentication requires the following environment variables be set HCP_CLIENT_ID and HCP_CLIENT_SECRET. +// Upon error a HCPClientError will be returned. +func NewDeprecatedClient() (*DeprecatedClient, error) { + // Use NewClient to validate HCP configuration provided by user. + tempClient, err := NewClient() + if err != nil { + return nil, err + } + + hcpClientCfg := httpclient.Config{ + SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()), + } + cl, err := httpclient.New(hcpClientCfg) + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } + } + + client := DeprecatedClient{ + Packer: packerSvc.New(cl, nil), + Organization: organizationSvc.New(cl, nil), + Project: projectSvc.New(cl, nil), + OrganizationID: tempClient.OrganizationID, + ProjectID: tempClient.ProjectID, + } + return &client, nil +} diff --git a/internal/hcp/api/deprecated_service.go b/internal/hcp/api/deprecated_service.go new file mode 100644 index 00000000000..9fa88d5dd36 --- /dev/null +++ b/internal/hcp/api/deprecated_service.go @@ -0,0 +1,79 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package api + +import ( + "context" + "fmt" + + hcpPackerDeprecatedAPI "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" + hcpPackerDeprecatedModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" +) + +type GetIterationOption func(*hcpPackerDeprecatedAPI.PackerServiceGetIterationParams) + +var ( + GetIteration_byID = func(id string) GetIterationOption { + return func(params *hcpPackerDeprecatedAPI.PackerServiceGetIterationParams) { + params.IterationID = &id + } + } + GetIteration_byFingerprint = func(fingerprint string) GetIterationOption { + return func(params *hcpPackerDeprecatedAPI.PackerServiceGetIterationParams) { + params.Fingerprint = &fingerprint + } + } +) + +func (client *DeprecatedClient) GetIteration( + ctx context.Context, bucketSlug string, opts ...GetIterationOption, +) (*hcpPackerDeprecatedModels.HashicorpCloudPackerIteration, error) { + getItParams := hcpPackerDeprecatedAPI.NewPackerServiceGetIterationParams() + getItParams.LocationOrganizationID = client.OrganizationID + getItParams.LocationProjectID = client.ProjectID + getItParams.BucketSlug = bucketSlug + + for _, opt := range opts { + opt(getItParams) + } + + resp, err := client.Packer.PackerServiceGetIteration(getItParams, nil) + if err != nil { + return nil, err + } + + if resp.Payload.Iteration != nil { + return resp.Payload.Iteration, nil + } + + return nil, fmt.Errorf( + "something went wrong retrieving the iteration for bucket %s", bucketSlug, + ) +} + +// GetChannel loads the named channel that is associated to the bucket slug . If the +// channel does not exist in HCP Packer, GetChannel returns an error. +func (client *DeprecatedClient) GetChannel( + ctx context.Context, bucketSlug string, channelName string, +) (*hcpPackerDeprecatedModels.HashicorpCloudPackerChannel, error) { + params := hcpPackerDeprecatedAPI.NewPackerServiceGetChannelParamsWithContext(ctx) + params.LocationOrganizationID = client.OrganizationID + params.LocationProjectID = client.ProjectID + params.BucketSlug = bucketSlug + params.Slug = channelName + + resp, err := client.Packer.PackerServiceGetChannel(params, nil) + if err != nil { + return nil, err + } + + if resp.Payload.Channel == nil { + return nil, fmt.Errorf( + "there is no channel with the name %s associated with the bucket %s", + channelName, bucketSlug, + ) + } + + return resp.Payload.Channel, nil +} diff --git a/internal/hcp/api/errors.go b/internal/hcp/api/errors.go index 491bf452f0b..cff55fc9e09 100644 --- a/internal/hcp/api/errors.go +++ b/internal/hcp/api/errors.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package api import ( diff --git a/internal/hcp/api/mock_service.go b/internal/hcp/api/mock_service.go index 8ab149f3bbf..9a513705052 100644 --- a/internal/hcp/api/mock_service.go +++ b/internal/hcp/api/mock_service.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package api import ( @@ -6,39 +9,38 @@ import ( "strconv" "github.com/go-openapi/runtime" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" - packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" + hcpPackerService "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) -//MockPackerClientService represents a basic mock of the Cloud Packer Service. -//Upon calling a service method a boolean is set to true to indicate that a method has been called. -//To skip the setting of these booleans set TrackCalledServiceMethods to false; defaults to true in NewMockPackerClientService(). +// MockPackerClientService represents a basic mock of the Cloud Packer Service. +// Upon calling a service method a boolean is set to true to indicate that a method has been called. +// To skip the setting of these booleans set TrackCalledServiceMethods to false; defaults to true in NewMockPackerClientService(). type MockPackerClientService struct { - CreateBucketCalled, UpdateBucketCalled, BucketAlreadyExist bool - CreateIterationCalled, GetIterationCalled, IterationAlreadyExist, IterationCompleted bool - CreateBuildCalled, UpdateBuildCalled, ListBuildsCalled, BuildAlreadyDone bool - TrackCalledServiceMethods bool + CreateBucketCalled, UpdateBucketCalled, BucketAlreadyExist bool + CreateVersionCalled, GetVersionCalled, VersionAlreadyExist, VersionCompleted bool + CreateBuildCalled, UpdateBuildCalled, ListBuildsCalled, BuildAlreadyDone bool + TrackCalledServiceMethods bool // Mock Creates - CreateBucketResp *models.HashicorpCloudPackerCreateBucketResponse - CreateIterationResp *models.HashicorpCloudPackerCreateIterationResponse - CreateBuildResp *models.HashicorpCloudPackerCreateBuildResponse + CreateBucketResp *hcpPackerModels.HashicorpCloudPacker20230101CreateBucketResponse + CreateVersionResp *hcpPackerModels.HashicorpCloudPacker20230101CreateVersionResponse + CreateBuildResp *hcpPackerModels.HashicorpCloudPacker20230101CreateBuildResponse // Mock Gets - GetIterationResp *models.HashicorpCloudPackerGetIterationResponse + GetVersionResp *hcpPackerModels.HashicorpCloudPacker20230101GetVersionResponse ExistingBuilds []string ExistingBuildLabels map[string]string - packerSvc.ClientService + hcpPackerService.ClientService } -//NewMockPackerClientService returns a basic mock of the Cloud Packer Service. -//Upon calling a service method a boolean is set to true to indicate that a method has been called. -//To skip the setting of these booleans set TrackCalledServiceMethods to false. By default it is true. +// NewMockPackerClientService returns a basic mock of the Cloud Packer Service. +// Upon calling a service method a boolean is set to true to indicate that a method has been called. +// To skip the setting of these booleans set TrackCalledServiceMethods to false. By default, it is true. func NewMockPackerClientService() *MockPackerClientService { m := MockPackerClientService{ ExistingBuilds: make([]string, 0), @@ -49,205 +51,234 @@ func NewMockPackerClientService() *MockPackerClientService { return &m } -func (svc *MockPackerClientService) PackerServiceCreateBucket(params *packerSvc.PackerServiceCreateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateBucketOK, error) { +func (svc *MockPackerClientService) PackerServiceCreateBucket( + params *hcpPackerService.PackerServiceCreateBucketParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceCreateBucketOK, error) { if svc.BucketAlreadyExist { - return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.AlreadyExists, codes.AlreadyExists.String())) + return nil, status.Error( + codes.AlreadyExists, + fmt.Sprintf("Code:%d %s", codes.AlreadyExists, codes.AlreadyExists.String()), + ) } - if params.Body.BucketSlug == "" { - return nil, errors.New("No bucket slug was passed in") + if params.Body.Name == "" { + return nil, errors.New("no bucket name was passed in") } if svc.TrackCalledServiceMethods { svc.CreateBucketCalled = true } - payload := &models.HashicorpCloudPackerCreateBucketResponse{ - Bucket: &models.HashicorpCloudPackerBucket{ + payload := &hcpPackerModels.HashicorpCloudPacker20230101CreateBucketResponse{ + Bucket: &hcpPackerModels.HashicorpCloudPacker20230101Bucket{ ID: "bucket-id", }, } - payload.Bucket.Slug = params.Body.BucketSlug + payload.Bucket.Name = params.Body.Name - ok := &packerSvc.PackerServiceCreateBucketOK{ + ok := &hcpPackerService.PackerServiceCreateBucketOK{ Payload: payload, } return ok, nil } -func (svc *MockPackerClientService) PackerServiceUpdateBucket(params *packerSvc.PackerServiceUpdateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceUpdateBucketOK, error) { +func (svc *MockPackerClientService) PackerServiceUpdateBucket( + params *hcpPackerService.PackerServiceUpdateBucketParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceUpdateBucketOK, error) { if svc.TrackCalledServiceMethods { svc.UpdateBucketCalled = true } - return packerSvc.NewPackerServiceUpdateBucketOK(), nil + return hcpPackerService.NewPackerServiceUpdateBucketOK(), nil } -func (svc *MockPackerClientService) PackerServiceCreateIteration(params *packerSvc.PackerServiceCreateIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateIterationOK, error) { - if svc.IterationAlreadyExist { - return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.AlreadyExists, codes.AlreadyExists.String())) +func (svc *MockPackerClientService) PackerServiceCreateVersion( + params *hcpPackerService.PackerServiceCreateVersionParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceCreateVersionOK, + error) { + if svc.VersionAlreadyExist { + return nil, status.Error( + codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.AlreadyExists, + codes.AlreadyExists.String()), + ) } if params.Body.Fingerprint == "" { - return nil, errors.New("No valid Fingerprint was passed in") + return nil, errors.New("no valid Fingerprint was passed in") } if svc.TrackCalledServiceMethods { - svc.CreateIterationCalled = true - } - payload := &models.HashicorpCloudPackerCreateIterationResponse{ - Iteration: &models.HashicorpCloudPackerIteration{ - ID: "iteration-id", + svc.CreateVersionCalled = true + } + payload := &hcpPackerModels.HashicorpCloudPacker20230101CreateVersionResponse{ + Version: &hcpPackerModels.HashicorpCloudPacker20230101Version{ + BucketName: params.BucketName, + Fingerprint: params.Body.Fingerprint, + ID: "version-id", + Name: "v0", + Status: hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONRUNNING.Pointer(), TemplateType: params.Body.TemplateType, }, } - payload.Iteration.BucketSlug = params.BucketSlug - payload.Iteration.Fingerprint = params.Body.Fingerprint - - ok := &packerSvc.PackerServiceCreateIterationOK{ + ok := &hcpPackerService.PackerServiceCreateVersionOK{ Payload: payload, } return ok, nil } -func (svc *MockPackerClientService) PackerServiceGetIteration(params *packerSvc.PackerServiceGetIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceGetIterationOK, error) { - if !svc.IterationAlreadyExist { +func (svc *MockPackerClientService) PackerServiceGetVersion( + params *hcpPackerService.PackerServiceGetVersionParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceGetVersionOK, error) { + if !svc.VersionAlreadyExist { return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.Aborted, codes.Aborted.String())) } - if params.BucketSlug == "" { - return nil, errors.New("No valid BucketSlug was passed in") + if params.BucketName == "" { + return nil, errors.New("no valid BucketName was passed in") } - if params.Fingerprint == nil { - return nil, errors.New("No valid Fingerprint was passed in") + if params.Fingerprint == "" { + return nil, errors.New("no valid Fingerprint was passed in") } if svc.TrackCalledServiceMethods { - svc.GetIterationCalled = true + svc.GetVersionCalled = true } - payload := &models.HashicorpCloudPackerGetIterationResponse{ - Iteration: &models.HashicorpCloudPackerIteration{ - ID: "iteration-id", - Builds: make([]*models.HashicorpCloudPackerBuild, 0), - TemplateType: models.HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET.Pointer(), + payload := &hcpPackerModels.HashicorpCloudPacker20230101GetVersionResponse{ + Version: &hcpPackerModels.HashicorpCloudPacker20230101Version{ + ID: "version-id", + Builds: make([]*hcpPackerModels.HashicorpCloudPacker20230101Build, 0), + TemplateType: hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeTEMPLATETYPEUNSET.Pointer(), }, } - payload.Iteration.BucketSlug = params.BucketSlug - payload.Iteration.Fingerprint = *params.Fingerprint - ok := &packerSvc.PackerServiceGetIterationOK{ + payload.Version.BucketName = params.BucketName + payload.Version.Fingerprint = params.Fingerprint + ok := &hcpPackerService.PackerServiceGetVersionOK{ Payload: payload, } - if svc.IterationCompleted { - ok.Payload.Iteration.Complete = true - ok.Payload.Iteration.IncrementalVersion = 1 - ok.Payload.Iteration.Builds = append(ok.Payload.Iteration.Builds, &models.HashicorpCloudPackerBuild{ + if svc.VersionCompleted { + ok.Payload.Version.Name = "v1" + ok.Payload.Version.Builds = append(ok.Payload.Version.Builds, &hcpPackerModels.HashicorpCloudPacker20230101Build{ ID: "build-id", ComponentType: svc.ExistingBuilds[0], - Status: models.HashicorpCloudPackerBuildStatusDONE.Pointer(), - Images: []*models.HashicorpCloudPackerImage{ - {ImageID: "image-id", Region: "somewhere"}, + Status: hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE.Pointer(), + Artifacts: []*hcpPackerModels.HashicorpCloudPacker20230101Artifact{ + {ExternalIdentifier: "image-id", Region: "somewhere"}, }, Labels: make(map[string]string), }) + } else { + ok.Payload.Version.Name = "v0" } return ok, nil } -func (svc *MockPackerClientService) PackerServiceCreateBuild(params *packerSvc.PackerServiceCreateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateBuildOK, error) { - if params.BucketSlug == "" { - return nil, errors.New("No valid BucketSlug was passed in") +func (svc *MockPackerClientService) PackerServiceCreateBuild( + params *hcpPackerService.PackerServiceCreateBuildParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceCreateBuildOK, error) { + if params.BucketName == "" { + return nil, errors.New("no valid BucketName was passed in") } - if params.Body.Fingerprint == "" { - return nil, errors.New("No valid Fingerprint was passed in") + if params.Fingerprint == "" { + return nil, errors.New("no valid Fingerprint was passed in") } - if params.Body.Build.ComponentType == "" { - return nil, errors.New("No build componentType was passed in") + if params.Body.ComponentType == "" { + return nil, errors.New("no build componentType was passed in") } if svc.TrackCalledServiceMethods { svc.CreateBuildCalled = true } - payload := &models.HashicorpCloudPackerCreateBuildResponse{ - Build: &models.HashicorpCloudPackerBuild{ + payload := &hcpPackerModels.HashicorpCloudPacker20230101CreateBuildResponse{ + Build: &hcpPackerModels.HashicorpCloudPacker20230101Build{ PackerRunUUID: "test-uuid", - Status: models.HashicorpCloudPackerBuildStatusUNSET.Pointer(), + Status: hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET.Pointer(), }, } - payload.Build.ComponentType = params.Body.Build.ComponentType - payload.Build.IterationID = params.IterationID + payload.Build.ComponentType = params.Body.ComponentType - ok := packerSvc.NewPackerServiceCreateBuildOK() + ok := hcpPackerService.NewPackerServiceCreateBuildOK() ok.Payload = payload return ok, nil } -func (svc *MockPackerClientService) PackerServiceUpdateBuild(params *packerSvc.PackerServiceUpdateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceUpdateBuildOK, error) { +func (svc *MockPackerClientService) PackerServiceUpdateBuild( + params *hcpPackerService.PackerServiceUpdateBuildParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceUpdateBuildOK, error) { if params.BuildID == "" { - return nil, errors.New("No valid BuildID was passed in") + return nil, errors.New("no valid BuildID was passed in") } - if params.Body.Updates == nil { - return nil, errors.New("No valid Updates were passed in") + if params.Body == nil { + return nil, errors.New("no valid Updates were passed in") } - if params.Body.Updates.Status == nil || *params.Body.Updates.Status == "" { - return nil, errors.New("No build status was passed in") + if params.Body.Status == nil || *params.Body.Status == "" { + return nil, errors.New("no build status was passed in") } if svc.TrackCalledServiceMethods { svc.UpdateBuildCalled = true } - ok := packerSvc.NewPackerServiceUpdateBuildOK() - ok.Payload = &models.HashicorpCloudPackerUpdateBuildResponse{ - Build: &models.HashicorpCloudPackerBuild{ + ok := hcpPackerService.NewPackerServiceUpdateBuildOK() + ok.Payload = &hcpPackerModels.HashicorpCloudPacker20230101UpdateBuildResponse{ + Build: &hcpPackerModels.HashicorpCloudPacker20230101Build{ ID: params.BuildID, }, } return ok, nil } -func (svc *MockPackerClientService) PackerServiceListBuilds(params *packerSvc.PackerServiceListBuildsParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceListBuildsOK, error) { +func (svc *MockPackerClientService) PackerServiceListBuilds( + params *hcpPackerService.PackerServiceListBuildsParams, _ runtime.ClientAuthInfoWriter, + opts ...hcpPackerService.ClientOption, +) (*hcpPackerService.PackerServiceListBuildsOK, error) { - status := models.HashicorpCloudPackerBuildStatusUNSET - images := make([]*models.HashicorpCloudPackerImage, 0) + status := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET + artifacts := make([]*hcpPackerModels.HashicorpCloudPacker20230101Artifact, 0) labels := make(map[string]string) if svc.BuildAlreadyDone { - status = models.HashicorpCloudPackerBuildStatusDONE - images = append(images, &models.HashicorpCloudPackerImage{ImageID: "image-id", Region: "somewhere"}) + status = hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE + artifacts = append(artifacts, &hcpPackerModels.HashicorpCloudPacker20230101Artifact{ExternalIdentifier: "image-id", Region: "somewhere"}) } for k, v := range svc.ExistingBuildLabels { labels[k] = v } - builds := make([]*models.HashicorpCloudPackerBuild, 0, len(svc.ExistingBuilds)) + builds := make([]*hcpPackerModels.HashicorpCloudPacker20230101Build, 0, len(svc.ExistingBuilds)) for i, name := range svc.ExistingBuilds { - builds = append(builds, &models.HashicorpCloudPackerBuild{ + builds = append(builds, &hcpPackerModels.HashicorpCloudPacker20230101Build{ ID: name + "--" + strconv.Itoa(i), ComponentType: name, - CloudProvider: "mockProvider", - Status: status.Pointer(), - Images: images, + Platform: "mockPlatform", + Status: &status, + Artifacts: artifacts, Labels: labels, }) } - ok := packerSvc.NewPackerServiceListBuildsOK() - ok.Payload = &models.HashicorpCloudPackerListBuildsResponse{ + ok := hcpPackerService.NewPackerServiceListBuildsOK() + ok.Payload = &hcpPackerModels.HashicorpCloudPacker20230101ListBuildsResponse{ Builds: builds, } diff --git a/internal/hcp/api/service.go b/internal/hcp/api/service.go deleted file mode 100644 index 41a20ccc231..00000000000 --- a/internal/hcp/api/service.go +++ /dev/null @@ -1,250 +0,0 @@ -package api - -import ( - "context" - "errors" - "fmt" - - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" - "google.golang.org/grpc/codes" -) - -func (client *Client) CreateBucket( - ctx context.Context, - bucketSlug, - bucketDescription string, - bucketLabels map[string]string, -) (*packer_service.PackerServiceCreateBucketOK, error) { - - createBktParams := packer_service.NewPackerServiceCreateBucketParams() - createBktParams.LocationOrganizationID = client.OrganizationID - createBktParams.LocationProjectID = client.ProjectID - createBktParams.Body = packer_service.PackerServiceCreateBucketBody{ - BucketSlug: bucketSlug, - Description: bucketDescription, - Labels: bucketLabels, - } - - return client.Packer.PackerServiceCreateBucket(createBktParams, nil) -} - -func (client *Client) DeleteBucket( - ctx context.Context, - bucketSlug string, -) (*packer_service.PackerServiceDeleteBucketOK, error) { - - deleteBktParams := packer_service.NewPackerServiceDeleteBucketParamsWithContext(ctx) - deleteBktParams.LocationOrganizationID = client.OrganizationID - deleteBktParams.LocationProjectID = client.ProjectID - deleteBktParams.BucketSlug = bucketSlug - - return client.Packer.PackerServiceDeleteBucket(deleteBktParams, nil) -} - -// UpsertBucket tries to create a bucket on a HCP Packer Registry. If the bucket -// exists it will handle the error and update the bucket with the provided -// details. -func (client *Client) UpsertBucket( - ctx context.Context, - bucketSlug, - bucketDescription string, - bucketLabels map[string]string, -) error { - - // Create bucket if exist we continue as is, eventually we want to treat - // this like an upsert - _, err := client.CreateBucket(ctx, bucketSlug, bucketDescription, bucketLabels) - if err != nil && !CheckErrorCode(err, codes.AlreadyExists) { - return err - } - - if err == nil { - return nil - } - - params := packer_service.NewPackerServiceUpdateBucketParamsWithContext(ctx) - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - params.BucketSlug = bucketSlug - params.Body = packer_service.PackerServiceUpdateBucketBody{ - Description: bucketDescription, - Labels: bucketLabels, - } - _, err = client.Packer.PackerServiceUpdateBucket(params, nil) - - return err -} - -func (client *Client) CreateIteration( - ctx context.Context, - bucketSlug, - fingerprint string, - templateType models.HashicorpCloudPackerIterationTemplateType, -) (*packer_service.PackerServiceCreateIterationOK, error) { - - params := packer_service.NewPackerServiceCreateIterationParamsWithContext(ctx) - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - params.BucketSlug = bucketSlug - params.Body = packer_service.PackerServiceCreateIterationBody{ - Fingerprint: fingerprint, - TemplateType: templateType.Pointer(), - } - - return client.Packer.PackerServiceCreateIteration(params, nil) -} - -type GetIterationOption func(*packer_service.PackerServiceGetIterationParams) - -var ( - GetIteration_byID = func(id string) GetIterationOption { - return func(params *packer_service.PackerServiceGetIterationParams) { - params.IterationID = &id - } - } - GetIteration_byFingerprint = func(fingerprint string) GetIterationOption { - return func(params *packer_service.PackerServiceGetIterationParams) { - params.Fingerprint = &fingerprint - } - } -) - -func (client *Client) GetIteration(ctx context.Context, bucketSlug string, opts ...GetIterationOption) (*models.HashicorpCloudPackerIteration, error) { - getItParams := packer_service.NewPackerServiceGetIterationParams() - getItParams.LocationOrganizationID = client.OrganizationID - getItParams.LocationProjectID = client.ProjectID - getItParams.BucketSlug = bucketSlug - - for _, opt := range opts { - opt(getItParams) - } - - resp, err := client.Packer.PackerServiceGetIteration(getItParams, nil) - if err != nil { - return nil, err - } - - if resp.Payload.Iteration != nil { - return resp.Payload.Iteration, nil - } - - return nil, fmt.Errorf("something went wrong retrieving the iteration for bucket %s", bucketSlug) -} - -func (client *Client) CreateBuild( - ctx context.Context, - bucketSlug, - runUUID, - iterationID, - fingerprint, - componentType string, - status models.HashicorpCloudPackerBuildStatus, -) (*packer_service.PackerServiceCreateBuildOK, error) { - - params := packer_service.NewPackerServiceCreateBuildParamsWithContext(ctx) - - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - params.BucketSlug = bucketSlug - params.IterationID = iterationID - params.Body = packer_service.PackerServiceCreateBuildBody{ - Fingerprint: fingerprint, - Build: &models.HashicorpCloudPackerBuildCreateBody{ - ComponentType: componentType, - PackerRunUUID: runUUID, - Status: status.Pointer(), - }, - } - - return client.Packer.PackerServiceCreateBuild(params, nil) -} - -// ListBuilds queries an Iteration on HCP Packer registry for all of it's -// associated builds. Currently all builds are returned regardless of status. -func (client *Client) ListBuilds( - ctx context.Context, - bucketSlug string, - iterationID string, -) ([]*models.HashicorpCloudPackerBuild, error) { - - params := packer_service.NewPackerServiceListBuildsParamsWithContext(ctx) - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - params.BucketSlug = bucketSlug - params.IterationID = iterationID - - resp, err := client.Packer.PackerServiceListBuilds(params, nil) - if err != nil { - return []*models.HashicorpCloudPackerBuild{}, err - } - - return resp.Payload.Builds, nil -} - -// UpdateBuild updates a single iteration build entry with the incoming input -// data. -func (client *Client) UpdateBuild( - ctx context.Context, - buildID, - runUUID, - cloudProvider, - sourceImageID string, - sourceIterationID string, - sourceChannelID string, - labels map[string]string, - status models.HashicorpCloudPackerBuildStatus, - images []*models.HashicorpCloudPackerImageCreateBody, -) (string, error) { - - params := packer_service.NewPackerServiceUpdateBuildParamsWithContext(ctx) - params.BuildID = buildID - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - - params.Body = packer_service.PackerServiceUpdateBuildBody{ - Updates: &models.HashicorpCloudPackerBuildUpdates{ - Images: images, - PackerRunUUID: runUUID, - Labels: labels, - Status: status.Pointer(), - CloudProvider: cloudProvider, - SourceImageID: sourceImageID, - SourceIterationID: sourceIterationID, - SourceChannelID: sourceChannelID, - }, - } - - resp, err := client.Packer.PackerServiceUpdateBuild(params, nil) - if err != nil { - return "", err - } - - if resp == nil { - return "", errors.New("Not sure why response is nil") - } - - return resp.Payload.Build.ID, nil -} - -// GetChannel loads the named channel that is associated to the bucket slug . If the -// channel does not exist in HCP Packer, GetChannel returns an error. -func (client *Client) GetChannel(ctx context.Context, bucketSlug string, channelName string) (*models.HashicorpCloudPackerChannel, error) { - params := packer_service.NewPackerServiceGetChannelParamsWithContext(ctx) - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - params.BucketSlug = bucketSlug - params.Slug = channelName - - resp, err := client.Packer.PackerServiceGetChannel(params, nil) - if err != nil { - return nil, err - } - - if resp.Payload.Channel == nil { - return nil, fmt.Errorf("there is no channel with the name %s associated with the bucket %s", - channelName, bucketSlug) - } - - return resp.Payload.Channel, nil -} diff --git a/internal/hcp/api/service_bucket.go b/internal/hcp/api/service_bucket.go new file mode 100644 index 00000000000..bfdbe99f809 --- /dev/null +++ b/internal/hcp/api/service_bucket.go @@ -0,0 +1,66 @@ +package api + +import ( + "context" + + hcpPackerService "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + "google.golang.org/grpc/codes" +) + +func (c *Client) CreateBucket( + ctx context.Context, bucketName, bucketDescription string, bucketLabels map[string]string, +) (*hcpPackerService.PackerServiceCreateBucketOK, error) { + + createBktParams := hcpPackerService.NewPackerServiceCreateBucketParams() + createBktParams.LocationOrganizationID = c.OrganizationID + createBktParams.LocationProjectID = c.ProjectID + createBktParams.Body = &hcpPackerModels.HashicorpCloudPacker20230101CreateBucketBody{ + Name: bucketName, + Description: bucketDescription, + Labels: bucketLabels, + } + + return c.Packer.PackerServiceCreateBucket(createBktParams, nil) +} + +func (c *Client) DeleteBucket( + ctx context.Context, bucketName string, +) (*hcpPackerService.PackerServiceDeleteBucketOK, error) { + + deleteBktParams := hcpPackerService.NewPackerServiceDeleteBucketParamsWithContext(ctx) + deleteBktParams.LocationOrganizationID = c.OrganizationID + deleteBktParams.LocationProjectID = c.ProjectID + deleteBktParams.BucketName = bucketName + + return c.Packer.PackerServiceDeleteBucket(deleteBktParams, nil) +} + +// UpsertBucket tries to create a bucket on a HCP Packer Registry. If the bucket exists it will +// handle the error and update the bucket with the provided details. +func (c *Client) UpsertBucket( + ctx context.Context, bucketName, bucketDescription string, bucketLabels map[string]string, +) error { + + // Create bucket if exist we continue as is, eventually we want to treat this like an upsert. + _, err := c.CreateBucket(ctx, bucketName, bucketDescription, bucketLabels) + if err != nil && !CheckErrorCode(err, codes.AlreadyExists) { + return err + } + + if err == nil { + return nil + } + + params := hcpPackerService.NewPackerServiceUpdateBucketParamsWithContext(ctx) + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Body = &hcpPackerModels.HashicorpCloudPacker20230101UpdateBucketBody{ + Description: bucketDescription, + Labels: bucketLabels, + } + _, err = c.Packer.PackerServiceUpdateBucket(params, nil) + + return err +} diff --git a/internal/hcp/api/service_build.go b/internal/hcp/api/service_build.go new file mode 100644 index 00000000000..946d8d08e42 --- /dev/null +++ b/internal/hcp/api/service_build.go @@ -0,0 +1,95 @@ +package api + +import ( + "context" + "fmt" + + hcpPackerAPI "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" +) + +func (c *Client) CreateBuild( + ctx context.Context, bucketName, runUUID, fingerprint, componentType string, + buildStatus hcpPackerModels.HashicorpCloudPacker20230101BuildStatus, +) (*hcpPackerAPI.PackerServiceCreateBuildOK, error) { + + params := hcpPackerAPI.NewPackerServiceCreateBuildParamsWithContext(ctx) + + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Fingerprint = fingerprint + params.Body = &hcpPackerModels.HashicorpCloudPacker20230101CreateBuildBody{ + ComponentType: componentType, + PackerRunUUID: runUUID, + Status: &buildStatus, + } + + return c.Packer.PackerServiceCreateBuild(params, nil) +} + +// ListBuilds queries a Version on HCP Packer registry for all of it's associated builds. +// Currently, all builds are returned regardless of status. +func (c *Client) ListBuilds( + ctx context.Context, bucketName, fingerprint string, +) ([]*hcpPackerModels.HashicorpCloudPacker20230101Build, error) { + + params := hcpPackerAPI.NewPackerServiceListBuildsParamsWithContext(ctx) + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Fingerprint = fingerprint + + resp, err := c.Packer.PackerServiceListBuilds(params, nil) + if err != nil { + return []*hcpPackerModels.HashicorpCloudPacker20230101Build{}, err + } + + return resp.Payload.Builds, nil +} + +// UpdateBuild updates a single build in a version with the incoming input data. +func (c *Client) UpdateBuild( + ctx context.Context, + bucketName, fingerprint string, + buildID, runUUID, platform, sourceExternalIdentifier string, + parentVersionID string, + parentChannelID string, + buildLabels map[string]string, + buildStatus hcpPackerModels.HashicorpCloudPacker20230101BuildStatus, + artifacts []*hcpPackerModels.HashicorpCloudPacker20230101ArtifactCreateBody, + metadata *hcpPackerModels.HashicorpCloudPacker20230101BuildMetadata, +) (string, error) { + + params := hcpPackerAPI.NewPackerServiceUpdateBuildParamsWithContext(ctx) + params.BuildID = buildID + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Fingerprint = fingerprint + + params.Body = &hcpPackerModels.HashicorpCloudPacker20230101UpdateBuildBody{ + Artifacts: artifacts, + Labels: buildLabels, + PackerRunUUID: runUUID, + ParentChannelID: parentChannelID, + ParentVersionID: parentVersionID, + Platform: platform, + SourceExternalIdentifier: sourceExternalIdentifier, + Status: &buildStatus, + Metadata: metadata, + } + + resp, err := c.Packer.PackerServiceUpdateBuild(params, nil) + if err != nil { + return "", err + } + + if resp == nil { + return "", fmt.Errorf( + "something went wrong retrieving the build %s from bucket %s", buildID, bucketName, + ) + } + + return resp.Payload.Build.ID, nil +} diff --git a/internal/hcp/api/service_channel.go b/internal/hcp/api/service_channel.go new file mode 100644 index 00000000000..50dbfe2d84c --- /dev/null +++ b/internal/hcp/api/service_channel.go @@ -0,0 +1,35 @@ +package api + +import ( + "context" + "fmt" + + hcpPackerAPI "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" +) + +// GetChannel loads the named channel that is associated to the bucket name. If the +// channel does not exist in HCP Packer, GetChannel returns an error. +func (c *Client) GetChannel( + ctx context.Context, bucketName, channelName string, +) (*hcpPackerModels.HashicorpCloudPacker20230101Channel, error) { + params := hcpPackerAPI.NewPackerServiceGetChannelParamsWithContext(ctx) + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.ChannelName = channelName + + resp, err := c.Packer.PackerServiceGetChannel(params, nil) + if err != nil { + return nil, err + } + + if resp.Payload.Channel == nil { + return nil, fmt.Errorf( + "there is no channel with the name %s associated with the bucket %s", + channelName, bucketName, + ) + } + + return resp.Payload.Channel, nil +} diff --git a/internal/hcp/api/service_version.go b/internal/hcp/api/service_version.go new file mode 100644 index 00000000000..0e67bc1bd88 --- /dev/null +++ b/internal/hcp/api/service_version.go @@ -0,0 +1,61 @@ +package api + +import ( + "context" + "fmt" + + hcpPackerAPI "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" +) + +const incompleteVersionName = "v0" + +// IsVersionComplete returns if the given version is completed or not. +// +// The best way to know if the version is completed or not is from the name of the version. All version that are +// incomplete are named "v0". +func (c *Client) IsVersionComplete(version *hcpPackerModels.HashicorpCloudPacker20230101Version) bool { + return version.Name != incompleteVersionName +} + +func (c *Client) CreateVersion( + ctx context.Context, + bucketName, + fingerprint string, + templateType hcpPackerModels.HashicorpCloudPacker20230101TemplateType, +) (*hcpPackerAPI.PackerServiceCreateVersionOK, error) { + + params := hcpPackerAPI.NewPackerServiceCreateVersionParamsWithContext(ctx) + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Body = &hcpPackerModels.HashicorpCloudPacker20230101CreateVersionBody{ + Fingerprint: fingerprint, + TemplateType: templateType.Pointer(), + } + + return c.Packer.PackerServiceCreateVersion(params, nil) +} + +func (c *Client) GetVersion( + ctx context.Context, bucketName string, fingerprint string, +) (*hcpPackerModels.HashicorpCloudPacker20230101Version, error) { + params := hcpPackerAPI.NewPackerServiceGetVersionParams() + params.LocationOrganizationID = c.OrganizationID + params.LocationProjectID = c.ProjectID + params.BucketName = bucketName + params.Fingerprint = fingerprint + + resp, err := c.Packer.PackerServiceGetVersion(params, nil) + if err != nil { + return nil, err + } + + if resp.Payload.Version != nil { + return resp.Payload.Version, nil + } + + return nil, fmt.Errorf( + "something went wrong retrieving the version for bucket %s", bucketName, + ) +} diff --git a/internal/hcp/env/env.go b/internal/hcp/env/env.go index 7d9e9d7798c..972fd68f77e 100644 --- a/internal/hcp/env/env.go +++ b/internal/hcp/env/env.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package env provides HCP Packer environment variables. package env @@ -6,6 +9,14 @@ import ( "strings" ) +func HasProjectID() bool { + return hasEnvVar(HCPProjectID) +} + +func HasOrganizationID() bool { + return hasEnvVar(HCPOrganizationID) +} + func HasClientID() bool { return hasEnvVar(HCPClientID) } diff --git a/internal/hcp/env/env_test.go b/internal/hcp/env/env_test.go index c2fd2759830..a773b41c928 100644 --- a/internal/hcp/env/env_test.go +++ b/internal/hcp/env/env_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package env import ( diff --git a/internal/hcp/env/variables.go b/internal/hcp/env/variables.go index 1d19fbcecc4..a8c1a493e13 100644 --- a/internal/hcp/env/variables.go +++ b/internal/hcp/env/variables.go @@ -1,8 +1,13 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package env const ( HCPClientID = "HCP_CLIENT_ID" HCPClientSecret = "HCP_CLIENT_SECRET" + HCPProjectID = "HCP_PROJECT_ID" + HCPOrganizationID = "HCP_ORGANIZATION_ID" HCPPackerRegistry = "HCP_PACKER_REGISTRY" HCPPackerBucket = "HCP_PACKER_BUCKET_NAME" HCPPackerBuildFingerprint = "HCP_PACKER_BUILD_FINGERPRINT" diff --git a/internal/hcp/registry/artifact.go b/internal/hcp/registry/artifact.go index e225d16bb82..6ee5467af65 100644 --- a/internal/hcp/registry/artifact.go +++ b/internal/hcp/registry/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( @@ -7,9 +10,9 @@ import ( const BuilderId = "packer.post-processor.hpc-packer-registry" type registryArtifact struct { - BucketSlug string - IterationID string - BuildName string + BucketName string + VersionID string + BuildName string } func (a *registryArtifact) BuilderId() string { @@ -25,7 +28,7 @@ func (a *registryArtifact) Files() []string { } func (a *registryArtifact) String() string { - return fmt.Sprintf("Published metadata to HCP Packer registry packer/%s/iterations/%s", a.BucketSlug, a.IterationID) + return fmt.Sprintf("Published metadata to HCP Packer registry packer/%s/versions/%s", a.BucketName, a.VersionID) } func (*registryArtifact) State(name string) interface{} { diff --git a/internal/hcp/registry/deprecated_ds_config.go b/internal/hcp/registry/deprecated_ds_config.go new file mode 100644 index 00000000000..20c3639807d --- /dev/null +++ b/internal/hcp/registry/deprecated_ds_config.go @@ -0,0 +1,131 @@ +package registry + +import ( + "fmt" + + "github.com/hashicorp/hcl/v2" + sdkpacker "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/gocty" +) + +type hcpImage struct { + ID string + ChannelID string + IterationID string +} + +func imageValueToDSOutput(imageVal map[string]cty.Value) hcpImage { + image := hcpImage{} + for k, v := range imageVal { + switch k { + case "id": + image.ID = v.AsString() + case "channel_id": + image.ChannelID = v.AsString() + case "iteration_id": + image.IterationID = v.AsString() + } + } + + return image +} + +type hcpIteration struct { + ID string + ChannelID string +} + +func iterValueToDSOutput(iterVal map[string]cty.Value) hcpIteration { + iter := hcpIteration{} + for k, v := range iterVal { + switch k { + case "id": + iter.ID = v.AsString() + case "channel_id": + iter.ChannelID = v.AsString() + } + } + return iter +} + +func withDeprecatedDatasourceConfiguration(vals map[string]cty.Value, ui sdkpacker.Ui) bucketConfigurationOpts { + return func(bucket *Bucket) hcl.Diagnostics { + var diags hcl.Diagnostics + + imageDS, imageOK := vals[hcpImageDatasourceType] + iterDS, iterOK := vals[hcpIterationDatasourceType] + + if !imageOK && !iterOK { + return nil + } + + iterations := map[string]hcpIteration{} + + var err error + if iterOK { + ui.Say("[WARN] Deprecation: `hcp-packer-iteration` datasource has been deprecated. " + + "Please use `hcp-packer-version` datasource instead.") + hcpData := map[string]cty.Value{} + err = gocty.FromCtyValue(iterDS, &hcpData) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid HCP datasources", + Detail: fmt.Sprintf("Failed to decode hcp-packer-iteration datasources: %s", err), + }) + return diags + } + + for k, v := range hcpData { + iterVals := v.AsValueMap() + iter := iterValueToDSOutput(iterVals) + iterations[k] = iter + } + } + + images := map[string]hcpImage{} + + if imageOK { + ui.Say("[WARN] Deprecation: `hcp-packer-image` datasource has been deprecated. " + + "Please use `hcp-packer-artifact` datasource instead.") + hcpData := map[string]cty.Value{} + err = gocty.FromCtyValue(imageDS, &hcpData) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid HCP datasources", + Detail: fmt.Sprintf("Failed to decode hcp_packer_image datasources: %s", err), + }) + return diags + } + + for k, v := range hcpData { + imageVals := v.AsValueMap() + img := imageValueToDSOutput(imageVals) + images[k] = img + } + } + + for _, img := range images { + sourceIteration := ParentVersion{} + + sourceIteration.VersionID = img.IterationID + + if img.ChannelID != "" { + sourceIteration.ChannelID = img.ChannelID + } else { + for _, it := range iterations { + if it.ID == img.IterationID { + sourceIteration.ChannelID = it.ChannelID + break + } + } + } + + bucket.SourceExternalIdentifierToParentVersions[img.ID] = sourceIteration + } + + return diags + } +} diff --git a/internal/hcp/registry/ds_config.go b/internal/hcp/registry/ds_config.go new file mode 100644 index 00000000000..e38dd722dca --- /dev/null +++ b/internal/hcp/registry/ds_config.go @@ -0,0 +1,129 @@ +package registry + +import ( + "fmt" + + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/gocty" +) + +type hcpVersion struct { + VersionID string + ChannelID string +} + +func versionValueToDSOutput(iterVal map[string]cty.Value) hcpVersion { + version := hcpVersion{} + for k, v := range iterVal { + switch k { + case "id": + version.VersionID = v.AsString() + case "channel_id": + version.ChannelID = v.AsString() + } + } + return version +} + +type hcpArtifact struct { + ExternalIdentifier string + ChannelID string + VersionID string +} + +func artifactValueToDSOutput(imageVal map[string]cty.Value) hcpArtifact { + artifact := hcpArtifact{} + for k, v := range imageVal { + switch k { + case "external_identifier": + artifact.ExternalIdentifier = v.AsString() + case "channel_id": + artifact.ChannelID = v.AsString() + case "version_id": + artifact.VersionID = v.AsString() + } + } + + return artifact +} + +func withDatasourceConfiguration(vals map[string]cty.Value) bucketConfigurationOpts { + return func(bucket *Bucket) hcl.Diagnostics { + var diags hcl.Diagnostics + + versionDS, versionOK := vals[hcpVersionDatasourceType] + artifactDS, artifactOK := vals[hcpArtifactDatasourceType] + + if !artifactOK && !versionOK { + return nil + } + + versions := map[string]hcpVersion{} + + var err error + if versionOK { + hcpData := map[string]cty.Value{} + err = gocty.FromCtyValue(versionDS, &hcpData) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid HCP datasources", + Detail: fmt.Sprintf( + "Failed to decode hcp-packer-version datasources: %s", err, + ), + }) + return diags + } + + for k, v := range hcpData { + versionVals := v.AsValueMap() + version := versionValueToDSOutput(versionVals) + versions[k] = version + } + } + + artifacts := map[string]hcpArtifact{} + + if artifactOK { + hcpData := map[string]cty.Value{} + err = gocty.FromCtyValue(artifactDS, &hcpData) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid HCP datasources", + Detail: fmt.Sprintf( + "Failed to decode hcp-packer-artifact datasources: %s", err, + ), + }) + return diags + } + + for k, v := range hcpData { + artifactVals := v.AsValueMap() + artifact := artifactValueToDSOutput(artifactVals) + artifacts[k] = artifact + } + } + + for _, a := range artifacts { + parentVersion := ParentVersion{} + parentVersion.VersionID = a.VersionID + + if a.ChannelID != "" { + parentVersion.ChannelID = a.ChannelID + } else { + for _, v := range versions { + if v.VersionID == a.VersionID { + parentVersion.ChannelID = v.ChannelID + break + } + } + } + + bucket.SourceExternalIdentifierToParentVersions[a.ExternalIdentifier] = parentVersion + } + + return diags + } +} diff --git a/internal/hcp/registry/errors.go b/internal/hcp/registry/errors.go index 1e1921d62c5..3b3dbbd92ba 100644 --- a/internal/hcp/registry/errors.go +++ b/internal/hcp/registry/errors.go @@ -1,6 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry -// ErrBuildAlreadyDone is the error returned by an HCP handler when a build cannot be started since it's already marked as DONE. +// ErrBuildAlreadyDone is the error returned by an HCP handler when a build cannot be started since it's already +// marked as DONE. type ErrBuildAlreadyDone struct { Message string } diff --git a/internal/hcp/registry/hcl.go b/internal/hcp/registry/hcl.go index ccbc1f577a3..d80577b1318 100644 --- a/internal/hcp/registry/hcl.go +++ b/internal/hcp/registry/hcl.go @@ -1,73 +1,114 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "context" "fmt" + "log" "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" sdkpacker "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer/hcl2template" + "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" - "github.com/zclconf/go-cty/cty/gocty" ) -// HCLMetadataRegistry is a HCP handler made for handling HCL configurations -type HCLMetadataRegistry struct { +// HCLRegistry is a HCP handler made for handling HCL configurations +type HCLRegistry struct { configuration *hcl2template.PackerConfig bucket *Bucket + ui sdkpacker.Ui } const ( - // Known HCP Packer Image Datasource, whose id is the SourceImageId for some build. - hcpImageDatasourceType string = "hcp-packer-image" + // Known HCP Packer Datasource, whose id is the SourceImageId for some build. + hcpImageDatasourceType string = "hcp-packer-image" + hcpArtifactDatasourceType string = "hcp-packer-artifact" + hcpIterationDatasourceType string = "hcp-packer-iteration" - buildLabel string = "build" + hcpVersionDatasourceType string = "hcp-packer-version" + + buildLabel string = "build" ) -// PopulateIteration creates the metadata on HCP for a build -func (h *HCLMetadataRegistry) PopulateIteration(ctx context.Context) error { - err := h.bucket.Initialize(ctx, models.HashicorpCloudPackerIterationTemplateTypeHCL2) +// PopulateVersion creates the metadata in HCP Packer Registry for a build +func (h *HCLRegistry) PopulateVersion(ctx context.Context) error { + err := h.bucket.Initialize(ctx, hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { return err } - err = h.bucket.populateIteration(ctx) + err = h.bucket.populateVersion(ctx) if err != nil { return err } - iterationID := h.bucket.Iteration.ID + versionID := h.bucket.Version.ID + versionFingerprint := h.bucket.Version.Fingerprint - h.configuration.HCPVars["iterationID"] = cty.StringVal(iterationID) + // FIXME: Remove + h.configuration.HCPVars["iterationID"] = cty.StringVal(versionID) + h.configuration.HCPVars["versionFingerprint"] = cty.StringVal(versionFingerprint) + + sha, err := getGitSHA(h.configuration.Basedir) + if err != nil { + log.Printf("failed to get GIT SHA from environment, won't set as build labels") + } else { + h.bucket.Version.AddSHAToBuildLabels(sha) + } return nil } // StartBuild is invoked when one build for the configuration is starting to be processed -func (h *HCLMetadataRegistry) StartBuild(ctx context.Context, buildName string) error { - return h.bucket.startBuild(ctx, buildName) +func (h *HCLRegistry) StartBuild(ctx context.Context, build sdkpacker.Build) error { + name := build.Name() + cb, ok := build.(*packer.CoreBuild) + if ok { + name = cb.Type + } + + return h.bucket.startBuild(ctx, name) } // CompleteBuild is invoked when one build for the configuration has finished -func (h *HCLMetadataRegistry) CompleteBuild( +func (h *HCLRegistry) CompleteBuild( ctx context.Context, - buildName string, + build sdkpacker.Build, artifacts []sdkpacker.Artifact, buildErr error, ) ([]sdkpacker.Artifact, error) { + buildName := build.Name() + cb, ok := build.(*packer.CoreBuild) + if ok { + buildName = cb.Type + } + + metadata := cb.GetMetadata() + err := h.bucket.Version.AddMetadataToBuild(ctx, buildName, metadata) + if err != nil { + return nil, err + } return h.bucket.completeBuild(ctx, buildName, artifacts, buildErr) } -func NewHCLMetadataRegistry(config *hcl2template.PackerConfig) (*HCLMetadataRegistry, hcl.Diagnostics) { +// VersionStatusSummary prints a status report in the UI if the version is not yet done +func (h *HCLRegistry) VersionStatusSummary() { + h.bucket.Version.statusSummary(h.ui) +} + +func NewHCLRegistry(config *hcl2template.PackerConfig, ui sdkpacker.Ui) (*HCLRegistry, hcl.Diagnostics) { var diags hcl.Diagnostics if len(config.Builds) > 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Multiple " + buildLabel + " blocks", - Detail: fmt.Sprintf("For Packer Registry enabled builds, only one " + buildLabel + + Detail: fmt.Sprintf("For HCP Packer Registry enabled builds, only one " + buildLabel + " block can be defined. Please remove any additional " + buildLabel + - " block(s). If this " + buildLabel + " is not meant for the Packer registry please " + + " block(s). If this " + buildLabel + " is not meant for the HCP Packer registry please " + "clear any HCP_PACKER_* environment variables."), }) @@ -77,10 +118,10 @@ func NewHCLMetadataRegistry(config *hcl2template.PackerConfig) (*HCLMetadataRegi withHCLBucketConfiguration := func(bb *hcl2template.BuildBlock) bucketConfigurationOpts { return func(bucket *Bucket) hcl.Diagnostics { bucket.ReadFromHCLBuildBlock(bb) - // If at this point the bucket.Slug is still empty, + // If at this point the bucket.Name is still empty, // last try is to use the build.Name if present - if bucket.Slug == "" && bb.Name != "" { - bucket.Slug = bb.Name + if bucket.Name == "" && bb.Name != "" { + bucket.Name = bb.Name } // If the description is empty, use the one from the build block @@ -102,6 +143,7 @@ func NewHCLMetadataRegistry(config *hcl2template.PackerConfig) (*HCLMetadataRegi config.Basedir, withPackerEnvConfiguration, withHCLBucketConfiguration(build), + withDeprecatedDatasourceConfiguration(vals, ui), withDatasourceConfiguration(vals), ) if bucketDiags != nil { @@ -116,125 +158,11 @@ func NewHCLMetadataRegistry(config *hcl2template.PackerConfig) (*HCLMetadataRegi bucket.RegisterBuildForComponent(source.String()) } - return &HCLMetadataRegistry{ + ui.Say(fmt.Sprintf("Tracking build on HCP Packer with fingerprint %q", bucket.Version.Fingerprint)) + + return &HCLRegistry{ configuration: config, bucket: bucket, + ui: ui, }, nil } - -type hcpImage struct { - ID string - ChannelID string - IterationID string -} - -func imageValueToDSOutput(imageVal map[string]cty.Value) hcpImage { - image := hcpImage{} - for k, v := range imageVal { - switch k { - case "id": - image.ID = v.AsString() - case "channel_id": - image.ChannelID = v.AsString() - case "iteration_id": - image.IterationID = v.AsString() - } - } - - return image -} - -type hcpIteration struct { - ID string - ChannelID string -} - -func iterValueToDSOutput(iterVal map[string]cty.Value) hcpIteration { - iter := hcpIteration{} - for k, v := range iterVal { - switch k { - case "id": - iter.ID = v.AsString() - case "channel_id": - iter.ChannelID = v.AsString() - } - } - return iter -} - -func withDatasourceConfiguration(vals map[string]cty.Value) bucketConfigurationOpts { - return func(bucket *Bucket) hcl.Diagnostics { - var diags hcl.Diagnostics - - imageDS, imageOK := vals[hcpImageDatasourceType] - iterDS, iterOK := vals[hcpIterationDatasourceType] - - if !imageOK && !iterOK { - return nil - } - - iterations := map[string]hcpIteration{} - - var err error - if iterOK { - hcpData := map[string]cty.Value{} - err = gocty.FromCtyValue(iterDS, &hcpData) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid HCP datasources", - Detail: fmt.Sprintf("Failed to decode hcp_packer_iteration datasources: %s", err), - }) - return diags - } - - for k, v := range hcpData { - iterVals := v.AsValueMap() - iter := iterValueToDSOutput(iterVals) - iterations[k] = iter - } - } - - images := map[string]hcpImage{} - - if imageOK { - hcpData := map[string]cty.Value{} - err = gocty.FromCtyValue(imageDS, &hcpData) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid HCP datasources", - Detail: fmt.Sprintf("Failed to decode hcp_packer_image datasources: %s", err), - }) - return diags - } - - for k, v := range hcpData { - imageVals := v.AsValueMap() - img := imageValueToDSOutput(imageVals) - images[k] = img - } - } - - for _, img := range images { - sourceIteration := ParentIteration{} - - sourceIteration.IterationID = img.IterationID - - if img.ChannelID != "" { - sourceIteration.ChannelID = img.ChannelID - } else { - for _, it := range iterations { - if it.ID == img.IterationID { - sourceIteration.ChannelID = it.ChannelID - break - } - } - } - - bucket.SourceImagesToParentIterations[img.ID] = sourceIteration - } - - return diags - } -} diff --git a/internal/hcp/registry/hcp.go b/internal/hcp/registry/hcp.go index fe95a0a63cd..d0d249f25c6 100644 --- a/internal/hcp/registry/hcp.go +++ b/internal/hcp/registry/hcp.go @@ -1,8 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "fmt" + "github.com/go-git/go-git/v5" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/internal/hcp/env" @@ -67,7 +71,7 @@ func createConfiguredBucket(templateDir string, opts ...bucketConfigurationOpts) }) } - bucket := NewBucketWithIteration() + bucket := NewBucketWithVersion() for _, opt := range opts { if optDiags := opt(bucket); optDiags.HasErrors() { @@ -75,10 +79,10 @@ func createConfiguredBucket(templateDir string, opts ...bucketConfigurationOpts) } } - if bucket.Slug == "" { + if bucket.Name == "" { diags = append(diags, &hcl.Diagnostic{ - Summary: "Image bucket name required", - Detail: "You must provide an image bucket name for HCP Packer builds. " + + Summary: "Bucket name required", + Detail: "You must provide a bucket name for HCP Packer builds. " + "You can set the HCP_PACKER_BUCKET_NAME environment variable. " + "For HCL2 templates, the registry either uses the name of your " + "template's build block, or you can set the bucket_name argument " + @@ -87,14 +91,11 @@ func createConfiguredBucket(templateDir string, opts ...bucketConfigurationOpts) }) } - err := bucket.Iteration.Initialize(IterationOptions{ - TemplateBaseDir: templateDir, - }) - + err := bucket.Version.Initialize() if err != nil { diags = append(diags, &hcl.Diagnostic{ - Summary: "Iteration initialization failed", - Detail: fmt.Sprintf("Initialization of the iteration failed with "+ + Summary: "Version initialization failed", + Detail: fmt.Sprintf("Initialization of the version failed with "+ "the following error message: %s", err), Severity: hcl.DiagError, }) @@ -109,3 +110,35 @@ func withPackerEnvConfiguration(bucket *Bucket) hcl.Diagnostics { return nil } + +// getGitSHA returns the HEAD commit for some template dir defined in baseDir. +// If the base directory is not under version control an error is returned. +func getGitSHA(baseDir string) (string, error) { + r, err := git.PlainOpenWithOptions(baseDir, &git.PlainOpenOptions{ + DetectDotGit: true, + }) + + if err != nil { + return "", fmt.Errorf("Packer could not read the fingerprint from git.") + } + + // The config can be used to retrieve user identity. for example, + // c.User.Email. Leaving in but commented because I'm not sure we care + // about this identity right now. - Megan + // + // c, err := r.ConfigScoped(config.GlobalScope) + // if err != nil { + // return "", fmt.Errorf("Error setting git scope", err) + // } + ref, err := r.Head() + if err != nil { + // If we get there, we're in a Git dir, but HEAD cannot be read. + // + // This may happen when there's no commit in the git dir. + return "", fmt.Errorf("Packer could not read a git SHA in directory %q: %s", baseDir, err) + } + + // log.Printf("Author: %v, Commit: %v\n", c.User.Email, ref.Hash()) + + return ref.Hash().String(), nil +} diff --git a/internal/hcp/registry/json.go b/internal/hcp/registry/json.go index 20e1f808e47..e94f7afd415 100644 --- a/internal/hcp/registry/json.go +++ b/internal/hcp/registry/json.go @@ -1,22 +1,28 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "context" + "fmt" + "log" "path/filepath" "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" sdkpacker "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer" ) -// JSONMetadataRegistry is a HCP handler made to process legacy JSON templates -type JSONMetadataRegistry struct { +// JSONRegistry is a HCP handler made to process legacy JSON templates +type JSONRegistry struct { configuration *packer.Core bucket *Bucket + ui sdkpacker.Ui } -func NewJSONMetadataRegistry(config *packer.Core) (*JSONMetadataRegistry, hcl.Diagnostics) { +func NewJSONRegistry(config *packer.Core, ui sdkpacker.Ui) (*JSONRegistry, hcl.Diagnostics) { bucket, diags := createConfiguredBucket( filepath.Dir(config.Template.Path), withPackerEnvConfiguration, @@ -27,46 +33,77 @@ func NewJSONMetadataRegistry(config *packer.Core) (*JSONMetadataRegistry, hcl.Di } for _, b := range config.Template.Builders { + buildName := b.Name + + // By default, if the name is unspecified, it will be assigned the type + // + // If the two are different, we can compose the HCP build name from both + if b.Name != b.Type { + buildName = fmt.Sprintf("%s.%s", b.Type, b.Name) + } + // Get all builds slated within config ignoring any only or exclude flags. - bucket.RegisterBuildForComponent(packer.HCPName(b)) + bucket.RegisterBuildForComponent(buildName) } - return &JSONMetadataRegistry{ + ui.Say(fmt.Sprintf("Tracking build on HCP Packer with fingerprint %q", bucket.Version.Fingerprint)) + + return &JSONRegistry{ configuration: config, bucket: bucket, + ui: ui, }, nil } -// PopulateIteration creates the metadata on HCP for a build -func (h *JSONMetadataRegistry) PopulateIteration(ctx context.Context) error { +// PopulateVersion creates the metadata in HCP Packer Registry for a build +func (h *JSONRegistry) PopulateVersion(ctx context.Context) error { err := h.bucket.Validate() if err != nil { return err } - err = h.bucket.Initialize(ctx, models.HashicorpCloudPackerIterationTemplateTypeJSON) + err = h.bucket.Initialize(ctx, hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeJSON) if err != nil { return err } - err = h.bucket.populateIteration(ctx) + err = h.bucket.populateVersion(ctx) if err != nil { return err } + sha, err := getGitSHA(h.configuration.Template.Path) + if err != nil { + log.Printf("failed to get GIT SHA from environment, won't set as build labels") + } else { + h.bucket.Version.AddSHAToBuildLabels(sha) + } + return nil } // StartBuild is invoked when one build for the configuration is starting to be processed -func (h *JSONMetadataRegistry) StartBuild(ctx context.Context, buildName string) error { - return h.bucket.startBuild(ctx, buildName) +func (h *JSONRegistry) StartBuild(ctx context.Context, build sdkpacker.Build) error { + name := build.Name() + return h.bucket.startBuild(ctx, name) } // CompleteBuild is invoked when one build for the configuration has finished -func (h *JSONMetadataRegistry) CompleteBuild( +func (h *JSONRegistry) CompleteBuild( ctx context.Context, - buildName string, + build sdkpacker.Build, artifacts []sdkpacker.Artifact, buildErr error, ) ([]sdkpacker.Artifact, error) { + buildName := build.Name() + buildMetadata := build.(*packer.CoreBuild).GetMetadata() + err := h.bucket.Version.AddMetadataToBuild(ctx, buildName, buildMetadata) + if err != nil { + return nil, err + } return h.bucket.completeBuild(ctx, buildName, artifacts, buildErr) } + +// VersionStatusSummary prints a status report in the UI if the version is not yet done +func (h *JSONRegistry) VersionStatusSummary() { + h.bucket.Version.statusSummary(h.ui) +} diff --git a/internal/hcp/registry/null_registry.go b/internal/hcp/registry/null_registry.go index fba9db4be91..4f32c3d12b3 100644 --- a/internal/hcp/registry/null_registry.go +++ b/internal/hcp/registry/null_registry.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( @@ -9,19 +12,21 @@ import ( // nullRegistry is a special handler that does nothing type nullRegistry struct{} -func (r nullRegistry) PopulateIteration(context.Context) error { +func (r nullRegistry) PopulateVersion(context.Context) error { return nil } -func (r nullRegistry) StartBuild(context.Context, string) error { +func (r nullRegistry) StartBuild(context.Context, sdkpacker.Build) error { return nil } func (r nullRegistry) CompleteBuild( ctx context.Context, - buildName string, + build sdkpacker.Build, artifacts []sdkpacker.Artifact, buildErr error, ) ([]sdkpacker.Artifact, error) { return artifacts, nil } + +func (r nullRegistry) VersionStatusSummary() {} diff --git a/internal/hcp/registry/registry.go b/internal/hcp/registry/registry.go index e9aa3f9f129..56b70285d41 100644 --- a/internal/hcp/registry/registry.go +++ b/internal/hcp/registry/registry.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package registry provides access to the HCP registry. package registry @@ -12,15 +15,15 @@ import ( // Registry is an entity capable to orchestrate a Packer build and upload metadata to HCP type Registry interface { - //Configure(packer.Handler) - PopulateIteration(context.Context) error - StartBuild(context.Context, string) error - CompleteBuild(ctx context.Context, buildName string, artifacts []sdkpacker.Artifact, buildErr error) ([]sdkpacker.Artifact, error) + PopulateVersion(context.Context) error + StartBuild(context.Context, sdkpacker.Build) error + CompleteBuild(ctx context.Context, build sdkpacker.Build, artifacts []sdkpacker.Artifact, buildErr error) ([]sdkpacker.Artifact, error) + VersionStatusSummary() } -// New instanciates the appropriate registry for the Packer configuration template type. +// New instantiates the appropriate registry for the Packer configuration template type. // A nullRegistry is returned for non-HCP Packer registry enabled templates. -func New(cfg packer.Handler) (Registry, hcl.Diagnostics) { +func New(cfg packer.Handler, ui sdkpacker.Ui) (Registry, hcl.Diagnostics) { if !IsHCPEnabled(cfg) { return &nullRegistry{}, nil } @@ -28,9 +31,9 @@ func New(cfg packer.Handler) (Registry, hcl.Diagnostics) { switch config := cfg.(type) { case *hcl2template.PackerConfig: // Maybe rename to what it represents.... - return NewHCLMetadataRegistry(config) + return NewHCLRegistry(config, ui) case *packer.Core: - return NewJSONMetadataRegistry(config) + return NewJSONRegistry(config, ui) } return nil, hcl.Diagnostics{ diff --git a/internal/hcp/registry/types.bucket.go b/internal/hcp/registry/types.bucket.go index e3f3895f295..9ebf42eb797 100644 --- a/internal/hcp/registry/types.bucket.go +++ b/internal/hcp/registry/types.bucket.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( @@ -10,11 +13,11 @@ import ( "time" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" - "github.com/hashicorp/packer-plugin-sdk/packer" - registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + packerSDK "github.com/hashicorp/packer-plugin-sdk/packer" + packerSDKRegistry "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" "github.com/hashicorp/packer/hcl2template" - "github.com/hashicorp/packer/internal/hcp/api" + hcpPackerAPI "github.com/hashicorp/packer/internal/hcp/api" "github.com/hashicorp/packer/internal/hcp/env" "github.com/mitchellh/mapstructure" "google.golang.org/grpc/codes" @@ -24,126 +27,131 @@ import ( // build is still alive. const HeartbeatPeriod = 2 * time.Minute -// Bucket represents a single Image bucket on the HCP Packer registry. +// Bucket represents a single bucket on the HCP Packer registry. type Bucket struct { - Slug string - Description string - Destination string - BucketLabels map[string]string - BuildLabels map[string]string - SourceImagesToParentIterations map[string]ParentIteration - RunningBuilds map[string]chan struct{} - Iteration *Iteration - client *api.Client + Name string + Description string + Destination string + BucketLabels map[string]string + BuildLabels map[string]string + SourceExternalIdentifierToParentVersions map[string]ParentVersion + RunningBuilds map[string]chan struct{} + Version *Version + client *hcpPackerAPI.Client } -type ParentIteration struct { - IterationID string - ChannelID string +type ParentVersion struct { + VersionID string + ChannelID string } -// NewBucketWithIteration initializes a simple Bucket that can be used publishing Packer build -// images to the HCP Packer registry. -func NewBucketWithIteration() *Bucket { +// NewBucketWithVersion initializes a simple Bucket that can be used for publishing Packer build artifacts +// to the HCP Packer registry. +func NewBucketWithVersion() *Bucket { b := Bucket{ - BucketLabels: make(map[string]string), - BuildLabels: make(map[string]string), - SourceImagesToParentIterations: make(map[string]ParentIteration), - RunningBuilds: make(map[string]chan struct{}), + BucketLabels: make(map[string]string), + BuildLabels: make(map[string]string), + SourceExternalIdentifierToParentVersions: make(map[string]ParentVersion), + RunningBuilds: make(map[string]chan struct{}), } - b.Iteration = NewIteration() + b.Version = NewVersion() return &b } -func (b *Bucket) Validate() error { - if b.Slug == "" { - return fmt.Errorf("no Packer bucket name defined; either the environment variable %q is undefined or the HCL configuration has no build name", env.HCPPackerBucket) +func (bucket *Bucket) Validate() error { + if bucket.Name == "" { + return fmt.Errorf( + "no Packer bucket name defined; either the environment variable %q is undefined or "+ + "the HCL configuration has no build name", + env.HCPPackerBucket, + ) } return nil } // ReadFromHCLBuildBlock reads the information for initialising a Bucket from a HCL2 build block -func (b *Bucket) ReadFromHCLBuildBlock(hcpBlock *hcl2template.BuildBlock) { - if b == nil { +func (bucket *Bucket) ReadFromHCLBuildBlock(build *hcl2template.BuildBlock) { + if bucket == nil { return } - b.Description = hcpBlock.Description - hcp := hcpBlock.HCPPackerRegistry - if hcp == nil { + registryBlock := build.HCPPackerRegistry + if registryBlock == nil { return } - b.BucketLabels = hcp.BucketLabels - b.BuildLabels = hcp.BuildLabels - // If there's already a Slug this was set from env variable. + bucket.Description = registryBlock.Description + bucket.BucketLabels = registryBlock.BucketLabels + bucket.BuildLabels = registryBlock.BuildLabels + // If there's already a Name this was set from env variable. // In Packer, env variable overrides config values so we keep it that way for consistency. - if b.Slug == "" && hcp.Slug != "" { - b.Slug = hcp.Slug + if bucket.Name == "" && registryBlock.Slug != "" { + bucket.Name = registryBlock.Slug } } // connect initializes a client connection to a remote HCP Packer Registry service on HCP. // Upon a successful connection the initialized client is persisted on the Bucket b for later usage. -func (b *Bucket) connect() error { - if b.client != nil { +func (bucket *Bucket) connect() error { + if bucket.client != nil { return nil } - registryClient, err := api.NewClient() + registryClient, err := hcpPackerAPI.NewClient() if err != nil { return errors.New("Failed to create client connection to artifact registry: " + err.Error()) } - b.client = registryClient + bucket.client = registryClient return nil } -// Initialize registers the Bucket b with the configured HCP Packer Registry. -// Upon initialization a Bucket will be upserted to, and new iteration will be created for the build if the configured -// fingerprint has no associated iterations. Lastly, the initialization process with register the builds that need to be -// completed before an iteration can be marked as DONE. +// Initialize registers the bucket with the configured HCP Packer Registry. +// Upon initialization a Bucket will be upserted to, and new version will be created for the build if the configured +// fingerprint has no associated versions. Lastly, the initialization process with register the builds that need to be +// completed before an version can be marked as DONE. // // b.Initialize() must be called before any data can be published to the configured HCP Packer Registry. // TODO ensure initialize can only be called once -func (b *Bucket) Initialize(ctx context.Context, templateType models.HashicorpCloudPackerIterationTemplateType) error { +func (bucket *Bucket) Initialize( + ctx context.Context, templateType hcpPackerModels.HashicorpCloudPacker20230101TemplateType, +) error { - if err := b.connect(); err != nil { + if err := bucket.connect(); err != nil { return err } - b.Destination = fmt.Sprintf("%s/%s", b.client.OrganizationID, b.client.ProjectID) + bucket.Destination = fmt.Sprintf("%s/%s", bucket.client.OrganizationID, bucket.client.ProjectID) - err := b.client.UpsertBucket(ctx, b.Slug, b.Description, b.BucketLabels) + err := bucket.client.UpsertBucket(ctx, bucket.Name, bucket.Description, bucket.BucketLabels) if err != nil { - return fmt.Errorf("failed to initialize bucket %q: %w", b.Slug, err) + return fmt.Errorf("failed to initialize bucket %q: %w", bucket.Name, err) } - return b.initializeIteration(ctx, templateType) + return bucket.initializeVersion(ctx, templateType) } -func (b *Bucket) RegisterBuildForComponent(sourceName string) { - if b == nil { +func (bucket *Bucket) RegisterBuildForComponent(sourceName string) { + if bucket == nil { return } - if ok := b.Iteration.HasBuild(sourceName); ok { + if ok := bucket.Version.HasBuild(sourceName); ok { return } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, sourceName) + bucket.Version.expectedBuilds = append(bucket.Version.expectedBuilds, sourceName) } -// CreateInitialBuildForIteration will create a build entry on the HCP Packer Registry for the named componentType. -// This initial creation is needed so that Packer can properly track when an iteration is complete. -func (b *Bucket) CreateInitialBuildForIteration(ctx context.Context, componentType string) error { - status := models.HashicorpCloudPackerBuildStatusUNSET +// CreateInitialBuildForVersion will create a build entry on the HCP Packer Registry for the named componentType. +// This initial creation is needed so that Packer can properly track when an version is complete. +func (bucket *Bucket) CreateInitialBuildForVersion(ctx context.Context, componentType string) error { + status := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET - resp, err := b.client.CreateBuild(ctx, - b.Slug, - b.Iteration.RunUUID, - b.Iteration.ID, - b.Iteration.Fingerprint, + resp, err := bucket.client.CreateBuild(ctx, + bucket.Name, + bucket.Version.RunUUID, + bucket.Version.Fingerprint, componentType, status, ) @@ -157,27 +165,30 @@ func (b *Bucket) CreateInitialBuildForIteration(ctx context.Context, componentTy } build.Labels = make(map[string]string) - build.Images = make(map[string]registryimage.Image) + build.Artifacts = make(map[string]packerSDKRegistry.Image) // Initial build labels are only pushed to the registry when an actual Packer run is executed on the said build. - // For example filtered builds (e.g --only or except) will not get the initial build labels until a build is executed on them. - // Global build label updates to existing builds are handled in PopulateIteration. - if len(b.BuildLabels) > 0 { - build.MergeLabels(b.BuildLabels) + // For example filtered builds (e.g --only or except) will not get the initial build labels until a build is + // executed on them. + // Global build label updates to existing builds are handled in PopulateVersion. + if len(bucket.BuildLabels) > 0 { + build.MergeLabels(bucket.BuildLabels) } - b.Iteration.StoreBuild(componentType, build) + bucket.Version.StoreBuild(componentType, build) return nil } // UpdateBuildStatus updates the status of a build entry on the HCP Packer registry with its current local status. // For updating a build status to DONE use CompleteBuild. -func (b *Bucket) UpdateBuildStatus(ctx context.Context, name string, status models.HashicorpCloudPackerBuildStatus) error { - if status == models.HashicorpCloudPackerBuildStatusDONE { +func (bucket *Bucket) UpdateBuildStatus( + ctx context.Context, name string, status hcpPackerModels.HashicorpCloudPacker20230101BuildStatus, +) error { + if status == hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE { return fmt.Errorf("do not use UpdateBuildStatus for updating to DONE") } - buildToUpdate, err := b.Iteration.Build(name) + buildToUpdate, err := bucket.Version.Build(name) if err != nil { return err } @@ -186,11 +197,13 @@ func (b *Bucket) UpdateBuildStatus(ctx context.Context, name string, status mode return fmt.Errorf("the build for the component %q does not have a valid id", name) } - if buildToUpdate.Status == models.HashicorpCloudPackerBuildStatusDONE { + if buildToUpdate.Status == hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE { return fmt.Errorf("cannot modify status of DONE build %s", name) } - _, err = b.client.UpdateBuild(ctx, + _, err = bucket.client.UpdateBuild(ctx, + bucket.Name, + bucket.Version.Fingerprint, buildToUpdate.ID, buildToUpdate.RunUUID, "", @@ -200,20 +213,21 @@ func (b *Bucket) UpdateBuildStatus(ctx context.Context, name string, status mode nil, status, nil, + nil, ) if err != nil { return err } buildToUpdate.Status = status - b.Iteration.StoreBuild(name, buildToUpdate) + bucket.Version.StoreBuild(name, buildToUpdate) return nil } // markBuildComplete should be called to set a build on the HCP Packer registry to DONE. -// Upon a successful call markBuildComplete will publish all images created by the named build, -// and set the registry build to done. A build with no images can not be set to DONE. -func (b *Bucket) markBuildComplete(ctx context.Context, name string) error { - buildToUpdate, err := b.Iteration.Build(name) +// Upon a successful call markBuildComplete will publish all artifacts created by the named build, +// and set the build to done. A build with no artifacts can not be set to DONE. +func (bucket *Bucket) markBuildComplete(ctx context.Context, name string) error { + buildToUpdate, err := bucket.Version.Build(name) if err != nil { return err } @@ -222,157 +236,185 @@ func (b *Bucket) markBuildComplete(ctx context.Context, name string) error { return fmt.Errorf("the build for the component %q does not have a valid id", name) } - status := models.HashicorpCloudPackerBuildStatusDONE + status := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE if buildToUpdate.Status == status { // let's no mess with anything that is already done return nil } - if len(buildToUpdate.Images) == 0 { - return fmt.Errorf("setting a build to DONE with no published images is not currently supported.") + if len(buildToUpdate.Artifacts) == 0 { + return fmt.Errorf("setting a build to DONE with no published artifacts is not currently supported") } - var providerName, sourceID, sourceIterationID, sourceChannelID string - images := make([]*models.HashicorpCloudPackerImageCreateBody, 0, len(buildToUpdate.Images)) - for _, image := range buildToUpdate.Images { - // These values will always be the same for all images in a single build, + var platformName, sourceID, parentVersionID, parentChannelID string + artifacts := make([]*hcpPackerModels.HashicorpCloudPacker20230101ArtifactCreateBody, 0, len(buildToUpdate.Artifacts)) + for _, artifact := range buildToUpdate.Artifacts { + // These values will always be the same for all artifacts in a single build, // so we can just set it inside the loop without consequence - if providerName == "" { - providerName = image.ProviderName + if platformName == "" { + platformName = artifact.ProviderName } - if image.SourceImageID != "" { - sourceID = image.SourceImageID + if artifact.SourceImageID != "" { + sourceID = artifact.SourceImageID } - // Check if image is using some other HCP Packer image - if v, ok := b.SourceImagesToParentIterations[image.SourceImageID]; ok { - sourceIterationID = v.IterationID - sourceChannelID = v.ChannelID + // Check if artifact is using some other HCP Packer artifact + if v, ok := bucket.SourceExternalIdentifierToParentVersions[artifact.SourceImageID]; ok { + parentVersionID = v.VersionID + parentChannelID = v.ChannelID } - images = append(images, &models.HashicorpCloudPackerImageCreateBody{ImageID: image.ImageID, Region: image.ProviderRegion}) + artifacts = append( + artifacts, + &hcpPackerModels.HashicorpCloudPacker20230101ArtifactCreateBody{ + ExternalIdentifier: artifact.ImageID, + Region: artifact.ProviderRegion, + }, + ) } - _, err = b.client.UpdateBuild(ctx, + _, err = bucket.client.UpdateBuild(ctx, + bucket.Name, + bucket.Version.Fingerprint, buildToUpdate.ID, buildToUpdate.RunUUID, - buildToUpdate.CloudProvider, + buildToUpdate.Platform, sourceID, - sourceIterationID, - sourceChannelID, + parentVersionID, + parentChannelID, buildToUpdate.Labels, status, - images, + artifacts, + &buildToUpdate.Metadata, ) if err != nil { return err } buildToUpdate.Status = status - b.Iteration.StoreBuild(name, buildToUpdate) + bucket.Version.StoreBuild(name, buildToUpdate) return nil } -// UpdateImageForBuild appends one or more images artifacts to the build referred to by componentType. -func (b *Bucket) UpdateImageForBuild(componentType string, images ...registryimage.Image) error { - return b.Iteration.AddImageToBuild(componentType, images...) +// UpdateArtifactForBuild appends one or more artifacts to the build referred to by componentType. +func (bucket *Bucket) UpdateArtifactForBuild(componentType string, artifacts ...packerSDKRegistry.Image) error { + return bucket.Version.AddArtifactToBuild(componentType, artifacts...) } // UpdateLabelsForBuild merges the contents of data to the labels associated with the build referred to by componentType. -func (b *Bucket) UpdateLabelsForBuild(componentType string, data map[string]string) error { - return b.Iteration.AddLabelsToBuild(componentType, data) +func (bucket *Bucket) UpdateLabelsForBuild(componentType string, data map[string]string) error { + return bucket.Version.AddLabelsToBuild(componentType, data) } -// Load defaults from environment variables -func (b *Bucket) LoadDefaultSettingsFromEnv() { +// LoadDefaultSettingsFromEnv loads defaults from environment variables +func (bucket *Bucket) LoadDefaultSettingsFromEnv() { // Configure HCP Packer Registry destination - if b.Slug == "" { - b.Slug = os.Getenv(env.HCPPackerBucket) + if bucket.Name == "" { + bucket.Name = os.Getenv(env.HCPPackerBucket) } - // Set some iteration values. For Packer RunUUID should always be set. - // Creating an iteration differently? Let's not overwrite a UUID that might be set. - if b.Iteration.RunUUID == "" { - b.Iteration.RunUUID = os.Getenv("PACKER_RUN_UUID") + // Set some version values. For Packer RunUUID should always be set. + // Creating an version differently? Let's not overwrite a UUID that might be set. + if bucket.Version.RunUUID == "" { + bucket.Version.RunUUID = os.Getenv("PACKER_RUN_UUID") } } -// createIteration creates an empty iteration for a give bucket on the HCP Packer registry. -// The iteration can then be stored locally and used for tracking build status and images for a running +// createVersion creates an empty version for a given bucket on the HCP Packer registry. +// The version can then be stored locally and used for tracking build status and artifacts for a running // Packer build. -func (b *Bucket) createIteration(templateType models.HashicorpCloudPackerIterationTemplateType) (*models.HashicorpCloudPackerIteration, error) { +func (bucket *Bucket) createVersion( + templateType hcpPackerModels.HashicorpCloudPacker20230101TemplateType, +) (*hcpPackerModels.HashicorpCloudPacker20230101Version, error) { ctx := context.Background() - if templateType == models.HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET { - return nil, fmt.Errorf("packer error: template type should not be unset when creating an iteration. This is a Packer internal bug which should be reported to the development team for a fix.") + if templateType == hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeTEMPLATETYPEUNSET { + return nil, fmt.Errorf( + "packer error: template type should not be unset when creating a version. " + + "This is a Packer internal bug which should be reported to the development team for a fix", + ) } - createIterationResp, err := b.client.CreateIteration(ctx, b.Slug, b.Iteration.Fingerprint, templateType) + createVersionResp, err := bucket.client.CreateVersion( + ctx, bucket.Name, bucket.Version.Fingerprint, templateType, + ) if err != nil { - return nil, fmt.Errorf("failed to create Iteration for Bucket %s with error: %w", b.Slug, err) + return nil, fmt.Errorf("failed to create Version for Bucket %s with error: %w", bucket.Name, err) } - if createIterationResp == nil { - return nil, fmt.Errorf("failed to create Iteration for Bucket %s with error: %w", b.Slug, err) + if createVersionResp == nil { + return nil, fmt.Errorf("failed to create Version for Bucket %s with error: %w", bucket.Name, err) } - log.Println("[TRACE] a valid iteration for build was created with the Id", createIterationResp.Payload.Iteration.ID) - return createIterationResp.Payload.Iteration, nil + log.Println( + "[TRACE] a valid version for build was created with the Id", createVersionResp.Payload.Version.ID, + ) + return createVersionResp.Payload.Version, nil } -func (b *Bucket) initializeIteration(ctx context.Context, templateType models.HashicorpCloudPackerIterationTemplateType) error { - // load existing iteration using fingerprint. - iteration, err := b.client.GetIteration(ctx, b.Slug, api.GetIteration_byFingerprint(b.Iteration.Fingerprint)) - if api.CheckErrorCode(err, codes.Aborted) { - // probably means Iteration doesn't exist need a way to check the error - iteration, err = b.createIteration(templateType) +func (bucket *Bucket) initializeVersion( + ctx context.Context, templateType hcpPackerModels.HashicorpCloudPacker20230101TemplateType, +) error { + // load existing version using fingerprint. + version, err := bucket.client.GetVersion(ctx, bucket.Name, bucket.Version.Fingerprint) + if hcpPackerAPI.CheckErrorCode(err, codes.Aborted) { + // probably means Version doesn't exist need a way to check the error + version, err = bucket.createVersion(templateType) } if err != nil { - return fmt.Errorf("failed to initialize iteration for fingerprint %s: %s", b.Iteration.Fingerprint, err) + return fmt.Errorf("failed to initialize version for fingerprint %s: %s", bucket.Version.Fingerprint, err) } - if iteration == nil { - return fmt.Errorf("failed to initialize iteration details for Bucket %s with error: %w", b.Slug, err) + if version == nil { + return fmt.Errorf("failed to initialize version details for Bucket %s with error: %w", bucket.Name, err) } - if iteration.TemplateType != nil && - *iteration.TemplateType != models.HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET && - *iteration.TemplateType != templateType { - return fmt.Errorf("This iteration was initially created with a %[2]s template. Changing from %[2]s to %[1]s is not supported.", - templateType, *iteration.TemplateType) + if version.TemplateType != nil && + *version.TemplateType != hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeTEMPLATETYPEUNSET && + *version.TemplateType != templateType { + return fmt.Errorf( + "This version was initially created with a %[2]s template. "+ + "Changing from %[2]s to %[1]s is not supported", + templateType, *version.TemplateType, + ) } - log.Println("[TRACE] a valid iteration was retrieved with the id", iteration.ID) - b.Iteration.ID = iteration.ID + log.Println( + "[TRACE] a valid version was retrieved with the id", version.ID, + ) + bucket.Version.ID = version.ID - // If the iteration is completed and there are no new builds to add, Packer + // If the version is completed and there are no new builds to add, Packer // should exit and inform the user that artifacts already exists for the - // fingerprint associated with the iteration. - if iteration.Complete { - return fmt.Errorf("This iteration associated to the fingerprint %s is complete. "+ - "If you wish to add a new build to this image a new iteration must be created by changing the build fingerprint.", b.Iteration.Fingerprint) + // fingerprint associated with the version. + if bucket.client.IsVersionComplete(version) { + return fmt.Errorf( + "The version associated to the fingerprint %v is complete. If you wish to add a new build to "+ + "this bucket a new version must be created by changing the fingerprint.", + bucket.Version.Fingerprint, + ) } return nil } -// populateIteration populates the bucket iteration with the details needed for tracking builds for a Packer run. -// If an existing Packer registry iteration exists for the said iteration fingerprint, calling initialize on iteration -// that doesn't yet exist will call createIteration to create the entry on the HCP packer registry for the given bucket. -// All build details will be created (if they don't exists) and added to b.Iteration.builds for tracking during runtime. -func (b *Bucket) populateIteration(ctx context.Context) error { - // list all this iteration's builds so we can figure out which ones +// populateVersion populates the version with the details needed for tracking builds for a Packer run. +// If a version exists for the said fingerprint, calling initialize on version that doesn't yet exist will call +// createVersion to create the entry on the HCP packer registry for the given bucket. +// All build details will be created (if they don't exist) and added to b.Version.builds for tracking during runtime. +func (bucket *Bucket) populateVersion(ctx context.Context) error { + // list all this version's builds so we can figure out which ones // we want to run against. TODO: pagination? - existingBuilds, err := b.client.ListBuilds(ctx, b.Slug, b.Iteration.ID) + existingBuilds, err := bucket.client.ListBuilds(ctx, bucket.Name, bucket.Version.Fingerprint) if err != nil { - return fmt.Errorf("error listing builds for this existing iteration: %s", err) + return fmt.Errorf("error listing builds for this existing version: %s", err) } var toCreate []string - for _, expected := range b.Iteration.expectedBuilds { + for _, expected := range bucket.Version.expectedBuilds { var found bool for _, existing := range existingBuilds { @@ -384,25 +426,27 @@ func (b *Bucket) populateIteration(ctx context.Context) error { } // When running against an existing build the Packer RunUUID is most likely different. - // We capture that difference here to know that the image was created in a different Packer run. - build.RunUUID = b.Iteration.RunUUID + // We capture that difference here to know that the artifacts were created in a different Packer run. + build.RunUUID = bucket.Version.RunUUID // When bucket build labels represent some dynamic data set, possibly set via some user variable, // we need to make sure that any newly executed builds get the labels at runtime. - if build.IsNotDone() && len(b.BuildLabels) > 0 { - build.MergeLabels(b.BuildLabels) + if build.IsNotDone() && len(bucket.BuildLabels) > 0 { + build.MergeLabels(bucket.BuildLabels) } - log.Printf("[TRACE] a build of component type %s already exists; skipping the create call", expected) - b.Iteration.StoreBuild(existing.ComponentType, build) + log.Printf( + "[TRACE] a build of component type %s already exists; skipping the create call", expected, + ) + bucket.Version.StoreBuild(existing.ComponentType, build) break } } if !found { - missingbuild := expected - toCreate = append(toCreate, missingbuild) + missingBuild := expected + toCreate = append(toCreate, missingBuild) } } @@ -418,10 +462,10 @@ func (b *Bucket) populateIteration(ctx context.Context) error { go func(name string) { defer wg.Done() - log.Printf("[TRACE] registering build with iteration for %q.", name) - err := b.CreateInitialBuildForIteration(ctx, name) + log.Printf("[TRACE] registering build with version for %q.", name) + err := bucket.CreateInitialBuildForVersion(ctx, name) - if api.CheckErrorCode(err, codes.AlreadyExists) { + if hcpPackerAPI.CheckErrorCode(err, codes.AlreadyExists) { log.Printf("[TRACE] build %s already exists in Packer registry, continuing...", name) return } @@ -438,14 +482,14 @@ func (b *Bucket) populateIteration(ctx context.Context) error { return errs.ErrorOrNil() } -// IsExpectingBuildForComponent returns true if the component referenced by buildName is part of the iteration +// IsExpectingBuildForComponent returns true if the component referenced by buildName is part of the version // and is not marked as DONE on the HCP Packer registry. -func (b *Bucket) IsExpectingBuildForComponent(buildName string) bool { - if !b.Iteration.HasBuild(buildName) { +func (bucket *Bucket) IsExpectingBuildForComponent(buildName string) bool { + if !bucket.Version.HasBuild(buildName) { return false } - build, err := b.Iteration.Build(buildName) + build, err := bucket.Version.Build(buildName) if err != nil { return false } @@ -459,8 +503,8 @@ func (b *Bucket) IsExpectingBuildForComponent(buildName string) bool { // as cancelled by the HCP Packer registry service. // // Usage: defer (b.HeartbeatBuild(ctx, build, period))() -func (b *Bucket) HeartbeatBuild(ctx context.Context, build string) (func(), error) { - buildToUpdate, err := b.Iteration.Build(build) +func (bucket *Bucket) HeartbeatBuild(ctx context.Context, build string) (func(), error) { + buildToUpdate, err := bucket.Version.Build(build) if err != nil { return nil, err } @@ -481,7 +525,9 @@ func (b *Bucket) HeartbeatBuild(ctx context.Context, build string) (func(), erro tick.Stop() break outHeartbeats case <-tick.C: - _, err = b.client.UpdateBuild(ctx, + _, err = bucket.client.UpdateBuild(ctx, + bucket.Name, + bucket.Version.Fingerprint, buildToUpdate.ID, buildToUpdate.RunUUID, "", @@ -489,7 +535,8 @@ func (b *Bucket) HeartbeatBuild(ctx context.Context, build string) (func(), erro "", "", nil, - models.HashicorpCloudPackerBuildStatusRUNNING, + hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING, + nil, nil, ) if err != nil { @@ -507,19 +554,19 @@ func (b *Bucket) HeartbeatBuild(ctx context.Context, build string) (func(), erro }, nil } -func (b *Bucket) startBuild(ctx context.Context, buildName string) error { - if !b.IsExpectingBuildForComponent(buildName) { +func (bucket *Bucket) startBuild(ctx context.Context, buildName string) error { + if !bucket.IsExpectingBuildForComponent(buildName) { return &ErrBuildAlreadyDone{ Message: "build is already done", } } - err := b.UpdateBuildStatus(ctx, buildName, models.HashicorpCloudPackerBuildStatusRUNNING) + err := bucket.UpdateBuildStatus(ctx, buildName, hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING) if err != nil { - return fmt.Errorf("failed to update HCP Packer registry status for %q: %s", buildName, err) + return fmt.Errorf("failed to update HCP Packer Build status for %q: %s", buildName, err) } - cleanupHeartbeat, err := b.HeartbeatBuild(ctx, buildName) + cleanupHeartbeat, err := bucket.HeartbeatBuild(ctx, buildName) if err != nil { log.Printf("[ERROR] failed to start heartbeat function") } @@ -530,13 +577,13 @@ func (b *Bucket) startBuild(ctx context.Context, buildName string) error { select { case <-ctx.Done(): cleanupHeartbeat() - err := b.UpdateBuildStatus( + err := bucket.UpdateBuildStatus( context.Background(), buildName, - models.HashicorpCloudPackerBuildStatusCANCELLED) + hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDCANCELLED) if err != nil { log.Printf( - "[ERROR] failed to update HCP Packer registry status for %q: %s", + "[ERROR] failed to update HCP Packer Build status for %q: %s", buildName, err) } @@ -546,18 +593,22 @@ func (b *Bucket) startBuild(ctx context.Context, buildName string) error { log.Printf("[TRACE] done waiting for heartbeat completion") }() - b.RunningBuilds[buildName] = buildDone + bucket.RunningBuilds[buildName] = buildDone return nil } -func (b *Bucket) completeBuild( +type NotAHCPArtifactError struct { + error +} + +func (bucket *Bucket) completeBuild( ctx context.Context, buildName string, - artifacts []packer.Artifact, + packerSDKArtifacts []packerSDK.Artifact, buildErr error, -) ([]packer.Artifact, error) { - doneCh, ok := b.RunningBuilds[buildName] +) ([]packerSDK.Artifact, error) { + doneCh, ok := bucket.RunningBuilds[buildName] if !ok { log.Print("[ERROR] done build does not have an entry in the heartbeat table, state will be inconsistent.") @@ -569,52 +620,71 @@ func (b *Bucket) completeBuild( } if buildErr != nil { - err := b.UpdateBuildStatus(ctx, buildName, models.HashicorpCloudPackerBuildStatusFAILED) + status := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDFAILED + if ctx.Err() != nil { + status = hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDCANCELLED + } + err := bucket.UpdateBuildStatus(context.Background(), buildName, status) if err != nil { log.Printf("[ERROR] failed to update build %q status to FAILED: %s", buildName, err) } - return artifacts, fmt.Errorf("build failed, not uploading artifacts") + return packerSDKArtifacts, fmt.Errorf("build failed, not uploading artifacts") } - for _, art := range artifacts { - var images []registryimage.Image + for _, art := range packerSDKArtifacts { + var sdkImages []packerSDKRegistry.Image decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: &images, + Result: &sdkImages, WeaklyTypedInput: true, ErrorUnused: false, }) if err != nil { - return artifacts, fmt.Errorf( - "failed to create decoder for HCP Packer registry image: %w", + return packerSDKArtifacts, fmt.Errorf( + "failed to create decoder for HCP Packer artifact: %w", err) } - state := art.State(registryimage.ArtifactStateURI) + state := art.State(packerSDKRegistry.ArtifactStateURI) + if state == nil { + log.Printf("[WARN] - artifact %q returned a nil value for the HCP state, ignoring", art.BuilderId()) + continue + } + err = decoder.Decode(state) if err != nil { - return artifacts, fmt.Errorf( - "failed to obtain HCP Packer registry image from post-processor artifact: %w", - err) + log.Printf("[WARN] - artifact %q failed to be decoded to an HCP artifact, this is probably because it is not compatible: %s", art.BuilderId(), err) + continue } - log.Printf("[TRACE] updating artifacts for build %q", buildName) - err = b.UpdateImageForBuild(buildName, images...) + err = bucket.UpdateArtifactForBuild(buildName, sdkImages...) if err != nil { - return artifacts, fmt.Errorf("failed to add image artifact for %q: %s", buildName, err) + return packerSDKArtifacts, fmt.Errorf("failed to add artifact for %q: %s", buildName, err) + } + } + + build, err := bucket.Version.Build(buildName) + if err != nil { + return packerSDKArtifacts, fmt.Errorf( + "failed to get build %q from version being built. This is a Packer bug.", + buildName) + } + if len(build.Artifacts) == 0 { + return packerSDKArtifacts, &NotAHCPArtifactError{ + fmt.Errorf("No HCP Packer-compatible artifacts were found for the build"), } } - parErr := b.markBuildComplete(ctx, buildName) + parErr := bucket.markBuildComplete(ctx, buildName) if parErr != nil { - return artifacts, fmt.Errorf( - "failed to update Packer registry with image artifacts for %q: %s", + return packerSDKArtifacts, fmt.Errorf( + "failed to update HCP Packer artifacts for %q: %s", buildName, parErr) } - return append(artifacts, ®istryArtifact{ - BuildName: buildName, - BucketSlug: b.Slug, - IterationID: b.Iteration.ID, + return append(packerSDKArtifacts, ®istryArtifact{ + BuildName: buildName, + BucketName: bucket.Name, + VersionID: bucket.Version.ID, }), nil } diff --git a/internal/hcp/registry/types.bucket_service_test.go b/internal/hcp/registry/types.bucket_service_test.go index 60317443707..a89233d686a 100644 --- a/internal/hcp/registry/types.bucket_service_test.go +++ b/internal/hcp/registry/types.bucket_service_test.go @@ -1,33 +1,35 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "context" "testing" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" - "github.com/hashicorp/packer/internal/hcp/api" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + hcpPackerAPI "github.com/hashicorp/packer/internal/hcp/api" ) -func TestInitialize_NewBucketNewIteration(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() +func TestInitialize_NewBucketNewVersion(t *testing.T) { + mockService := hcpPackerAPI.NewMockPackerClientService() b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { t.Errorf("unexpected failure: %v", err) } @@ -36,19 +38,19 @@ func TestInitialize_NewBucketNewIteration(t *testing.T) { t.Errorf("expected a call to CreateBucket but it didn't happen") } - if !mockService.CreateIterationCalled { - t.Errorf("expected a call to CreateIteration but it didn't happen") + if !mockService.CreateVersionCalled { + t.Errorf("expected a call to CreateVersion but it didn't happen") } if mockService.CreateBuildCalled { t.Errorf("Didn't expect a call to CreateBuild") } - if b.Iteration.ID != "iteration-id" { - t.Errorf("expected an iteration to created but it didn't") + if b.Version.ID != "version-id" { + t.Errorf("expected a version to created but it didn't") } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } @@ -56,57 +58,55 @@ func TestInitialize_NewBucketNewIteration(t *testing.T) { t.Errorf("Expected a call to CreateBuild but it didn't happen") } - if ok := b.Iteration.HasBuild("happycloud.image"); !ok { + if ok := b.Version.HasBuild("happycloud.image"); !ok { t.Errorf("expected a basic build entry to be created but it didn't") } } func TestInitialize_UnsetTemplateTypeError(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testunsettemplate") - mockService := api.NewMockPackerClientService() + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeTEMPLATETYPEUNSET) if err == nil { t.Fatalf("unexpected success") } - t.Logf("iteration creating failed as expected: %s", err) + t.Logf("version creating failed as expected: %s", err) } -func TestInitialize_ExistingBucketNewIteration(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() +func TestInitialize_ExistingBucketNewVersion(t *testing.T) { + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { t.Errorf("unexpected failure: %v", err) } @@ -115,19 +115,19 @@ func TestInitialize_ExistingBucketNewIteration(t *testing.T) { t.Errorf("expected call to UpdateBucket but it didn't happen") } - if !mockService.CreateIterationCalled { - t.Errorf("expected a call to CreateIteration but it didn't happen") + if !mockService.CreateVersionCalled { + t.Errorf("expected a call to CreateVersion but it didn't happen") } if mockService.CreateBuildCalled { t.Errorf("Didn't expect a call to CreateBuild") } - if b.Iteration.ID != "iteration-id" { - t.Errorf("expected an iteration to created but it didn't") + if b.Version.ID != "version-id" { + t.Errorf("expected a version to created but it didn't") } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } @@ -135,39 +135,38 @@ func TestInitialize_ExistingBucketNewIteration(t *testing.T) { t.Errorf("Expected a call to CreateBuild but it didn't happen") } - if ok := b.Iteration.HasBuild("happycloud.image"); !ok { + if ok := b.Version.HasBuild("happycloud.image"); !ok { t.Errorf("expected a basic build entry to be created but it didn't") } } -func TestInitialize_ExistingBucketExistingIteration(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() +func TestInitialize_ExistingBucketExistingVersion(t *testing.T) { + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true - mockService.IterationAlreadyExist = true + mockService.VersionAlreadyExist = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") mockService.ExistingBuilds = append(mockService.ExistingBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { t.Errorf("unexpected failure: %v", err) } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } @@ -180,193 +179,188 @@ func TestInitialize_ExistingBucketExistingIteration(t *testing.T) { t.Errorf("expected call to UpdateBucket but it didn't happen") } - if mockService.CreateIterationCalled { - t.Errorf("unexpected a call to CreateIteration") + if mockService.CreateVersionCalled { + t.Errorf("unexpected a call to CreateVersion") } - if !mockService.GetIterationCalled { - t.Errorf("expected a call to GetIteration but it didn't happen") + if !mockService.GetVersionCalled { + t.Errorf("expected a call to GetVersion but it didn't happen") } if mockService.CreateBuildCalled { t.Errorf("unexpected a call to CreateBuild") } - if b.Iteration.ID != "iteration-id" { - t.Errorf("expected an iteration to created but it didn't") + if b.Version.ID != "version-id" { + t.Errorf("expected a version to created but it didn't") } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } - existingBuild, err := b.Iteration.Build("happycloud.image") + existingBuild, err := b.Version.Build("happycloud.image") if err != nil { t.Errorf("expected the existing build loaded from an existing bucket to be valid: %v", err) } - if existingBuild.Status != models.HashicorpCloudPackerBuildStatusUNSET { + if existingBuild.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET { t.Errorf("expected the existing build to be in the default state") } } -func TestInitialize_ExistingBucketCompleteIteration(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() +func TestInitialize_ExistingBucketCompleteVersion(t *testing.T) { + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true - mockService.IterationAlreadyExist = true - mockService.IterationCompleted = true + mockService.VersionAlreadyExist = true + mockService.VersionCompleted = true mockService.BuildAlreadyDone = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") mockService.ExistingBuilds = append(mockService.ExistingBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err == nil { t.Errorf("unexpected failure: %v", err) } - if mockService.CreateIterationCalled { - t.Errorf("unexpected call to CreateIteration") + if mockService.CreateVersionCalled { + t.Errorf("unexpected call to CreateVersion") } - if !mockService.GetIterationCalled { - t.Errorf("expected a call to GetIteration but it didn't happen") + if !mockService.GetVersionCalled { + t.Errorf("expected a call to GetVersion but it didn't happen") } if mockService.CreateBuildCalled { t.Errorf("unexpected call to CreateBuild") } - if b.Iteration.ID != "iteration-id" { - t.Errorf("expected an iteration to be returned but it wasn't") + if b.Version.ID != "version-id" { + t.Errorf("expected a version to be returned but it wasn't") } } func TestUpdateBuildStatus(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true - mockService.IterationAlreadyExist = true + mockService.VersionAlreadyExist = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") mockService.ExistingBuilds = append(mockService.ExistingBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { t.Errorf("unexpected failure: %v", err) } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } - existingBuild, err := b.Iteration.Build("happycloud.image") + existingBuild, err := b.Version.Build("happycloud.image") if err != nil { t.Errorf("expected the existing build loaded from an existing bucket to be valid: %v", err) } - if existingBuild.Status != models.HashicorpCloudPackerBuildStatusUNSET { + if existingBuild.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET { t.Errorf("expected the existing build to be in the default state") } - err = b.UpdateBuildStatus(context.TODO(), "happycloud.image", models.HashicorpCloudPackerBuildStatusRUNNING) + err = b.UpdateBuildStatus(context.TODO(), "happycloud.image", hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING) if err != nil { t.Errorf("unexpected failure for PublishBuildStatus: %v", err) } - existingBuild, err = b.Iteration.Build("happycloud.image") + existingBuild, err = b.Version.Build("happycloud.image") if err != nil { t.Errorf("expected the existing build loaded from an existing bucket to be valid: %v", err) } - if existingBuild.Status != models.HashicorpCloudPackerBuildStatusRUNNING { + if existingBuild.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING { t.Errorf("expected the existing build to be in the running state") } } func TestUpdateBuildStatus_DONENoImages(t *testing.T) { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "testnumber") - mockService := api.NewMockPackerClientService() + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true - mockService.IterationAlreadyExist = true + mockService.VersionAlreadyExist = true b := &Bucket{ - Slug: "TestBucket", - client: &api.Client{ + Name: "TestBucket", + client: &hcpPackerAPI.Client{ Packer: mockService, }, } - b.Iteration = NewIteration() - err := b.Iteration.Initialize(IterationOptions{}) + b.Version = NewVersion() + err := b.Version.Initialize() if err != nil { t.Errorf("unexpected failure: %v", err) } - b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds, "happycloud.image") + b.Version.expectedBuilds = append(b.Version.expectedBuilds, "happycloud.image") mockService.ExistingBuilds = append(mockService.ExistingBuilds, "happycloud.image") - err = b.Initialize(context.TODO(), models.HashicorpCloudPackerIterationTemplateTypeHCL2) + err = b.Initialize(context.TODO(), hcpPackerModels.HashicorpCloudPacker20230101TemplateTypeHCL2) if err != nil { t.Errorf("unexpected failure: %v", err) } - err = b.populateIteration(context.TODO()) + err = b.populateVersion(context.TODO()) if err != nil { t.Errorf("unexpected failure: %v", err) } - existingBuild, err := b.Iteration.Build("happycloud.image") + existingBuild, err := b.Version.Build("happycloud.image") if err != nil { t.Errorf("expected the existing build loaded from an existing bucket to be valid: %v", err) } - if existingBuild.Status != models.HashicorpCloudPackerBuildStatusUNSET { + if existingBuild.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDUNSET { t.Errorf("expected the existing build to be in the default state") } //nolint:errcheck - b.UpdateBuildStatus(context.TODO(), "happycloud.image", models.HashicorpCloudPackerBuildStatusRUNNING) + _ = b.UpdateBuildStatus(context.TODO(), "happycloud.image", hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING) - err = b.UpdateBuildStatus(context.TODO(), "happycloud.image", models.HashicorpCloudPackerBuildStatusDONE) + err = b.UpdateBuildStatus(context.TODO(), "happycloud.image", hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE) if err == nil { t.Errorf("expected failure for PublishBuildStatus when setting status to DONE with no images") } - existingBuild, err = b.Iteration.Build("happycloud.image") + existingBuild, err = b.Version.Build("happycloud.image") if err != nil { t.Errorf("expected the existing build loaded from an existing bucket to be valid: %v", err) } - if existingBuild.Status != models.HashicorpCloudPackerBuildStatusRUNNING { + if existingBuild.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING { t.Errorf("expected the existing build to be in the running state") } } - -//func (b *Bucket) PublishBuildStatus(ctx context.Context, name string, status models.HashicorpCloudPackerBuildStatus) error {} diff --git a/internal/hcp/registry/types.bucket_test.go b/internal/hcp/registry/types.bucket_test.go index e7c926f6253..1b50fb887bf 100644 --- a/internal/hcp/registry/types.bucket_test.go +++ b/internal/hcp/registry/types.bucket_test.go @@ -1,29 +1,36 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "context" + "reflect" "strconv" + "sync" "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/packer/internal/hcp/api" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + "github.com/hashicorp/packer-plugin-sdk/packer" + "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" + "github.com/hashicorp/packer/hcl2template" + hcpPackerAPI "github.com/hashicorp/packer/internal/hcp/api" ) func createInitialTestBucket(t testing.TB) *Bucket { - t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "no-fingerprint-here") - t.Helper() - bucket := NewBucketWithIteration() - err := bucket.Iteration.Initialize(IterationOptions{}) + bucket := NewBucketWithVersion() + err := bucket.Version.Initialize() if err != nil { t.Errorf("failed to initialize Bucket: %s", err) return nil } - mockService := api.NewMockPackerClientService() + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.TrackCalledServiceMethods = false - bucket.Slug = "TestBucket" - bucket.client = &api.Client{ + bucket.Name = "TestBucket" + bucket.client = &hcpPackerAPI.Client{ Packer: mockService, } @@ -40,20 +47,20 @@ func checkError(t testing.TB, err error) { t.Errorf("received an error during testing %s", err) } -func TestBucket_CreateInitialBuildForIteration(t *testing.T) { +func TestBucket_CreateInitialBuildForVersion(t *testing.T) { bucket := createInitialTestBucket(t) - componentName := "happycloud.image" + componentName := "happycloud.artifact" bucket.RegisterBuildForComponent(componentName) bucket.BuildLabels = map[string]string{ "version": "1.7.0", "based_off": "alpine", } - err := bucket.CreateInitialBuildForIteration(context.TODO(), componentName) + err := bucket.CreateInitialBuildForVersion(context.TODO(), componentName) checkError(t, err) - // Assert that a build stored on the iteration - build, err := bucket.Iteration.Build(componentName) + // Assert that a build stored on the version + build, err := bucket.Version.Build(componentName) if err != nil { t.Errorf("expected an initial build for %s to be created, but it failed", componentName) } @@ -78,12 +85,12 @@ func TestBucket_UpdateLabelsForBuild(t *testing.T) { }{ { desc: "no bucket or build specific labels", - buildName: "happcloud.image", + buildName: "happcloud.artifact", noDiffExpected: true, }, { desc: "bucket build labels", - buildName: "happcloud.image", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.0", "based_off": "alpine", @@ -93,22 +100,22 @@ func TestBucket_UpdateLabelsForBuild(t *testing.T) { }, { desc: "bucket build labels and build specific label", - buildName: "happcloud.image", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.0", "based_off": "alpine", }, buildLabels: map[string]string{ - "source_image": "another-happycloud-image", + "source_artifact": "another-happycloud-artifact", }, labelsCount: 3, noDiffExpected: false, }, { desc: "build specific label", - buildName: "happcloud.image", + buildName: "happcloud.artifact", buildLabels: map[string]string{ - "source_image": "another-happycloud-image", + "source_artifact": "another-happycloud-artifact", }, labelsCount: 1, noDiffExpected: false, @@ -127,11 +134,11 @@ func TestBucket_UpdateLabelsForBuild(t *testing.T) { bucket.BuildLabels[k] = v } - err := bucket.CreateInitialBuildForIteration(context.TODO(), componentName) + err := bucket.CreateInitialBuildForVersion(context.TODO(), componentName) checkError(t, err) - // Assert that the build is stored on the iteration - build, err := bucket.Iteration.Build(componentName) + // Assert that the build is stored on the version + build, err := bucket.Version.Build(componentName) if err != nil { t.Errorf("expected an initial build for %s to be created, but it failed", componentName) } @@ -159,31 +166,31 @@ func TestBucket_UpdateLabelsForBuild(t *testing.T) { func TestBucket_UpdateLabelsForBuild_withMultipleBuilds(t *testing.T) { bucket := createInitialTestBucket(t) - firstComponent := "happycloud.image" + firstComponent := "happycloud.artifact" bucket.RegisterBuildForComponent(firstComponent) - secondComponent := "happycloud.image2" + secondComponent := "happycloud.artifact2" bucket.RegisterBuildForComponent(secondComponent) - err := bucket.populateIteration(context.TODO()) + err := bucket.populateVersion(context.TODO()) checkError(t, err) err = bucket.UpdateLabelsForBuild(firstComponent, map[string]string{ - "source_image": "another-happycloud-image", + "source_artifact": "another-happycloud-artifact", }) checkError(t, err) err = bucket.UpdateLabelsForBuild(secondComponent, map[string]string{ - "source_image": "the-original-happycloud-image", - "role_name": "no-role-is-a-good-role", + "source_artifact": "the-original-happycloud-artifact", + "role_name": "no-role-is-a-good-role", }) checkError(t, err) var registeredBuilds []*Build expectedComponents := []string{firstComponent, secondComponent} for _, componentName := range expectedComponents { - // Assert that a build stored on the iteration - build, err := bucket.Iteration.Build(componentName) + // Assert that a build stored on the version + build, err := bucket.Version.Build(componentName) if err != nil { t.Errorf("expected an initial build for %s to be created, but it failed", componentName) } @@ -207,7 +214,7 @@ func TestBucket_UpdateLabelsForBuild_withMultipleBuilds(t *testing.T) { } } -func TestBucket_PopulateIteration(t *testing.T) { +func TestBucket_PopulateVersion(t *testing.T) { tc := []struct { desc string buildName string @@ -218,15 +225,15 @@ func TestBucket_PopulateIteration(t *testing.T) { noDiffExpected bool }{ { - desc: "populating iteration with existing incomplete build and no bucket build labels does nothing", - buildName: "happcloud.image", + desc: "populating version with existing incomplete build and no bucket build labels does nothing", + buildName: "happcloud.artifact", labelsCount: 0, buildCompleted: false, noDiffExpected: true, }, { - desc: "populating iteration with existing incomplete build should add bucket build labels", - buildName: "happcloud.image", + desc: "populating version with existing incomplete build should add bucket build labels", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.0", "based_off": "alpine", @@ -236,8 +243,8 @@ func TestBucket_PopulateIteration(t *testing.T) { noDiffExpected: true, }, { - desc: "populating iteration with existing incomplete build should update bucket build labels", - buildName: "happcloud.image", + desc: "populating version with existing incomplete build should update bucket build labels", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.3", "based_off": "alpine-3.14", @@ -251,8 +258,8 @@ func TestBucket_PopulateIteration(t *testing.T) { noDiffExpected: true, }, { - desc: "populating iteration with completed build should not modify any labels", - buildName: "happcloud.image", + desc: "populating version with completed build should not modify any labels", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.0", "based_off": "alpine", @@ -262,8 +269,8 @@ func TestBucket_PopulateIteration(t *testing.T) { noDiffExpected: false, }, { - desc: "populating iteration with existing build should only modify bucket build labels", - buildName: "happcloud.image", + desc: "populating version with existing build should only modify bucket build labels", + buildName: "happcloud.artifact", bucketBuildLabels: map[string]string{ "version": "1.7.3", "based_off": "alpine-3.14", @@ -283,39 +290,39 @@ func TestBucket_PopulateIteration(t *testing.T) { t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "test-run-"+strconv.Itoa(i)) - mockService := api.NewMockPackerClientService() + mockService := hcpPackerAPI.NewMockPackerClientService() mockService.BucketAlreadyExist = true - mockService.IterationAlreadyExist = true + mockService.VersionAlreadyExist = true mockService.BuildAlreadyDone = tt.buildCompleted - bucket := NewBucketWithIteration() - err := bucket.Iteration.Initialize(IterationOptions{}) + bucket := NewBucketWithVersion() + err := bucket.Version.Initialize() if err != nil { - t.Fatalf("failed when calling NewBucketWithIteration: %s", err) + t.Fatalf("failed when calling NewBucketWithVersion: %s", err) } - bucket.Slug = "TestBucket" - bucket.client = &api.Client{ + bucket.Name = "TestBucket" + bucket.client = &hcpPackerAPI.Client{ Packer: mockService, } for k, v := range tt.bucketBuildLabels { bucket.BuildLabels[k] = v } - componentName := "happycloud.image" + componentName := "happycloud.artifact" bucket.RegisterBuildForComponent(componentName) mockService.ExistingBuilds = append(mockService.ExistingBuilds, componentName) mockService.ExistingBuildLabels = tt.buildLabels - err = bucket.populateIteration(context.TODO()) + err = bucket.populateVersion(context.TODO()) checkError(t, err) if mockService.CreateBuildCalled { t.Errorf("expected an initial build for %s to already exist, but it called CreateBuild", componentName) } - // Assert that a build stored on the iteration - build, err := bucket.Iteration.Build(componentName) + // Assert that a build stored on the version + build, err := bucket.Version.Build(componentName) if err != nil { t.Errorf("expected an existing build for %s to be stored, but it failed", componentName) } @@ -335,3 +342,171 @@ func TestBucket_PopulateIteration(t *testing.T) { }) } } + +func TestReadFromHCLBuildBlock(t *testing.T) { + tc := []struct { + desc string + buildBlock *hcl2template.BuildBlock + expectedBucket *Bucket + }{ + { + desc: "configure bucket using only hcp_packer_registry block", + buildBlock: &hcl2template.BuildBlock{ + HCPPackerRegistry: &hcl2template.HCPPackerRegistryBlock{ + Slug: "hcp_packer_registry-block-test", + Description: "description from hcp_packer_registry block", + BucketLabels: map[string]string{ + "org": "test", + }, + BuildLabels: map[string]string{ + "version": "1.7.0", + "based_off": "alpine", + }, + }, + }, + expectedBucket: &Bucket{ + Name: "hcp_packer_registry-block-test", + Description: "description from hcp_packer_registry block", + BucketLabels: map[string]string{ + "org": "test", + }, + BuildLabels: map[string]string{ + "version": "1.7.0", + "based_off": "alpine", + }, + }, + }, + } + for _, tt := range tc { + tt := tt + t.Run(tt.desc, func(t *testing.T) { + bucket := &Bucket{} + bucket.ReadFromHCLBuildBlock(tt.buildBlock) + + diff := cmp.Diff(bucket, tt.expectedBucket, cmp.AllowUnexported(Bucket{})) + if diff != "" { + t.Errorf("expected the build to to have contents of hcp_packer_registry block but it does not: %v", diff) + } + }) + } +} + +func TestCompleteBuild(t *testing.T) { + hcpArtifact := &packer.MockArtifact{ + BuilderIdValue: "builder.test", + FilesValue: []string{"file.one"}, + IdValue: "Test", + StateValues: map[string]interface{}{ + "builder.test": "OK", + image.ArtifactStateURI: &image.Image{ + ImageID: "hcp-test", + ProviderName: "none", + ProviderRegion: "none", + Labels: map[string]string{}, + SourceImageID: "", + }, + }, + DestroyCalled: false, + StringValue: "", + } + nonHCPArtifact := &packer.MockArtifact{ + BuilderIdValue: "builder.test", + FilesValue: []string{"file.one"}, + IdValue: "Test", + StateValues: map[string]interface{}{ + "builder.test": "OK", + }, + DestroyCalled: false, + StringValue: "", + } + + testCases := []struct { + name string + artifactsToUse []packer.Artifact + expectError bool + wantNotHCPErr bool + }{ + { + "OK - one artifact compatible with HCP", + []packer.Artifact{ + hcpArtifact, + }, + false, false, + }, + { + "Fail - no artifacts", + []packer.Artifact{}, + true, false, + }, + { + "Fail - only non HCP compatible artifacts", + []packer.Artifact{ + nonHCPArtifact, + }, + true, true, + }, + { + "OK - one hcp artifact, one non hcp artifact (order matters)", + []packer.Artifact{ + hcpArtifact, + nonHCPArtifact, + }, + false, false, + }, + { + "OK - one non hcp artifact, one hcp artifact (order matters)", + []packer.Artifact{ + nonHCPArtifact, + hcpArtifact, + }, + false, false, + }, + } + mockCli := &hcpPackerAPI.Client{ + Packer: hcpPackerAPI.NewMockPackerClientService(), + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + dummyBucket := &Bucket{ + Name: "test-bucket", + Description: "test", + Destination: "none", + RunningBuilds: map[string]chan struct{}{ + // Need buffer with 1 cap so we can signal end of + // heartbeats in test, otherwise it'll block + "test-build": make(chan struct{}, 1), + }, + Version: &Version{ + ID: "noneID", + Fingerprint: "TestFingerprint", + RunUUID: "testuuid", + builds: sync.Map{}, + }, + client: mockCli, + } + + dummyBucket.Version.StoreBuild("test-build", &Build{ + ID: "test-build", + Platform: "none", + ComponentType: "none", + RunUUID: "testuuid", + Artifacts: make(map[string]image.Image), + Status: models.HashicorpCloudPacker20230101BuildStatusBUILDRUNNING, + }) + + _, err := dummyBucket.completeBuild(context.Background(), "test-build", tt.artifactsToUse, nil) + if err != nil != tt.expectError { + t.Errorf("expected %t error; got %t", tt.expectError, err != nil) + t.Logf("error was: %s", err) + } + + if err != nil && tt.wantNotHCPErr { + _, ok := err.(*NotAHCPArtifactError) + if !ok { + t.Errorf("expected a NotAHCPArtifactError, got a %q", reflect.TypeOf(err).String()) + } + } + }) + } +} diff --git a/internal/hcp/registry/types.builds.go b/internal/hcp/registry/types.builds.go index 52c176fef82..dc7e132762c 100644 --- a/internal/hcp/registry/types.builds.go +++ b/internal/hcp/registry/types.builds.go @@ -1,43 +1,47 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( "fmt" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" - registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + packerSDKRegistry "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" ) // Build represents a build of a given component type for some bucket on the HCP Packer Registry. type Build struct { ID string - CloudProvider string + Platform string ComponentType string RunUUID string Labels map[string]string - Images map[string]registryimage.Image - Status models.HashicorpCloudPackerBuildStatus + Artifacts map[string]packerSDKRegistry.Image + Status hcpPackerModels.HashicorpCloudPacker20230101BuildStatus + Metadata hcpPackerModels.HashicorpCloudPacker20230101BuildMetadata } -// NewBuildFromCloudPackerBuild converts a HashicorpCloudePackerBuild to a local build that can be tracked and published to the HCP Packer Registry. -// Any existing labels or images associated to src will be copied to the returned Build. -func NewBuildFromCloudPackerBuild(src *models.HashicorpCloudPackerBuild) (*Build, error) { +// NewBuildFromCloudPackerBuild converts a HashicorpCloudPackerBuild to a local build that can be tracked and +// published to the HCP Packer. +// Any existing labels or artifacts associated to src will be copied to the returned Build. +func NewBuildFromCloudPackerBuild(src *hcpPackerModels.HashicorpCloudPacker20230101Build) (*Build, error) { build := Build{ ID: src.ID, ComponentType: src.ComponentType, - CloudProvider: src.CloudProvider, + Platform: src.Platform, RunUUID: src.PackerRunUUID, Status: *src.Status, Labels: src.Labels, } var err error - for _, image := range src.Images { - image := image - err = build.AddImages(registryimage.Image{ - ImageID: image.ImageID, - ProviderName: build.CloudProvider, - ProviderRegion: image.Region, + for _, artifact := range src.Artifacts { + err = build.AddArtifacts(packerSDKRegistry.Image{ + ImageID: artifact.ExternalIdentifier, + ProviderName: build.Platform, + ProviderRegion: artifact.Region, }) if err != nil { @@ -48,58 +52,56 @@ func NewBuildFromCloudPackerBuild(src *models.HashicorpCloudPackerBuild) (*Build return &build, nil } -// AddLabelsToBuild merges the contents of data to the labels associated with the build. +// MergeLabels merges the contents of data to the labels associated with the build. // Duplicate keys will be updated to reflect the new value. -func (b *Build) MergeLabels(data map[string]string) { +func (build *Build) MergeLabels(data map[string]string) { if data == nil { return } - if b.Labels == nil { - b.Labels = make(map[string]string) + if build.Labels == nil { + build.Labels = make(map[string]string) } for k, v := range data { // TODO: (nywilken) Determine why we skip labels already set - //if _, ok := build.Labels[k]; ok { - //continue - //} - b.Labels[k] = v + // if _, ok := build.Labels[k]; ok { + // continue + // } + build.Labels[k] = v } } -// AddImages appends one or more images artifacts to the build. -func (b *Build) AddImages(images ...registryimage.Image) error { +// AddArtifacts appends one or more artifacts to the build. +func (build *Build) AddArtifacts(artifacts ...packerSDKRegistry.Image) error { - if b.Images == nil { - b.Images = make(map[string]registryimage.Image) + if build.Artifacts == nil { + build.Artifacts = make(map[string]packerSDKRegistry.Image) } - for _, image := range images { - image := image - - if err := image.Validate(); err != nil { - return fmt.Errorf("AddImages: failed to add image to build %q: %w", b.ComponentType, err) + for _, artifact := range artifacts { + if err := artifact.Validate(); err != nil { + return fmt.Errorf("AddArtifacts: failed to add artifact to build %q: %w", build.ComponentType, err) } - if b.CloudProvider == "" { - b.CloudProvider = image.ProviderName + if build.Platform == "" { + build.Platform = artifact.ProviderName } - b.MergeLabels(image.Labels) - b.Images[image.String()] = image + build.MergeLabels(artifact.Labels) + build.Artifacts[artifact.String()] = artifact } return nil } // IsNotDone returns true if build does not satisfy all requirements of a completed build. -// A completed build must have a valid ID, one or more Images, and its Status is HashicorpCloudPackerBuildStatusDONE. -func (b *Build) IsNotDone() bool { - hasBuildID := b.ID != "" - hasNoImages := len(b.Images) == 0 - isNotDone := b.Status != models.HashicorpCloudPackerBuildStatusDONE +// A completed build must have a valid ID, one or more Artifacts, and its Status is HashicorpCloudPacker20230101BuildStatusBUILDDONE. +func (build *Build) IsNotDone() bool { + hasBuildID := build.ID != "" + hasNoArtifacts := len(build.Artifacts) == 0 + isNotDone := build.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE - return hasBuildID && hasNoImages && isNotDone + return hasBuildID && hasNoArtifacts && isNotDone } diff --git a/internal/hcp/registry/types.iterations.go b/internal/hcp/registry/types.iterations.go deleted file mode 100644 index aafd6205940..00000000000 --- a/internal/hcp/registry/types.iterations.go +++ /dev/null @@ -1,154 +0,0 @@ -package registry - -import ( - "errors" - "fmt" - "os" - "sync" - - git "github.com/go-git/go-git/v5" - registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" - "github.com/hashicorp/packer/internal/hcp/env" -) - -type Iteration struct { - ID string - AncestorSlug string - Fingerprint string - RunUUID string - Labels map[string]string - builds sync.Map - expectedBuilds []string -} - -type IterationOptions struct { - TemplateBaseDir string -} - -// NewIteration returns a pointer to an Iteration that can be used for storing Packer build details needed by PAR. -func NewIteration() *Iteration { - i := Iteration{ - expectedBuilds: make([]string, 0), - } - - return &i -} - -// Initialize prepares the iteration to be used with an active HCP Packer registry bucket. -func (i *Iteration) Initialize(opts IterationOptions) error { - if i == nil { - return errors.New("Unexpected call to initialize for a nil Iteration") - } - - // By default we try to load a Fingerprint from the environment variable. - // If no variable is defined we should try to load a fingerprint from Git, or other VCS. - i.Fingerprint = os.Getenv(env.HCPPackerBuildFingerprint) - - if i.Fingerprint != "" { - return nil - } - - fp, err := GetGitFingerprint(opts) - if err != nil { - return err - } - i.Fingerprint = fp - - return nil -} - -// GetGitFingerprint returns the HEAD commit for some template dir defined in opt.TemplateBaseDir. -// If the base directory is not under version control an error is returned. -func GetGitFingerprint(opts IterationOptions) (string, error) { - r, err := git.PlainOpenWithOptions(opts.TemplateBaseDir, &git.PlainOpenOptions{ - DetectDotGit: true, - }) - - if err != nil { - return "", fmt.Errorf("Packer could not read the fingerprint from git." + - "\n\nIf your Packer template is not within a git managed directory, " + - "you can set the HCP_PACKER_BUILD_FINGERPRINT environment variable. " + - "The fingerprint must be less than 32 characters and can contain letters and numbers.") - } - - // The config can be used to retrieve user identity. for example, - // c.User.Email. Leaving in but commented because I'm not sure we care - // about this identity right now. - Megan - // - // c, err := r.ConfigScoped(config.GlobalScope) - // if err != nil { - // return "", fmt.Errorf("Error setting git scope", err) - // } - ref, err := r.Head() - if err != nil { - // If we get there, we're in a Git dir, but HEAD cannot be read. - // - // This may happen when there's no commit in the git dir. - return "", fmt.Errorf("Packer could not read a git SHA in directory %q.\n"+ - "This may happen if your template is in a git repository without any "+ - "commits. You can either add a commit in this directory, or set the "+ - "HCP_PACKER_BUILD_FINGERPRINT environment variable. The fingerprint "+ - "must be less than 32 characters and can contain letters and numbers.\n"+ - "Error: %s", opts.TemplateBaseDir, err) - } - - // log.Printf("Author: %v, Commit: %v\n", c.User.Email, ref.Hash()) - - return ref.Hash().String(), nil -} - -//StoreBuild stores a build for buildName to an active iteration. -func (i *Iteration) StoreBuild(buildName string, build *Build) { - i.builds.Store(buildName, build) -} - -//Build gets the store build associated with buildName in the active iteration. -func (i *Iteration) Build(buildName string) (*Build, error) { - build, ok := i.builds.Load(buildName) - if !ok { - return nil, errors.New("no associated build found for the name " + buildName) - } - - b, ok := build.(*Build) - if !ok { - return nil, fmt.Errorf("the build for the component %q does not appear to be a valid registry Build", buildName) - } - - return b, nil -} - -//HasBuild checks if iteration has a stored build associated with buildName. -func (i *Iteration) HasBuild(buildName string) bool { - _, ok := i.builds.Load(buildName) - - return ok -} - -// AddImageToBuild appends one or more images artifacts to the build referred to by buildName. -func (i *Iteration) AddImageToBuild(buildName string, images ...registryimage.Image) error { - build, err := i.Build(buildName) - if err != nil { - return fmt.Errorf("AddImageToBuild: %w", err) - } - - err = build.AddImages(images...) - if err != nil { - return fmt.Errorf("AddImageToBuild: %w", err) - } - - i.StoreBuild(buildName, build) - return nil -} - -// AddLabelsToBuild merges the contents of data to the labels associated with the build referred to by buildName. -func (i *Iteration) AddLabelsToBuild(buildName string, data map[string]string) error { - build, err := i.Build(buildName) - if err != nil { - return fmt.Errorf("AddLabelsToBuild: %w", err) - } - - build.MergeLabels(data) - - i.StoreBuild(buildName, build) - return nil -} diff --git a/internal/hcp/registry/types.version.go b/internal/hcp/registry/types.version.go new file mode 100644 index 00000000000..91d81749702 --- /dev/null +++ b/internal/hcp/registry/types.version.go @@ -0,0 +1,204 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package registry + +import ( + "context" + "errors" + "fmt" + "math/rand" + "os" + "strings" + "sync" + "time" + + hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" + sdkpacker "github.com/hashicorp/packer-plugin-sdk/packer" + packerSDKRegistry "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" + "github.com/hashicorp/packer/internal/hcp/env" + "github.com/hashicorp/packer/packer" + "github.com/oklog/ulid" +) + +type Version struct { + ID string + Fingerprint string + RunUUID string + builds sync.Map + expectedBuilds []string +} + +type VersionOptions struct { + TemplateBaseDir string +} + +// NewVersion returns a pointer to a Version that can be used for storing Packer build details needed. +func NewVersion() *Version { + i := Version{ + expectedBuilds: make([]string, 0), + } + + return &i +} + +// Initialize prepares the version to be used with HCP Packer. +func (version *Version) Initialize() error { + if version == nil { + return errors.New("Unexpected call to initialize for a nil Version") + } + + // Bydefault we try to load a Fingerprint from the environment variable. + // If no variable is defined we generate a new fingerprint. + version.Fingerprint = os.Getenv(env.HCPPackerBuildFingerprint) + + if version.Fingerprint != "" { + return nil + } + + fp, err := ulid.New(ulid.Now(), ulid.Monotonic(rand.New(rand.NewSource(time.Now().UnixNano())), 0)) + if err != nil { + return fmt.Errorf("Failed to generate a fingerprint: %s", err) + } + version.Fingerprint = fp.String() + + return nil +} + +// StoreBuild stores a build for buildName to an active version. +func (version *Version) StoreBuild(buildName string, build *Build) { + version.builds.Store(buildName, build) +} + +// Build gets the store build associated with buildName in the active version. +func (version *Version) Build(buildName string) (*Build, error) { + build, ok := version.builds.Load(buildName) + if !ok { + return nil, errors.New("no associated build found for the name " + buildName) + } + + b, ok := build.(*Build) + if !ok { + return nil, fmt.Errorf("the build for the component %q does not appear to be a valid registry Build", buildName) + } + + return b, nil +} + +// HasBuild checks if version has a stored build associated with buildName. +func (version *Version) HasBuild(buildName string) bool { + _, ok := version.builds.Load(buildName) + + return ok +} + +// AddArtifactToBuild appends one or more artifacts to the build referred to by buildName. +func (version *Version) AddArtifactToBuild(buildName string, artifacts ...packerSDKRegistry.Image) error { + build, err := version.Build(buildName) + if err != nil { + return fmt.Errorf("AddArtifactToBuild: %w", err) + } + + err = build.AddArtifacts(artifacts...) + if err != nil { + return fmt.Errorf("AddArtifactToBuild: %w", err) + } + + version.StoreBuild(buildName, build) + return nil +} + +// AddLabelsToBuild merges the contents of data to the labels associated with the build referred to by buildName. +func (version *Version) AddLabelsToBuild(buildName string, data map[string]string) error { + build, err := version.Build(buildName) + if err != nil { + return fmt.Errorf("AddLabelsToBuild: %w", err) + } + + build.MergeLabels(data) + + version.StoreBuild(buildName, build) + return nil +} + +// AddSHAToBuildLabels adds the Git SHA for the current version (if set) as a label for all the builds of the version +func (version *Version) AddSHAToBuildLabels(sha string) { + version.builds.Range(func(_, v any) bool { + b, ok := v.(*Build) + if !ok { + return true + } + + b.MergeLabels(map[string]string{ + "git_sha": sha, + }) + + return true + }) +} + +// RemainingBuilds returns the list of builds that are not in a DONE status +func (version *Version) RemainingBuilds() []*Build { + var todo []*Build + + version.builds.Range(func(k, v any) bool { + build, ok := v.(*Build) + if !ok { + // Unlikely since the builds map contains only Build instances + return true + } + + if build.Status != hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE { + todo = append(todo, build) + } + return true + }) + + return todo +} + +func (version *Version) statusSummary(ui sdkpacker.Ui) { + rem := version.RemainingBuilds() + if rem == nil { + return + } + + buf := &strings.Builder{} + + buf.WriteString(fmt.Sprintf( + "\nVersion %q is incomplete, the following builds are missing artifact metadata:\n\n", + version.Fingerprint)) + for _, b := range rem { + buf.WriteString(fmt.Sprintf("* %q: %s\n", b.ComponentType, b.Status)) + } + buf.WriteString("\nYou may resume work on this version in further Packer builds by defining the following variable in your environment:\n") + buf.WriteString(fmt.Sprintf("HCP_PACKER_BUILD_FINGERPRINT=%q", version.Fingerprint)) + + ui.Say(buf.String()) +} + +// AddMetadataToBuild adds metadata to a build in the HCP Packer registry. +func (version *Version) AddMetadataToBuild( + ctx context.Context, buildName string, metadata packer.BuildMetadata, +) error { + buildToUpdate, err := version.Build(buildName) + if err != nil { + return err + } + + packerMetadata := make(map[string]interface{}) + packerMetadata["version"] = metadata.PackerVersion + + var pluginsMetadata []map[string]interface{} + for _, plugin := range metadata.Plugins { + pluginMetadata := map[string]interface{}{ + "version": plugin.Description.Version, + "name": plugin.Name, + } + pluginsMetadata = append(pluginsMetadata, pluginMetadata) + } + packerMetadata["plugins"] = pluginsMetadata + + buildToUpdate.Metadata.Packer = packerMetadata + return nil +} diff --git a/internal/hcp/registry/types.iterations_test.go b/internal/hcp/registry/types.version_test.go similarity index 64% rename from internal/hcp/registry/types.iterations_test.go rename to internal/hcp/registry/types.version_test.go index d7d0435f837..ab6b0e122c7 100644 --- a/internal/hcp/registry/types.iterations_test.go +++ b/internal/hcp/registry/types.version_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package registry import ( @@ -5,14 +8,13 @@ import ( "path" "testing" - git "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5" ) -func TestIteration_Initialize(t *testing.T) { +func TestVersion_Initialize(t *testing.T) { var tc = []struct { name string fingerprint string - opts IterationOptions setupFn func(t *testing.T) errorExpected bool }{ @@ -26,9 +28,6 @@ func TestIteration_Initialize(t *testing.T) { { name: "using git fingerprint", fingerprint: "4ec004e18e977a5b8a3a28f4b24279b6993d7e7c", - opts: IterationOptions{ - TemplateBaseDir: tempdir("4ec004e18e"), - }, setupFn: func(t *testing.T) { //nolint:errcheck git.PlainClone(tempdir("4ec004e18e"), false, &git.CloneOptions{ @@ -37,33 +36,16 @@ func TestIteration_Initialize(t *testing.T) { Depth: 1, }) + t.Setenv("HCP_PACKER_BUILD_FINGERPRINT", "4ec004e18e977a5b8a3a28f4b24279b6993d7e7c") + t.Cleanup(func() { //nolint:errcheck os.RemoveAll(tempdir("4ec004e18e")) }) }, }, - { - name: "using empty git directory", - opts: IterationOptions{ - TemplateBaseDir: tempdir("empty-init"), - }, - setupFn: func(t *testing.T) { - //nolint:errcheck - git.PlainInit(tempdir("empty-init"), false) - t.Cleanup(func() { - //nolint:errcheck - os.RemoveAll(tempdir("empty-init")) - }) - }, - errorExpected: true, - }, { name: "using no fingerprint in clean directory", - opts: IterationOptions{ - TemplateBaseDir: "/dev/null", - }, - errorExpected: true, }, } @@ -74,8 +56,8 @@ func TestIteration_Initialize(t *testing.T) { tt.setupFn(t) } - i := NewIteration() - err := i.Initialize(tt.opts) + i := NewVersion() + err := i.Initialize() if tt.errorExpected { t.Logf("%v", err) if err == nil { @@ -83,7 +65,7 @@ func TestIteration_Initialize(t *testing.T) { } if i.Fingerprint != "" { - t.Errorf("expected %q to result in an error with an empty iteration fingerprint, but got %q", tt.name, i.Fingerprint) + t.Errorf("expected %q to result in an error with an empty version fingerprint, but got %q", tt.name, i.Fingerprint) } return } @@ -92,7 +74,7 @@ func TestIteration_Initialize(t *testing.T) { t.Errorf("expected %q to return with no error, but it %v", tt.name, err) } - if i.Fingerprint != tt.fingerprint { + if tt.fingerprint != "" && i.Fingerprint != tt.fingerprint { t.Errorf("%q failed to load the expected fingerprint %q, but got %q", tt.name, tt.fingerprint, i.Fingerprint) } diff --git a/log.go b/log.go index ff12c94c079..72744bc3dd5 100644 --- a/log.go +++ b/log.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/main.go b/main.go index 060bf12278b..81a65a68aab 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // This is the main package for the `packer` application. //go:generate go run ./scripts/generate-plugins.go @@ -6,7 +9,6 @@ package main import ( "fmt" "io" - "io/ioutil" "log" "math/rand" "os" @@ -62,13 +64,13 @@ func realMain() int { return 1 } if logWriter == nil { - logWriter = ioutil.Discard + logWriter = io.Discard } packersdk.LogSecretFilter.SetOutput(logWriter) // Disable logging here - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) // We always send logs to a temporary file that we use in case // there is a panic. Otherwise, we delete it. @@ -249,11 +251,21 @@ func wrappedMain() int { Ui: ui, } + //versionCLIHelper shortcuts "--version" and "-v" to just show the version + versionCLIHelper := &cli.CLI{ + Args: args, + Version: version.Version, + } + if versionCLIHelper.IsVersion() && versionCLIHelper.Version != "" { + // by default version flags ignore all other args so there is no need to persist the original args. + args = []string{"version"} + } + cli := &cli.CLI{ Args: args, Autocomplete: true, Commands: Commands, - HelpFunc: excludeHelpFunc(Commands, []string{"plugin"}), + HelpFunc: excludeHelpFunc(Commands, []string{"execute", "plugin"}), HelpWriter: os.Stdout, Name: "packer", Version: version.Version, @@ -317,80 +329,20 @@ func extractMachineReadable(args []string) ([]string, bool) { } func loadConfig() (*config, error) { + pluginDir, err := packer.PluginFolder() + if err != nil { + return nil, err + } + var config config config.Plugins = &packer.PluginConfig{ - PluginMinPort: 10000, - PluginMaxPort: 25000, - KnownPluginFolders: packer.PluginFolders("."), - - // BuilderRedirects - BuilderRedirects: map[string]string{ - - //"amazon-chroot": "github.com/hashicorp/amazon", - //"amazon-ebs": "github.com/hashicorp/amazon", - //"amazon-ebssurrogate": "github.com/hashicorp/amazon", - //"amazon-ebsvolume": "github.com/hashicorp/amazon", - //"amazon-instance": "github.com/hashicorp/amazon", - - //"azure-arm": "github.com/hashicorp/azure", - //"azure-chroot": "github.com/hashicorp/azure", - //"azure-dtl": "github.com/hashicorp/azure", - - //"docker": "github.com/hashicorp/docker", - - //"exoscale": "github.com/exoscale/exoscale", - - //"googlecompute": "github.com/hashicorp/googlecompute", - - //"parallels-iso": "github.com/hashicorp/parallels", - //"parallels-pvm": "github.com/hashicorp/parallels", - - //"qemu": "github.com/hashicorp/qemu", - - //"vagrant": "github.com/hashicorp/vagrant", - - //"virtualbox-iso": "github.com/hashicorp/virtualbox", - //"virtualbox-ovf": "github.com/hashicorp/virtualbox", - //"virtualbox-vm": "github.com/hashicorp/virtualbox", - - //"vmware-iso": "github.com/hashicorp/vmware", - //"vmware-vmx": "github.com/hashicorp/vmware", - - //"vsphere-iso": "github.com/hashicorp/vsphere", - //"vsphere-clone": "github.com/hashicorp/vsphere", - }, - DatasourceRedirects: map[string]string{ - //"amazon-ami": "github.com/hashicorp/amazon", - //"amazon-secretsmanager": "github.com/hashicorp/amazon", - }, - ProvisionerRedirects: map[string]string{ - //"ansible": "github.com/hashicorp/ansible", - //"ansible-local": "github.com/hashicorp/ansible", - - //"azure-dtlartifact": "github.com/hashicorp/azure", - }, - PostProcessorRedirects: map[string]string{ - //"amazon-import": "github.com/hashicorp/amazon", - - //"docker-import": "github.com/hashicorp/docker", - //"docker-push": "github.com/hashicorp/docker", - //"docker-save": "github.com/hashicorp/docker", - //"docker-tag": "github.com/hashicorp/docker", - - //"googlecompute-export": "github.com/hashicorp/googlecompute", - //"googlecompute-import": "github.com/hashicorp/googlecompute", - - //"exoscale-import": "github.com/exoscale/exoscale", - - //"vagrant": "github.com/hashicorp/vagrant", - //"vagrant-cloud": "github.com/hashicorp/vagrant", - - //"vsphere": "github.com/hashicorp/vsphere", - //"vsphere-template": "github.com/hashicorp/vsphere", - }, - } - if err := config.Plugins.Discover(); err != nil { - return nil, err + PluginMinPort: 10000, + PluginMaxPort: 25000, + PluginDirectory: pluginDir, + Builders: packer.MapOfBuilder{}, + Provisioners: packer.MapOfProvisioner{}, + PostProcessors: packer.MapOfPostProcessor{}, + DataSources: packer.MapOfDatasource{}, } // Finally, try to use an internal plugin. Note that this will not override diff --git a/main_test.go b/main_test.go index f4d44bbf120..b71319e9dea 100644 --- a/main_test.go +++ b/main_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/packer/build.go b/packer/build.go index c5f2b13834f..8b62ec53799 100644 --- a/packer/build.go +++ b/packer/build.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -10,6 +13,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/version" + "github.com/zclconf/go-cty/cty" ) // A CoreBuild struct represents a single build job, the result of which should @@ -17,10 +21,19 @@ import ( // multiple files, of course, but it should be for only a single provider (such // as VirtualBox, EC2, etc.). type CoreBuild struct { - BuildName string - Type string - Builder packersdk.Builder - BuilderConfig interface{} + BuildName string + Type string + Builder packersdk.Builder + // BuilderConfig is the config for the builder. + // + // Is is deserialised directly from the JSON template, + // and is only populated for legacy JSON templates. + BuilderConfig interface{} + // HCLConfig is the HCL config for the builder + // + // Its only use is for telemetry, since we use it to extract the + // field names from it. + HCLConfig cty.Value BuilderType string hooks map[string][]packersdk.Hook Provisioners []CoreBuildProvisioner @@ -39,12 +52,59 @@ type CoreBuild struct { prepareCalled bool } +type BuildMetadata struct { + PackerVersion string + Plugins map[string]PluginDetails +} + +func (b *CoreBuild) getPluginsMetadata() map[string]PluginDetails { + resp := map[string]PluginDetails{} + + builderPlugin, builderPluginOk := GlobalPluginsDetailsStore.GetBuilder(b.BuilderType) + if builderPluginOk { + resp[builderPlugin.Name] = builderPlugin + } + + for _, pp := range b.PostProcessors { + for _, p := range pp { + postprocessorsPlugin, postprocessorsPluginOk := GlobalPluginsDetailsStore.GetPostProcessor(p.PType) + if postprocessorsPluginOk { + resp[postprocessorsPlugin.Name] = postprocessorsPlugin + } + } + } + + for _, pv := range b.Provisioners { + provisionerPlugin, provisionerPluginOk := GlobalPluginsDetailsStore.GetProvisioner(pv.PType) + if provisionerPluginOk { + resp[provisionerPlugin.Name] = provisionerPlugin + } + } + + return resp +} + +func (b *CoreBuild) GetMetadata() BuildMetadata { + metadata := BuildMetadata{ + PackerVersion: version.FormattedVersion(), + Plugins: b.getPluginsMetadata(), + } + return metadata +} + // CoreBuildPostProcessor Keeps track of the post-processor and the // configuration of the post-processor used within a build. type CoreBuildPostProcessor struct { - PostProcessor packersdk.PostProcessor - PType string - PName string + PostProcessor packersdk.PostProcessor + PType string + PName string + // HCLConfig is the HCL config for the post-processor + // + // Its only use is for telemetry, since we use it to extract the + // field names from it. + HCLConfig cty.Value + // config is JSON-specific, the configuration for the post-processor + // deserialised directly from the JSON template config map[string]interface{} KeepInputArtifact *bool } @@ -55,7 +115,14 @@ type CoreBuildProvisioner struct { PType string PName string Provisioner packersdk.Provisioner - config []interface{} + // HCLConfig is the HCL config for the provisioner + // + // Its only use is for telemetry, since we use it to extract the + // field names from it. + HCLConfig cty.Value + // config is JSON-specific, and is the configuration of the + // provisioner, with overrides + config []interface{} } // Returns the name of the build. @@ -173,6 +240,8 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi packersdk.Ui) ([]packers var pConfig interface{} if len(p.config) > 0 { pConfig = p.config[0] + } else { + pConfig = p.HCLConfig } if b.debug { hookedProvisioners[i] = &HookedProvisioner{ @@ -218,8 +287,13 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi packersdk.Ui) ([]packers Ui: originalUi, } + var ts *TelemetrySpan log.Printf("Running builder: %s", b.BuilderType) - ts := CheckpointReporter.AddSpan(b.Type, "builder", b.BuilderConfig) + if b.BuilderConfig != nil { + ts = CheckpointReporter.AddSpan(b.Type, "builder", b.BuilderConfig) + } else { + ts = CheckpointReporter.AddSpan(b.Type, "builder", b.HCLConfig) + } builderArtifact, err := b.Builder.Run(ctx, builderUi, hook) ts.End(err) if err != nil { @@ -238,7 +312,7 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi packersdk.Ui) ([]packers select { case <-ctx.Done(): log.Println("Build was cancelled. Skipping post-processors.") - return nil, nil + return nil, ctx.Err() default: } @@ -257,7 +331,12 @@ PostProcessorRunSeqLoop: } else { builderUi.Say(fmt.Sprintf("Running post-processor: %s (type %s)", corePP.PName, corePP.PType)) } - ts := CheckpointReporter.AddSpan(corePP.PType, "post-processor", corePP.config) + var ts *TelemetrySpan + if corePP.config != nil { + ts = CheckpointReporter.AddSpan(corePP.PType, "post-processor", corePP.config) + } else { + ts = CheckpointReporter.AddSpan(corePP.PType, "post-processor", corePP.HCLConfig) + } artifact, defaultKeep, forceOverride, err := corePP.PostProcessor.PostProcess(ctx, ppUi, priorArtifact) ts.End(err) if err != nil { diff --git a/packer/build_test.go b/packer/build_test.go index 9b4812b3565..c15eec5b570 100644 --- a/packer/build_test.go +++ b/packer/build_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -9,6 +12,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/version" + "github.com/zclconf/go-cty/cty" ) func boolPointer(tf bool) *bool { @@ -32,7 +36,7 @@ func testBuild() *CoreBuild { }, PostProcessors: [][]CoreBuildPostProcessor{ { - {&MockPostProcessor{ArtifactId: "pp"}, "testPP", "testPPName", make(map[string]interface{}), boolPointer(true)}, + {&MockPostProcessor{ArtifactId: "pp"}, "testPP", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(true)}, }, }, Variables: make(map[string]string), @@ -302,7 +306,7 @@ func TestBuild_Run_Artifacts(t *testing.T) { build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { - {&MockPostProcessor{ArtifactId: "pp"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, + {&MockPostProcessor{ArtifactId: "pp"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false)}, }, } @@ -327,10 +331,10 @@ func TestBuild_Run_Artifacts(t *testing.T) { build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { - {&MockPostProcessor{ArtifactId: "pp1"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, + {&MockPostProcessor{ArtifactId: "pp1"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false)}, }, { - {&MockPostProcessor{ArtifactId: "pp2"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(true)}, + {&MockPostProcessor{ArtifactId: "pp2"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(true)}, }, } @@ -355,12 +359,12 @@ func TestBuild_Run_Artifacts(t *testing.T) { build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { - {&MockPostProcessor{ArtifactId: "pp1a"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, - {&MockPostProcessor{ArtifactId: "pp1b"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(true)}, + {&MockPostProcessor{ArtifactId: "pp1a"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false)}, + {&MockPostProcessor{ArtifactId: "pp1b"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(true)}, }, { - {&MockPostProcessor{ArtifactId: "pp2a"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, - {&MockPostProcessor{ArtifactId: "pp2b"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, + {&MockPostProcessor{ArtifactId: "pp2a"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false)}, + {&MockPostProcessor{ArtifactId: "pp2b"}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false)}, }, } @@ -386,7 +390,7 @@ func TestBuild_Run_Artifacts(t *testing.T) { build.PostProcessors = [][]CoreBuildPostProcessor{ { { - &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: true}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false), + &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: true}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false), }, }, } @@ -414,7 +418,7 @@ func TestBuild_Run_Artifacts(t *testing.T) { build.PostProcessors = [][]CoreBuildPostProcessor{ { { - &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false), + &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), boolPointer(false), }, }, } @@ -441,7 +445,7 @@ func TestBuild_Run_Artifacts(t *testing.T) { build.PostProcessors = [][]CoreBuildPostProcessor{ { { - &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", make(map[string]interface{}), nil, + &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", cty.Value{}, make(map[string]interface{}), nil, }, }, } diff --git a/packer/builder_test.go b/packer/builder_test.go index d7c610c153e..85b7eaf5f08 100644 --- a/packer/builder_test.go +++ b/packer/builder_test.go @@ -1 +1,4 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer diff --git a/packer/client_test.go b/packer/client_test.go index 9610cedceec..c914a3edaed 100644 --- a/packer/client_test.go +++ b/packer/client_test.go @@ -1,8 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( "bytes" - "io/ioutil" "os" "strings" "testing" @@ -99,7 +101,7 @@ func TestClient_Stderr(t *testing.T) { func TestClient_Stdin(t *testing.T) { // Overwrite stdin for this test with a temporary file - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("err: %s", err) } diff --git a/packer/cmd_builder.go b/packer/cmd_builder.go index 7371cb43c3a..8b472d1fb24 100644 --- a/packer/cmd_builder.go +++ b/packer/cmd_builder.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_builder_test.go b/packer/cmd_builder_test.go index 7ab9c65133f..a47bcea31b8 100644 --- a/packer/cmd_builder_test.go +++ b/packer/cmd_builder_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_datasource.go b/packer/cmd_datasource.go index 399ef036837..0e2d6b79892 100644 --- a/packer/cmd_datasource.go +++ b/packer/cmd_datasource.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_datasource_test.go b/packer/cmd_datasource_test.go index 590d0674ed9..1616b218cf7 100644 --- a/packer/cmd_datasource_test.go +++ b/packer/cmd_datasource_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_hook.go b/packer/cmd_hook.go index 58e2caeaefc..f3973a98a0d 100644 --- a/packer/cmd_hook.go +++ b/packer/cmd_hook.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_hook_test.go b/packer/cmd_hook_test.go index a3c8ba36489..ed149c5af7c 100644 --- a/packer/cmd_hook_test.go +++ b/packer/cmd_hook_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_post_processor.go b/packer/cmd_post_processor.go index e75e5c3e344..139c9133390 100644 --- a/packer/cmd_post_processor.go +++ b/packer/cmd_post_processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_post_processor_test.go b/packer/cmd_post_processor_test.go index 4d327d1fcdd..3c69d899f6b 100644 --- a/packer/cmd_post_processor_test.go +++ b/packer/cmd_post_processor_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_provisioner.go b/packer/cmd_provisioner.go index a1c7003be82..335b7bd97ec 100644 --- a/packer/cmd_provisioner.go +++ b/packer/cmd_provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/cmd_provisioner_test.go b/packer/cmd_provisioner_test.go index acf81f1be1e..6c2005b9354 100644 --- a/packer/cmd_provisioner_test.go +++ b/packer/cmd_provisioner_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/core.go b/packer/core.go index 40b6560eddd..0f3ea9c9c1e 100644 --- a/packer/core.go +++ b/packer/core.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -15,6 +18,7 @@ import ( multierror "github.com/hashicorp/go-multierror" version "github.com/hashicorp/go-version" hcl "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/packer-plugin-sdk/didyoumean" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/template" "github.com/hashicorp/packer-plugin-sdk/template/interpolate" @@ -129,6 +133,23 @@ func NewCore(c *CoreConfig) *Core { return core } +// DetectPluginBinaries is used to load required plugins from the template, +// since it is unsupported in JSON, this is essentially a no-op. +func (c *Core) DetectPluginBinaries() hcl.Diagnostics { + var diags hcl.Diagnostics + + err := c.components.PluginConfig.Discover() + if err != nil { + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Failed to discover installed plugins", + Detail: err.Error(), + }) + } + + return diags +} + func (c *Core) Initialize(_ InitializeOptions) hcl.Diagnostics { err := c.initialize() if err != nil { @@ -209,15 +230,33 @@ func (c *Core) BuildNames(only, except []string) []string { func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName string) (CoreBuildProvisioner, error) { // Get the provisioner cbp := CoreBuildProvisioner{} + + if !c.components.PluginConfig.Provisioners.Has(rawP.Type) { + err := fmt.Errorf( + "The provisioner %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + rawP.Type, + strings.Split(rawP.Type, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.Provisioners.List()); sugg != "" { + err = fmt.Errorf("Did you mean to use %q?", sugg) + } + + return cbp, err + } + provisioner, err := c.components.PluginConfig.Provisioners.Start(rawP.Type) if err != nil { return cbp, fmt.Errorf( "error initializing provisioner '%s': %s", rawP.Type, err) } + // Seems unlikely that a provisioner doesn't start successfully without error if provisioner == nil { return cbp, fmt.Errorf( - "provisioner type not found: %s", rawP.Type) + "provisioner failed to be started and did not error: %s", rawP.Type) } // Get the configuration @@ -268,10 +307,9 @@ func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName // This is used for json templates to launch the build plugins. // They will be prepared via b.Prepare() later. -func (c *Core) GetBuilds(opts GetBuildsOptions) ([]packersdk.Build, map[string]string, hcl.Diagnostics) { +func (c *Core) GetBuilds(opts GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) { buildNames := c.BuildNames(opts.Only, opts.Except) builds := []packersdk.Build{} - hcpTranslationMap := map[string]string{} diags := hcl.Diagnostics{} for _, n := range buildNames { b, err := c.Build(n) @@ -284,8 +322,6 @@ func (c *Core) GetBuilds(opts GetBuildsOptions) ([]packersdk.Build, map[string]s continue } - hcpTranslationMap[n] = HCPName(c.builds[n]) - // Now that build plugin has been launched, call Prepare() log.Printf("Preparing build: %s", b.Name()) b.SetDebug(opts.Debug) @@ -315,25 +351,7 @@ func (c *Core) GetBuilds(opts GetBuildsOptions) ([]packersdk.Build, map[string]s } } } - return builds, hcpTranslationMap, diags -} - -// HCPName is a helper to get a curated HCP name for a legacy JSON builder. -// -// In order to make the naming scheme between HCL2 and JSON more consistent, -// we implement a similar kind of logic on both template types. -// -// This means that when for HCL2 templates we have a build name formed of -// the source type and the source name, we will do the name here for JSON. -func HCPName(builder *template.Builder) string { - // By default, if the name is unspecified, it will be assigned the type - // - // No need to repeat ourselves here, so we can keep the current behaviour - if builder.Name == builder.Type { - return builder.Name - } - - return fmt.Sprintf("%s.%s", builder.Type, builder.Name) + return builds, diags } // Build returns the Build object for the given name. @@ -347,6 +365,22 @@ func (c *Core) Build(n string) (packersdk.Build, error) { // For reference, the builtin BuilderStore is generated in // packer/config.go in the Discover() func. + if !c.components.PluginConfig.Builders.Has(configBuilder.Type) { + err := fmt.Errorf( + "The builder %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + configBuilder.Type, + strings.Split(configBuilder.Type, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(configBuilder.Type, c.components.PluginConfig.Builders.List()); sugg != "" { + err = fmt.Errorf("Did you mean to use %q?", sugg) + } + + return nil, err + } + // the Start command launches the builder plugin of the given type without // calling Prepare() or passing any build-specific details. builder, err := c.components.PluginConfig.Builders.Start(configBuilder.Type) @@ -408,6 +442,22 @@ func (c *Core) Build(n string) (packersdk.Build, error) { break } + if !c.components.PluginConfig.PostProcessors.Has(rawP.Type) { + err := fmt.Errorf( + "The post-processor %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ + "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ + "https://developer.hashicorp.com/packer/integrations?filter=%s", + rawP.Type, + strings.Split(rawP.Type, "-")[0], + ) + + if sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.PostProcessors.List()); sugg != "" { + err = fmt.Errorf("Did you mean to use %q?", sugg) + } + + return nil, err + } + // Get the post-processor postProcessor, err := c.components.PluginConfig.PostProcessors.Start(rawP.Type) if err != nil { @@ -441,7 +491,7 @@ func (c *Core) Build(n string) (packersdk.Build, error) { // Return a structure that contains the plugins, their types, variables, and // the raw builder config loaded from the json template - return &CoreBuild{ + cb := &CoreBuild{ Type: n, Builder: builder, BuilderConfig: configBuilder.Config, @@ -451,7 +501,15 @@ func (c *Core) Build(n string) (packersdk.Build, error) { CleanupProvisioner: cleanupProvisioner, TemplatePath: c.Template.Path, Variables: c.variables, - }, nil + } + + //configBuilder.Name is left uninterpolated so we must check against + // the interpolated name. + if configBuilder.Type != configBuilder.Name { + cb.BuildName = configBuilder.Type + } + + return cb, nil } // Context returns an interpolation context. diff --git a/packer/core_test.go b/packer/core_test.go index 309e547550a..b1694cbf86c 100644 --- a/packer/core_test.go +++ b/packer/core_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -68,6 +71,10 @@ func TestCoreBuild_basic(t *testing.T) { t.Fatalf("err: %s", err) } + if build.Name() != "test" { + t.Fatalf("bad: build name does not match expected: %q, got: %q", "test", build.Name()) + } + if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } @@ -98,6 +105,10 @@ func TestCoreBuild_basicInterpolated(t *testing.T) { t.Fatalf("err: %s", err) } + if build.Name() != "test.NAME" { + t.Fatalf("bad: build name does not match expected: %q, got: %q", "NAME", build.Name()) + } + if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } @@ -865,3 +876,64 @@ func TestCoreBuild_packerVersion(t *testing.T) { t.Fatalf("bad: %#v", result) } } + +func TestCoreBuild_buildNameIntepolation(t *testing.T) { + config := TestCoreConfig(t) + cases := []struct { + File string + InterpolatedName, Expected string + Vars map[string]string + }{ + { + File: "build-interpolated-name.json", + InterpolatedName: "mybuild-RandomToken", + Expected: "test.mybuild-RandomToken", + Vars: map[string]string{ + "build_name": "mybuild-RandomToken", + }, + }, + { + File: "build-interpolated-name.json", + InterpolatedName: "build-vardata", + Expected: "test.build-vardata", + Vars: map[string]string{ + "build_name": "build-vardata", + }, + }, + { + File: "build-interpolated-name.json", + InterpolatedName: "build-12345", + Expected: "test.build-12345", + Vars: map[string]string{ + "something": "build-12345", + "build_name": "{{user `something`}}", + }, + }, + { + // When no name attribute is provided in the config the builder type is the default name. + File: "build-basic.json", + InterpolatedName: "test", + Expected: "test", + }, + } + + for _, tc := range cases { + config.Variables = tc.Vars + testCoreTemplate(t, config, fixtureDir(tc.File)) + core := TestCore(t, config) + diags := core.Initialize(InitializeOptions{}) + if diags.HasErrors() { + t.Fatalf("err: %s\n\n%s", tc.File, diags) + } + + build, err := core.Build(tc.InterpolatedName) + if err != nil { + t.Fatalf("err for InterpolatedName(%q): %s", tc.InterpolatedName, err) + } + + if build.Name() != tc.Expected { + t.Errorf("build type interpolation failed; expected %q, got %q", tc.Expected, build.Name()) + } + + } +} diff --git a/packer/fixconfigmode_enumer.go b/packer/fixconfigmode_enumer.go index 82b09a63399..715fa73f558 100644 --- a/packer/fixconfigmode_enumer.go +++ b/packer/fixconfigmode_enumer.go @@ -1,6 +1,5 @@ // Code generated by "enumer -type FixConfigMode"; DO NOT EDIT. -// package packer import ( diff --git a/packer/maps.go b/packer/maps.go index 41727279d5a..1d99802dfef 100644 --- a/packer/maps.go +++ b/packer/maps.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/packer_test.go b/packer/packer_test.go index ec536e2c3b8..2f52c5e76d2 100644 --- a/packer/packer_test.go +++ b/packer/packer_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/plugin-getter/checksum.go b/packer/plugin-getter/checksum.go index 9d1fcdfbce1..d7193ba3b7f 100644 --- a/packer/plugin-getter/checksum.go +++ b/packer/plugin-getter/checksum.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package plugingetter import ( diff --git a/packer/plugin-getter/docs.go b/packer/plugin-getter/docs.go index 59f8145c873..216a7781d2f 100644 --- a/packer/plugin-getter/docs.go +++ b/packer/plugin-getter/docs.go @@ -1,2 +1,5 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package plugingetter defines means to download and install plugins. package plugingetter diff --git a/packer/plugin-getter/github/docs.go b/packer/plugin-getter/github/docs.go index 868b074ebd4..50fa13e30ae 100644 --- a/packer/plugin-getter/github/docs.go +++ b/packer/plugin-getter/github/docs.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Package github defines a Github getter. package github diff --git a/packer/plugin-getter/github/getter.go b/packer/plugin-getter/github/getter.go index 229ece1b0b3..e4cd4f603b2 100644 --- a/packer/plugin-getter/github/getter.go +++ b/packer/plugin-getter/github/getter.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package github import ( @@ -8,14 +11,15 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net/http" "os" + "path" "path/filepath" "strings" "github.com/google/go-github/v33/github" + "github.com/hashicorp/packer/hcl2template/addrs" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" "golang.org/x/oauth2" ) @@ -68,7 +72,7 @@ func transformChecksumStream() func(in io.ReadCloser) (io.ReadCloser, error) { } } _, _ = buffer.WriteString("]") - return ioutil.NopCloser(buffer), nil + return io.NopCloser(buffer), nil } } @@ -100,7 +104,7 @@ func transformVersionStream(in io.ReadCloser) (io.ReadCloser, error) { return nil, err } - return ioutil.NopCloser(buf), nil + return io.NopCloser(buf), nil } // HostSpecificTokenAuthTransport makes sure the http roundtripper only sets an @@ -154,10 +158,40 @@ func (t *HostSpecificTokenAuthTransport) base() http.RoundTripper { return http.DefaultTransport } +type GithubPlugin struct { + Hostname string + Namespace string + Type string +} + +func NewGithubPlugin(source *addrs.Plugin) (*GithubPlugin, error) { + parts := source.Parts() + if len(parts) != 3 { + return nil, fmt.Errorf("Invalid github.com URI %q: a Github-compatible source must be in the github.com// format.", source.String()) + } + + if parts[0] != defaultHostname { + return nil, fmt.Errorf("%q doesn't appear to be a valid %q source address; check source and try again.", source.String(), defaultHostname) + } + + return &GithubPlugin{ + Hostname: parts[0], + Namespace: parts[1], + Type: strings.Replace(parts[2], "packer-plugin-", "", 1), + }, nil +} + +func (gp GithubPlugin) RealRelativePath() string { + return path.Join( + gp.Namespace, + fmt.Sprintf("packer-plugin-%s", gp.Type), + ) +} + func (g *Getter) Get(what string, opts plugingetter.GetOptions) (io.ReadCloser, error) { - if opts.PluginRequirement.Identifier.Hostname != defaultHostname { - s := opts.PluginRequirement.Identifier.String() + " doesn't appear to be a valid " + defaultHostname + " source address; check source and try again." - return nil, errors.New(s) + ghURI, err := NewGithubPlugin(opts.PluginRequirement.Identifier) + if err != nil { + return nil, err } ctx := context.TODO() @@ -186,19 +220,18 @@ func (g *Getter) Get(what string, opts plugingetter.GetOptions) (io.ReadCloser, } var req *http.Request - var err error transform := func(in io.ReadCloser) (io.ReadCloser, error) { return in, nil } switch what { case "releases": - u := filepath.ToSlash("/repos/" + opts.PluginRequirement.Identifier.RealRelativePath() + "/git/matching-refs/tags") + u := filepath.ToSlash("/repos/" + ghURI.RealRelativePath() + "/git/matching-refs/tags") req, err = g.Client.NewRequest("GET", u, nil) transform = transformVersionStream case "sha256": // something like https://github.com/sylviamoss/packer-plugin-comment/releases/download/v0.2.11/packer-plugin-comment_v0.2.11_x5_SHA256SUMS - u := filepath.ToSlash("https://github.com/" + opts.PluginRequirement.Identifier.RealRelativePath() + "/releases/download/" + opts.Version() + "/" + opts.PluginRequirement.FilenamePrefix() + opts.Version() + "_SHA256SUMS") + u := filepath.ToSlash("https://github.com/" + ghURI.RealRelativePath() + "/releases/download/" + opts.Version() + "/" + opts.PluginRequirement.FilenamePrefix() + opts.Version() + "_SHA256SUMS") req, err = g.Client.NewRequest( "GET", u, @@ -206,7 +239,7 @@ func (g *Getter) Get(what string, opts plugingetter.GetOptions) (io.ReadCloser, ) transform = transformChecksumStream() case "zip": - u := filepath.ToSlash("https://github.com/" + opts.PluginRequirement.Identifier.RealRelativePath() + "/releases/download/" + opts.Version() + "/" + opts.ExpectedZipFilename()) + u := filepath.ToSlash("https://github.com/" + ghURI.RealRelativePath() + "/releases/download/" + opts.Version() + "/" + opts.ExpectedZipFilename()) req, err = g.Client.NewRequest( "GET", u, diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index a94823692e3..1cd10a230ea 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package plugingetter import ( @@ -6,10 +9,13 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" + "io/fs" "log" "os" + "os/exec" + "path" "path/filepath" + "regexp" "sort" "strconv" "strings" @@ -17,8 +23,10 @@ import ( "github.com/hashicorp/go-multierror" "github.com/hashicorp/go-version" + pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer-plugin-sdk/tmp" "github.com/hashicorp/packer/hcl2template/addrs" + "golang.org/x/mod/semver" ) type Requirements []*Requirement @@ -40,13 +48,13 @@ type Requirement struct { // VersionConstraints as defined by user. Empty ( to be avoided ) means // highest found version. VersionConstraints version.Constraints - - // was this require implicitly guessed ? - Implicit bool } type BinaryInstallationOptions struct { + // The API version with which to check remote compatibility // + // They're generally extracted from the SDK since it's what Packer Core + // supports as far as the protocol goes APIVersionMajor, APIVersionMinor string // OS and ARCH usually should be runtime.GOOS and runtime.ARCH, they allow // to pick the correct binary. @@ -56,12 +64,15 @@ type BinaryInstallationOptions struct { Ext string Checksummers []Checksummer + + // ReleasesOnly may be set by commands like validate or build, and + // forces Packer to not consider plugin pre-releases. + ReleasesOnly bool } type ListInstallationsOptions struct { - // FromFolders where plugins could be installed. Paths should be absolute for - // safety but can also be relative. - FromFolders []string + // The directory in which to look for when installing plugins + PluginDirectory string BinaryInstallationOptions } @@ -86,13 +97,66 @@ func (pr Requirement) FilenamePrefix() string { if pr.Identifier == nil { return "packer-plugin-" } - return "packer-plugin-" + pr.Identifier.Type + "_" + + return "packer-plugin-" + pr.Identifier.Name() + "_" } func (opts BinaryInstallationOptions) FilenameSuffix() string { return "_" + opts.OS + "_" + opts.ARCH + opts.Ext } +// getPluginBinaries lists the plugin binaries installed locally. +// +// Each plugin binary must be in the right hierarchy (not root) and has to be +// conforming to the packer-plugin-____ convention. +func (pr Requirement) getPluginBinaries(opts ListInstallationsOptions) ([]string, error) { + var matches []string + + rootdir := opts.PluginDirectory + if pr.Identifier != nil { + rootdir = filepath.Join(rootdir, path.Dir(pr.Identifier.Source)) + } + + if _, err := os.Lstat(rootdir); err != nil { + log.Printf("Directory %q does not exist, the plugin likely isn't installed locally yet.", rootdir) + return matches, nil + } + + err := filepath.WalkDir(rootdir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + + // No need to inspect directory entries, we can continue walking + if d.IsDir() { + return nil + } + + // Skip plugins installed at root, only those in a hierarchy should be considered valid + if filepath.Dir(path) == opts.PluginDirectory { + return nil + } + + // If the binary's name doesn't start with packer-plugin-, we skip it. + if !strings.HasPrefix(filepath.Base(path), pr.FilenamePrefix()) { + return nil + } + // If the binary's name doesn't match the expected convention, we skip it + if !strings.HasSuffix(filepath.Base(path), opts.FilenameSuffix()) { + return nil + } + + matches = append(matches, path) + + return nil + }) + if err != nil { + return nil, err + } + + return matches, err +} + // ListInstallations lists unique installed versions of plugin Requirement pr // with opts as a filter. // @@ -103,87 +167,136 @@ func (opts BinaryInstallationOptions) FilenameSuffix() string { // considered. func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallList, error) { res := InstallList{} - FilenamePrefix := pr.FilenamePrefix() - filenameSuffix := opts.FilenameSuffix() log.Printf("[TRACE] listing potential installations for %q that match %q. %#v", pr.Identifier, pr.VersionConstraints, opts) - for _, knownFolder := range opts.FromFolders { - glob := "" - if pr.Identifier == nil { - glob = filepath.Join(knownFolder, "*", "*", "*", FilenamePrefix+"*"+filenameSuffix) - } else { - glob = filepath.Join(knownFolder, pr.Identifier.Hostname, pr.Identifier.Namespace, pr.Identifier.Type, FilenamePrefix+"*"+filenameSuffix) - } - matches, err := filepath.Glob(glob) - if err != nil { - return nil, fmt.Errorf("ListInstallations: %q failed to list binaries in folder: %v", pr.Identifier.String(), err) - } - for _, path := range matches { - fname := filepath.Base(path) - if fname == "." { - continue - } + matches, err := pr.getPluginBinaries(opts) + if err != nil { + return nil, fmt.Errorf("ListInstallations: failed to list installed plugins: %s", err) + } - // base name could look like packer-plugin-amazon_v1.2.3_x5.1_darwin_amd64.exe - versionsStr := strings.TrimPrefix(fname, FilenamePrefix) - versionsStr = strings.TrimSuffix(versionsStr, filenameSuffix) + for _, path := range matches { + fname := filepath.Base(path) + if fname == "." { + continue + } - if pr.Identifier == nil { - if idx := strings.Index(versionsStr, "_"); idx > 0 { - versionsStr = versionsStr[idx+1:] - } - } + checksumOk := false + for _, checksummer := range opts.Checksummers { - // versionsStr now looks like v1.2.3_x5.1 or amazon_v1.2.3_x5.1 - parts := strings.SplitN(versionsStr, "_", 2) - pluginVersionStr, protocolVerionStr := parts[0], parts[1] - pv, err := version.NewVersion(pluginVersionStr) + cs, err := checksummer.GetCacheChecksumOfFile(path) if err != nil { - // could not be parsed, ignoring the file - log.Printf("found %q with an incorrect %q version, ignoring it. %v", path, pluginVersionStr, err) + log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", path, err) continue } - // no constraint means always pass, this will happen for implicit - // plugin requirements and when we list all plugins. - if !pr.VersionConstraints.Check(pv) { - log.Printf("[TRACE] version %q of file %q does not match constraint %q", pluginVersionStr, path, pr.VersionConstraints.String()) + if err := checksummer.ChecksumFile(cs, path); err != nil { + log.Printf("[TRACE] ChecksumFile(%q) failed: %v", path, err) continue } + checksumOk = true + break + } + if !checksumOk { + log.Printf("[TRACE] No checksum found for %q ignoring possibly unsafe binary", path) + continue + } - if err := opts.CheckProtocolVersion(protocolVerionStr); err != nil { - log.Printf("[NOTICE] binary %s requires protocol version %s that is incompatible "+ - "with this version of Packer. %s", path, protocolVerionStr, err) - continue + // base name could look like packer-plugin-amazon_v1.2.3_x5.1_darwin_amd64.exe + versionsStr := strings.TrimPrefix(fname, pr.FilenamePrefix()) + versionsStr = strings.TrimSuffix(versionsStr, opts.FilenameSuffix()) + + if pr.Identifier == nil { + if idx := strings.Index(versionsStr, "_"); idx > 0 { + versionsStr = versionsStr[idx+1:] } + } - checksumOk := false - for _, checksummer := range opts.Checksummers { + descOut, err := exec.Command(path, "describe").Output() + if err != nil { + log.Printf("couldn't call describe on %q, ignoring", path) + continue + } - cs, err := checksummer.GetCacheChecksumOfFile(path) - if err != nil { - log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", path, err) - continue - } + var describeInfo pluginsdk.SetDescription + err = json.Unmarshal(descOut, &describeInfo) + if err != nil { + log.Printf("%q: describe output deserialization error %q, ignoring", path, err) + } - if err := checksummer.ChecksumFile(cs, path); err != nil { - log.Printf("[TRACE] ChecksumFile(%q) failed: %v", path, err) - continue - } - checksumOk = true - break - } - if !checksumOk { - log.Printf("[TRACE] No checksum found for %q ignoring possibly unsafe binary", path) - continue - } + // versionsStr now looks like v1.2.3_x5.1 or amazon_v1.2.3_x5.1 + parts := strings.SplitN(versionsStr, "_", 2) + pluginVersionStr, protocolVersionStr := parts[0], parts[1] + ver, err := version.NewVersion(pluginVersionStr) + if err != nil { + // could not be parsed, ignoring the file + log.Printf("found %q with an incorrect %q version, ignoring it. %v", path, pluginVersionStr, err) + continue + } + + if fmt.Sprintf("v%s", ver.String()) != pluginVersionStr { + log.Printf("version %q in path is non canonical, this could introduce ambiguity and is not supported, ignoring it.", pluginVersionStr) + continue + } - res.InsertSortedUniq(&Installation{ - BinaryPath: path, - Version: pluginVersionStr, - }) + if ver.Prerelease() != "" && opts.ReleasesOnly { + log.Printf("ignoring pre-release plugin %q", path) + continue } + + rawVersion, err := version.NewVersion(pluginVersionStr) + if err != nil { + log.Printf("malformed version string in filename %q: %s, ignoring", pluginVersionStr, err) + continue + } + + descVersion, err := version.NewVersion(describeInfo.Version) + if err != nil { + log.Printf("malformed reported version string %q: %s, ignoring", describeInfo.Version, err) + continue + } + + if rawVersion.Compare(descVersion) != 0 { + log.Printf("plugin %q reported version %q while its name implies version %q, ignoring", path, describeInfo.Version, pluginVersionStr) + continue + } + + preRel := descVersion.Prerelease() + if preRel != "" && preRel != "dev" { + log.Printf("invalid plugin pre-release version %q, only development or release binaries are accepted", pluginVersionStr) + } + + // Check the API version matches between path and describe + if describeInfo.APIVersion != protocolVersionStr { + log.Printf("plugin %q reported API version %q while its name implies version %q, ignoring", path, describeInfo.APIVersion, protocolVersionStr) + continue + } + + // no constraint means always pass, this will happen for implicit + // plugin requirements and when we list all plugins. + // + // Note: we use the raw version name here, without the pre-release + // suffix, as otherwise constraints reject them, which is not + // what we want by default. + if !pr.VersionConstraints.Check(rawVersion.Core()) { + log.Printf("[TRACE] version %q of file %q does not match constraint %q", pluginVersionStr, path, pr.VersionConstraints.String()) + continue + } + + if err := opts.CheckProtocolVersion(protocolVersionStr); err != nil { + log.Printf("[NOTICE] binary %s requires protocol version %s that is incompatible "+ + "with this version of Packer. %s", path, protocolVersionStr, err) + continue + } + + res = append(res, &Installation{ + BinaryPath: path, + Version: pluginVersionStr, + APIVersion: describeInfo.APIVersion, + }) } + + sort.Sort(res) + return res, nil } @@ -207,32 +320,81 @@ func (l InstallList) String() string { return v.String() } -// InsertSortedUniq inserts the installation in the right spot in the list by -// comparing the version lexicographically. -// A Duplicate version will replace any already present version. -func (l *InstallList) InsertSortedUniq(install *Installation) { - pos := sort.Search(len(*l), func(i int) bool { return (*l)[i].Version >= install.Version }) - if len(*l) > pos && (*l)[pos].Version == install.Version { - // already detected, let's ignore any new foundings, this way any plugin - // close to cwd or the packer exec takes precedence; this will be better - // for plugin development/tests. - return +// Len is the number of elements in the collection. +func (l InstallList) Len() int { + return len(l) +} + +var rawPluginName = regexp.MustCompile("packer-plugin-[^_]+") + +// Less reports whether the element with index i +// must sort before the element with index j. +// +// If both Less(i, j) and Less(j, i) are false, +// then the elements at index i and j are considered equal. +// Sort may place equal elements in any order in the final result, +// while Stable preserves the original input order of equal elements. +// +// Less must describe a transitive ordering: +// - if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well. +// - if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well. +// +// Note that floating-point comparison (the < operator on float32 or float64 values) +// is not a transitive ordering when not-a-number (NaN) values are involved. +// See Float64Slice.Less for a correct implementation for floating-point values. +func (l InstallList) Less(i, j int) bool { + lowPluginPath := l[i] + hiPluginPath := l[j] + + lowRawPluginName := rawPluginName.FindString(path.Base(lowPluginPath.BinaryPath)) + hiRawPluginName := rawPluginName.FindString(path.Base(hiPluginPath.BinaryPath)) + + // We group by path, then by descending order for the versions + // + // i.e. if the path are not the same, we can return the plain + // lexicographic order, otherwise, we'll do a semver-conscious + // version comparison for sorting. + if lowRawPluginName != hiRawPluginName { + return lowRawPluginName < hiRawPluginName + } + + verCmp := semver.Compare(lowPluginPath.Version, hiPluginPath.Version) + if verCmp != 0 { + return verCmp < 0 } - (*l) = append((*l), nil) - copy((*l)[pos+1:], (*l)[pos:]) - (*l)[pos] = install + + // Ignore errors here, they are already validated when populating the InstallList + loAPIVer, _ := NewAPIVersion(lowPluginPath.APIVersion) + hiAPIVer, _ := NewAPIVersion(hiPluginPath.APIVersion) + + if loAPIVer.Major != hiAPIVer.Major { + return loAPIVer.Major < hiAPIVer.Major + } + + return loAPIVer.Minor < hiAPIVer.Minor +} + +// Swap swaps the elements with indexes i and j. +func (l InstallList) Swap(i, j int) { + tmp := l[i] + l[i] = l[j] + l[j] = tmp } // Installation describes a plugin installation type Installation struct { - // path to where binary is installed, if installed. - // Ex: /usr/azr/.packer.d/plugins/github.com/hashicorp/packer-plugin-amazon/packer-plugin-amazon_v1.2.3_darwin_amd64 + // Path to where binary is installed. + // Ex: /usr/azr/.packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.3_darwin_amd64 BinaryPath string - // Version of this plugin, if installed and versionned. Ex: + // Version of this plugin. Ex: // * v1.2.3 for packer-plugin-amazon_v1.2.3_darwin_x5 - // * empty for packer-plugin-amazon Version string + + // API version for the plugin. Ex: + // * 5.0 for packer-plugin-amazon_v1.2.3_darwin_x5.0 + // * 5.1 for packer-plugin-amazon_v1.2.3_darwin_x5.1 + APIVersion string } // InstallOptions describes the possible options for installing the plugin that @@ -241,9 +403,11 @@ type InstallOptions struct { // Different means to get releases, sha256 and binary files. Getters []Getter - // Any downloaded binary and checksum file will be put in the last possible - // folder of this list. - InFolders []string + // The directory in which the plugins should be installed + PluginDirectory string + + // Forces installation of the plugin, even if already installed. + Force bool BinaryInstallationOptions } @@ -264,41 +428,70 @@ func (gp *GetOptions) ExpectedZipFilename() string { return gp.expectedZipFilename } -func (binOpts *BinaryInstallationOptions) CheckProtocolVersion(remoteProt string) error { - remoteProt = strings.TrimPrefix(remoteProt, "x") - parts := strings.Split(remoteProt, ".") +type APIVersion struct { + Major int + Minor int +} + +func NewAPIVersion(apiVersion string) (APIVersion, error) { + ver := APIVersion{} + + apiVersion = strings.TrimPrefix(strings.TrimSpace(apiVersion), "x") + parts := strings.Split(apiVersion, ".") if len(parts) < 2 { - return fmt.Errorf("Invalid remote protocol: %q, expected something like '%s.%s'", remoteProt, binOpts.APIVersionMajor, binOpts.APIVersionMinor) + return ver, fmt.Errorf( + "Invalid remote protocol: %q, expected something like '%s.%s'", + apiVersion, pluginsdk.APIVersionMajor, pluginsdk.APIVersionMinor, + ) + } + + vMajor, err := strconv.Atoi(parts[0]) + if err != nil { + return ver, err + } + ver.Major = vMajor + + vMinor, err := strconv.Atoi(parts[1]) + if err != nil { + return ver, err } - vMajor, vMinor := parts[0], parts[1] + ver.Minor = vMinor + + return ver, nil +} +var localAPIVersion APIVersion + +func (binOpts *BinaryInstallationOptions) CheckProtocolVersion(remoteProt string) error { // no protocol version check if binOpts.APIVersionMajor == "" && binOpts.APIVersionMinor == "" { return nil } - if vMajor != binOpts.APIVersionMajor { - return fmt.Errorf("Unsupported remote protocol MAJOR version %q. The current MAJOR protocol version is %q."+ - " This version of Packer can only communicate with plugins using that version.", vMajor, binOpts.APIVersionMajor) - } + localVersion := localAPIVersion + if binOpts.APIVersionMajor != pluginsdk.APIVersionMajor || + binOpts.APIVersionMinor != pluginsdk.APIVersionMinor { + var err error - if vMinor == binOpts.APIVersionMinor { - return nil + localVersion, err = NewAPIVersion(fmt.Sprintf("x%s.%s", binOpts.APIVersionMajor, binOpts.APIVersionMinor)) + if err != nil { + return fmt.Errorf("Failed to parse API Version from constraints: %s", err) + } } - vMinori, err := strconv.Atoi(vMinor) + remoteVersion, err := NewAPIVersion(remoteProt) if err != nil { return err } - APIVersoinMinori, err := strconv.Atoi(binOpts.APIVersionMinor) - if err != nil { - return err + if localVersion.Major != remoteVersion.Major { + return fmt.Errorf("Unsupported remote protocol MAJOR version %d. The current MAJOR protocol version is %d."+ + " This version of Packer can only communicate with plugins using that version.", remoteVersion.Major, localVersion.Major) } - if vMinori > APIVersoinMinori { - return fmt.Errorf("Unsupported remote protocol MINOR version %q. The supported MINOR protocol versions are version %q and bellow."+ - "Please upgrade Packer or use an older version of the plugin if possible.", vMinor, binOpts.APIVersionMinor) + if remoteVersion.Minor > localVersion.Minor { + return fmt.Errorf("Unsupported remote protocol MINOR version %d. The supported MINOR protocol versions are version %d and below. "+ + "Please upgrade Packer or use an older version of the plugin if possible.", remoteVersion.Minor, localVersion.Minor) } return nil @@ -383,8 +576,8 @@ func (e ChecksumFileEntry) Os() string { return e.os } func (e ChecksumFileEntry) Arch() string { return e.arch } // a file inside will look like so: -// packer-plugin-comment_v0.2.12_x5.0_freebsd_amd64.zip // +// packer-plugin-comment_v0.2.12_x5.0_freebsd_amd64.zip func (e *ChecksumFileEntry) init(req *Requirement) (err error) { filename := e.Filename res := strings.TrimPrefix(filename, req.FilenamePrefix()) @@ -495,7 +688,7 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) outputFolder := filepath.Join( // Pick last folder as it's the one with the highest priority - opts.InFolders[len(opts.InFolders)-1], + opts.PluginDirectory, // add expected full path filepath.Join(pr.Identifier.Parts()...), ) @@ -563,36 +756,33 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) expectedZipFilename := checksum.Filename expectedBinaryFilename := strings.TrimSuffix(expectedZipFilename, filepath.Ext(expectedZipFilename)) + opts.BinaryInstallationOptions.Ext - for _, outputFolder := range opts.InFolders { - potentialOutputFilename := filepath.Join( - outputFolder, - filepath.Join(pr.Identifier.Parts()...), - expectedBinaryFilename, - ) - for _, potentialChecksumer := range opts.Checksummers { - // First check if a local checksum file is already here in the expected - // download folder. Here we want to download a binary so we only check - // for an existing checksum file from the folder we want to download - // into. - cs, err := potentialChecksumer.GetCacheChecksumOfFile(potentialOutputFilename) - if err == nil && len(cs) > 0 { - localChecksum := &FileChecksum{ - Expected: cs, - Checksummer: potentialChecksumer, - } - - log.Printf("[TRACE] found a pre-exising %q checksum file", potentialChecksumer.Type) - // if outputFile is there and matches the checksum: do nothing more. - if err := localChecksum.ChecksumFile(localChecksum.Expected, potentialOutputFilename); err == nil { - log.Printf("[INFO] %s v%s plugin is already correctly installed in %q", pr.Identifier, version, potentialOutputFilename) - return nil, nil // success - } + outputFileName := filepath.Join( + outputFolder, + expectedBinaryFilename, + ) + for _, potentialChecksumer := range opts.Checksummers { + // First check if a local checksum file is already here in the expected + // download folder. Here we want to download a binary so we only check + // for an existing checksum file from the folder we want to download + // into. + cs, err := potentialChecksumer.GetCacheChecksumOfFile(outputFileName) + if err == nil && len(cs) > 0 { + localChecksum := &FileChecksum{ + Expected: cs, + Checksummer: potentialChecksumer, + } + + log.Printf("[TRACE] found a pre-exising %q checksum file", potentialChecksumer.Type) + // if outputFile is there and matches the checksum: do nothing more. + if err := localChecksum.ChecksumFile(localChecksum.Expected, outputFileName); err == nil && !opts.Force { + log.Printf("[INFO] %s v%s plugin is already correctly installed in %q", pr.Identifier, version, outputFileName) + return nil, nil // success } } } // The last folder from the installation list is where we will install. - outputFileName := filepath.Join(outputFolder, expectedBinaryFilename) + outputFileName = filepath.Join(outputFolder, expectedBinaryFilename) // create directories if need be if err := os.MkdirAll(outputFolder, 0755); err != nil { @@ -714,7 +904,7 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) log.Printf("[WARNING] %v, ignoring", err) } - if err := ioutil.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0555); err != nil { + if err := os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0644); err != nil { err := fmt.Errorf("failed to write local binary checksum file: %s", err) errs = multierror.Append(errs, err) log.Printf("[WARNING] %v, ignoring", err) @@ -742,3 +932,12 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) return nil, errs } + +func init() { + var err error + // Should never error if both components are set + localAPIVersion, err = NewAPIVersion(fmt.Sprintf("x%s.%s", pluginsdk.APIVersionMajor, pluginsdk.APIVersionMinor)) + if err != nil { + panic("malformed API version in Packer. This is a programming error, please open an error to report it.") + } +} diff --git a/packer/plugin-getter/plugins_test.go b/packer/plugin-getter/plugins_test.go index 1e2c5dfde43..32e82ef191d 100644 --- a/packer/plugin-getter/plugins_test.go +++ b/packer/plugin-getter/plugins_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package plugingetter import ( @@ -7,7 +10,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -16,7 +18,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template/addrs" ) @@ -32,9 +33,7 @@ func TestChecksumFileEntry_init(t *testing.T) { expectedVersion := "v0.3.0" req := &Requirement{ Identifier: &addrs.Plugin{ - Hostname: "github.com", - Namespace: "ddelnano", - Type: "xenserver", + Source: "github.com/ddelnano/xenserver", }, } @@ -54,259 +53,6 @@ func TestChecksumFileEntry_init(t *testing.T) { } } -func TestPlugin_ListInstallations(t *testing.T) { - - type fields struct { - Identifier string - VersionConstraints version.Constraints - } - tests := []struct { - name string - fields fields - opts ListInstallationsOptions - wantErr bool - want InstallList - }{ - - { - "windows_all_plugins", - fields{ - // empty - }, - ListInstallationsOptions{ - []string{ - pluginFolderOne, - pluginFolderTwo, - }, - BinaryInstallationOptions{ - OS: "windows", ARCH: "amd64", - Ext: ".exe", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v1.2.3", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_windows_amd64.exe"), - }, - { - Version: "v1.2.4", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_windows_amd64.exe"), - }, - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_windows_amd64.exe"), - }, - { - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), - Version: "v4.5.6", - }, - { - Version: "v4.5.7", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.7_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.8", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.9", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), - }, - }, - }, - - { - "darwin_amazon_prot_5.0", - fields{ - Identifier: "github.com/hashicorp/amazon", - }, - ListInstallationsOptions{ - []string{ - pluginFolderOne, - pluginFolderTwo, - }, - BinaryInstallationOptions{ - APIVersionMajor: "5", APIVersionMinor: "0", - OS: "darwin", ARCH: "amd64", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v1.2.3", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_darwin_amd64"), - }, - { - Version: "v1.2.4", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_darwin_amd64"), - }, - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_darwin_amd64"), - }, - }, - }, - { - "darwin_amazon_prot_5.1", - fields{ - Identifier: "github.com/hashicorp/amazon", - }, - ListInstallationsOptions{ - []string{ - pluginFolderOne, - pluginFolderTwo, - }, - BinaryInstallationOptions{ - APIVersionMajor: "5", APIVersionMinor: "1", - OS: "darwin", ARCH: "amd64", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v1.2.3", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_darwin_amd64"), - }, - { - Version: "v1.2.4", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_darwin_amd64"), - }, - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_darwin_amd64"), - }, - { - Version: "v1.2.6", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.6_x5.1_darwin_amd64"), - }, - }, - }, - { - "windows_amazon", - fields{ - Identifier: "github.com/hashicorp/amazon", - }, - ListInstallationsOptions{ - []string{ - pluginFolderOne, - pluginFolderTwo, - }, - BinaryInstallationOptions{ - APIVersionMajor: "5", APIVersionMinor: "0", - OS: "windows", ARCH: "amd64", - Ext: ".exe", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v1.2.3", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_windows_amd64.exe"), - }, - { - Version: "v1.2.4", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_windows_amd64.exe"), - }, - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_windows_amd64.exe"), - }, - }, - }, - { - "windows_google_multifolder", - fields{ - Identifier: "github.com/hashicorp/google", - }, - ListInstallationsOptions{ - []string{ - pluginFolderOne, - pluginFolderTwo, - }, - BinaryInstallationOptions{ - APIVersionMajor: "5", APIVersionMinor: "0", - OS: "windows", ARCH: "amd64", - Ext: ".exe", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v4.5.6", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.7", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.7_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.8", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.9", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), - }, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var identifier *addrs.Plugin - if tt.fields.Identifier != "" { - var diags hcl.Diagnostics - identifier, diags = addrs.ParsePluginSourceString(tt.fields.Identifier) - if diags.HasErrors() { - t.Fatalf("%v", diags) - } - } - p := Requirement{ - Identifier: identifier, - VersionConstraints: tt.fields.VersionConstraints, - } - got, err := p.ListInstallations(tt.opts) - if (err != nil) != tt.wantErr { - t.Errorf("Plugin.ListInstallations() error = %v, wantErr %v", err, tt.wantErr) - return - } - if diff := cmp.Diff(tt.want, got); diff != "" { - t.Errorf("Plugin.ListInstallations() unexpected output: %s", diff) - } - }) - } -} - func TestRequirement_InstallLatest(t *testing.T) { type fields struct { Identifier string @@ -342,11 +88,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderOne, + false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "0", OS: "darwin", ARCH: "amd64", @@ -378,11 +121,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderOne, + false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -423,11 +163,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderOne, + false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "0", OS: "darwin", ARCH: "amd64", @@ -470,11 +207,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderTwo, + false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -520,11 +254,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderTwo, + false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -570,11 +301,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderTwo, + false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "linux", ARCH: "amd64", @@ -614,11 +342,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - pluginFolderOne, - pluginFolderTwo, - }, + pluginFolderTwo, + false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -657,9 +382,8 @@ func TestRequirement_InstallLatest(t *testing.T) { }, }, }, - []string{ - pluginFolderWrongChecksums, - }, + pluginFolderTwo, + false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -732,9 +456,10 @@ func (g *mockPluginGetter) Get(what string, options GetOptions) (io.ReadCloser, } toEncode = enc case "zip": - acc := options.PluginRequirement.Identifier.Hostname + "/" + - options.PluginRequirement.Identifier.RealRelativePath() + "/" + - options.ExpectedZipFilename() + // Note: we'll act as if the plugin sources would always be github sources for now. + // This test will need to be updated if/when we move on to support other sources. + parts := options.PluginRequirement.Identifier.Parts() + acc := fmt.Sprintf("%s/%s/packer-plugin-%s/%s", parts[0], parts[1], parts[2], options.ExpectedZipFilename()) zip, found := g.Zips[acc] if found == false { @@ -751,7 +476,7 @@ func (g *mockPluginGetter) Get(what string, options GetOptions) (io.ReadCloser, panic(err) } }() - return ioutil.NopCloser(read), nil + return io.NopCloser(read), nil } func zipFile(content map[string]string) io.ReadCloser { @@ -775,7 +500,239 @@ func zipFile(content map[string]string) io.ReadCloser { if err != nil { panic(err) } - return ioutil.NopCloser(buff) + return io.NopCloser(buff) } var _ Getter = &mockPluginGetter{} + +func Test_LessInstallList(t *testing.T) { + tests := []struct { + name string + installs InstallList + expectLess bool + }{ + { + "v1.2.1 < v1.2.2 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.1", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2", + APIVersion: "x5.0", + }, + }, + true, + }, + { + // Impractical with the changes to the loading model + "v1.2.1 = v1.2.1 => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.1", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.1", + APIVersion: "x5.0", + }, + }, + false, + }, + { + "v1.2.2 < v1.2.1 => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.1", + APIVersion: "x5.0", + }, + }, + false, + }, + { + "v1.2.2-dev < v1.2.2 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2-dev", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2", + APIVersion: "x5.0", + }, + }, + true, + }, + { + "v1.2.2 < v1.2.2-dev => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2-dev", + APIVersion: "x5.0", + }, + }, + false, + }, + { + "v1.2.1 < v1.2.2-dev => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.1", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2-dev", + APIVersion: "x5.0", + }, + }, + true, + }, + { + "v1.2.3 < v1.2.2-dev => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.2-dev", + APIVersion: "x5.0", + }, + }, + false, + }, + { + "v1.2.3_x5.0 < v1.2.3_x5.1 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.1", + }, + }, + true, + }, + { + "v1.2.3_x5.0 < v1.2.3_x5.0 => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + }, + false, + }, + { + "v1.2.3_x4.15 < v1.2.3_x5.0 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x4.15", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + }, + true, + }, + { + "v1.2.3_x9.0 < v1.2.3_x10.0 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x9.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x10.0", + }, + }, + true, + }, + { + "v1.2.3_x5.9 < v1.2.3_x5.10 => true", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.9", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.10", + }, + }, + true, + }, + { + "v1.2.3_x5.0 < v1.2.3_x4.15 => false", + InstallList{ + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x5.0", + }, + &Installation{ + BinaryPath: "host/org/plugin", + Version: "v1.2.3", + APIVersion: "x4.15", + }, + }, + false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + isLess := tt.installs.Less(0, 1) + if isLess != tt.expectLess { + t.Errorf("Less mismatch for %s_%s < %s_%s, expected %t, got %t", + tt.installs[0].Version, + tt.installs[0].APIVersion, + tt.installs[1].Version, + tt.installs[1].APIVersion, + tt.expectLess, isLess) + } + }) + } +} diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 new file mode 100644 index 00000000000..7813681f5b4 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM new file mode 100644 index 00000000000..2ef9d7d4c35 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM @@ -0,0 +1 @@ +ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 new file mode 100644 index 00000000000..7813681f5b4 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM new file mode 100644 index 00000000000..2ef9d7d4c35 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM @@ -0,0 +1 @@ +ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/packer/plugin.go b/packer/plugin.go index f69803a7054..8ad1ed33e62 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -7,50 +10,37 @@ import ( "log" "os" "os/exec" + "path" "path/filepath" + "regexp" "runtime" - "sort" "strings" + "sync" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/pathing" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" ) // PluginConfig helps load and use packer plugins type PluginConfig struct { - KnownPluginFolders []string - PluginMinPort int - PluginMaxPort int - Builders BuilderSet - Provisioners ProvisionerSet - PostProcessors PostProcessorSet - DataSources DatasourceSet - - // Redirects are only set when a plugin was completely moved out; they allow - // telling where a plugin has moved by checking if a known component of this - // plugin is used. For example implicitly require the - // github.com/hashicorp/amazon plugin if it was moved out and the - // "amazon-ebs" plugin is used, but not found. - // - // Redirects will be bypassed if the redirected components are already found - // in their corresponding sets (Builders, Provisioners, PostProcessors, - // DataSources). That is, for example, if you manually put a single - // component plugin in the plugins folder. - // - // Example BuilderRedirects: "amazon-ebs" => "github.com/hashicorp/amazon" - BuilderRedirects map[string]string - DatasourceRedirects map[string]string - ProvisionerRedirects map[string]string - PostProcessorRedirects map[string]string + PluginDirectory string + PluginMinPort int + PluginMaxPort int + Builders BuilderSet + Provisioners ProvisionerSet + PostProcessors PostProcessorSet + DataSources DatasourceSet + ReleasesOnly bool } // PACKERSPACE is used to represent the spaces that separate args for a command // without being confused with spaces in the path to the command itself. const PACKERSPACE = "-PACKERSPACE-" -// Discover discovers plugins. +var extractPluginBasename = regexp.MustCompile("^packer-plugin-([^_]+)") + +// Discover discovers the latest installed version of each installed plugin. // // Search the directory of the executable, then the plugins directory, and // finally the CWD, in that order. Any conflicts will overwrite previously @@ -77,188 +67,46 @@ func (c *PluginConfig) Discover() error { return nil } - // TODO: use KnownPluginFolders here. TODO probably after JSON is deprecated - // so that we can keep the current behavior just the way it is. - - // Next, look in the same directory as the executable. - exePath, err := os.Executable() - if err != nil { - log.Printf("[ERR] Error loading exe directory: %s", err) - } else { - if err := c.discoverExternalComponents(filepath.Dir(exePath)); err != nil { - return err - } - } - - // Next, look in the default plugins directory inside the configdir/.packer.d/plugins. - dir, err := pathing.ConfigDir() - if err != nil { - log.Printf("[ERR] Error loading config directory: %s", err) - } else { - if err := c.discoverExternalComponents(filepath.Join(dir, "plugins")); err != nil { - return err - } - } - - // Next, look in the CWD. - if err := c.discoverExternalComponents("."); err != nil { - return err - } - - // Check whether there is a custom Plugin directory defined. This gets - // absolute preference. - if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { - sep := ":" - if runtime.GOOS == "windows" { - // on windows, PATH is semicolon-separated - sep = ";" - } - plugPaths := strings.Split(packerPluginPath, sep) - for _, plugPath := range plugPaths { - if err := c.discoverExternalComponents(plugPath); err != nil { - return err - } - } - } - - return nil -} - -func (c *PluginConfig) discoverExternalComponents(path string) error { - var err error - log.Printf("[TRACE] discovering plugins in %s", path) - - if !filepath.IsAbs(path) { - path, err = filepath.Abs(path) - if err != nil { - return err - } - } - var externallyUsed []string - - pluginPaths, err := c.discoverSingle(filepath.Join(path, "packer-builder-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.Builders.Set(pluginName, func() (packersdk.Builder, error) { - return c.Client(newPath).Builder() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("[INFO] using external builders: %v", externallyUsed) - externallyUsed = nil - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-post-processor-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.PostProcessors.Set(pluginName, func() (packersdk.PostProcessor, error) { - return c.Client(newPath).PostProcessor() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external post-processors %v", externallyUsed) - externallyUsed = nil - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-provisioner-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.Provisioners.Set(pluginName, func() (packersdk.Provisioner, error) { - return c.Client(newPath).Provisioner() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external provisioners %v", externallyUsed) - externallyUsed = nil + if c.PluginDirectory == "" { + c.PluginDirectory, _ = PluginFolder() } - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-datasource-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.DataSources.Set(pluginName, func() (packersdk.Datasource, error) { - return c.Client(newPath).Datasource() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external datasource %v", externallyUsed) - } - - //Check for installed plugins using the `packer plugins install` command - binInstallOpts := plugingetter.BinaryInstallationOptions{ - OS: runtime.GOOS, - ARCH: runtime.GOARCH, - APIVersionMajor: pluginsdk.APIVersionMajor, - APIVersionMinor: pluginsdk.APIVersionMinor, - Checksummers: []plugingetter.Checksummer{ - {Type: "sha256", Hash: sha256.New()}, + installations, err := plugingetter.Requirement{}.ListInstallations(plugingetter.ListInstallationsOptions{ + PluginDirectory: c.PluginDirectory, + BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ + OS: runtime.GOOS, + ARCH: runtime.GOARCH, + APIVersionMajor: pluginsdk.APIVersionMajor, + APIVersionMinor: pluginsdk.APIVersionMinor, + Checksummers: []plugingetter.Checksummer{ + {Type: "sha256", Hash: sha256.New()}, + }, + ReleasesOnly: c.ReleasesOnly, }, - } - - if runtime.GOOS == "windows" { - binInstallOpts.Ext = ".exe" - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "*", "*", "*", fmt.Sprintf("packer-plugin-*%s", binInstallOpts.FilenameSuffix()))) + }) if err != nil { return err } - for pluginName, pluginPath := range pluginPaths { - var checksumOk bool - for _, checksummer := range binInstallOpts.Checksummers { - cs, err := checksummer.GetCacheChecksumOfFile(pluginPath) - if err != nil { - log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", pluginPath, err) - continue - } - - if err := checksummer.ChecksumFile(cs, pluginPath); err != nil { - log.Printf("[TRACE] ChecksumFile(%q) failed: %v", pluginPath, err) - continue - } - checksumOk = true - break - } - - if !checksumOk { - log.Printf("[TRACE] No checksum found for %q ignoring possibly unsafe binary", path) + // Map of plugin basename to executable + // + // We'll use that later to register the components for each plugin + pluginMap := map[string]string{} + for _, install := range installations { + pluginBasename := path.Base(install.BinaryPath) + matches := extractPluginBasename.FindStringSubmatch(pluginBasename) + if len(matches) != 2 { + log.Printf("[INFO] - plugin %q could not have its name matched, ignoring", pluginBasename) continue } - if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { - return err - } + pluginName := matches[1] + pluginMap[pluginName] = install.BinaryPath } - // Manually installed plugins take precedence over all. Duplicate plugins installed - // prior to the packer plugins install command should be removed by user to avoid overrides. - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-plugin-*")) - if err != nil { - return err - } - - for pluginName, pluginPath := range pluginPaths { - if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { + for name, path := range pluginMap { + err := c.DiscoverMultiPlugin(name, path) + if err != nil { return err } } @@ -266,51 +114,6 @@ func (c *PluginConfig) discoverExternalComponents(path string) error { return nil } -func (c *PluginConfig) discoverSingle(glob string) (map[string]string, error) { - matches, err := filepath.Glob(glob) - if err != nil { - return nil, err - } - var prefix string - res := make(map[string]string) - // Sort the matches so we add the newer version of a plugin last - sort.Strings(matches) - prefix = filepath.Base(glob) - prefix = prefix[:strings.Index(prefix, "*")] - for _, match := range matches { - file := filepath.Base(match) - // skip folders like packer-plugin-sdk - if stat, err := os.Stat(file); err == nil && stat.IsDir() { - continue - } - - // On Windows, ignore any plugins that don't end in .exe. - // We could do a full PATHEXT parse, but this is probably good enough. - if runtime.GOOS == "windows" && strings.ToLower(filepath.Ext(file)) != ".exe" { - log.Printf( - "[DEBUG] Ignoring plugin match %s, no exe extension", - match) - continue - } - - // If the filename has a ".", trim up to there - if idx := strings.Index(file, ".exe"); idx >= 0 { - file = file[:idx] - } - - // Look for foo-bar-baz. The plugin name is "baz" - pluginName := file[len(prefix):] - // multi-component plugins installed via the plugins subcommand will have a name that looks like baz_vx.y.z_x5.0_darwin_arm64. - // After the split the plugin name is "baz". - pluginName = strings.SplitN(pluginName, "_", 2)[0] - - log.Printf("[DEBUG] Discovered plugin: %s = %s", pluginName, match) - res[pluginName] = match - } - - return res, nil -} - // DiscoverMultiPlugin takes the description from a multi-component plugin // binary and makes the plugins available to use in Packer. Each plugin found in the // binary will be addressable using `${pluginName}-${builderName}` for example. @@ -329,6 +132,11 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error } pluginPrefix := pluginName + "-" + pluginDetails := PluginDetails{ + Name: pluginName, + Description: desc, + PluginPath: pluginPath, + } for _, builderName := range desc.Builders { builderName := builderName // copy to avoid pointer overwrite issue @@ -339,6 +147,7 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error c.Builders.Set(key, func() (packersdk.Builder, error) { return c.Client(pluginPath, "start", "builder", builderName).Builder() }) + GlobalPluginsDetailsStore.SetBuilder(key, pluginDetails) } if len(desc.Builders) > 0 { @@ -354,6 +163,7 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error c.PostProcessors.Set(key, func() (packersdk.PostProcessor, error) { return c.Client(pluginPath, "start", "post-processor", postProcessorName).PostProcessor() }) + GlobalPluginsDetailsStore.SetPostProcessor(key, pluginDetails) } if len(desc.PostProcessors) > 0 { @@ -369,6 +179,8 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error c.Provisioners.Set(key, func() (packersdk.Provisioner, error) { return c.Client(pluginPath, "start", "provisioner", provisionerName).Provisioner() }) + GlobalPluginsDetailsStore.SetProvisioner(key, pluginDetails) + } if len(desc.Provisioners) > 0 { log.Printf("found external %v provisioner from %s plugin", desc.Provisioners, pluginName) @@ -383,6 +195,7 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error c.DataSources.Set(key, func() (packersdk.Datasource, error) { return c.Client(pluginPath, "start", "datasource", datasourceName).Datasource() }) + GlobalPluginsDetailsStore.SetDataSource(key, pluginDetails) } if len(desc.Datasources) > 0 { log.Printf("found external %v datasource from %s plugin", desc.Datasources, pluginName) @@ -423,9 +236,9 @@ func (c *PluginConfig) Client(path string, args ...string) *PluginClient { } if strings.Contains(originalPath, PACKERSPACE) { - log.Printf("[TRACE] Starting internal plugin %s", args[len(args)-1]) + log.Printf("[INFO] Starting internal plugin %s", args[len(args)-1]) } else { - log.Printf("[TRACE] Starting external plugin %s %s", path, strings.Join(args, " ")) + log.Printf("[INFO] Starting external plugin %s %s", path, strings.Join(args, " ")) } var config PluginClientConfig config.Cmd = exec.Command(path, args...) @@ -434,3 +247,80 @@ func (c *PluginConfig) Client(path string, args ...string) *PluginClient { config.MaxPort = c.PluginMaxPort return NewClient(&config) } + +type PluginComponentType string + +const ( + PluginComponentBuilder PluginComponentType = "builder" + PluginComponentPostProcessor PluginComponentType = "post-processor" + PluginComponentProvisioner PluginComponentType = "provisioner" + PluginComponentDataSource PluginComponentType = "data-source" +) + +type PluginDetails struct { + Name string + Description pluginsdk.SetDescription + PluginPath string +} + +type pluginsDetailsStorage struct { + rwMutex sync.RWMutex + data map[string]PluginDetails +} + +var GlobalPluginsDetailsStore = &pluginsDetailsStorage{ + data: make(map[string]PluginDetails), +} + +func (pds *pluginsDetailsStorage) set(key string, plugin PluginDetails) { + pds.rwMutex.Lock() + defer pds.rwMutex.Unlock() + pds.data[key] = plugin +} + +func (pds *pluginsDetailsStorage) get(key string) (PluginDetails, bool) { + pds.rwMutex.RLock() + defer pds.rwMutex.RUnlock() + plugin, exists := pds.data[key] + return plugin, exists +} + +func (pds *pluginsDetailsStorage) SetBuilder(name string, plugin PluginDetails) { + key := fmt.Sprintf("%q-%q", PluginComponentBuilder, name) + pds.set(key, plugin) +} + +func (pds *pluginsDetailsStorage) GetBuilder(name string) (PluginDetails, bool) { + key := fmt.Sprintf("%q-%q", PluginComponentBuilder, name) + return pds.get(key) +} + +func (pds *pluginsDetailsStorage) SetPostProcessor(name string, plugin PluginDetails) { + key := fmt.Sprintf("%q-%q", PluginComponentPostProcessor, name) + pds.set(key, plugin) +} + +func (pds *pluginsDetailsStorage) GetPostProcessor(name string) (PluginDetails, bool) { + key := fmt.Sprintf("%q-%q", PluginComponentPostProcessor, name) + return pds.get(key) +} + +func (pds *pluginsDetailsStorage) SetProvisioner(name string, plugin PluginDetails) { + key := fmt.Sprintf("%q-%q", PluginComponentProvisioner, name) + pds.set(key, plugin) +} + +func (pds *pluginsDetailsStorage) GetProvisioner(name string) (PluginDetails, bool) { + key := fmt.Sprintf("%q-%q", PluginComponentProvisioner, name) + return pds.get(key) +} + +func (pds *pluginsDetailsStorage) SetDataSource(name string, plugin PluginDetails) { + key := fmt.Sprintf("%q-%q", PluginComponentDataSource, name) + pds.set(key, plugin) +} + +func (pds *pluginsDetailsStorage) GetDataSource(name string) (PluginDetails, bool) { + key := fmt.Sprintf("%q-%q", PluginComponentDataSource, name) + return pds.get(key) +} diff --git a/packer/plugin_client.go b/packer/plugin_client.go index 24102aff54c..01e899e2813 100644 --- a/packer/plugin_client.go +++ b/packer/plugin_client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -5,7 +8,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net" "os" @@ -111,7 +113,7 @@ func NewClient(config *PluginClientConfig) (c *PluginClient) { } if config.Stderr == nil { - config.Stderr = ioutil.Discard + config.Stderr = io.Discard } c = &PluginClient{config: config} diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index b75053ea633..de50136cdc8 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -14,6 +17,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer-plugin-sdk/tmp" + "github.com/hashicorp/packer-plugin-sdk/version" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" ) @@ -39,115 +43,210 @@ func TestDiscoverReturnsIfMagicCookieSet(t *testing.T) { } } -func TestEnvVarPackerPluginPath(t *testing.T) { - // Create a temporary directory to store plugins in - dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", - []string{"packer-provisioner-partyparrot"}) +func TestMultiPlugin_describe(t *testing.T) { + createMockPlugins(t, mockPlugins) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + c := PluginConfig{} + err := c.Discover() if err != nil { - t.Fatalf("Error creating fake custom plugins: %s", err) + t.Fatalf("error discovering plugins; %s", err.Error()) } - defer cleanUpFunc() + for mockPluginName, plugin := range mockPlugins { + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName - // Add temp dir to path. - t.Setenv("PACKER_PLUGIN_PATH", dir) + if !c.Builders.Has(expectedBuilderName) { + t.Errorf("expected to find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if !c.Provisioners.Has(expectedProvisionerName) { + t.Errorf("expected to find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if !c.PostProcessors.Has(expectedPostProcessorName) { + t.Errorf("expected to find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if !c.DataSources.Has(expectedDatasourceName) { + t.Errorf("expected to find datasource %q", expectedDatasourceName) + } + } + } +} - config := newPluginConfig() +func TestMultiPlugin_describe_installed(t *testing.T) { + createMockInstalledPlugins(t, mockInstalledPlugins, createMockChecksumFile) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) - err = config.Discover() + c := PluginConfig{} + err := c.Discover() if err != nil { - t.Fatalf("Should not have errored: %s", err) + t.Fatalf("error discovering plugins; %s", err.Error()) } - if len(config.Provisioners.List()) == 0 { - t.Fatalf("Should have found partyparrot provisioner") - } - if !config.Provisioners.Has("partyparrot") { - t.Fatalf("Should have found partyparrot provisioner.") + for mockPluginName, plugin := range mockInstalledPlugins { + mockPluginName = strings.Split(mockPluginName, "_")[0] + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName + if !c.Builders.Has(expectedBuilderName) { + t.Fatalf("expected to find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if !c.Provisioners.Has(expectedProvisionerName) { + t.Fatalf("expected to find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if !c.PostProcessors.Has(expectedPostProcessorName) { + t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if !c.DataSources.Has(expectedDatasourceName) { + t.Fatalf("expected to find datasource %q", expectedDatasourceName) + } + } } } -func TestEnvVarPackerPluginPath_MultiplePaths(t *testing.T) { - // Create a temporary directory to store plugins in - dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", - []string{"packer-provisioner-partyparrot"}) - if err != nil { - t.Fatalf("Error creating fake custom plugins: %s", err) +func TestMultiPlugin_describe_installed_for_invalid(t *testing.T) { + tc := []struct { + desc string + installedPluginsMock map[string]pluginsdk.Set + createMockFn func(*testing.T, map[string]pluginsdk.Set) + }{ + { + desc: "Incorrectly named plugins", + installedPluginsMock: invalidInstalledPluginsMock, + createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { + createMockInstalledPlugins(t, mocks, createMockChecksumFile) + }, + }, + { + desc: "Plugins missing checksums", + installedPluginsMock: mockInstalledPlugins, + createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { + createMockInstalledPlugins(t, mocks) + }, + }, } - defer cleanUpFunc() - - pathsep := ":" - if runtime.GOOS == "windows" { - pathsep = ";" - } + for _, tt := range tc { + t.Run(tt.desc, func(t *testing.T) { + tt.createMockFn(t, tt.installedPluginsMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) - // Create a second dir to look in that will be empty - decoyDir, err := os.MkdirTemp("", "decoy") - if err != nil { - t.Fatalf("Failed to create a temporary test dir.") + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s", err.Error()) + } + if c.Builders.Has("feather") { + t.Fatalf("expected to not find builder %q", "feather") + } + for mockPluginName, plugin := range tt.installedPluginsMock { + mockPluginName = strings.Split(mockPluginName, "_")[0] + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName + if c.Builders.Has(expectedBuilderName) { + t.Fatalf("expected to not find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if c.Provisioners.Has(expectedProvisionerName) { + t.Fatalf("expected to not find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if c.PostProcessors.Has(expectedPostProcessorName) { + t.Fatalf("expected to not find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if c.DataSources.Has(expectedDatasourceName) { + t.Fatalf("expected to not find datasource %q", expectedDatasourceName) + } + } + } + }) } - defer os.Remove(decoyDir) - - pluginPath := dir + pathsep + decoyDir - - // Add temp dir to path. - t.Setenv("PACKER_PLUGIN_PATH", pluginPath) +} - config := newPluginConfig() +func TestMultiPlugin_defaultName(t *testing.T) { + createMockPlugins(t, defaultNameMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) - err = config.Discover() + c := PluginConfig{} + err := c.Discover() if err != nil { - t.Fatalf("Should not have errored: %s", err) + t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) } - if len(config.Provisioners.List()) == 0 { - t.Fatalf("Should have found partyparrot provisioner") - } - if !config.Provisioners.Has("partyparrot") { - t.Fatalf("Should have found partyparrot provisioner.") + expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} + for _, mockBuilderName := range expectedBuilderNames { + if !c.Builders.Has(mockBuilderName) { + t.Fatalf("expected to find builder %q; builders is %#v", mockBuilderName, c.Builders) + } } } -func TestDiscoverDatasource(t *testing.T) { - // Create a temporary directory to store plugins in - dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", - []string{"packer-datasource-partyparrot"}) +func TestMultiPlugin_IgnoreChecksumFile(t *testing.T) { + createMockPlugins(t, defaultNameMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + fooPluginName := fmt.Sprintf("packer-plugin-foo_v1.0.0_x5.0_%s_%s", runtime.GOOS, runtime.GOARCH) + fooPluginPath := filepath.Join(pluginDir, "github.com", "hashicorp", "foo", fooPluginName) + csFile, err := generateMockChecksumFile(fooPluginPath) if err != nil { - t.Fatalf("Error creating fake custom plugins: %s", err) + t.Fatal(err.Error()) } - defer cleanUpFunc() - - pathsep := ":" - if runtime.GOOS == "windows" { - pathsep = ";" + // Copy plugin contents into checksum file to validate that it is not only skipped but that it never gets loaded + if err := os.Rename(fooPluginPath, csFile); err != nil { + t.Fatalf("failed to rename plugin bin file to checkfum file needed for test: %s", err) } - // Create a second dir to look in that will be empty - decoyDir, err := os.MkdirTemp("", "decoy") + c := PluginConfig{} + err = c.Discover() if err != nil { - t.Fatalf("Failed to create a temporary test dir.") + t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) } - defer os.Remove(decoyDir) - - pluginPath := dir + pathsep + decoyDir - - // Add temp dir to path. - t.Setenv("PACKER_PLUGIN_PATH", pluginPath) + expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} + for _, mockBuilderName := range expectedBuilderNames { + if c.Builders.Has(mockBuilderName) { + t.Fatalf("expected to not find builder %q; builders is %#v", mockBuilderName, c.Builders) + } + } +} - config := newPluginConfig() +func TestMultiPlugin_defaultName_each_plugin_type(t *testing.T) { + createMockPlugins(t, doubleDefaultMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) - err = config.Discover() + c := PluginConfig{} + err := c.Discover() if err != nil { - t.Fatalf("Should not have errored: %s", err) - } - - if len(config.DataSources.List()) == 0 { - t.Fatalf("Should have found partyparrot datasource") - } - if !config.DataSources.Has("partyparrot") { - t.Fatalf("Should have found partyparrot datasource.") + t.Fatal("Should not have error because pluginsdk.DEFAULT_NAME is used twice but only once per plugin type.") } } @@ -207,6 +306,7 @@ func TestHelperPlugins(t *testing.T) { for _, mock := range allMocks { plugin, found := mock[pluginName] if found { + plugin.SetVersion(version.InitializePluginVersion("1.0.0", "")) err := plugin.RunCommand(args...) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) @@ -277,7 +377,13 @@ func createMockPlugins(t *testing.T, plugins map[string]pluginsdk.Set) { shPath := MustHaveCommand(t, "bash") for name := range plugins { - plugin := path.Join(pluginDir, "packer-plugin-"+name) + pluginName := fmt.Sprintf("packer-plugin-%s_v1.0.0_x5.0_%s_%s", name, runtime.GOOS, runtime.GOARCH) + pluginSubDir := fmt.Sprintf("github.com/hashicorp/%s", name) + err := os.MkdirAll(path.Join(pluginDir, pluginSubDir), 0755) + if err != nil { + t.Fatalf("failed to create plugin hierarchy: %s", err) + } + plugin := path.Join(pluginDir, pluginSubDir, pluginName) t.Logf("creating fake plugin %s", plugin) fileContent := "" fileContent = fmt.Sprintf("#!%s\n", shPath) @@ -287,12 +393,25 @@ func createMockPlugins(t *testing.T, plugins map[string]pluginsdk.Set) { if err := os.WriteFile(plugin, []byte(fileContent), os.ModePerm); err != nil { t.Fatalf("failed to create fake plugin binary: %v", err) } + + if _, err := generateMockChecksumFile(plugin); err != nil { + t.Fatalf("failed to create fake plugin binary checksum file: %v", err) + } } } t.Setenv("PACKER_PLUGIN_PATH", pluginDir) } func createMockChecksumFile(t testing.TB, filePath string) { + t.Helper() + cs, err := generateMockChecksumFile(filePath) + if err != nil { + t.Fatalf(err.Error()) + } + t.Logf("created fake plugin checksum file %s", cs) +} + +func generateMockChecksumFile(filePath string) (string, error) { cs := plugingetter.Checksummer{ Type: "sha256", Hash: sha256.New(), @@ -300,19 +419,20 @@ func createMockChecksumFile(t testing.TB, filePath string) { f, err := os.Open(filePath) if err != nil { - t.Fatalf("failed to open fake plugin binary: %v", err) + return "", fmt.Errorf("failed to open fake plugin binary: %v", err) } defer f.Close() sum, err := cs.Sum(f) if err != nil { - t.Fatalf("failed to checksum fake plugin binary: %v", err) + return "", fmt.Errorf("failed to checksum fake plugin binary: %v", err) } - t.Logf("creating fake plugin checksum file %s with contents %x", filePath+cs.FileExt(), string(sum)) - if err := os.WriteFile(filePath+cs.FileExt(), []byte(fmt.Sprintf("%x", sum)), os.ModePerm); err != nil { - t.Fatalf("failed to write checksum fake plugin binary: %v", err) + sumfile := filePath + cs.FileExt() + if err := os.WriteFile(sumfile, []byte(fmt.Sprintf("%x", sum)), os.ModePerm); err != nil { + return "", fmt.Errorf("failed to write checksum fake plugin binary: %v", err) } + return sumfile, nil } func createMockInstalledPlugins(t *testing.T, plugins map[string]pluginsdk.Set, opts ...func(tb testing.TB, filePath string)) { @@ -370,268 +490,90 @@ func getFormattedInstalledPluginSuffix() string { } var ( - mockPlugins = map[string]pluginsdk.Set{ - "bird": { - Builders: map[string]packersdk.Builder{ - "feather": nil, - "guacamole": nil, - }, - }, - "chimney": { - PostProcessors: map[string]packersdk.PostProcessor{ - "smoke": nil, - }, - }, - "data": { - Datasources: map[string]packersdk.Datasource{ - "source": nil, - }, - }, - } - mockInstalledPlugins = map[string]pluginsdk.Set{ - fmt.Sprintf("bird_%s", getFormattedInstalledPluginSuffix()): { - Builders: map[string]packersdk.Builder{ - "feather": nil, - "guacamole": nil, - }, - }, - fmt.Sprintf("chimney_%s", getFormattedInstalledPluginSuffix()): { - PostProcessors: map[string]packersdk.PostProcessor{ - "smoke": nil, - }, - }, - fmt.Sprintf("data_%s", getFormattedInstalledPluginSuffix()): { - Datasources: map[string]packersdk.Datasource{ - "source": nil, - }, - }, - } + mockPlugins = map[string]pluginsdk.Set{} + mockInstalledPlugins = map[string]pluginsdk.Set{} + invalidInstalledPluginsMock = map[string]pluginsdk.Set{} + defaultNameMock = map[string]pluginsdk.Set{} + doubleDefaultMock = map[string]pluginsdk.Set{} + badDefaultNameMock = map[string]pluginsdk.Set{} +) - invalidInstalledPluginsMock = map[string]pluginsdk.Set{ - "bird_v0.1.1_x5.0_wrong_architecture": { - Builders: map[string]packersdk.Builder{ - "feather": nil, - "guacamole": nil, - }, - }, - "chimney_cool_ranch": { - PostProcessors: map[string]packersdk.PostProcessor{ - "smoke": nil, - }, - }, - "data": { - Datasources: map[string]packersdk.Datasource{ - "source": nil, - }, - }, +func init() { + mockPluginsBird := pluginsdk.NewSet() + mockPluginsBird.Builders = map[string]packersdk.Builder{ + "feather": nil, + "guacamole": nil, } - defaultNameMock = map[string]pluginsdk.Set{ - "foo": { - Builders: map[string]packersdk.Builder{ - "bar": nil, - "baz": nil, - pluginsdk.DEFAULT_NAME: nil, - }, - }, + mockPluginsChim := pluginsdk.NewSet() + mockPluginsChim.PostProcessors = map[string]packersdk.PostProcessor{ + "smoke": nil, } - - doubleDefaultMock = map[string]pluginsdk.Set{ - "yolo": { - Builders: map[string]packersdk.Builder{ - "bar": nil, - "baz": nil, - pluginsdk.DEFAULT_NAME: nil, - }, - PostProcessors: map[string]packersdk.PostProcessor{ - pluginsdk.DEFAULT_NAME: nil, - }, - }, + mockPluginsData := pluginsdk.NewSet() + mockPluginsData.Datasources = map[string]packersdk.Datasource{ + "source": nil, } + mockPlugins["bird"] = *mockPluginsBird + mockPlugins["chimney"] = *mockPluginsChim + mockPlugins["data"] = *mockPluginsData - badDefaultNameMock = map[string]pluginsdk.Set{ - "foo": { - Builders: map[string]packersdk.Builder{ - "bar": nil, - "baz": nil, - pluginsdk.DEFAULT_NAME: nil, - }, - }, + mockInstalledPluginsBird := pluginsdk.NewSet() + mockInstalledPluginsBird.Builders = map[string]packersdk.Builder{ + "feather": nil, + "guacamole": nil, } -) - -func Test_multiplugin_describe(t *testing.T) { - createMockPlugins(t, mockPlugins) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) + mockInstalledPluginsChim := pluginsdk.NewSet() + mockInstalledPluginsChim.PostProcessors = map[string]packersdk.PostProcessor{ + "smoke": nil, } - - for mockPluginName, plugin := range mockPlugins { - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - - if !c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if !c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if !c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if !c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to find datasource %q", expectedDatasourceName) - } - } + mockInstalledPluginsData := pluginsdk.NewSet() + mockInstalledPluginsData.Datasources = map[string]packersdk.Datasource{ + "source": nil, } -} + mockInstalledPlugins[fmt.Sprintf("bird_%s", getFormattedInstalledPluginSuffix())] = *mockInstalledPluginsBird + mockInstalledPlugins[fmt.Sprintf("chimney_%s", getFormattedInstalledPluginSuffix())] = *mockInstalledPluginsChim + mockInstalledPlugins[fmt.Sprintf("data_%s", getFormattedInstalledPluginSuffix())] = *mockInstalledPluginsData -func Test_multiplugin_describe_installed(t *testing.T) { - createMockInstalledPlugins(t, mockInstalledPlugins, createMockChecksumFile) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) + invalidInstalledPluginsMockBird := pluginsdk.NewSet() + invalidInstalledPluginsMockBird.Builders = map[string]packersdk.Builder{ + "feather": nil, + "guacamole": nil, } - - for mockPluginName, plugin := range mockInstalledPlugins { - mockPluginName = strings.Split(mockPluginName, "_")[0] - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - if !c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if !c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if !c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if !c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to find datasource %q", expectedDatasourceName) - } - } + invalidInstalledPluginsMockChimney := pluginsdk.NewSet() + invalidInstalledPluginsMockChimney.PostProcessors = map[string]packersdk.PostProcessor{ + "smoke": nil, } -} - -func Test_multiplugin_describe_installed_for_invalid(t *testing.T) { - tc := []struct { - desc string - installedPluginsMock map[string]pluginsdk.Set - createMockFn func(*testing.T, map[string]pluginsdk.Set) - }{ - { - desc: "Incorrectly named plugins", - installedPluginsMock: invalidInstalledPluginsMock, - createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { - createMockInstalledPlugins(t, mocks, createMockChecksumFile) - }, - }, - { - desc: "Plugins missing checksums", - installedPluginsMock: mockInstalledPlugins, - createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { - createMockInstalledPlugins(t, mocks) - }, - }, + invalidInstalledPluginsMockData := pluginsdk.NewSet() + invalidInstalledPluginsMockData.Datasources = map[string]packersdk.Datasource{ + "source": nil, } + invalidInstalledPluginsMock["bird_v0.1.1_x5.0_wrong_architecture"] = *invalidInstalledPluginsMockBird + invalidInstalledPluginsMock["chimney_cool_ranch"] = *invalidInstalledPluginsMockChimney + invalidInstalledPluginsMock["data"] = *invalidInstalledPluginsMockData - for _, tt := range tc { - t.Run(tt.desc, func(t *testing.T) { - tt.createMockFn(t, tt.installedPluginsMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) - } - if c.Builders.Has("feather") { - t.Fatalf("expected to not find builder %q", "feather") - } - for mockPluginName, plugin := range tt.installedPluginsMock { - mockPluginName = strings.Split(mockPluginName, "_")[0] - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - if c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to not find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to not find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to not find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to not find datasource %q", expectedDatasourceName) - } - } - } - }) + defaultNameFooSet := pluginsdk.NewSet() + defaultNameFooSet.Builders = map[string]packersdk.Builder{ + "bar": nil, + "baz": nil, + pluginsdk.DEFAULT_NAME: nil, } -} + defaultNameMock["foo"] = *defaultNameFooSet -func Test_multiplugin_defaultName(t *testing.T) { - createMockPlugins(t, defaultNameMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + doubleDefaultYoloSet := pluginsdk.NewSet() + doubleDefaultYoloSet.Builders = map[string]packersdk.Builder{ + "bar": nil, + "baz": nil, + pluginsdk.DEFAULT_NAME: nil, } - - expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} - for _, mockBuilderName := range expectedBuilderNames { - if !c.Builders.Has(mockBuilderName) { - t.Fatalf("expected to find builder %q; builders is %#v", mockBuilderName, c.Builders) - } + doubleDefaultYoloSet.PostProcessors = map[string]packersdk.PostProcessor{ + pluginsdk.DEFAULT_NAME: nil, } -} + doubleDefaultMock["yolo"] = *doubleDefaultYoloSet -func Test_only_one_multiplugin_defaultName_each_plugin_type(t *testing.T) { - createMockPlugins(t, doubleDefaultMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatal("Should not have error because pluginsdk.DEFAULT_NAME is used twice but only once per plugin type.") + badDefaultSet := pluginsdk.NewSet() + badDefaultSet.Builders = map[string]packersdk.Builder{ + "bar": nil, + "baz": nil, + pluginsdk.DEFAULT_NAME: nil, } + badDefaultNameMock["foo"] = *badDefaultSet } diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index 6b04ff2ee05..5682c91b8d6 100644 --- a/packer/plugin_folders.go +++ b/packer/plugin_folders.go @@ -1,35 +1,27 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( "log" "os" "path/filepath" - "strings" "github.com/hashicorp/packer-plugin-sdk/pathing" ) -// PluginFolders returns the list of known plugin folders based on system. -func PluginFolders(dirs ...string) []string { - res := []string{} - - if path, err := os.Executable(); err != nil { - log.Printf("[ERR] Error finding executable: %v", err) - } else { - res = append(res, path) +// PluginFolder returns the known plugin folder based on system. +func PluginFolder() (string, error) { + if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { + return packerPluginPath, nil } - res = append(res, dirs...) - - if cd, err := pathing.ConfigDir(); err != nil { + cd, err := pathing.ConfigDir() + if err != nil { log.Printf("[ERR] Error loading config directory: %v", err) - } else { - res = append(res, filepath.Join(cd, "plugins")) - } - - if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { - res = append(res, strings.Split(packerPluginPath, string(os.PathListSeparator))...) + return "", err } - return res + return filepath.Join(cd, "plugins"), nil } diff --git a/packer/plugin_test.go b/packer/plugin_test.go index 1972a10d89f..a912ca07a38 100644 --- a/packer/plugin_test.go +++ b/packer/plugin_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/post_processor_mock.go b/packer/post_processor_mock.go index 20d36f87b83..5a9bfc85ae2 100644 --- a/packer/post_processor_mock.go +++ b/packer/post_processor_mock.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type MockPostProcessor package packer diff --git a/packer/progressbar.go b/packer/progressbar.go index a6e7a3b0825..0a9225047c3 100644 --- a/packer/progressbar.go +++ b/packer/progressbar.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build !solaris // +build !solaris diff --git a/packer/progressbar_solaris.go b/packer/progressbar_solaris.go index 1f88716802f..7aa199339a7 100644 --- a/packer/progressbar_solaris.go +++ b/packer/progressbar_solaris.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/progressbar_test.go b/packer/progressbar_test.go index 40928d2738f..20edc07c9b2 100644 --- a/packer/progressbar_test.go +++ b/packer/progressbar_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( "bytes" - "io/ioutil" + "io" "testing" "golang.org/x/sync/errgroup" @@ -13,10 +16,10 @@ import ( func TestProgressTracking_open_close(t *testing.T) { var bar *UiProgressBar - tracker := bar.TrackProgress("1,", 1, 42, ioutil.NopCloser(nil)) + tracker := bar.TrackProgress("1,", 1, 42, io.NopCloser(nil)) tracker.Close() - tracker = bar.TrackProgress("2,", 1, 42, ioutil.NopCloser(nil)) + tracker = bar.TrackProgress("2,", 1, 42, io.NopCloser(nil)) tracker.Close() } @@ -26,7 +29,7 @@ func TestProgressTracking_multi_open_close(t *testing.T) { for i := 0; i < 100; i++ { g.Go(func() error { - tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(nil)) + tracker := bar.TrackProgress("file,", 1, 42, io.NopCloser(nil)) return tracker.Close() }) } @@ -43,7 +46,7 @@ func TestProgressTracking_races(t *testing.T) { g.Go(func() error { txt := []byte("foobarbaz dolores") b := bytes.NewReader(txt) - tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(b)) + tracker := bar.TrackProgress("file,", 1, 42, io.NopCloser(b)) for i := 0; i < 42; i++ { tracker.Read([]byte("i")) diff --git a/packer/provisioner.go b/packer/provisioner.go index 8d8c54a9b8f..c7761adeb5f 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/provisioner_test.go b/packer/provisioner_test.go index 4fad60b23f4..bc646e5ca10 100644 --- a/packer/provisioner_test.go +++ b/packer/provisioner_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/provisioner_timeout.go b/packer/provisioner_timeout.go index 627333e8b33..f1183744cdb 100644 --- a/packer/provisioner_timeout.go +++ b/packer/provisioner_timeout.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/packer/run_interfaces.go b/packer/run_interfaces.go index 0eff3fa4c34..07829e629e1 100644 --- a/packer/run_interfaces.go +++ b/packer/run_interfaces.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -21,7 +24,7 @@ type BuildGetter interface { // GetBuilds return all possible builds for a config. It also starts all // builders. // TODO(azr): rename to builder starter ? - GetBuilds(GetBuildsOptions) ([]packersdk.Build, map[string]string, hcl.Diagnostics) + GetBuilds(GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) } type Evaluator interface { @@ -37,6 +40,12 @@ type InitializeOptions struct { SkipDatasourcesExecution bool } +type PluginBinaryDetector interface { + // DetectPluginBinaries is used only for HCL2 templates, and loads required + // plugins if specified. + DetectPluginBinaries() hcl.Diagnostics +} + // The Handler handles all Packer things. This interface reflects the Packer // commands, ex: init, console ( evaluate ), fix config, inspect config, etc. To // run a build we will start the builds and then the core of Packer handles @@ -50,6 +59,7 @@ type Handler interface { BuildGetter ConfigFixer ConfigInspector + PluginBinaryDetector } //go:generate enumer -type FixConfigMode diff --git a/packer/telemetry.go b/packer/telemetry.go index 92711d6a3b8..c3d0573ef5e 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -1,7 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( "context" + "fmt" "log" "os" "path/filepath" @@ -11,24 +15,37 @@ import ( checkpoint "github.com/hashicorp/go-checkpoint" "github.com/hashicorp/packer-plugin-sdk/pathing" packerVersion "github.com/hashicorp/packer/version" + "github.com/zclconf/go-cty/cty" ) -const TelemetryVersion string = "beta/packer/5" +type PackerTemplateType string + +const ( + UnknownTemplate PackerTemplateType = "Unknown" + HCL2Template PackerTemplateType = "HCL2" + JSONTemplate PackerTemplateType = "JSON" +) + +const TelemetryVersion string = "beta/packer/7" const TelemetryPanicVersion string = "beta/packer_panic/4" var CheckpointReporter *CheckpointTelemetry type PackerReport struct { - Spans []*TelemetrySpan `json:"spans"` - ExitCode int `json:"exit_code"` - Error string `json:"error"` - Command string `json:"command"` + Spans []*TelemetrySpan `json:"spans"` + ExitCode int `json:"exit_code"` + Error string `json:"error"` + Command string `json:"command"` + TemplateType PackerTemplateType `json:"template_type"` + UseBundled bool `json:"use_bundled"` } type CheckpointTelemetry struct { spans []*TelemetrySpan signatureFile string startTime time.Time + templateType PackerTemplateType + useBundled bool } func NewCheckpointReporter(disableSignature bool) *CheckpointTelemetry { @@ -52,6 +69,7 @@ func NewCheckpointReporter(disableSignature bool) *CheckpointTelemetry { return &CheckpointTelemetry{ signatureFile: signatureFile, startTime: time.Now().UTC(), + templateType: UnknownTemplate, } } @@ -103,6 +121,23 @@ func (c *CheckpointTelemetry) AddSpan(name, pluginType string, options interface return ts } +// SetTemplateType registers the template type being processed for a Packer command +func (c *CheckpointTelemetry) SetTemplateType(t PackerTemplateType) { + if c == nil { + return + } + + c.templateType = t +} + +// SetBundledUsage marks the template as using bundled plugins +func (c *CheckpointTelemetry) SetBundledUsage() { + if c == nil { + return + } + c.useBundled = true +} + func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) error { if c == nil { return nil @@ -119,6 +154,9 @@ func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) e if err != nil { extra.Error = err.Error() } + + extra.UseBundled = c.useBundled + extra.TemplateType = c.templateType params.Payload = extra // b, _ := json.MarshalIndent(params, "", " ") // log.Println(string(b)) @@ -154,22 +192,66 @@ func flattenConfigKeys(options interface{}) []string { var flatten func(string, interface{}) []string flatten = func(prefix string, options interface{}) (strOpts []string) { - if m, ok := options.(map[string]interface{}); ok { - for k, v := range m { - if prefix != "" { - k = prefix + "/" + k - } - if n, ok := v.(map[string]interface{}); ok { - strOpts = append(strOpts, flatten(k, n)...) - } else { - strOpts = append(strOpts, k) - } - } + switch opt := options.(type) { + case map[string]interface{}: + return flattenJSON(prefix, options) + case cty.Value: + return flattenHCL(prefix, opt) + default: + return nil } - return } flattened := flatten("", options) sort.Strings(flattened) return flattened } + +func flattenJSON(prefix string, options interface{}) (strOpts []string) { + if m, ok := options.(map[string]interface{}); ok { + for k, v := range m { + if prefix != "" { + k = prefix + "/" + k + } + if n, ok := v.(map[string]interface{}); ok { + strOpts = append(strOpts, flattenJSON(k, n)...) + } else { + strOpts = append(strOpts, k) + } + } + } + return +} + +func flattenHCL(prefix string, v cty.Value) (args []string) { + if v.IsNull() { + return []string{} + } + t := v.Type() + switch { + case t.IsObjectType(), t.IsMapType(): + if !v.IsKnown() { + return []string{} + } + it := v.ElementIterator() + for it.Next() { + key, val := it.Element() + keyStr := key.AsString() + + if val.IsNull() { + continue + } + + if prefix != "" { + keyStr = fmt.Sprintf("%s/%s", prefix, keyStr) + } + + if val.Type().IsObjectType() || val.Type().IsMapType() { + args = append(args, flattenHCL(keyStr, val)...) + } else { + args = append(args, keyStr) + } + } + } + return args +} diff --git a/packer/telemetry_test.go b/packer/telemetry_test.go index c4192f61f67..7abc600cda1 100644 --- a/packer/telemetry_test.go +++ b/packer/telemetry_test.go @@ -1,6 +1,10 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( + "errors" "testing" "github.com/stretchr/testify/assert" @@ -30,3 +34,24 @@ func TestFlattenConfigKeys_nested(t *testing.T) { "Input didn't flatten correctly.", ) } + +func TestCheckpointTelemetry(t *testing.T) { + defer func() { + if r := recover(); r != nil { + t.Error("a noop CheckpointTelemetry should not to panic but it did\n", r) + } + }() + + // A null CheckpointTelemetry obtained in Packer when the CHECKPOINT_DISABLE env var is set results in a NOOP reporter + // The null reporter can be executable as a configured reporter but does not report any telemetry data. + var c *CheckpointTelemetry + c.SetTemplateType(HCL2Template) + c.SetBundledUsage() + c.AddSpan("mockprovisioner", "provisioner", nil) + if err := c.ReportPanic("Bogus Panic"); err != nil { + t.Errorf("calling ReportPanic on a nil checkpoint reporter should not error") + } + if err := c.Finalize("test", 1, errors.New("Bogus Error")); err != nil { + t.Errorf("calling Finalize on a nil checkpoint reporter should not error") + } +} diff --git a/packer/test-fixtures/build-interpolated-name.json b/packer/test-fixtures/build-interpolated-name.json new file mode 100644 index 00000000000..9ac1dd779f0 --- /dev/null +++ b/packer/test-fixtures/build-interpolated-name.json @@ -0,0 +1,7 @@ + +{ + "builders": [{ + "type": "test", + "name": "{{user `build_name`}}" + }] +} diff --git a/packer/testing.go b/packer/testing.go index dcdcf2a3023..b0ebc04b95f 100644 --- a/packer/testing.go +++ b/packer/testing.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( "bytes" - "io/ioutil" + "io" "testing" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -37,8 +40,8 @@ func TestUi(t *testing.T) packersdk.Ui { var buf bytes.Buffer return &packersdk.BasicUi{ Reader: &buf, - Writer: ioutil.Discard, - ErrorWriter: ioutil.Discard, + Writer: io.Discard, + ErrorWriter: io.Discard, } } diff --git a/packer/ui.go b/packer/ui.go index 1c6033ef415..ca1bec2937c 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( @@ -44,10 +47,18 @@ func (u *ColoredUi) Ask(query string) (string, error) { return u.Ui.Ask(u.colorize(query, u.Color, true)) } +func (u *ColoredUi) Askf(query string, vals ...any) (string, error) { + return u.Ask(fmt.Sprintf(query, vals...)) +} + func (u *ColoredUi) Say(message string) { u.Ui.Say(u.colorize(message, u.Color, true)) } +func (u *ColoredUi) Sayf(message string, vals ...any) { + u.Say(fmt.Sprintf(message, vals...)) +} + func (u *ColoredUi) Message(message string) { u.Ui.Message(u.colorize(message, u.Color, false)) } @@ -61,6 +72,10 @@ func (u *ColoredUi) Error(message string) { u.Ui.Error(u.colorize(message, color, true)) } +func (u *ColoredUi) Errorf(message string, vals ...any) { + u.Error(fmt.Sprintf(message, vals...)) +} + func (u *ColoredUi) Machine(t string, args ...string) { // Don't colorize machine-readable output u.Ui.Machine(t, args...) @@ -118,10 +133,18 @@ func (u *TargetedUI) Ask(query string) (string, error) { return u.Ui.Ask(u.prefixLines(true, query)) } +func (u *TargetedUI) Askf(query string, args ...any) (string, error) { + return u.Ask(fmt.Sprintf(query, args...)) +} + func (u *TargetedUI) Say(message string) { u.Ui.Say(u.prefixLines(true, message)) } +func (u *TargetedUI) Sayf(message string, args ...any) { + u.Say(fmt.Sprintf(message, args...)) +} + func (u *TargetedUI) Message(message string) { u.Ui.Message(u.prefixLines(false, message)) } @@ -130,6 +153,10 @@ func (u *TargetedUI) Error(message string) { u.Ui.Error(u.prefixLines(true, message)) } +func (u *TargetedUI) Errorf(message string, args ...any) { + u.Error(fmt.Sprintf(message, args...)) +} + func (u *TargetedUI) Machine(t string, args ...string) { // Prefix in the target, then pass through u.Ui.Machine(fmt.Sprintf("%s,%s", u.Target, t), args...) @@ -167,10 +194,18 @@ func (u *MachineReadableUi) Ask(query string) (string, error) { return "", errors.New("machine-readable UI can't ask") } +func (u *MachineReadableUi) Askf(query string, args ...any) (string, error) { + return u.Ask(fmt.Sprintf(query, args...)) +} + func (u *MachineReadableUi) Say(message string) { u.Machine("ui", "say", message) } +func (u *MachineReadableUi) Sayf(message string, args ...any) { + u.Say(fmt.Sprintf(message, args...)) +} + func (u *MachineReadableUi) Message(message string) { u.Machine("ui", "message", message) } @@ -179,6 +214,10 @@ func (u *MachineReadableUi) Error(message string) { u.Machine("ui", "error", message) } +func (u *MachineReadableUi) Errorf(message string, args ...any) { + u.Error(fmt.Sprintf(message, args...)) +} + func (u *MachineReadableUi) Machine(category string, args ...string) { now := time.Now().UTC() @@ -229,10 +268,18 @@ func (u *TimestampedUi) Ask(query string) (string, error) { return u.Ui.Ask(query) } +func (u *TimestampedUi) Askf(query string, args ...any) (string, error) { + return u.Ask(fmt.Sprintf(query, args...)) +} + func (u *TimestampedUi) Say(message string) { u.Ui.Say(u.timestampLine(message)) } +func (u *TimestampedUi) Sayf(message string, args ...any) { + u.Say(fmt.Sprintf(message, args...)) +} + func (u *TimestampedUi) Message(message string) { u.Ui.Message(u.timestampLine(message)) } @@ -241,6 +288,10 @@ func (u *TimestampedUi) Error(message string) { u.Ui.Error(u.timestampLine(message)) } +func (u *TimestampedUi) Errorf(message string, args ...any) { + u.Error(fmt.Sprintf(message, args...)) +} + func (u *TimestampedUi) Machine(message string, args ...string) { u.Ui.Machine(message, args...) } diff --git a/packer/ui_test.go b/packer/ui_test.go index 974c09cf29e..44fa93c7f07 100644 --- a/packer/ui_test.go +++ b/packer/ui_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package packer import ( diff --git a/panic.go b/panic.go index 5d58c56854f..6fdfc59af24 100644 --- a/panic.go +++ b/panic.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/post-processor/artifice/artifact.go b/post-processor/artifice/artifact.go index de55e46e63b..859b05e6199 100644 --- a/post-processor/artifice/artifact.go +++ b/post-processor/artifice/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package artifice import ( diff --git a/post-processor/artifice/post-processor.go b/post-processor/artifice/post-processor.go index 71cc7339a43..d1a4f422268 100644 --- a/post-processor/artifice/post-processor.go +++ b/post-processor/artifice/post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package artifice diff --git a/post-processor/artifice/version/version.go b/post-processor/artifice/version/version.go index 85e9772b656..b329b365688 100644 --- a/post-processor/artifice/version/version.go +++ b/post-processor/artifice/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/post-processor/checksum/artifact.go b/post-processor/checksum/artifact.go index 78360bb85c8..5468460d53a 100644 --- a/post-processor/checksum/artifact.go +++ b/post-processor/checksum/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package checksum import ( diff --git a/post-processor/checksum/post-processor.go b/post-processor/checksum/post-processor.go index 81d2d85a18e..efd51b6a169 100644 --- a/post-processor/checksum/post-processor.go +++ b/post-processor/checksum/post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package checksum diff --git a/post-processor/checksum/post-processor_test.go b/post-processor/checksum/post-processor_test.go index 8c388e3ac88..6a08f029735 100644 --- a/post-processor/checksum/post-processor_test.go +++ b/post-processor/checksum/post-processor_test.go @@ -1,10 +1,13 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package checksum import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "os" "strings" "testing" @@ -35,7 +38,7 @@ func TestChecksumSHA1(t *testing.T) { if err != nil { t.Errorf("Unable to read checksum file: %s", err) } - if buf, _ := ioutil.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { + if buf, _ := io.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { t.Errorf("Failed to compute checksum: %s\n%s", buf, "d3486ae9136e7856bc42212385ea797094475802 package.txt") } diff --git a/post-processor/checksum/version/version.go b/post-processor/checksum/version/version.go index be8fc4ac1d3..9e1eeb239d9 100644 --- a/post-processor/checksum/version/version.go +++ b/post-processor/checksum/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/post-processor/compress/artifact.go b/post-processor/compress/artifact.go index 9bd89b213ab..c56b2905daf 100644 --- a/post-processor/compress/artifact.go +++ b/post-processor/compress/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package compress import ( diff --git a/post-processor/compress/artifact_test.go b/post-processor/compress/artifact_test.go index cba4ecb5124..a30a803edf6 100644 --- a/post-processor/compress/artifact_test.go +++ b/post-processor/compress/artifact_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package compress import ( diff --git a/post-processor/compress/benchmark.go b/post-processor/compress/benchmark.go index f21b7a18d01..e315f3bcf2d 100644 --- a/post-processor/compress/benchmark.go +++ b/post-processor/compress/benchmark.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build ignore // +build ignore @@ -15,7 +18,7 @@ import ( "github.com/biogo/hts/bgzf" "github.com/klauspost/pgzip" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" "github.com/ulikunitz/xz" ) @@ -187,7 +190,7 @@ func (c *Compressor) BenchmarkPGZIPReader(b *testing.B) { func (c *Compressor) BenchmarkLZ4Writer(b *testing.B) { cw := lz4.NewWriter(c.w) // cw.Header.HighCompression = true - cw.Header.NoChecksum = true + cw.Apply(lz4.ChecksumOption(false)) b.ResetTimer() _, err := io.Copy(cw, c.r) diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 8214bce0cb6..07a74e813d0 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package compress @@ -21,7 +24,7 @@ import ( "github.com/hashicorp/packer-plugin-sdk/template/config" "github.com/hashicorp/packer-plugin-sdk/template/interpolate" "github.com/klauspost/pgzip" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" "github.com/ulikunitz/xz" ) @@ -330,8 +333,27 @@ func makeBZIP2Writer(output io.Writer, compressionLevel int) (io.WriteCloser, er func makeLZ4Writer(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { lzwriter := lz4.NewWriter(output) - if compressionLevel > 0 { - lzwriter.Header.CompressionLevel = compressionLevel + if compressionLevel < 0 { + return lzwriter, nil + } + levels := map[int]lz4.CompressionLevel{ + 0: lz4.Fast, + 1: lz4.Level1, + 2: lz4.Level2, + 3: lz4.Level3, + 4: lz4.Level4, + 5: lz4.Level5, + 6: lz4.Level6, + 7: lz4.Level7, + 8: lz4.Level8, + 9: lz4.Level9, + } + level, ok := levels[compressionLevel] + if !ok { + return nil, ErrInvalidCompressionLevel + } + if err := lzwriter.Apply(lz4.CompressionLevelOption(level)); err != nil { + return nil, err } return lzwriter, nil } diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index e8f9d030273..00b8a1377ca 100644 --- a/post-processor/compress/post-processor_test.go +++ b/post-processor/compress/post-processor_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package compress import ( @@ -6,7 +9,7 @@ import ( "compress/gzip" "context" "fmt" - "io/ioutil" + "io" "os" "strings" "testing" @@ -15,7 +18,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/template" "github.com/hashicorp/packer/builder/file" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" ) func TestDetectFilename(t *testing.T) { @@ -81,7 +84,7 @@ func TestCompressOptions(t *testing.T) { filename := "package.gz" archive, _ := os.Open(filename) gzipReader, _ := gzip.NewReader(archive) - data, _ := ioutil.ReadAll(gzipReader) + data, _ := io.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) @@ -112,7 +115,7 @@ func TestCompressInterpolation(t *testing.T) { } gzipReader, _ := gzip.NewReader(archive) - data, _ := ioutil.ReadAll(gzipReader) + data, _ := io.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) @@ -191,7 +194,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(bzipReader) + return io.ReadAll(bzipReader) }, "zip": func(archive *os.File) ([]byte, error) { fi, _ := archive.Stat() @@ -203,7 +206,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(ctt) + return io.ReadAll(ctt) }, "tar": func(archive *os.File) ([]byte, error) { tarReader := tar.NewReader(archive) @@ -211,7 +214,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(tarReader) + return io.ReadAll(tarReader) }, "tar.gz": func(archive *os.File) ([]byte, error) { gzipReader, err := gzip.NewReader(archive) @@ -223,15 +226,15 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(tarReader) + return io.ReadAll(tarReader) }, "gz": func(archive *os.File) ([]byte, error) { gzipReader, _ := gzip.NewReader(archive) - return ioutil.ReadAll(gzipReader) + return io.ReadAll(gzipReader) }, "lz4": func(archive *os.File) ([]byte, error) { lz4Reader := lz4.NewReader(archive) - return ioutil.ReadAll(lz4Reader) + return io.ReadAll(lz4Reader) }, } diff --git a/post-processor/compress/tar_fix.go b/post-processor/compress/tar_fix.go index d565cca2aa2..0402f4e7075 100644 --- a/post-processor/compress/tar_fix.go +++ b/post-processor/compress/tar_fix.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build !go1.10 // +build !go1.10 diff --git a/post-processor/compress/tar_fix_go110.go b/post-processor/compress/tar_fix_go110.go index 72c2c46c1a2..2e0eba8d8cf 100644 --- a/post-processor/compress/tar_fix_go110.go +++ b/post-processor/compress/tar_fix_go110.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build go1.10 // +build go1.10 diff --git a/post-processor/compress/version/version.go b/post-processor/compress/version/version.go index 08eb1da4177..75bfb46f656 100644 --- a/post-processor/compress/version/version.go +++ b/post-processor/compress/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/post-processor/manifest/artifact.go b/post-processor/manifest/artifact.go index 61f11bb8525..ceef83f8123 100644 --- a/post-processor/manifest/artifact.go +++ b/post-processor/manifest/artifact.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package manifest import "fmt" diff --git a/post-processor/manifest/post-processor.go b/post-processor/manifest/post-processor.go index 2b32243f110..74f203525d9 100644 --- a/post-processor/manifest/post-processor.go +++ b/post-processor/manifest/post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown @@ -7,7 +10,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "log" "os" "path/filepath" @@ -32,7 +34,7 @@ type Config struct { // Don't write the `build_time` field from the output. StripTime bool `mapstructure:"strip_time"` // Arbitrary data to add to the manifest. This is a [template - // engine](https://packer.io/docs/templates/legacy_json_templates/engine.html). Therefore, you + // engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you // may use user variables and template functions in this field. CustomData map[string]string `mapstructure:"custom_data"` ctx interpolate.Context @@ -140,7 +142,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source // Read the current manifest file from disk contents := []byte{} - if contents, err = ioutil.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { + if contents, err = os.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { return source, true, true, fmt.Errorf("Unable to open %s for reading: %s", p.config.OutputPath, err) } @@ -164,7 +166,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source // Write JSON to disk if out, err := json.MarshalIndent(manifestFile, "", " "); err == nil { - if err = ioutil.WriteFile(p.config.OutputPath, out, 0664); err != nil { + if err = os.WriteFile(p.config.OutputPath, out, 0664); err != nil { return source, true, true, fmt.Errorf("Unable to write %s: %s", p.config.OutputPath, err) } } else { diff --git a/post-processor/manifest/version/version.go b/post-processor/manifest/version/version.go index a4ded430904..86f862f89fd 100644 --- a/post-processor/manifest/version/version.go +++ b/post-processor/manifest/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/post-processor/shell-local/post-processor.go b/post-processor/shell-local/post-processor.go index 8748e16ca71..801e8ac6567 100644 --- a/post-processor/shell-local/post-processor.go +++ b/post-processor/shell-local/post-processor.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell_local import ( diff --git a/post-processor/shell-local/post-processor_test.go b/post-processor/shell-local/post-processor_test.go index 4007584cd51..13121658af2 100644 --- a/post-processor/shell-local/post-processor_test.go +++ b/post-processor/shell-local/post-processor_test.go @@ -1,7 +1,9 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell_local import ( - "io/ioutil" "os" "runtime" "testing" @@ -92,7 +94,7 @@ func TestPostProcessorPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -160,7 +162,7 @@ func TestPostProcessorPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -179,7 +181,7 @@ func TestPostProcessorPrepare_ScriptAndScripts(t *testing.T) { raws := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -205,7 +207,7 @@ func TestPostProcessorPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/post-processor/shell-local/version/version.go b/post-processor/shell-local/version/version.go index 53f0562e849..1f602bc5f46 100644 --- a/post-processor/shell-local/version/version.go +++ b/post-processor/shell-local/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/breakpoint/provisioner.go b/provisioner/breakpoint/provisioner.go index a708a67b18a..9ac6e340fb2 100644 --- a/provisioner/breakpoint/provisioner.go +++ b/provisioner/breakpoint/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package breakpoint @@ -64,8 +67,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe ui.Say("Pausing at breakpoint provisioner.") } - message := fmt.Sprintf( - "Press enter to continue.") + message := "Press enter to continue." var g errgroup.Group result := make(chan string, 1) diff --git a/provisioner/breakpoint/version/version.go b/provisioner/breakpoint/version/version.go index 48a982805bf..2024c7e5a74 100644 --- a/provisioner/breakpoint/version/version.go +++ b/provisioner/breakpoint/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/file/provisioner.go b/provisioner/file/provisioner.go index 369eec74204..586896611d9 100644 --- a/provisioner/file/provisioner.go +++ b/provisioner/file/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown diff --git a/provisioner/file/provisioner_test.go b/provisioner/file/provisioner_test.go index a8cb9de5b2c..280afa0250a 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -1,9 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package file import ( "bytes" "context" - "io/ioutil" "os" "path/filepath" "regexp" @@ -59,7 +61,7 @@ func TestProvisionerPrepare_InvalidSource(t *testing.T) { func TestProvisionerPrepare_ValidSource(t *testing.T) { var p Provisioner - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -104,7 +106,7 @@ func TestProvisionerPrepare_EmptyDestination(t *testing.T) { func TestProvisionerProvision_SendsFile(t *testing.T) { var p Provisioner - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -192,7 +194,7 @@ func TestProvisionerProvision_SendsContent(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -202,7 +204,7 @@ func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -245,13 +247,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { var p Provisioner // Prepare the first directory - td1, err := ioutil.TempDir("", "packerdir") + td1, err := os.MkdirTemp("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td1) - tf1, err := ioutil.TempFile(td1, "packer") + tf1, err := os.CreateTemp(td1, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -261,13 +263,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { } // Prepare the second directory - td2, err := ioutil.TempDir("", "packerdir") + td2, err := os.MkdirTemp("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td2) - tf2, err := ioutil.TempFile(td2, "packer") + tf2, err := os.CreateTemp(td2, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -314,7 +316,7 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -324,7 +326,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -385,7 +387,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -395,7 +397,7 @@ func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -451,12 +453,12 @@ func TestProvisionDownloadMkdirAll(t *testing.T) { {"path/to/dir"}, {"path/to/dir/"}, } - tmpDir, err := ioutil.TempDir("", "packer-file") + tmpDir, err := os.MkdirTemp("", "packer-file") if err != nil { t.Fatalf("error tempdir: %s", err) } defer os.RemoveAll(tmpDir) - tf, err := ioutil.TempFile(tmpDir, "packer") + tf, err := os.CreateTemp(tmpDir, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/file/version/version.go b/provisioner/file/version/version.go index d524a335ca9..8451cf03227 100644 --- a/provisioner/file/version/version.go +++ b/provisioner/file/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/powershell/execution_policy.go b/provisioner/powershell/execution_policy.go index c79b2f72cab..057f60a2ec7 100644 --- a/provisioner/powershell/execution_policy.go +++ b/provisioner/powershell/execution_policy.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy package powershell diff --git a/provisioner/powershell/execution_policy_test.go b/provisioner/powershell/execution_policy_test.go index ae8680c67ae..5631b78bdd1 100644 --- a/provisioner/powershell/execution_policy_test.go +++ b/provisioner/powershell/execution_policy_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package powershell import ( diff --git a/provisioner/powershell/executionpolicy_enumer.go b/provisioner/powershell/executionpolicy_enumer.go index b8157b9cfc3..eac957360e8 100644 --- a/provisioner/powershell/executionpolicy_enumer.go +++ b/provisioner/powershell/executionpolicy_enumer.go @@ -1,6 +1,5 @@ // Code generated by "enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy"; DO NOT EDIT. -// package powershell import ( diff --git a/provisioner/powershell/provisioner.go b/provisioner/powershell/provisioner.go index 396eafc21df..aae71f9fb3e 100644 --- a/provisioner/powershell/provisioner.go +++ b/provisioner/powershell/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes powershell diff --git a/provisioner/powershell/provisioner_acc_test.go b/provisioner/powershell/provisioner_acc_test.go index fb0be9a80e3..8073d011334 100644 --- a/provisioner/powershell/provisioner_acc_test.go +++ b/provisioner/powershell/provisioner_acc_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package powershell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -32,7 +35,7 @@ func LoadProvisionerFragment(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/powershell/provisioner_test.go b/provisioner/powershell/provisioner_test.go index ac0b656103c..024b0585fa2 100644 --- a/provisioner/powershell/provisioner_test.go +++ b/provisioner/powershell/provisioner_test.go @@ -1,10 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package powershell import ( "bytes" "context" "fmt" - "io/ioutil" "os" "regexp" "strings" @@ -32,7 +34,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := ioutil.ReadFile(file) + readFile, err := os.ReadFile(file) expectedContents := "foo\nbar\n" if err != nil { t.Fatalf("Should not be error: %s", err) @@ -184,7 +186,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -211,7 +213,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -231,7 +233,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -258,7 +260,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -509,7 +511,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -539,7 +541,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") ui := testUi() defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -576,7 +578,7 @@ func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { } func TestProvisionerProvision_SkipClean(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") defer func() { tempFile.Close() os.Remove(tempFile.Name()) diff --git a/provisioner/powershell/version/version.go b/provisioner/powershell/version/version.go index 2f89c87401a..b0350e51cbd 100644 --- a/provisioner/powershell/version/version.go +++ b/provisioner/powershell/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/shell-local/provisioner.go b/provisioner/shell-local/provisioner.go index e041278b6f6..3c62b28f9d5 100644 --- a/provisioner/shell-local/provisioner.go +++ b/provisioner/shell-local/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( diff --git a/provisioner/shell-local/provisioner_acc_test.go b/provisioner/shell-local/provisioner_acc_test.go index fd0f390aea0..1f1b37a0cb8 100644 --- a/provisioner/shell-local/provisioner_acc_test.go +++ b/provisioner/shell-local/provisioner_acc_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -28,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/shell-local/provisioner_test.go b/provisioner/shell-local/provisioner_test.go index 7473e046d76..c320ad4a1d1 100644 --- a/provisioner/shell-local/provisioner_test.go +++ b/provisioner/shell-local/provisioner_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( diff --git a/provisioner/shell-local/version/version.go b/provisioner/shell-local/version/version.go index b26a6eb0a05..27e57fb5c0a 100644 --- a/provisioner/shell-local/version/version.go +++ b/provisioner/shell-local/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 62fc3c6cfd1..593f898caf0 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes diff --git a/provisioner/shell/provisioner_acc_test.go b/provisioner/shell/provisioner_acc_test.go index 7dc956367f2..167456d274a 100644 --- a/provisioner/shell/provisioner_acc_test.go +++ b/provisioner/shell/provisioner_acc_test.go @@ -1,8 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -28,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/shell/provisioner_test.go b/provisioner/shell/provisioner_test.go index 9cdd5459a2e..40da9b5ea2b 100644 --- a/provisioner/shell/provisioner_test.go +++ b/provisioner/shell/provisioner_test.go @@ -1,7 +1,9 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( - "io/ioutil" "os" "regexp" "strings" @@ -120,7 +122,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -146,7 +148,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -165,7 +167,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -191,7 +193,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/shell/unix_reader.go b/provisioner/shell/unix_reader.go index 837ecdeaee8..9e27a6de928 100644 --- a/provisioner/shell/unix_reader.go +++ b/provisioner/shell/unix_reader.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( diff --git a/provisioner/shell/unix_reader_test.go b/provisioner/shell/unix_reader_test.go index 4aa1f9ea9da..869531653ad 100644 --- a/provisioner/shell/unix_reader_test.go +++ b/provisioner/shell/unix_reader_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( diff --git a/provisioner/shell/version/version.go b/provisioner/shell/version/version.go index 53fb36b1ad5..bb0b798efe2 100644 --- a/provisioner/shell/version/version.go +++ b/provisioner/shell/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/sleep/provisioner.go b/provisioner/sleep/provisioner.go index 20955fe8a29..7c74c74b73d 100644 --- a/provisioner/sleep/provisioner.go +++ b/provisioner/sleep/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Provisioner package sleep diff --git a/provisioner/sleep/provisioner_test.go b/provisioner/sleep/provisioner_test.go index 2ed66ff5046..94acf5771ef 100644 --- a/provisioner/sleep/provisioner_test.go +++ b/provisioner/sleep/provisioner_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package sleep import ( diff --git a/provisioner/sleep/version/version.go b/provisioner/sleep/version/version.go index cf38b86861e..3b0c4c2bf25 100644 --- a/provisioner/sleep/version/version.go +++ b/provisioner/sleep/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index c98087063e6..4c1113a0df8 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config package restart diff --git a/provisioner/windows-restart/provisioner_test.go b/provisioner/windows-restart/provisioner_test.go index 34977aba4da..c2d934ed539 100644 --- a/provisioner/windows-restart/provisioner_test.go +++ b/provisioner/windows-restart/provisioner_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package restart import ( diff --git a/provisioner/windows-restart/version/version.go b/provisioner/windows-restart/version/version.go index e20c9ddc11f..d178be5e559 100644 --- a/provisioner/windows-restart/version/version.go +++ b/provisioner/windows-restart/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/provisioner/windows-shell/provisioner.go b/provisioner/windows-shell/provisioner.go index 0e21c6cb986..0002d85ba06 100644 --- a/provisioner/windows-shell/provisioner.go +++ b/provisioner/windows-shell/provisioner.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:generate packer-sdc mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes @@ -25,7 +28,7 @@ import ( "github.com/hashicorp/packer-plugin-sdk/tmp" ) -//FIXME query remote host or use %SYSTEMROOT%, %TEMP% and more creative filename +// FIXME query remote host or use %SYSTEMROOT%, %TEMP% and more creative filename const DefaultRemotePath = "c:/Windows/Temp/script.bat" type Config struct { diff --git a/provisioner/windows-shell/provisioner_test.go b/provisioner/windows-shell/provisioner_test.go index d75ff861a21..08990b00ae7 100644 --- a/provisioner/windows-shell/provisioner_test.go +++ b/provisioner/windows-shell/provisioner_test.go @@ -1,9 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package shell import ( "bytes" "context" - "io/ioutil" "log" "os" "strings" @@ -34,7 +36,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := ioutil.ReadFile(file) + readFile, err := os.ReadFile(file) if err != nil { t.Fatalf("Should not be error: %s", err) } @@ -99,7 +101,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -126,7 +128,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -146,7 +148,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -173,7 +175,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -322,7 +324,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -354,7 +356,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/windows-shell/version/version.go b/provisioner/windows-shell/version/version.go index 70d61de8315..71885679439 100644 --- a/provisioner/windows-shell/version/version.go +++ b/provisioner/windows-shell/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 79bda1696b0..3290347fe0f 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + <# .Synopsis Build script for Packer. diff --git a/scripts/build.sh b/scripts/build.sh index b72be90385e..491a1bbce4f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + # This script builds the application from source for multiple platforms. # Determine the arch/os combos we're building for diff --git a/scripts/codesign_example.sh b/scripts/codesign_example.sh index aa68169d055..85303332049 100755 --- a/scripts/codesign_example.sh +++ b/scripts/codesign_example.sh @@ -1,4 +1,7 @@ #! /usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + set -euo pipefail # first makes some assertions about the environment and set some shared diff --git a/scripts/dist.sh b/scripts/dist.sh index 1cd42e7fb11..999be612a05 100755 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + set -e # Get the parent directory of where this script is. diff --git a/scripts/generate-plugins.go b/scripts/generate-plugins.go index d2e69c5af6d..b31306ae12e 100755 --- a/scripts/generate-plugins.go +++ b/scripts/generate-plugins.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + // Generate Plugins is a small program that updates the lists of plugins in // command/plugin.go so they will be compiled into the main packer binary. // @@ -9,7 +12,6 @@ import ( "go/ast" "go/parser" "go/token" - "io/ioutil" "log" "os" "path/filepath" @@ -19,7 +21,7 @@ import ( "golang.org/x/tools/imports" ) -const target = "command/plugin.go" +const target = "command/execute.go" func main() { wd, _ := os.Getwd() @@ -96,10 +98,10 @@ type plugin struct { // makeMap creates a map named Name with type packer.Name that looks something // like this: // -// var Builders = map[string]packersdk.Builder{ -// "amazon-chroot": new(chroot.Builder), -// "amazon-ebs": new(ebs.Builder), -// "amazon-instance": new(instance.Builder), +// var Builders = map[string]packersdk.Builder{ +// "amazon-chroot": new(chroot.Builder), +// "amazon-ebs": new(ebs.Builder), +// "amazon-instance": new(instance.Builder), func makeMap(varName, varType string, items []plugin) string { output := "" @@ -139,7 +141,7 @@ func makeImports(builders, provisioners, postProcessors, Datasources []plugin) s // listDirectories recursively lists directories under the specified path func listDirectories(path string) ([]string, error) { names := []string{} - items, err := ioutil.ReadDir(path) + items, err := os.ReadDir(path) if err != nil { return names, err } @@ -276,7 +278,7 @@ packersdk "github.com/hashicorp/packer-plugin-sdk/packer" IMPORTS ) -type PluginCommand struct { +type ExecuteCommand struct { Meta } @@ -290,20 +292,20 @@ DATASOURCES var pluginRegexp = regexp.MustCompile("packer-(builder|post-processor|provisioner|datasource)-(.+)") -func (c *PluginCommand) Run(args []string) int { +func (c *ExecuteCommand) Run(args []string) int { // This is an internal call (users should not call this directly) so we're // not going to do much input validation. If there's a problem we'll often // just crash. Error handling should be added to facilitate debugging. log.Printf("args: %#v", args) if len(args) != 1 { - c.Ui.Error("Wrong number of args") + c.Ui.Error(c.Help()) return 1 } // Plugin will match something like "packer-builder-amazon-ebs" parts := pluginRegexp.FindStringSubmatch(args[0]) if len(parts) != 3 { - c.Ui.Error(fmt.Sprintf("Error parsing plugin argument [DEBUG]: %#v", parts)) + c.Ui.Error(c.Help()) return 1 } pluginType := parts[1] // capture group 1 (builder|post-processor|provisioner) @@ -351,9 +353,9 @@ func (c *PluginCommand) Run(args []string) int { return 0 } -func (*PluginCommand) Help() string { +func (*ExecuteCommand) Help() string { helpText := ` + "`" + ` -Usage: packer plugin PLUGIN +Usage: packer execute PLUGIN Runs an internally-compiled version of a plugin from the packer binary. @@ -363,7 +365,7 @@ Usage: packer plugin PLUGIN return strings.TrimSpace(helpText) } -func (c *PluginCommand) Synopsis() string { +func (c *ExecuteCommand) Synopsis() string { return "internal plugin command" } ` diff --git a/scripts/off_gopath.sh b/scripts/off_gopath.sh index ead92a6d7e2..04e1ae709e5 100755 --- a/scripts/off_gopath.sh +++ b/scripts/off_gopath.sh @@ -1,4 +1,7 @@ #! /usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + set -eu -o pipefail diff --git a/scripts/prepare_changelog.sh b/scripts/prepare_changelog.sh index 3bb5d1f9ef1..a10b9972b6a 100755 --- a/scripts/prepare_changelog.sh +++ b/scripts/prepare_changelog.sh @@ -1,78 +1,56 @@ #!/bin/zsh +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + LAST_RELEASE=$1 -DO_PR_CHECK=1 set -o pipefail -is_doc_or_tech_debt_pr(){ - if ! (($+commands[jq])); then - DO_PR_CHECK=0 - echo "jq not found" - return 1 - fi - out=$(python3 -m json.tool < pull.json \ - | jq '[.labels[].name == "docs" or .labels[].name == "tech-debt" or .labels[].name == "website"] | any') - grep -q true <<< $out - return $? -} - if [ -z $LAST_RELEASE ]; then echo "you need to give the previous release version. prepare_changelog.sh v" exit 1 fi +if [ -z "$(which jq)" ]; then + echo "jq command not found" + return 1 +fi + +if [ -z "$(which jq)" ]; then + echo "gh command not found" + return 1 +fi + get_prs(){ - # git log v0.10.2...c3861d167533fb797b0fae0c380806625712e5f7 | - git log HEAD...${LAST_RELEASE} --first-parent --oneline --grep="Merge pull request #[0-9]\+" --grep="(#[0-9]\+)$" | - grep -o "#\([0-9]\+\)" | awk -F\# '{print $2}' | while read line + release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})" + gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' \ + | while read line do - grep -q "GH-${line}" CHANGELOG.md - if [ $? -ne 0 ]; then - echo $line + if grep -q "GH-${line}" CHANGELOG.md; then + continue fi + echo $line done | while read PR_NUM do - if [[ -z "${GITHUB_TOKEN}" ]] || [[ -z "${GITHUB_USERNAME}" ]] ; then - out=$(curl -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) - else - # authenticated call - out=$(curl -u ${GITHUB_USERNAME}:${GITHUB_TOKEN} -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) - fi - exy="$?" - if [ $exy -ne 0 ]; then + out=$(gh pr view ${PR_NUM} --json "title,labels,url" > pull.json) + if [ "$?" -ne 0 ]; then echo "bad response from github: manually check PR ${PR_NUM}" continue fi - if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr; then - echo "Skipping PR ${PR_NUM}: labeled as tech debt, docs or website. (waiting a second so we don't get rate-limited...)" - continue - fi - echo "$(python3 -m json.tool < pull.json | jq -r '.title') - [GH-${PR_NUM}](https://github.com/hashicorp/packer/pull/${PR_NUM})" + echo "$(jq -r '.title' < pull.json) - [GH-${PR_NUM}](https://github.com/hashicorp/packer/pull/${PR_NUM})" + rm -f pull.json done } -#is_doc_or_tech_debt_pr 52061111 -# is_doc_or_tech_debt_pr 5206 # non-doc pr -#is_doc_or_tech_debt_pr 5434 # doc pr -#echo $? -#exit - -# prpid=$! -# trap 'kill -9 ${prpid}; exit' INT TERM - get_prs | while read line; do echo $line if [[ "$line" =~ "bad" ]]; then exit 1 - elif [[ "$line" =~ "Skipping" ]]; then - sleep 1 # GH will rate limit us if we have several in a row - continue fi - rm -f pull.json + echo "Press enter to continue with next entry." vared -ch ok done - #TODO: just generate it automatically using PR titles and tags diff --git a/scripts/sign.sh b/scripts/sign.sh index 024e5e5bde2..494347ef677 100755 --- a/scripts/sign.sh +++ b/scripts/sign.sh @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + #!/usr/bin/env bash diff --git a/scripts/sort-md-list.py b/scripts/sort-md-list.py index e7bafc56e51..c84ad663da2 100755 --- a/scripts/sort-md-list.py +++ b/scripts/sort-md-list.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + """ sort-md-list.py sorts markdown lists diff --git a/scripts/upgrade_plugins.sh b/scripts/upgrade_plugins.sh deleted file mode 100755 index f2c7335c042..00000000000 --- a/scripts/upgrade_plugins.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/zsh - -## This script is to be run before a Packer release in order to update -## all vendored plugins to the latest available release. -## The SDK is included in the plugin list and will be upgraded as well if a -## newest version is available. -## This script should be run in packer's root. - -declare -a plugins=( - "hashicorp/packer-plugin-alicloud" - "hashicorp/packer-plugin-amazon" - "hashicorp/packer-plugin-ansible" - "hashicorp/packer-plugin-azure" - "hashicorp/packer-plugin-chef" - "hashicorp/packer-plugin-cloudstack" - "hashicorp/packer-plugin-converge" - "digitalocean/packer-plugin-digitalocean" - "hashicorp/packer-plugin-docker" - "hashicorp/packer-plugin-googlecompute" - "hashicorp/packer-plugin-hcloud" - "hashicorp/packer-plugin-hyperone" - "hashicorp/packer-plugin-hyperv" - "hashicorp/packer-plugin-jdcloud" - "hashicorp/packer-plugin-linode" - "hashicorp/packer-plugin-lxc" - "hashicorp/packer-plugin-lxd" - "hashicorp/packer-plugin-ncloud" - "hashicorp/packer-plugin-openstack" - "hashicorp/packer-plugin-oneandone" - "hashicorp/packer-plugin-parallels" - "hashicorp/packer-plugin-profitbricks" - "hashicorp/packer-plugin-proxmox" - "hashicorp/packer-plugin-puppet" - "hashicorp/packer-plugin-qemu" - "hashicorp/packer-plugin-sdk" - "hashicorp/packer-plugin-tencentcloud" - "hashicorp/packer-plugin-triton" - "hashicorp/packer-plugin-ucloud" - "hashicorp/packer-plugin-vagrant" - "hashicorp/packer-plugin-virtualbox" - "hashicorp/packer-plugin-vmware" - "hashicorp/packer-plugin-vsphere" - "hashicorp/packer-plugin-yandex" -) - -## now loop through the above plugin array -## update the plugins and the SDK to the latest available version -for i in "${plugins[@]}" -do - happy=false - while ! $happy - do - echo "upgrading $i" - output=$(go get -d github.com/$i) - happy=true - if [[ $output == *"443: Connection refused"* ]]; then - echo "Try again after 5 seconds" - sleep 5 - happy=false - fi - done - sleep 1 -done - -go mod tidy -compat=1.18 diff --git a/scripts/vagrant-freebsd-priv-config.sh b/scripts/vagrant-freebsd-priv-config.sh index e2ea148dce0..89915370f36 100755 --- a/scripts/vagrant-freebsd-priv-config.sh +++ b/scripts/vagrant-freebsd-priv-config.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + chown vagrant:wheel \ /opt/gopath \ diff --git a/scripts/vagrant-freebsd-unpriv-bootstrap.sh b/scripts/vagrant-freebsd-unpriv-bootstrap.sh index 26d40b91e2e..809415ab6c8 100755 --- a/scripts/vagrant-freebsd-unpriv-bootstrap.sh +++ b/scripts/vagrant-freebsd-unpriv-bootstrap.sh @@ -1,4 +1,7 @@ #!/bin/sh +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + export GOPATH=/opt/gopath diff --git a/scripts/vagrant-linux-priv-config.sh b/scripts/vagrant-linux-priv-config.sh index edbb5b8b76c..b658e719179 100755 --- a/scripts/vagrant-linux-priv-config.sh +++ b/scripts/vagrant-linux-priv-config.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + export DEBIAN_FRONTEND=noninteractive diff --git a/scripts/vagrant-linux-priv-go.sh b/scripts/vagrant-linux-priv-go.sh index f9e792cb0a8..e59ae7e145d 100755 --- a/scripts/vagrant-linux-priv-go.sh +++ b/scripts/vagrant-linux-priv-go.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + function install_go() { local go_version=1.13 diff --git a/scripts/vagrant-linux-unpriv-bootstrap.sh b/scripts/vagrant-linux-unpriv-bootstrap.sh index 04cc38bec68..ff6b8f8f90f 100755 --- a/scripts/vagrant-linux-unpriv-bootstrap.sh +++ b/scripts/vagrant-linux-unpriv-bootstrap.sh @@ -1,3 +1,6 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + cd /opt/gopath/src/github.com/hashicorp/packer && make dev diff --git a/scripts/version.sh b/scripts/version.sh deleted file mode 100755 index c854cab307b..00000000000 --- a/scripts/version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -version_file=$1 -version=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < "${version_file}") -prerelease=$(awk '$1 == "VersionPrerelease" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < "${version_file}") - -if [ -n "$prerelease" ]; then - echo "${version}-${prerelease}" -else - echo "${version}" -fi \ No newline at end of file diff --git a/test/README.md b/test/README.md deleted file mode 100644 index 1c8949f1fd9..00000000000 --- a/test/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Packer Black-Box Tests - -This folder contains tests that test Packer using a black-box approach: -`packer` is executed directly (with whatever is on the PATH) and certain -results are expected. - -Tests are run using [Bats](https://github.com/sstephenson/bats), and therefore -Bash is required to run any tests. - -**Warning:** Many of these tests run using cloud infrastructure, and therefore have -a real-world cost associated with running the tests. Be aware of that prior -to running the tests. Additionally, many tests will leave left-over artifacts -(AMIs) that you'll have to manually clean up. - -## Running Tests - -### Required Software - -Before running the tests, you'll need the following installed. If you're -running on macOS, most of these are available with `brew`: - -* [Bats](https://github.com/sstephenson/bats) - -* [AWS cli](http://aws.amazon.com/cli/) for AWS tests as well as most - of the components. - -* [gcutil](https://developers.google.com/compute/docs/gcutil/#install) for - Google Compute Engine tests. - -* [h1-cli](https://github.com/hyperonecom/h1-client-go) for HyperOne tests. - -### Configuring Tests - -**For tests that require AWS credentials:** - -Set the following self-explanatory environmental variables: - -* `AWS_ACCESS_KEY_ID` -* `AWS_SECRET_ACCESS_KEY` - -**For tests that test Google Compute Engine:** - -Set the following environmental variables: - -* `GC_BUCKET_NAME` -* `GC_ACCOUNT_FILE` -* `GC_PROJECT_ID` - -**For tests that test HyperOne:** - -Set the following environmental variables: - -* `HYPERONE_TOKEN` -* `HYPERONE_PROJECT` - -You have to be authenticated within the `h1` tool (use `h1 login`). - -### Running - -These tests are meant to be run _one file at a time_. There are some -test files (such as the amazon-chroot builder test) that simply won't -run except in special environments, so running all test files will probably -never work. - -If you're working on Packer and want to test that your change didn't -adversely affect something, try running only the test that is related to -your change. - -``` -$ bats builder_amazon_ebs.bats -``` - -Note: Working directory doesn't matter. You can call the bats test file -from any directory. diff --git a/test/builder_googlecompute.bats b/test/builder_googlecompute.bats deleted file mode 100755 index 1051bb99a1e..00000000000 --- a/test/builder_googlecompute.bats +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the googlecompute builder. The teardown function will -# delete any images with the text "packerbats" within the name. - -load test_helper -fixtures builder-googlecompute - -# Required parameters -: ${GC_ACCOUNT_FILE:?} -: ${GC_PROJECT_ID:?} -command -v gcloud >/dev/null 2>&1 || { - echo "'gcloud' must be installed" >&2 - exit 1 -} - -USER_VARS="${USER_VARS} -var account_file=${GC_ACCOUNT_FILE}" -USER_VARS="${USER_VARS} -var project_id=${GC_PROJECT_ID}" - -# This tests if GCE has an image that contains the given parameter. -gc_has_image() { - gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ - | grep $1 | wc -l -} - -teardown() { - gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ - | grep packerbats \ - | xargs -n1 gcloud compute --project=${GC_PROJECT_ID} images delete -} - -@test "googlecompute: build minimal.json" { - run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json - [ "$status" -eq 0 ] - [ "$(gc_has_image "packerbats-minimal")" -eq 1 ] -} diff --git a/test/builder_hyperone.bats b/test/builder_hyperone.bats deleted file mode 100755 index 66ae5e3fe2a..00000000000 --- a/test/builder_hyperone.bats +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the hyperone builder. The teardown function will -# delete any images with the text "packerbats" within the name. - -load test_helper -fixtures builder-hyperone - -# Required parameters -: ${HYPERONE_TOKEN:?} -: ${HYPERONE_PROJECT:?} -command -v h1 >/dev/null 2>&1 || { - echo "'h1' must be installed" >&2 - exit 1 -} - -USER_VARS="${USER_VARS} -var token=${HYPERONE_TOKEN}" -USER_VARS="${USER_VARS} -var project=${HYPERONE_PROJECT}" - -hyperone_has_image() { - h1 image list --project-select=${HYPERONE_PROJECT} --query "[?tag.${2}=='${3}']" --output=tsv | grep $1 -c -} - -teardown() { - h1 image list --project-select=${HYPERONE_PROJECT} --output=tsv \ - | grep packerbats \ - | awk '{print $1}' \ - | xargs -n1 h1 image delete --project-select=${HYPERONE_PROJECT} --yes --image -} - -@test "hyperone: build minimal.json" { - run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json - [ "$status" -eq 0 ] - [ "$(hyperone_has_image "packerbats-minimal" "key" "value")" -eq 1 ] -} - -@test "hyperone: build new-syntax.pkr.hcl" { - run packer build ${USER_VARS} $FIXTURE_ROOT/new-syntax.pkr.hcl - [ "$status" -eq 0 ] - [ "$(hyperone_has_image "packerbats-hcl" "key" "value")" -eq 1 ] -} - - -@test "hyperone: build chroot.json" { - run packer build ${USER_VARS} $FIXTURE_ROOT/chroot.json - [ "$status" -eq 0 ] - [ "$(hyperone_has_image "packerbats-chroot" "key2" "value2")" -eq 1 ] -} diff --git a/test/builder_lxc.bats b/test/builder_lxc.bats deleted file mode 100644 index 7173d0f7d33..00000000000 --- a/test/builder_lxc.bats +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the lxc builder by creating minimal containers and checking that -# custom lxc container configuration files are successfully applied. The -# teardown function will delete any images in the output-lxc-* folders along -# with the auto-generated lxc container configuration files and hook scripts. - -#load test_helper -#fixtures builder-lxc -FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/builder-lxc" - -have_command() { - command -v "$1" >/dev/null 2>&1 -} - -# Required parameters -have_command lxc-create || { - echo "'lxc-create' must be installed via the lxc (or lxc1 for ubuntu >=16.04) package" >&2 - exit 1 -} - -DESTROY_HOOK_SCRIPT=$FIXTURE_ROOT/destroy-hook.sh -DESTROY_HOOK_LOG=$FIXTURE_ROOT/destroy-hook.log -printf > "$DESTROY_HOOK_SCRIPT" ' -echo "$LXC_NAME" > "%s" -' "$DESTROY_HOOK_LOG" -chmod +x "$DESTROY_HOOK_SCRIPT" - -INIT_CONFIG=$FIXTURE_ROOT/lxc.custom.conf -printf > "$INIT_CONFIG" ' -lxc.hook.destroy = %s -' "$DESTROY_HOOK_SCRIPT" - -teardown() { - for f in "$INIT_CONFIG" "$DESTROY_HOOK_SCRIPT" "$DESTROY_HOOK_LOG"; do - [ -e "$f" ] && rm -f "$f" - done - - rm -rf output-lxc-* -} - -assert_build() { - local template_name="$1" - shift - - local build_status=0 - - run packer build -var template_name="$template_name" "$@" - - [ "$status" -eq 0 ] || { - echo "${template_name} build exited badly: $status" >&2 - echo "$output" >&2 - build_status="$status" - } - - for expected in "output-lxc-${template_name}"/{rootfs.tar.gz,lxc-config}; do - [ -f "$expected" ] || { - echo "missing expected artifact '${expected}'" >&2 - build_status=1 - } - done - - return $build_status -} - -assert_container_name() { - local container_name="$1" - - [ -f "$DESTROY_HOOK_LOG" ] || { - echo "missing expected lxc.hook.destroy logfile '$DESTROY_HOOK_LOG'" - return 1 - } - - read -r lxc_name < "$DESTROY_HOOK_LOG" - - [ "$lxc_name" = "$container_name" ] -} - -@test "lxc: build centos minimal.json" { - have_command yum || skip "'yum' must be installed to build centos containers" - local container_name=packer-lxc-centos - assert_build centos -var init_config="$INIT_CONFIG" \ - -var container_name="$container_name" \ - $FIXTURE_ROOT/minimal.json - assert_container_name "$container_name" -} - -@test "lxc: build trusty minimal.json" { - have_command debootstrap || skip "'debootstrap' must be installed to build ubuntu containers" - local container_name=packer-lxc-ubuntu - assert_build ubuntu -var init_config="$INIT_CONFIG" \ - -var container_name="$container_name" \ - -var template_parameters="SUITE=trusty" \ - $FIXTURE_ROOT/minimal.json - assert_container_name "$container_name" -} - -@test "lxc: build debian minimal.json" { - have_command debootstrap || skip "'debootstrap' must be installed to build debian containers" - local container_name=packer-lxc-debian - assert_build debian -var init_config="$INIT_CONFIG" \ - -var container_name="$container_name" \ - -var template_parameters="SUITE=jessie" \ - $FIXTURE_ROOT/minimal.json - assert_container_name "$container_name" -} diff --git a/test/cli.bats b/test/cli.bats deleted file mode 100755 index 0284dd3e352..00000000000 --- a/test/cli.bats +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the basic CLI functionality of Packer. It makes no network -# requests and should be very fast. - -load test_helper - -@test "cli: packer should show help" { - run packer - [ "$status" -eq 1 ] - [[ "$output" == *"usage: packer"* ]] -} - -@test "cli: packer version" { - run packer version - [ "$status" -eq 0 ] - [[ "$output" == *"Packer v"* ]] - - run packer -v - [ "$status" -eq 1 ] - [[ "$output" =~ ([0-9]+\.[0-9]+) ]] - - run packer --version - [ "$status" -eq 1 ] - [[ "$output" =~ ([0-9]+\.[0-9]+) ]] -} - -@test "cli: packer version show help" { - run packer version -h - [ "$status" -eq 0 ] - [[ "$output" == *"Packer v"* ]] - - run packer version --help - [ "$status" -eq 0 ] - [[ "$output" == *"Packer v"* ]] -} diff --git a/test/communicator_ssh.bats b/test/communicator_ssh.bats deleted file mode 100644 index eb466c9c317..00000000000 --- a/test/communicator_ssh.bats +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the ssh communicator using AWS builder. The teardown function will automatically -# delete any AMIs with a tag of `packer-test` being equal to "true" so -# be sure any test cases set this. - -load test_helper -verify_aws_cli -fixtures communicator-ssh - -setup() { - cd $FIXTURE_ROOT -} - -teardown() { - aws_ami_cleanup -} - -@test "shell provisioner: local port tunneling" { - run packer build $FIXTURE_ROOT/local-tunnel.json - [ "$status" -eq 0 ] - [[ "$output" == *"Connection to localhost port 10022 [tcp/*] succeeded"* ]] -} - -@test "shell provisioner: remote port tunneling" { - run packer build $FIXTURE_ROOT/remote-tunnel.json - [ "$status" -eq 0 ] - MY_LOCAL_IP=$(curl -s https://ifconfig.co/) - [[ "$output" == *"$MY_LOCAL_IP"* ]] -} diff --git a/test/fixtures/amazon-ebs/ami_region_copy.json b/test/fixtures/amazon-ebs/ami_region_copy.json deleted file mode 100644 index 6f591b6bdfd..00000000000 --- a/test/fixtures/amazon-ebs/ami_region_copy.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true", - "packer-id": "ami_region_copy" - }, - "ami_regions": ["us-west-1", "us-west-2"] - }] -} diff --git a/test/fixtures/amazon-ebs/minimal.json b/test/fixtures/amazon-ebs/minimal.json deleted file mode 100644 index bfe7cab63e6..00000000000 --- a/test/fixtures/amazon-ebs/minimal.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }] -} diff --git a/test/fixtures/builder-googlecompute/minimal.json b/test/fixtures/builder-googlecompute/minimal.json deleted file mode 100644 index 95dd99254dd..00000000000 --- a/test/fixtures/builder-googlecompute/minimal.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "variables": { - "account_file": null, - "project_id": null - }, - - "builders": [{ - "type": "googlecompute", - "account_file": "{{user `account_file`}}", - "project_id": "{{user `project_id`}}", - - "image_name": "packerbats-minimal-{{timestamp}}", - "source_image": "debian-7-wheezy-v20141108", - "zone": "us-central1-a" - }] -} diff --git a/test/fixtures/builder-hyperone/chroot.json b/test/fixtures/builder-hyperone/chroot.json deleted file mode 100644 index ccf7a8be5ad..00000000000 --- a/test/fixtures/builder-hyperone/chroot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "variables": { - "token": null, - "project": null - }, - "builders": [{ - "token": "{{ user `token` }}", - "project": "{{ user `project` }}", - "type": "hyperone", - "source_image": "ubuntu", - "disk_size": 10, - "vm_type": "a1.nano", - "chroot_disk": true, - "chroot_command_wrapper": "sudo {{.Command}}", - "pre_mount_commands": [ - "parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print", - "mkfs.ext4 {{.Device}}1" - ], - "post_mount_commands": [ - "apt-get update", - "apt-get install debootstrap", - "debootstrap --arch amd64 bionic {{.MountPath}}" - ], - "image_name": "packerbats-chroot-{{timestamp}}", - "image_tags": { - "key2":"value2" - } - }], - "provisioners": [] -} diff --git a/test/fixtures/builder-hyperone/minimal.json b/test/fixtures/builder-hyperone/minimal.json deleted file mode 100644 index eb5411de636..00000000000 --- a/test/fixtures/builder-hyperone/minimal.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "variables": { - "token": null, - "project": null - }, - "builders": [{ - "token": "{{ user `token` }}", - "project": "{{ user `project` }}", - "type": "hyperone", - "source_image": "ubuntu", - "disk_size": 10, - "vm_type": "a1.nano", - "image_name": "packerbats-minimal-{{timestamp}}", - "image_tags": { - "key":"value" - } - }] -} diff --git a/test/fixtures/builder-hyperone/new-syntax.pkr.hcl b/test/fixtures/builder-hyperone/new-syntax.pkr.hcl deleted file mode 100644 index 14e8d7e6f04..00000000000 --- a/test/fixtures/builder-hyperone/new-syntax.pkr.hcl +++ /dev/null @@ -1,29 +0,0 @@ -variable "token" { - type = string -} - -variable "project" { - type = string -} - -source "hyperone" "new-syntax" { - token = var.token - project = var.project - source_image = "debian" - disk_size = 10 - vm_type = "a1.nano" - image_name = "packerbats-hcl-{{timestamp}}" - image_tags = { - key="value" - } -} - -build { - sources = [ - "source.hyperone.new-syntax" - ] - - provisioner "shell" { - inline = ["sleep 5"] - } -} \ No newline at end of file diff --git a/test/fixtures/builder-linode/minimal.json b/test/fixtures/builder-linode/minimal.json deleted file mode 100644 index 400cfa63ada..00000000000 --- a/test/fixtures/builder-linode/minimal.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "variables": { - "linode_token": "{{env `LINODE_TOKEN`}}" - }, - "builders": [ - { - "type": "linode", - "linode_token": "{{user `linode_token`}}", - - "region": "us-central", - "swap_size": 256, - "image": "linode/debian9", - "instance_type": "g6-nanode-1", - "instance_label": "packerbats-minimal-{{timestamp}}", - - "image_label": "packerbats-minimal-image-{{timestamp}}", - "image_description": "packerbats", - - "ssh_username": "root" - } - ], - "provisioners": [ - { - "type": "shell", - "inline": ["echo Hello > /root/message.txt"] - } - ] - } diff --git a/test/fixtures/builder-lxc/minimal.json b/test/fixtures/builder-lxc/minimal.json deleted file mode 100644 index 997e48cfdb2..00000000000 --- a/test/fixtures/builder-lxc/minimal.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "variables": { - "template_name": "debian", - "template_parameters": "SUITE=jessie", - "container_name": "packer-lxc", - "set_var": "hello" - }, - "provisioners": [ - { - "type": "shell", - "inline": [ - "if [ \"$SET_VAR\" != \"{{user `set_var`}}\" ]; then", - " echo \"Got unexpected value '$SET_VAR' for SET_VAR\" 1>&2", - " exit 1", - "fi" - ] - } - ], - "builders": [ - { - "type": "lxc", - "name": "lxc-{{user `template_name`}}", - "template_name": "{{user `template_name`}}", - "container_name": "{{user `container_name`}}", - "create_options": [ "-f", "{{user `init_config`}}" ], - "attach_options": [ "--clear-env", "--set-var", "SET_VAR={{user `set_var`}}" ], - "config_file": "/usr/share/lxc/config/{{user `template_name`}}.common.conf", - "template_environment_vars": [ "{{user `template_parameters`}}" ] - } - ] -} diff --git a/test/fixtures/communicator-ssh/local-tunnel.json b/test/fixtures/communicator-ssh/local-tunnel.json deleted file mode 100644 index 2db4ebcacdb..00000000000 --- a/test/fixtures/communicator-ssh/local-tunnel.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "ssh_local_tunnels": ["10022:localhost:22"], - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "shell-local", - "inline": [ - "echo | nc -G 5 -w 5 -v localhost 10022 2>&1" - ] - }] -} diff --git a/test/fixtures/communicator-ssh/remote-tunnel.json b/test/fixtures/communicator-ssh/remote-tunnel.json deleted file mode 100644 index 8f69be84ace..00000000000 --- a/test/fixtures/communicator-ssh/remote-tunnel.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "t2.micro", - "region": "us-east-1", - "ssh_username": "ubuntu", - "ssh_remote_tunnels": ["8443:ifconfig.co:443"], - "source_ami": "ami-0111e8c43a763eb71", - "tags": { - "packer-test": "true" - } - }], - "provisioners": [{ - "inline": [ - "curl -kvs --connect-to ifconfig.co:443:localhost:8443 https://ifconfig.co/" - ], - "type": "shell" - } - ] - } - \ No newline at end of file diff --git a/test/fixtures/provisioner-file/dir/file.txt b/test/fixtures/provisioner-file/dir/file.txt deleted file mode 100644 index 806dddba59a..00000000000 --- a/test/fixtures/provisioner-file/dir/file.txt +++ /dev/null @@ -1 +0,0 @@ -337 miles diff --git a/test/fixtures/provisioner-file/dir_no_trailing.json b/test/fixtures/provisioner-file/dir_no_trailing.json deleted file mode 100644 index e48a2f16061..00000000000 --- a/test/fixtures/provisioner-file/dir_no_trailing.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "dir", - "destination": "/tmp" - }, { - "type": "shell", - "inline": ["cat /tmp/dir/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-file/dir_no_trailing_sftp.json b/test/fixtures/provisioner-file/dir_no_trailing_sftp.json deleted file mode 100644 index 2837516982f..00000000000 --- a/test/fixtures/provisioner-file/dir_no_trailing_sftp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "t2.micro", - "region": "us-east-1", - "ssh_username": "ec2-user", - "ssh_file_transfer_method": "sftp", - "source_ami": "ami-8da458e6", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "dir", - "destination": "/tmp" - }, { - "type": "shell", - "inline": ["cat /tmp/dir/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-file/dir_with_trailing.json b/test/fixtures/provisioner-file/dir_with_trailing.json deleted file mode 100644 index bf5f754150b..00000000000 --- a/test/fixtures/provisioner-file/dir_with_trailing.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "dir/", - "destination": "/tmp" - }, { - "type": "shell", - "inline": ["cat /tmp/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-file/dir_with_trailing_sftp.json b/test/fixtures/provisioner-file/dir_with_trailing_sftp.json deleted file mode 100644 index f263654345d..00000000000 --- a/test/fixtures/provisioner-file/dir_with_trailing_sftp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "t2.micro", - "region": "us-east-1", - "ssh_username": "ec2-user", - "ssh_file_transfer_method": "sftp", - "source_ami": "ami-8da458e6", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "dir/", - "destination": "/tmp" - }, { - "type": "shell", - "inline": ["cat /tmp/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-file/file.json b/test/fixtures/provisioner-file/file.json deleted file mode 100644 index e8287abb901..00000000000 --- a/test/fixtures/provisioner-file/file.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "file.txt", - "destination": "/tmp/file.txt" - }, { - "type": "shell", - "inline": ["cat /tmp/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-file/file.txt b/test/fixtures/provisioner-file/file.txt deleted file mode 100644 index e8a85b0cd35..00000000000 --- a/test/fixtures/provisioner-file/file.txt +++ /dev/null @@ -1 +0,0 @@ -24901 miles diff --git a/test/fixtures/provisioner-file/file_sftp.json b/test/fixtures/provisioner-file/file_sftp.json deleted file mode 100644 index 19a8a98b894..00000000000 --- a/test/fixtures/provisioner-file/file_sftp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "t2.micro", - "region": "us-east-1", - "ssh_username": "ec2-user", - "ssh_file_transfer_method": "sftp", - "source_ami": "ami-8da458e6", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "file", - "source": "file.txt", - "destination": "/tmp/file.txt" - }, { - "type": "shell", - "inline": ["cat /tmp/file.txt"] - }] -} diff --git a/test/fixtures/provisioner-shell/inline.json b/test/fixtures/provisioner-shell/inline.json deleted file mode 100644 index 25afae1665d..00000000000 --- a/test/fixtures/provisioner-shell/inline.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "shell", - "inline": [ - "bash -c 'echo HELLO I AM `whoami`'", - "echo AND ANOTHER" - ] - }] -} diff --git a/test/fixtures/provisioner-shell/script.json b/test/fixtures/provisioner-shell/script.json deleted file mode 100644 index dc8ad509ec1..00000000000 --- a/test/fixtures/provisioner-shell/script.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "shell", - "script": "script.sh" - }] -} diff --git a/test/fixtures/provisioner-shell/script.sh b/test/fixtures/provisioner-shell/script.sh deleted file mode 100755 index e4e504ff9d8..00000000000 --- a/test/fixtures/provisioner-shell/script.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -echo HELLO I AM DOG diff --git a/test/fixtures/provisioner-shell/scripts.json b/test/fixtures/provisioner-shell/scripts.json deleted file mode 100644 index 290c6f5adcb..00000000000 --- a/test/fixtures/provisioner-shell/scripts.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "builders": [{ - "type": "amazon-ebs", - "ami_name": "packer-test {{timestamp}}", - "instance_type": "m1.small", - "region": "us-east-1", - "ssh_username": "ubuntu", - "source_ami": "ami-0568456c", - "tags": { - "packer-test": "true" - } - }], - - "provisioners": [{ - "type": "shell", - "scripts": [ - "script.sh" - ] - }] -} diff --git a/test/provisioner_file.bats b/test/provisioner_file.bats deleted file mode 100755 index 3c846989788..00000000000 --- a/test/provisioner_file.bats +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the amazon-ebs builder. The teardown function will automatically -# delete any AMIs with a tag of `packer-test` being equal to "true" so -# be sure any test cases set this. - -load test_helper -verify_aws_cli -fixtures provisioner-file - -setup() { - cd $FIXTURE_ROOT -} - -teardown() { - aws_ami_cleanup -} - -@test "file provisioner: single file" { - run packer build $FIXTURE_ROOT/file.json - [ "$status" -eq 0 ] - [[ "$output" == *"24901 miles"* ]] -} - -@test "file provisioner: directory (no trailing slash)" { - run packer build $FIXTURE_ROOT/dir_no_trailing.json - [ "$status" -eq 0 ] - [[ "$output" == *"337 miles"* ]] -} - -@test "file provisioner: directory (with trailing slash)" { - run packer build $FIXTURE_ROOT/dir_with_trailing.json - [ "$status" -eq 0 ] - [[ "$output" == *"337 miles"* ]] -} - -@test "file provisioner: single file through sftp" { - run packer build $FIXTURE_ROOT/file_sftp.json - [ "$status" -eq 0 ] - [[ "$output" == *"24901 miles"* ]] -} - -@test "file provisioner: directory through sftp (no trailing slash)" { - run packer build $FIXTURE_ROOT/dir_no_trailing_sftp.json - [ "$status" -eq 0 ] - [[ "$output" == *"337 miles"* ]] -} - -@test "file provisioner: directory through sftp (with trailing slash)" { - run packer build $FIXTURE_ROOT/dir_with_trailing_sftp.json - [ "$status" -eq 0 ] - [[ "$output" == *"337 miles"* ]] -} diff --git a/test/provisioner_shell.bats b/test/provisioner_shell.bats deleted file mode 100755 index 016c209b067..00000000000 --- a/test/provisioner_shell.bats +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bats -# -# This tests the amazon-ebs builder. The teardown function will automatically -# delete any AMIs with a tag of `packer-test` being equal to "true" so -# be sure any test cases set this. - -load test_helper -verify_aws_cli -fixtures provisioner-shell - -setup() { - cd $FIXTURE_ROOT -} - -teardown() { - aws_ami_cleanup -} - -@test "shell provisioner: inline scripts" { - run packer build $FIXTURE_ROOT/inline.json - [ "$status" -eq 0 ] - [[ "$output" == *"HELLO I AM ubuntu"* ]] - [[ "$output" == *"AND ANOTHER"* ]] -} - -@test "shell provisioner: script" { - run packer build $FIXTURE_ROOT/script.json - [ "$status" -eq 0 ] - [[ "$output" == *"HELLO I AM DOG"* ]] -} - -@test "shell provisioner: scripts" { - run packer build $FIXTURE_ROOT/scripts.json - [ "$status" -eq 0 ] - [[ "$output" == *"HELLO I AM DOG"* ]] -} diff --git a/test/test_helper.bash b/test/test_helper.bash deleted file mode 100644 index a9dbc38eb1e..00000000000 --- a/test/test_helper.bash +++ /dev/null @@ -1,52 +0,0 @@ -# Let's verify that the tools we need are installed -verify_aws_cli() { - declare -a required=(aws) - for cmd in "${required[@]}"; do - command -v $cmd >/dev/null 2>&1 || { - echo "'$cmd' must be installed" >&2 - exit 1 - } - done -} - -#-------------------------------------------------------------------- -# Bats modification -#-------------------------------------------------------------------- -# This allows us to override a function in Bash -save_function() { - local ORIG_FUNC=$(declare -f $1) - local NEWNAME_FUNC="$2${ORIG_FUNC#$1}" - eval "$NEWNAME_FUNC" -} - -# Override the run function so that we always output the output -save_function run old_run -run() { - old_run $@ - - # Output the command we ran - echo "Executing: " $@ - - # "$output" gets rid of newlines. This will bring them back. - for line in "${lines[@]}"; do - echo $line - done -} - -#-------------------------------------------------------------------- -# Helper functions -#-------------------------------------------------------------------- -# This sets the directory for fixtures by specifying the name of -# the folder with fixtures. -fixtures() { - FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/$1" -} - -# This deletes any AMIs with a tag "packer-test" of "true" -aws_ami_cleanup() { - local region=${1:-us-east-1} - aws ec2 describe-images --region ${region} --owners self --output text \ - --filters 'Name=tag:packer-test,Values=true' \ - --query 'Images[*].ImageId' \ - | xargs -n1 aws ec2 deregister-image --region ${region} --image-id -} diff --git a/tty.go b/tty.go index 5aa5a33bf23..62fa5203ffd 100644 --- a/tty.go +++ b/tty.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + //go:build !solaris // +build !solaris diff --git a/tty_solaris.go b/tty_solaris.go index 1c20d3acf1d..ed40b7fdb82 100644 --- a/tty_solaris.go +++ b/tty_solaris.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package main import ( diff --git a/version/VERSION b/version/VERSION new file mode 100644 index 00000000000..1f724bf455d --- /dev/null +++ b/version/VERSION @@ -0,0 +1 @@ +1.11.0-dev diff --git a/version/version.go b/version/version.go index ffaf4493888..c2157873583 100644 --- a/version/version.go +++ b/version/version.go @@ -1,6 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + package version import ( + _ "embed" + "strings" + "github.com/hashicorp/go-version" pluginVersion "github.com/hashicorp/packer-plugin-sdk/version" ) @@ -13,13 +19,24 @@ var ( // Whether cgo is enabled or not; set at build time CgoEnabled bool + //go:embed VERSION + rawVersion string + + // The next version number that will be released. This will be updated after every release + // Version must conform to the format expected by github.com/hashicorp/go-version + // for tests to work. + // A pre-release marker for the version can also be specified (e.g -dev). If this is omitted // The main version number that is being run at the moment. - Version = "1.8.5-incognia.2" + Version = "1.8.5-incognia.3" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. - VersionPrerelease = "" - VersionMetadata = "" + VersionPrerelease string + // VersionMetadata may be added to give more non-normalised information on a build + // like a commit SHA for example. + // + // Ex: 1.0.0-dev+metadata + VersionMetadata string ) var PackerVersion *pluginVersion.PluginVersion @@ -34,8 +51,18 @@ func FormattedVersion() string { var SemVer *version.Version func init() { - PackerVersion = pluginVersion.InitializePluginVersion(Version, VersionPrerelease) - SemVer = PackerVersion.SemVer() + rawVersion = strings.TrimSpace(rawVersion) + + PackerVersion = pluginVersion.NewRawVersion(rawVersion) + // A bug in the SDK prevents us from calling SemVer on the PluginVersion + // derived from the rawVersion, as when doing so, we reset the semVer + // attribute to only use the core part of the version, thereby dropping any + // information on pre-release/metadata. + SemVer, _ = version.NewVersion(rawVersion) + + Version = PackerVersion.GetVersion() + VersionPrerelease = PackerVersion.GetVersionPrerelease() + VersionMetadata = PackerVersion.GetMetadata() } // String returns the complete version string, including prerelease diff --git a/website/.husky/pre-commit b/website/.husky/pre-commit new file mode 100644 index 00000000000..ed0b6423e4d --- /dev/null +++ b/website/.husky/pre-commit @@ -0,0 +1,3 @@ +cd website + +npx next-hashicorp precommit \ No newline at end of file diff --git a/website/.nvmrc b/website/.nvmrc index 6f7f377bf51..3f430af82b3 100644 --- a/website/.nvmrc +++ b/website/.nvmrc @@ -1 +1 @@ -v16 +v18 diff --git a/website/Dockerfile b/website/Dockerfile index f8cbf41594e..ef0a51433f7 100644 --- a/website/Dockerfile +++ b/website/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.mirror.hashicorp.services/node:14.17.0-alpine +FROM docker.mirror.hashicorp.services/node:18.18.2-alpine RUN apk add --update --no-cache git make g++ automake autoconf libtool nasm libpng-dev COPY ./package.json /website/package.json diff --git a/website/README.md b/website/README.md index 5bba4f52e2f..611b80b0982 100644 --- a/website/README.md +++ b/website/README.md @@ -49,7 +49,7 @@ The Docker image is pre-built with all the website dependencies installed, which ### With Node -If your local development environment has a supported version (v16+) of [node installed](https://nodejs.org/en/) you can run: +If your local development environment has a supported version (v18+) of [node installed](https://nodejs.org/en/) you can run: - `npm install` - `npm start` @@ -87,6 +87,16 @@ The significant keys in the YAML frontmatter are: > ⚠️ If there is a need for a `/api/*` url on this website, the url will be changed to `/api-docs/*`, as the `api` folder is reserved by next.js. +### Validating Content + +Content changes are automatically validated against a set of rules as part of the pull request process. If you want to run these checks locally to validate your content before committing your changes, you can run the following command: + +``` +npm run content-check +``` + +If the validation fails, actionable error messages will be displayed to help you address detected issues. + ### Creating New Pages There is currently a small bug with new page creation - if you create a new page and link it up via subnav data while the server is running, it will report an error saying the page was not found. This can be resolved by restarting the server. @@ -95,12 +105,12 @@ There is currently a small bug with new page creation - if you create a new page There are several custom Markdown plugins that are available by default that enhance [standard markdown](https://commonmark.org/) to fit our use cases. This set of plugins introduces a couple instances of custom syntax, and a couple specific pitfalls that are not present by default with markdown, detailed below: -- If you see the symbols `~>`, `->`, `=>`, or `!>`, these represent [custom alerts](https://github.com/hashicorp/remark-plugins/tree/master/plugins/paragraph-custom-alerts#paragraph-custom-alerts). These render as colored boxes to draw the user's attention to some type of aside. +- > **Warning**: We are deprecating the current [paragraph alerts](https://github.com/hashicorp/remark-plugins/tree/master/plugins/paragraph-custom-alerts#paragraph-custom-alerts), in favor of the newer [MDX Inline Alert](#inline-alerts) components. The legacy paragraph alerts are represented by the symbols `~>`, `->`, `=>`, or `!>`. - If you see `@include '/some/path.mdx'`, this is a [markdown include](https://github.com/hashicorp/remark-plugins/tree/master/plugins/include-markdown#include-markdown-plugin). It's worth noting as well that all includes resolve from `website/content/partials` by default, and that changes to partials will not live-reload the website. - If you see `# Headline ((#slug))`, this is an example of an [anchor link alias](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-link-aliases). It adds an extra permalink to a headline for compatibility and is removed from the output. - Due to [automatically generated permalinks](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-links), any text changes to _headlines_ or _list items that begin with inline code_ can and will break existing permalinks. Be very cautious when changing either of these two text items. - Headlines are fairly self-explanitory, but here's an example of how list items that begin with inline code look. + Headlines are fairly self-explanatory, but here's an example of how to list items that begin with inline code look. ```markdown - this is a normal list item @@ -120,13 +130,51 @@ There are several custom Markdown plugins that are available by default that enh A number of custom [mdx components](https://mdxjs.com/) are available for use within any `.mdx` file. Each one is documented below: +#### Inline Alerts + +There are custom MDX components available to author alert data. [See the full documentation here](https://developer.hashicorp.com/swingset/components/mdxinlinealert). They render as colored boxes to draw the user's attention to some type of aside. + +```mdx +## Alert types + +### Tip + + + To provide general information to the user regarding the current context or + relevant actions. + + +### Highlight + + + To provide general or promotional information to the user prominently. + + +### Note + + + To help users avoid an issue. Provide guidance and actions if possible. + + +### Warning + + + To indicate critical issues that need immediate action or help users + understand something critical. + + +## Title override prop + +To provide general information. +``` + #### Tabs The `Tabs` component creates tabbed content of any type, but is often used for code examples given in different languages. Here's an example of how it looks from the Vagrant documentation website: ![Tabs Component](https://p176.p0.n0.cdn.getcloudapp.com/items/WnubALZ4/Screen%20Recording%202020-06-11%20at%2006.03%20PM.gif?v=1de81ea720a8cc8ade83ca64fb0b9edd) -> Please refer to the [Swingset](https://react-components.vercel.app/?component=Tabs) documention for the latest examples and API reference. +> Please refer to the [Swingset](https://react-components.vercel.app/?component=Tabs) documentation for the latest examples and API reference. It can be used as such within a markdown file: @@ -150,7 +198,7 @@ $ curl ... -Contined normal markdown content +Continued normal markdown content ```` The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs must have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four. @@ -451,7 +499,7 @@ This configuration would display something like the following text on the websit A {{ release candidate }} for {{ v1.0.0 }} is available! The release can be downloaded here. ``` -You may customize the parameters in any way you'd like. To remove a prerelease from the website, simply delete the `prerelease` paremeter from the above component. +You may customize the parameters in any way you'd like. To remove a prerelease from the website, simply delete the `prerelease` parameter from the above component. @@ -551,9 +599,9 @@ It's also worth noting that it is possible to do glob-based redirects, for examp We support the following browsers targeting roughly the versions specified. -| ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_24x24.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_24x24.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_24x24.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_24x24.png) | ![Internet Explorer](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_24x24.png) | -| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| **Latest** | **Latest** | **Latest** | **Latest** | **11+** | +| ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.svg) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge.svg) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera.svg) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari.svg) | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| **Latest** | **Latest** | **Latest** | **Latest** | **Latest** | diff --git a/website/content/docs/builders/community-supported.mdx b/website/content/docs/builders/community-supported.mdx index e01177b87b8..6ce89fb856e 100644 --- a/website/content/docs/builders/community-supported.mdx +++ b/website/content/docs/builders/community-supported.mdx @@ -9,6 +9,6 @@ page_title: Community - Builders The following builders are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -builders, see our docs on [extending Packer](/docs/plugins/creation). +builders, see our docs on [extending Packer](/packer/docs/plugins/creation). @include 'builders/community_builders.mdx' diff --git a/website/content/docs/builders/custom.mdx b/website/content/docs/builders/custom.mdx index 91e20f2ceec..4445cf03ad1 100644 --- a/website/content/docs/builders/custom.mdx +++ b/website/content/docs/builders/custom.mdx @@ -11,5 +11,5 @@ page_title: Custom - Builders Packer is extensible, allowing you to write new builders without having to modify the core source code of Packer itself. Documentation for creating new builders is covered in the [custom -builders](/docs/plugins/creation/custom-builders) page of the Packer plugin +builders](/packer/docs/plugins/creation/custom-builders) page of the Packer plugin section. diff --git a/website/content/docs/builders/file.mdx b/website/content/docs/builders/file.mdx index 5b5d851a876..55f73d9b61e 100644 --- a/website/content/docs/builders/file.mdx +++ b/website/content/docs/builders/file.mdx @@ -58,7 +58,7 @@ Configuration options are organized below into two categories: required and optional. Within each category, the available options are alphabetized and described. -Any [communicator](/docs/templates/legacy_json_templates/communicator) defined is ignored. +Any [communicator](/packer/docs/templates/legacy_json_templates/communicator) defined is ignored. ### Required: diff --git a/website/content/docs/builders/index.mdx b/website/content/docs/builders/index.mdx index 6fff028c2fb..f4401058855 100644 --- a/website/content/docs/builders/index.mdx +++ b/website/content/docs/builders/index.mdx @@ -11,12 +11,12 @@ Builders create machines and generate images from those machines for various pla Packer has the following types of builders: -- [Plugin](/plugins): Each plugin has its own associated set of builders. For example, there are separate builders for EC2, VMware, VirtualBox, etc. -- [File](/docs/builders/file): The `file` builder creates an artifact from a file. -- [Null](/docs/builders/null): The `null` builder sets up an SSH connection and runs the provisioners. -- [Custom](/docs/plugins/creation/custom-builders): You can write new builders for new or existing platforms. -- [Community-Supported](/docs/builders/community-supported): The Packer community develops and maintains builders for several additional platforms. +- [Plugin](/packer/plugins): Each plugin has its own associated set of builders. For example, there are separate builders for EC2, VMware, VirtualBox, etc. +- [File](/packer/docs/builders/file): The `file` builder creates an artifact from a file. +- [Null](/packer/docs/builders/null): The `null` builder sets up an SSH connection and runs the provisioners. +- [Custom](/packer/docs/plugins/creation/custom-builders): You can write new builders for new or existing platforms. +- [Community-Supported](/packer/docs/builders/community-supported): The Packer community develops and maintains builders for several additional platforms. -Refer to the [`source`](/docs/templates/hcl_templates/blocks/source) block documentation to learn more about configuring builders in the Packer templating language. +Refer to the [`source`](/packer/docs/templates/hcl_templates/blocks/source) block documentation to learn more about configuring builders in the Packer templating language. diff --git a/website/content/docs/builders/null.mdx b/website/content/docs/builders/null.mdx index c1579adc196..2098fec67f4 100644 --- a/website/content/docs/builders/null.mdx +++ b/website/content/docs/builders/null.mdx @@ -58,4 +58,4 @@ build { ## Configuration Reference The null builder has no configuration parameters other than the -[communicator](/docs/templates/legacy_json_templates/communicator) settings. +[communicator](/packer/docs/templates/legacy_json_templates/communicator) settings. diff --git a/website/content/docs/commands/build.mdx b/website/content/docs/commands/build.mdx index bb5ba266321..60c2f7c8d1b 100644 --- a/website/content/docs/commands/build.mdx +++ b/website/content/docs/commands/build.mdx @@ -44,7 +44,7 @@ artifacts that are created will be outputted at the end of the build. - `ask` presents a prompt and waits for you to decide to clean up, abort, or retry the failed step. - `run-cleanup-provisioner` aborts and exits without any cleanup besides - the [error-cleanup-provisioner](/docs/templates/legacy_json_templates/provisioners#on-error-provisioner) if one is defined. + the [error-cleanup-provisioner](/packer/docs/templates/legacy_json_templates/provisioners#on-error-provisioner) if one is defined. `@include 'commands/only.mdx'` diff --git a/website/content/docs/commands/console.mdx b/website/content/docs/commands/console.mdx index bd2fe0480f3..f61a7a1bb66 100644 --- a/website/content/docs/commands/console.mdx +++ b/website/content/docs/commands/console.mdx @@ -116,7 +116,7 @@ $ echo {{timestamp}} | packer console templating ( or `{{..}}` calls ) will not work in HCL2 mode. Without a config file, `packer console` can be used to experiment with the -expression syntax and [built-in functions](/docs/templates/hcl_templates/functions). +expression syntax and [built-in functions](/packer/docs/templates/hcl_templates/functions). ### Starting diff --git a/website/content/docs/commands/fmt.mdx b/website/content/docs/commands/fmt.mdx index be66e3eda39..d082f9afc7c 100644 --- a/website/content/docs/commands/fmt.mdx +++ b/website/content/docs/commands/fmt.mdx @@ -52,4 +52,7 @@ $ cat my-template.pkr.hcl | packer fmt - - `-write=false` - Don't write formatting changes to source files (always disabled if using -check) -- `-` - read formatting changes from stdin and write them to stdout. \ No newline at end of file +- `-` - read formatting changes from stdin and write them to stdout. + +- `recursive` Also process files in subdirectories. By default, only the + given directory (or current directory) is processed. \ No newline at end of file diff --git a/website/content/docs/commands/hcl2_upgrade.mdx b/website/content/docs/commands/hcl2_upgrade.mdx index f18874cdf8d..baaee637d58 100644 --- a/website/content/docs/commands/hcl2_upgrade.mdx +++ b/website/content/docs/commands/hcl2_upgrade.mdx @@ -81,7 +81,7 @@ here is the list of calls that should get transformed: - `` {{ user `my_var` }} `` becomes `${var.my_var}`. - `` {{ env `my_var` }} `` becomes `${var.my_var}`. Packer HCL2 supports environment variables through input variables. See - [docs](/docs/templates/hcl_templates/variables#environment-variables) + [docs](/packer/docs/templates/hcl_templates/variables#environment-variables) for more info. - `{{ timestamp }}` becomes `${local.timestamp}`, the local variable will be created for all generated files. @@ -134,6 +134,6 @@ locals { ## Upgrading templates that use third-party community plugins If your template references a plugin that is not bundled with the main Packer -binary, you need to make sure that the [plugin is installed](/docs/plugins#installing-plugins) +binary, you need to make sure that the [plugin is installed](/packer/docs/plugins#installing-plugins) or you will get an `unknown builder type` error. Packer needs to load the plugin to transpose the template. diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index 1c130a368aa..940751c5b67 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -7,18 +7,38 @@ page_title: packer init - Commands # `init` Command -> **Note:** Packer init does not work with legacy JSON templates. You can -upgrade your JSON config files to HCL using the [hcl2_upgrade](/docs/commands/hcl2_upgrade) command. +upgrade your JSON config files to HCL using the [hcl2_upgrade](/packer/docs/commands/hcl2_upgrade) command. -> **Note:** Packer init will only work with multi-component plugins -- that is plugins that are named `packer-plugin-*`. To install a single-component plugin -- that is `packer-provisioner-*`, `packer-builder-*`, etc. -- nothing changes, you will -have to [install the plugin manually](/docs/plugins#installing-plugins). +have to [install the plugin manually](/packer/docs/plugins#installing-plugins). The `packer init` command is used to download Packer plugin binaries. This is the first command that should be executed when working with a new or existing template. This command is always safe to run multiple times. Though subsequent runs may give errors, this command will never delete anything. +You should invoke `packer init` on either an HCL2 template, or a directory that contains +at least a valid HCL2 template, and eventually other related dependencies like varfiles +for example. + +Example: + +```sh +$ ls . +template.pkr.hcl varfile.pkrvars.pkr.hcl + +$ packer init template.pkr.hcl # You can invoke packer init on a single template in this case + # This works if the template is self-contained, but may fail if + # the template is meant to be built as a bundle of partials. + +$ packer init . # Alternatively, you can invoke packer init on a directory instead, + # which behaves the same in a configuration like this one, but if + # the target is a collection ofHCL2 templates, this is the + # preferred way to invoke it. +``` + Packer does not currently have the notion of a state like Terraform has. In other words, currently `packer init` is only in charge of installing Packer plugins. @@ -36,7 +56,7 @@ for the ones that are missing. `packer init -upgrade` will try to get the latest versions for all plugins. -Import a plugin using the [`required_plugin`](/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) +Import a plugin using the [`required_plugin`](/packer/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) block : ```hcl @@ -50,7 +70,7 @@ packer { } ``` -HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all open source tools, please do your own due diligence when using a new tool. +HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all community tools, please do your own due diligence when using a new tool. ## Plugin Selection @@ -61,23 +81,11 @@ is `https://github.com/azr/packer-plugin-happycloud` for a plugin matching the v Packer init will install the latest found version matching the version selection in the `required_plugins` section. Make sure to set a correct [version constraint -string](/docs/templates/hcl_templates/blocks/packer#version-constraints). The +string](/packer/docs/templates/hcl_templates/blocks/packer#version-constraints). The plugins will be installed in the [Plugin -Directory](/docs/configure#packer-s-plugin-directory). - -See [Installing Plugins](/docs/plugins#installing-plugins) for more information on how plugin installation works. - -### Implicit required plugin +Directory](/packer/docs/configure#packer-s-plugin-directory). -This is part of a set of breaking changes made to decouple Packer releases from -plugin releases. To make the transition easier, we will tag components of these -plugins as "moved out". If one of the components of a moved out plugin is used -in a config file, but there is no mention of that plugin in the -"required_plugin" block, then Packer init will automatically download and -install that plugin. Packer will then display a warning and suggest that you -add the plugin to your required_plugin block. We recommend you use the -required_plugin block even if you are only using official plugins, because it -allows you to set the plugin version to avoid surprises in the future. +See [Installing Plugins](/packer/docs/plugins#installing-plugins) for more information on how plugin installation works. ## Options diff --git a/website/content/docs/commands/inspect.mdx b/website/content/docs/commands/inspect.mdx index 2b4ab0b720b..9cebe60c53c 100644 --- a/website/content/docs/commands/inspect.mdx +++ b/website/content/docs/commands/inspect.mdx @@ -22,7 +22,7 @@ like what variables a template accepts, the builders it defines, the provisioners it defines and the order they'll run, and more. This command is extra useful when used with [machine-readable -output](/docs/commands) enabled. The command outputs the components +output](/packer/docs/commands) enabled. The command outputs the components in a way that is parseable by machines. The command doesn't validate the actual configuration of the various components diff --git a/website/content/docs/commands/plugins/index.mdx b/website/content/docs/commands/plugins/index.mdx index 382b791fda1..551cbff03b6 100644 --- a/website/content/docs/commands/plugins/index.mdx +++ b/website/content/docs/commands/plugins/index.mdx @@ -27,4 +27,4 @@ Subcommands: ## Related -- [`packer init`](/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. diff --git a/website/content/docs/commands/plugins/install.mdx b/website/content/docs/commands/plugins/install.mdx index b5a931458e6..711bfc3469a 100644 --- a/website/content/docs/commands/plugins/install.mdx +++ b/website/content/docs/commands/plugins/install.mdx @@ -21,4 +21,4 @@ Usage: packer plugins install [] ## Related -- [`packer init`](/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. diff --git a/website/content/docs/commands/plugins/installed.mdx b/website/content/docs/commands/plugins/installed.mdx index 2b0b330c2f2..164da29e079 100644 --- a/website/content/docs/commands/plugins/installed.mdx +++ b/website/content/docs/commands/plugins/installed.mdx @@ -18,4 +18,4 @@ Usage: packer plugins installed ## Related -- [`packer init`](/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. diff --git a/website/content/docs/commands/plugins/remove.mdx b/website/content/docs/commands/plugins/remove.mdx index 8887df5112d..4a5ea6dbd52 100644 --- a/website/content/docs/commands/plugins/remove.mdx +++ b/website/content/docs/commands/plugins/remove.mdx @@ -21,4 +21,4 @@ Usage: packer plugins remove [] ## Related -- [`packer init`](/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. diff --git a/website/content/docs/commands/plugins/required.mdx b/website/content/docs/commands/plugins/required.mdx index 25b16a64d24..38523108795 100644 --- a/website/content/docs/commands/plugins/required.mdx +++ b/website/content/docs/commands/plugins/required.mdx @@ -27,4 +27,4 @@ Usage: packer plugins required ## Related -- [`packer init`](/docs/commands/init) will install all required plugins. +- [`packer init`](/packer/docs/commands/init) will install all required plugins. diff --git a/website/content/docs/commands/validate.mdx b/website/content/docs/commands/validate.mdx index 562c501eceb..0827f5b53c0 100644 --- a/website/content/docs/commands/validate.mdx +++ b/website/content/docs/commands/validate.mdx @@ -10,7 +10,7 @@ page_title: packer validate - Commands # `validate` Command The `packer validate` Packer command is used to validate the syntax and -configuration of a [template](/docs/templates). The command will +configuration of a [template](/packer/docs/templates). The command will return a zero exit status on success, and a non-zero exit status on failure. Additionally, if a template doesn't validate, any error messages will be outputted. @@ -47,7 +47,7 @@ Errors validating build 'vmware'. 1 error(s) occurred: source block's "name" label, unless an in-build source definition adds the "name" configuration option. -- `-no-warn-on-undeclared-var` - Silence warnings when the a variable definition +- `-no-warn-undeclared-var` - Silence warnings when the variable definition file contains variable assignments for undeclared variables. This can occur when using a var-file that contains a large amount of unused variables for a given HCL2 template. For HCL2 template defining a value for a variable in a diff --git a/website/content/docs/communicators/index.mdx b/website/content/docs/communicators/index.mdx index 19506cf070f..d6564fa4c8e 100644 --- a/website/content/docs/communicators/index.mdx +++ b/website/content/docs/communicators/index.mdx @@ -11,16 +11,16 @@ Communicators are the mechanism Packer uses to upload files, execute scripts, etc. with the machine being created. Communicators are configured within the -[builder](/docs/templates/legacy_json_templates/builders) section. Packer currently supports +[builder](/packer/docs/templates/legacy_json_templates/builders) section. Packer currently supports three kinds of communicators: - `none` - No communicator will be used. If this is set, most provisioners also can't be used. -- [ssh](/docs/communicators/ssh) - An SSH connection will be established to the machine. This is +- [ssh](/packer/docs/communicators/ssh) - An SSH connection will be established to the machine. This is usually the default. -- [winrm](/docs/communicators/winrm) - A WinRM connection will be established. +- [winrm](/packer/docs/communicators/winrm) - A WinRM connection will be established. In addition to the above, some builders have custom communicators they can use. For example, the Docker builder has a "docker" communicator that uses diff --git a/website/content/docs/communicators/ssh.mdx b/website/content/docs/communicators/ssh.mdx index e2a7bd6895c..f3b48e528b3 100644 --- a/website/content/docs/communicators/ssh.mdx +++ b/website/content/docs/communicators/ssh.mdx @@ -9,7 +9,7 @@ page_title: Communicators - SSH Communicators are the mechanism Packer uses to upload files, execute scripts, etc. on the machine being created, and are configured within the -[builder](/docs/templates/legacy_json_templates/builders) section. +[builder](/packer/docs/templates/legacy_json_templates/builders) section. The SSH communicator does this by using the SSH protocol. It is the default communicator for a majority of builders. @@ -31,7 +31,7 @@ the Packer template. However, if you are building from a brand-new and unconfigured operating system image, you will almost always have to perform some extra work to configure SSH on the guest machine. For most operating system distributions, this work will -be performed by a [boot command](/plugins/builders/vmware/iso#boot-configuration) +be performed by a [boot command](/packer/plugins/builders/vmware/iso#boot-configuration) that references a file which provides answers to the normally-interactive questions you get asked when installing an operating system. The name of this file varies by operating system; some common examples are the "preseed" file @@ -42,7 +42,7 @@ rest of the documentation. If you are unfamiliar with how to use a preseed file for automatic bootstrapping of an image, please either take a look at our -[quick guides](/guides/automatic-operating-system-installs) to +[quick guides](/packer/guides/automatic-operating-system-installs) to image bootstrapping, or research automatic configuration for your specific guest operating system. Knowing how to automatically initalize your operating system is critical for being able to successfully use Packer. @@ -79,4 +79,4 @@ Packer supports the following MACs: - `hmac-sha2-256-etm@openssh.com` For more information on the ciphers that Packer supports, check the docs for -the [ssh_ciphers](/docs/communicators/ssh#ssh_ciphers) template option. +the [ssh_ciphers](/packer/docs/communicators/ssh#ssh_ciphers) template option. diff --git a/website/content/docs/communicators/winrm.mdx b/website/content/docs/communicators/winrm.mdx index 1d10f56ea54..103637205a3 100644 --- a/website/content/docs/communicators/winrm.mdx +++ b/website/content/docs/communicators/winrm.mdx @@ -28,7 +28,7 @@ refer to each builder's documentation for more information on how to supply the winrm configuration script. If you are unfamiliar with how to use an autounattend file, take a look at our -[quick guides](/guides/automatic-operating-system-installs); knowing +[quick guides](/packer/guides/automatic-operating-system-installs); knowing how to automatically initalize your operating system is critical for being able to successfully use Packer to build from an iso. @@ -182,10 +182,10 @@ provisioning step to make sure your image is secure. Most clouds allow you to provide a configuration script that runs when the instance is launched. In AWS, this is the -[user_data_file](/plugins/builders/amazon/ebs#user_data_file). In Google +[user_data_file](/packer/plugins/builders/amazon/ebs#user_data_file). In Google Cloud, this is provided using the `windows-startup-script-cmd` -[metadata](/plugins/builders/googlecompute#metadata) tag. -[Example](/plugins/builders/googlecompute#windows-example) +[metadata](/packer/plugins/builders/googlecompute#metadata) tag. +[Example](/packer/plugins/builders/googlecompute#windows-example) Essentially, these files are powershell or cmd scripts that configure winrm, without having to be wrapped in an Autounattend. Provide the script in the diff --git a/website/content/community-tools.mdx b/website/content/docs/community-tools.mdx similarity index 89% rename from website/content/community-tools.mdx rename to website/content/docs/community-tools.mdx index 638ff50c3a6..3a222f17a75 100644 --- a/website/content/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -19,7 +19,7 @@ vendors. These plugins are not officially tested nor officially maintained by HashiCorp, and are listed here in order to help users find them easily. To learn more about how to use community plugins, or how to build your own, -check out the docs on [extending Packer](/docs/plugins/install-plugins) +check out the docs on [extending Packer](https://developer.hashicorp.com/packer/docs/plugins/install-plugins) If you have built a plugin and would like to add it to this community list, please make a pull request so that we can document your @@ -65,6 +65,9 @@ contribution here! to automate the creation of virtual machine images and their guest operating systems on VMware vSphere using HashiCorp Packer and the Packer Plugin for VMware vSphere (vsphere-iso). +- [Parallels/packer-examples](https://github.com/parallels/packer-examples) - Examples in how to use Packer with Parallels Desktop + to automate the creation of virtual machine images and their guest operating systems on macOS, windows and linux. + ## Wrappers - [packer-config](https://github.com/ianchesal/packer-config) - a Ruby model that lets you build Packer configurations in Ruby diff --git a/website/content/docs/configure.mdx b/website/content/docs/configure.mdx index a448541ac69..18eeb409396 100644 --- a/website/content/docs/configure.mdx +++ b/website/content/docs/configure.mdx @@ -13,69 +13,43 @@ so you generally don't have to worry about it until you want to tweak a configuration. If you're just getting started with Packer, don't worry about core configuration for now. -## Packer's home directory - -Plugins and core configuration files can exist in the home directory of Packer. -The home directory of Packer will be the first one of the following env values -to be set : - -| Unix | Windows | -| ---------------------- | --------------------- | -| `${PACKER_CONFIG_DIR}` | `%PACKER_CONFIG_DIR%` | -| `${APPDATA}` | `%APPDATA%` | -| `${HOME}` | `%HOME%` | -| user dir of `${USER}` | user dir of `${USER}` | - --> Note: On this page "Packer's home directory" will be referenced as -`PACKER_HOME_DIR`. - -## Packer's config file - -Packer can optionally read a JSON file for the end user to set core settings. -The config file of Packer will be looked up on the following paths: - -| Unix | Windows | -| -------------------------------- | -------------------------------- | -| `${PACKER_CONFIG}` | `%PACKER_CONFIG%` | -| `PACKER_HOME_DIR/.packerconfig` | `PACKER_HOME_DIR/packer.config/` | -| `${XDG_CONFIG_HOME}/packer` | | -| `PACKER_HOME_DIR/.config/packer` | | - ## Packer's config directory Packer's configuration directory can potentially contain plugins and internal -Packer files. The config dir of Packer will be looked up on the following paths: +Packer files. The Packer config directory will be looked up on the following paths: | Unix | Windows | | --------------------------- | --------------------------- | -| `PACKER_HOME_DIR/.packer.d` | `PACKER_HOME_DIR/packer.d/` | +| `${HOME}/.config/packer/` | `%APPDATA%\packer.d\` | + +-> **Note:** On Unix systems, Packer defaults to using the XDG base directory specification. +When the environment variable `PACKER_CONFIG_DIR` is unset or empty a default equal to `$HOME/.config/packer` should be used. +In all other cases, where there is an existing older style `.packer.d` directory (e.g `$HOME/.packer.d/`) or PACKER_CONFIG_DIR is not empty +the older configuration directory will be used. Examples: -- On a Unix system, if the `$PACKER_CONFIG_DIR` env var is set to +- On a Unix system, if the `$PACKER_CONFIG_DIR` environment variable is set to `/home/packer`, the config directory will be: `/home/packer/.packer.d/` and other values will not be checked. -- On a Unix system, if the `HOME` env var is `/home/azr` or the `USER` env var - is `azr`, then the config directory will default to `/home/azr/.packer.d/`. -- On a Windows system, if the `PACKER_CONFIG_DIR` env var is set to `C:/`,the +- On a Windows system, if the `PACKER_CONFIG_DIR` environment variable is set to `C:/`,the config directory will be: `C:/packer.d/` and other values will not be checked. -## Packer's plugin directory + -@include "plugins/plugin-location.mdx" +## Packer's config file (deprecated) -The format of the configuration file is basic JSON. +Packer can optionally read a JSON file for the end user to set core settings. +The config file of Packer will be looked up on the following paths: -## Packer's cache directory +| Unix | Windows | +| -------------------------------- | --------------------------------- | +| `${PACKER_CONFIG}` | `%PACKER_CONFIG%` | +| `${HOME}/.packerconfig` | `%APPDATA%\packer.config\` | -Packer uses a cache directory to download large files and for logistics around -large file download. By default, Packer caches things in the current directory, -under: `./packer_cache/`. This can be changed by setting the `PACKER_CACHE_DIR` -env var. It is recommended to share the same Packer cache dir across your -builds if you have multiple builds doing similar things to avoid downloading the -same ISO twice for example. +The format of the configuration file is basic JSON. -## Packer config file configuration Reference +### Packer config file configuration Reference Below is the list of all available configuration parameters for the core configuration file. None of these are required, since all have defaults. @@ -89,18 +63,25 @@ configuration file. None of these are required, since all have defaults. - `builders`, `commands`, `post-processors`, and `provisioners` are objects that are used to install plugins. The details of how exactly these are set is covered in more detail in the [installing plugins documentation - page](/docs/plugins/install-plugins). It is instead recommended to use [HCL2 - `required_plugins`](/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) - and the [`packer init`](/docs/commands/init) command to install plugins; if + page](/packer/docs/plugins/install-plugins). It is instead recommended to use [HCL2 + `required_plugins`](/packer/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) + and the [`packer init`](/packer/docs/commands/init) command to install plugins; if you are using both, the `required_plugin` config will take precedence. -### HCP Packer Configuration +## Packer's plugin directory -You can configure both legacy JSON and HCL2 Packer templates to publish image metadata to an active HCP Packer registry. The HCP Packer registry helps you track information about machine images, clearly designate which images are appropriate for test and production environments, and query the right images to use in both Packer and Terraform configurations. +@include "plugins/plugin-location.mdx" -For complete configuration details and examples, refer to [Packer Template Configuration](https://cloud.hashicorp.com/docs/packer/store-image-metadata/template-configuration) in the HCP Packer documentation. +## Packer's cache directory + +Packer uses a cache directory to download large files and for logistics around +large file download. By default, Packer caches things in the current directory, +under: `./packer_cache/`. This can be changed by setting the `PACKER_CACHE_DIR` +env var. It is recommended to share the same Packer cache directory across your +builds if you have multiple builds doing similar things to avoid downloading the +same ISO twice for example. -## Full list of Environment Variables usable for Packer +## Environment Variables usable for Packer Packer uses a variety of environmental variables. A listing and description of each can be found below: @@ -122,11 +103,11 @@ each can be found below: - `PACKER_LOG` - Setting this to any value other than "" (empty string) or "0" will enable the logger. See the [debugging - page](/docs/debugging). + page](/packer/docs/debugging). - `PACKER_LOG_PATH` - The location of the log file. Note: `PACKER_LOG` must be set for any logging to occur. See the [debugging - page](/docs/debugging). + page](/packer/docs/debugging). - `PACKER_NO_COLOR` - Setting this to any value will disable color in the terminal. diff --git a/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx b/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx new file mode 100644 index 00000000000..0261242a879 --- /dev/null +++ b/website/content/docs/datasources/hcp/hcp-packer-artifact.mdx @@ -0,0 +1,105 @@ +--- +description: | + The HCP Packer Artifact Data Source retrieves information about an + artifact from the HCP Packer Registry. This information can be used to + provide a source artifact to various Packer builders. +page_title: HCP Packer Artifact - Data Sources +--- + + + + + + +# HCP Packer Artifact Data Source + +Type: `hcp-packer-artifact` + +The `HCP Packer Artifact` Data Source retrieves information about an +artifact from the HCP Packer Registry. This information can be used to +provide a source artifact to various Packer builders. + +To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try +the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). + +~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. +An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries +with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. + +## Revoked Versions + +If an HCP Packer Version is revoked, the `hcp-packer-version` data source will fail and Packer won't proceed with +the build. Building new artifacts from a revoked artifact is not compliant. +Versions that are scheduled to be revoked will still be considered valid until the revocation date. + +## Basic Example + +Below is a fully functioning example. It stores information about an image artifact, +which can then be parsed and accessed as a variable. + +```hcl +data "hcp-packer-artifact" "example" { + bucket_name = "hardened-ubuntu-16-04" + version_fingerprint = "${data.hcp-packer-version.hardened-source.fingerprint}" + platform = "aws" + region = "us-east-1" +} +``` + +## Full Example + +This data source can be used in conjunction with the hcp-packer-version +data source to retrieve a version fingerprint using a channel. You provide the version fingerprint and channel +name to the version data source, then use the version source inside the +artifact data source, then use the artifact data source inside your source block. + +```hcl +# Retrieves information about the HCP Packer Version; a "version" can be +# thought of as all the metadata created by a single call of `packer build`. +data "hcp-packer-version" "hardened-source" { + bucket_name = "hardened-ubuntu-16-04" + channel_name = "dev" +} + +# Retrieves information about the HCP Packer Artifact; an artifact can be thought +# of as all the metadata (including the artifact names) created by a single +# "source" builder; this can include multiple artifacts so we provide a +# region to disambiguate. +data "hcp-packer-artifact" "example" { + bucket_name = "hardened-ubuntu-16-04" + version_fingerprint = data.hcp_packer_version.hardened-source.fingerprint + platform = "aws" + region = "us-east-1" +} + +# This source uses the output from a previous Packer build. By using the +# HCP Packer Registry in this way, you can easily create build pipelines where +# a single base artifact can be customized in multiple secondary layers. +source "amazon-ebs" "packer-secondary" { + source_ami = data.hcp-packer-artifact.example.external_identifier + ... +} +``` + +## Configuration Reference + +Configuration options are organized below into two categories: required and +optional. Within each category, the available options are alphabetized and +described. + +### Required: + +@include 'datasource/hcp-packer-artifact/Config-required.mdx' + +### Optional: + +~> **Note:** This data source only returns the first found artifact's metadata filtered by the given options, +from the returned list of artifacts associated with the specified version. Therefore, if multiple artifacts exist +in the same region, it will only pick one of them. In this case, you can filter artifact by a source build name +(Ex: `amazon-ebs.example`) using the `component_type` option. + +@include 'datasource/hcp-packer-artifact/Config-not-required.mdx' + +### Output Fields: + +@include 'datasource/hcp-packer-artifact/DatasourceOutput.mdx' diff --git a/website/content/docs/datasources/hcp/hcp-packer-image.mdx b/website/content/docs/datasources/hcp/hcp-packer-image.mdx index 634d93d08ae..d7312921cb4 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-image.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-image.mdx @@ -1,5 +1,6 @@ --- description: | + This data source has been deprecated, please use HCP Packer Artifact data source instead. The HCP Packer Image Data Source retrieves information about an image from the HCP Packer registry. This information can be used to provide a source image to various Packer builders. @@ -8,18 +9,19 @@ page_title: HCP Packer Image - Data Sources - # HCP Packer Image Data Source +~> **Note:** This data source has been deprecated, please use [HCP Packer Artifact](/packer/docs/datasources/hcp/hcp-packer-artifact) data source instead. + Type: `hcp-packer-image` The `HCP Packer Image` Data Source retrieves information about an image from the HCP Packer registry. This information can be used to provide a source image to various Packer builders. -To get started with HCP Packer, refer to the [HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the [Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started). +To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). ~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. diff --git a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx index 70a785467d9..6ad6fb3c396 100644 --- a/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx +++ b/website/content/docs/datasources/hcp/hcp-packer-iteration.mdx @@ -1,5 +1,6 @@ --- description: | + This data source has been deprecated, please use HCP Packer Version data source instead. The HCP Packer Iteration Data Source retrieves information about an iteration from the HCP Packer registry. This information can be used to query HCP for a source image for various Packer builders. @@ -8,18 +9,19 @@ page_title: HCP Packer Iteration - Data Sources - # HCP Packer Iteration Data Source +~> **Note:** This data source has been deprecated, please use [HCP Packer Version](/packer/docs/datasources/hcp/hcp-packer-version) data source instead. + Type: `hcp-packer-iteration` The `HCP Packer Iteration` Data Source retrieves information about an iteration from the HCP Packer registry. This information can be used to query HCP for a source image for various Packer builders. -To get started with HCP Packer, refer to the [HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the [Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started). +To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). ~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. diff --git a/website/content/docs/datasources/hcp/hcp-packer-version.mdx b/website/content/docs/datasources/hcp/hcp-packer-version.mdx new file mode 100644 index 00000000000..31b288ca4a0 --- /dev/null +++ b/website/content/docs/datasources/hcp/hcp-packer-version.mdx @@ -0,0 +1,96 @@ +--- +description: | + The HCP Packer Version Data Source retrieves information about + HCP Packer Version from the HCP Packer Registry. This information can be used to + query HCP for a source external identifier for various Packer builders. +page_title: HCP Packer Version - Data Sources +--- + + + + + + +# HCP Packer Version Data Source + +Type: `hcp-packer-version` + +The `HCP Packer Version` Data Source retrieves information about +HCP Packer Version from the HCP Packer Registry. This information can be used to +query HCP for a source external identifier for various Packer builders. + +To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the +[Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). + +~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. +An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries +with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions. + +## Revoked Versions + +If an HCP Packer Version is revoked, the `hcp-packer-version` data source will fail and Packer won't proceed with +the build. Building new artifacts from a revoked artifact is not compliant. +Versions that are scheduled to be revoked will still be considered valid until the revocation date. + +## Basic Example + +Below is a fully functioning example. It stores information about an HCP Packer Version, which can then be accessed as a variable. + +```hcl +data "hcp-packer-version" "hardened-source" { + bucket_name = "hardened-ubuntu-16-04" + channel_name = "dev" +} +``` + +## Full Example + +This data source can be used in conjunction with the `hcp-packer-artifact` +data source to retrieve an artifact identifier. You provide the version fingerprint and channel +name to the version data source, then use the version source inside the +artifact data source, then use the artifact data source inside your source block. + +```hcl +# Retrieves information about the HCP Packer Version; a "version" can be +# thought of as all the metadata created by a single call of `packer build`. +data "hcp-packer-version" "hardened-source" { + bucket_name = "hardened-ubuntu-16-04" + channel_name = "dev" +} + +# Retrieves information about the HCP Packer Artifact; an artifact can be thought +# of as all the metadata (including the artifact names) created by a single +# "source" builder; this can include multiple artifacts so we provide a +# region to disambiguate. +data "hcp-packer-artifact" "example" { + bucket_name = "hardened-ubuntu-16-04" + version_fingerprint = data.hcp_packer_version.hardened-source.fingerprint + platform = "aws" + region = "us-east-1" +} + +# This source uses the output from a previous Packer build. By using the +# HCP Packer Registry in this way, you can easily create build pipelines where +# a single base artifact can be customized in multiple secondary layers. +source "amazon-ebs" "packer-secondary" { + source_ami = data.hcp-packer-artifact.example.external_identifier + ... +} +``` + +## Configuration Reference + +Configuration options are organized below into two categories: required and +optional. Within each category, the available options are alphabetized and +described. + +### Required: + +@include 'datasource/hcp-packer-version/Config-required.mdx' + +There are currently no optional fields for this datasource, though we intend +to add filtering fields in the future. + +### Output Fields: + +@include 'datasource/hcp-packer-version/DatasourceOutput.mdx' diff --git a/website/content/docs/datasources/hcp/index.mdx b/website/content/docs/datasources/hcp/index.mdx index 22af507fffc..7f5fff7616a 100644 --- a/website/content/docs/datasources/hcp/index.mdx +++ b/website/content/docs/datasources/hcp/index.mdx @@ -11,31 +11,37 @@ sidebar_title: Overview # HCP Packer Registry Data sources -The HCP Packer registry bridges the gap between image factories and image +The HCP Packer Registry bridges the gap between artifact factories and artifact deployments, allowing development and security teams to work together to create, -manage, and consume images in a centralized way. - -The HCP Packer registry stores metadata about your images, including when they -were created, where the image exists in the cloud, and what (if any) git commit -is associated with your image build. You can use the registry to track -information about the golden images your Packer builds produce, clearly -designate which images are appropriate for test and production environments, -and query for the right golden images to use in both Packer and Terraform +manage, and consume artifacts in a centralized way. + +The HCP Packer Registry stores metadata about your artifacts, including when they +were created, where the artifacts exists in the cloud, and what (if any) git commit +is associated with your build. You can use the registry to track +information about the artifacts your Packer builds produce, clearly +designate which artifacts are appropriate for test and production environments, +and query for the right artifacts to use in both Packer and Terraform configurations. Packer has two data sources that work together to retrieve information from the HCP Packer registry: -- [hcp-packer-iteration](/docs/datasources/hcp/hcp-packer-iteration) - +- [hcp-packer-version](/packer/docs/datasources/hcp/hcp-packer-version) - +retrieves information about an HCP Packer Version in HCP Packer Registry +- [hcp-packer-artifact](/packer/docs/datasources/hcp/hcp-packer-artifact) - retrieves +information about a specific artifact created in the HCP Packer registry + +Deprecated data sources: (Please use above given data sources instead) +- [hcp-packer-iteration](/packer/docs/datasources/hcp/hcp-packer-iteration) - retrieves information about an iteration in HCP Packer registry -- [hcp-packer-image](/docs/datasources/hcp/hcp-packer-image) - retrieves +- [hcp-packer-image](/packer/docs/datasources/hcp/hcp-packer-image) - retrieves information about a specific image created in the HCP Packer registry -These data sources are intended to be used together to determine source images +These data sources are intended to be used together to determine source artifact for pipelined Packer builds. ## How to use this plugin This plugin comes bundled with the Packer core, so you do not need to install it separately. Please install Packer v1.7.7 or above to use the latest version -of the HCP Packer registry datasources. +of the HCP Packer Registry data sources. diff --git a/website/content/docs/datasources/index.mdx b/website/content/docs/datasources/index.mdx index ed7e0e7242e..cf70bde28cf 100644 --- a/website/content/docs/datasources/index.mdx +++ b/website/content/docs/datasources/index.mdx @@ -9,7 +9,7 @@ page_title: Data Sources Data sources let Packer fetch data to use in a template, including information defined outside of Packer. -Refer to the [`data`](/docs/templates/hcl_templates/datasources) block documentation to learn more about working with data sources. The documentation also contains details about each type of data source. +Refer to the [`data`](/packer/docs/templates/hcl_templates/datasources) block documentation to learn more about working with data sources. The documentation also contains details about each type of data source. -> **Note:** Data sources is a feature exclusively available to HCL2 templates included in Packer `v1.7.0` (and newer). diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index a5ddf719683..8063bd0dcc7 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -1,44 +1,120 @@ --- description: | - Packer can publish metadata for completed builds to an HCP Packer registry. Legacy JSON templates can connect to the registry using environment variables. HCL2 templates can connect using an hcp_packer_registry block. + Packer can publish metadata for completed builds to an HCP Packer Registry. Legacy JSON templates can connect to the registry using environment variables. HCL2 templates can connect using an hcp_packer_registry block. page_title: HCP Packer --- +-> **Note:** On May 16th 2023, HCP introduced multi-project support to the platform. In order to use multiple projects +in your organization, you will need to update Packer to version 1.9.1 or above. Starting with 1.9.1, you may specify +a project ID to push builds to with the `HCP_PROJECT_ID` environment variable. If no project ID is specified, +Packer will pick the project with the oldest creation date. Older versions of Packer are incompatible with multi-project +support on HCP, and builds will fail for HCP organizations with multiple projects on versions before 1.9.1. + # HCP Packer -The HCP Packer registry bridges the gap between image factories and image deployments, allowing development and security teams to work together to create, manage, and consume images in a centralized way. +The HCP Packer registry bridges the gap between artifact factories and artifact deployments, allowing development and +security teams to work together to create, manage, and consume artifacts in a centralized way. -The HCP Packer registry stores metadata about your images, including when they were created, where the image exists in the cloud, and what (if any) git commit is associated with your image build. You can use the registry to track information about the golden images your Packer builds produce, clearly designate which images are appropriate for test and production environments, and query for the right golden images to use in both Packer and Terraform configurations. +The HCP Packer Registry stores metadata about your artifact, including when they were created, where the artifact +exists on the external platform, and what (if any) git commit is associated with your build. You can use the registry +to track information about the artifact your Packer builds produce, clearly designate which artifact are appropriate +for test and production environments, and query for the right artifact to use in both Packer and Terraform +configurations. -You can use HCP Packer with both JSON and HCL2 templates. If you are using JSON templates, we recommend getting started with -the [HCP Packer environment variables](#hcp-packer-environment-variables) and then migrating to HCL when possible. +You can use HCP Packer with both JSON and HCL2 templates. If you are using JSON templates, we recommend getting started with +the [HCP Packer environment variables](#hcp-packer-environment-variables) and then migrating to HCL when possible. -This page summarizes the methods you can use to connect JSON and HCL2 templates to the HCP Packer registry. It also provides a full list of HCP Packer environment variables. Refer to the [Packer Template Configuration](https://cloud.hashicorp.com/docs/packer/store-image-metadata/packer-template-configuration) page in the HCP Packer documentation for full configuration details and examples. +This page summarizes the methods you can use to connect JSON and HCL2 templates to the HCP Packer registry. It also +provides a full list of HCP Packer environment variables. Refer to the +[Packer Template Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration) page in the HCP +Packer documentation for full configuration details and examples. ### HCP Packer Environment Variables -The following environment variables let you configure Packer to push image metadata to an active registry without changing your template. You can use environment variables with both JSON and HCL2 templates. Refer to [Basic Configuration With Environment Variables](https://cloud.hashicorp.com/docs/packer/store-image-metadata/packer-template-configuration#basic-configuration-with-environment-variables) in the HCP Packer documentation for complete instructions and examples. +The following environment variables let you configure Packer to push artifact metadata to an active registry without +changing your template. You can use environment variables with both JSON and HCL2 templates. +Refer to [Basic Configuration With Environment Variables](/hcp/docs/packer/store-image-metadata/packer-template-configuration#basic-configuration-with-environment-variables) +in the HCP Packer documentation for complete instructions and examples. You must set the following environment variables to enable Packer to push metadata to a registry. -- `HCP_CLIENT_ID` - The HCP client ID of a HashiCorp Cloud Platform service principle that Packer can use to authenticate to an HCP Packer registry. +- `HCP_CLIENT_ID` - The HCP client ID of a HashiCorp Cloud Platform service principle that Packer can use to +authenticate to an HCP Packer Registry. -- `HCP_CLIENT_SECRET` - The HCP client secret of the HashiCorp Cloud Platform service principle that Packer can use to authenticate to an HCP Packer registry. +- `HCP_CLIENT_SECRET` - The HCP client secret of the HashiCorp Cloud Platform service principle that Packer +can use to authenticate to an HCP Packer Registry. -- `HCP_PACKER_BUCKET_NAME` - The name of the image bucket where you want HCP Packer to store image metadata from builds associated with your template. HCP Packer automatically creates the image bucket if it does not already exist. If your HCL2 template contains an `hcp_packer_registry` block, the bucket name specified in the configuration will be overwritten by this environment variable. +- `HCP_PACKER_BUCKET_NAME` - The name of the HCP Packer Bucket where you want HCP Packer to store artifact metadata +from builds associated with your template. HCP Packer automatically creates the bucket if it does not already exist. +If your HCL2 template contains an `hcp_packer_registry` block, the bucket name specified in the configuration will be +overwritten by this environment variable. You can set these additional environment variables to control how metadata is pushed to the registry. -- `HCP_PACKER_BUILD_FINGERPRINT` - A unique identifier assigned to each build. HCP Packer uses this identifier to determine if metadata for a build on the registry is complete. By default, HCP Packer uses the HEAD Git SHA for the template file. If the template is not version controlled, you must set this environment variable to a unique value before running `packer build`. +- `HCP_PACKER_BUILD_FINGERPRINT` - A unique identifier assigned to each version. To reuse a fingerprint that is +associated with an existing incomplete version you must set this environment variable. Refer to +[Version Fingerprinting](#version-fingerprinting) for usage details. + +- `HCP_PACKER_REGISTRY` - When set, Packer does not push artifact metadata to HCP Packer from an otherwise +configured template. Allowed values are [0|OFF]. + +- `HCP_ORGANIZATION_ID` - The ID of the HCP organization linked to your service principal. This is environment +variable is not required and available for the sole purpose of keeping parity with the HCP SDK authentication options. +Its use may change in a future release. -- `HCP_PACKER_REGISTRY` - When set, Packer does not push image metadata to HCP Packer from an otherwise configured template. Allowed values are [0|OFF]. +- `HCP_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple +projects, as by default Packer will pick the one created first as target. + +-> **Note**: The HCP_PROJECT_ID environment variable must be set if you're authenticating with a project-level service +principal, otherwise Packer will attempt to get the list of projects for an organization and error due to a lack of +permissions for a project-level service principal. This is supported starting with Packer 1.9.3; older versions of +Packer do not support using project-level service principals. ### HCP Packer Registry Block -The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize the metadata that Packer sends to the registry. +The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. +For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize +the metadata that Packer sends to the registry. + +The `hcp_packer_registry` block is only available for HCL2 Packer templates. There is no [`PACKER_CONFIG`](/packer/docs/configure#packer-s-config-file) equivalent for JSON. + +Refer to [`hcp_packer_registry`](/packer/docs/templates/hcl_templates/blocks/build/hcp_packer_registry) for a full list +of configuration arguments. Refer to [Custom Configuration](/hcp/docs/packer/store-image-metadata/packer-template-configuration#custom-configuration) +in the HCP Packer documentation for information and examples about how to customize artifact metadata. + +### Version Fingerprinting + +Packer uses a unique fingerprint for tracking the completion of builds associated to a version. By default a fingerprint +is automatically generated by Packer during each invocation of `packer build`, unless a fingerprint is manually provided +via the `HCP_PACKER_BUILD_FINGERPRINT` environment variable. + +In versions before 1.9.0, this fingerprint was computed from the Git SHA of the current HEAD in which your template is +stored. If you were running builds using a non Git managed template, you had to set the `HCP_PACKER_BUILD_FINGERPRINT` +environment variable prior to invoking `packer build`. +Starting with Packer 1.9.0, fingerprint generation does not rely on Git at all, and instead Packer now generates +a Unique Lexicographically sortable Identifier (ULID) as the fingerprint for every `packer build` invocation. + +#### Fingerprints and Incomplete Versions + +When you build a template with Packer, there's always a chance that it does not succeed because of a network issue, +a provisioning failure, or some upstream error. When that happens, Packer will output the generated fingerprint +associated with the incomplete version so that you can resume building that version using the `HCP_PACKER_BUILD_FINGERPRINT` +environment variable; a version can be resumed until it is marked as complete. This environment variable is necessary +for resuming an incomplete version, otherwise Packer will create a new version for the build. + +There are two alternatives for when and how to set your own fingerprint: -The `hcp_packer_registry` block is only available for HCL2 Packer templates. There is no [`PACKER_CONFIG`](docs/configure#packer-s-config-file) equivalent for JSON. +* You can set it prior to invoking `packer build` for the first time on this template. This will require the +fingerprint to be unique, otherwise Packer will attempt to continue the version with the same fingerprint. +* You can invoke `packer build` on the template, and if it fails, you can then get the fingerprint from the output of +the command and set it for subsequent runs, Packer will then continue building this version. -Refer to [`hcp_packer_registry`](docs/templates/hcl_templates/blocks/build/hcp_packer_registry) for a full list of configuration arguments. Refer to [Custom Configuration](https://cloud.hashicorp.com/docs/packer/store-image-metadata/packer-template-configuration#custom-configuration) in the HCP Packer documentation for information and examples about how to customize image metadata. +The first alternative is recommended for CI environments, as you can use environment variables from the CI to generate +a unique, deterministic, fingerprint, and then re-use this in case the step fails for any reason. This will let you +continue building the same version, rather than creating a new one on each invocation. +The second alternative is good for local builds, as you can interact with the build environment directly, and therefore +can decide if you want to continue building a version by setting the fingerprint provided by Packer in case of failure. +Please note that in all cases, a version can only be continued if it has not completed yet. Once a version is +complete, it cannot be modified, and you will have to create a new one. diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx index edf4ca6b9e8..b4ab7cf0cd6 100644 --- a/website/content/docs/index.mdx +++ b/website/content/docs/index.mdx @@ -6,12 +6,14 @@ page_title: Documentation # Packer Documentation -[Packer](https://www.packer.io/) is an open source tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. +[Packer](https://www.packer.io/) is a community tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. -To install Packer and learn the standard Packer workflow, try the [Get Started tutorials](https://learn.hashicorp.com/packer). +To install Packer and learn the standard Packer workflow, try the [Get Started tutorials](/packer/tutorials). ## HCP Packer -The HCP Packer registry stores metadata about your images. You can use the registry to track information about golden images from your Packer builds, clearly designate which images are appropriate for test and production environments, and query for the right images to use in both Packer and Terraform configurations. +The HCP Packer registry stores metadata about your artifacts. You can use the registry to track information about +artifacts from your Packer builds, clearly designate which artifacts are appropriate for test and production +environments, and query for the right artifacts to use in both Packer and Terraform configurations. -To get started, visit the [HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the [Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started). +To get started, visit the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). diff --git a/website/content/docs/install.mdx b/website/content/docs/install.mdx index d2982f024cf..548049dc7a1 100644 --- a/website/content/docs/install.mdx +++ b/website/content/docs/install.mdx @@ -10,4 +10,4 @@ page_title: Install For detailed instructions on how to install Packer, see [this Getting Started guide][install]. -[install]: https://learn.hashicorp.com/packer/getting-started/install 'Install Packer' +[install]: /packer/tutorials/docker-get-started/get-started-install-cli 'Install Packer' diff --git a/website/content/docs/intro/index.mdx b/website/content/docs/intro/index.mdx index b9c4ebb1a33..d6fb56902f6 100644 --- a/website/content/docs/intro/index.mdx +++ b/website/content/docs/intro/index.mdx @@ -12,12 +12,12 @@ description: |- Welcome to the world of Packer! This introduction guide will show you what Packer is, explain why it exists, the benefits it has to offer, and how you can get started with it. If you're already familiar with Packer, the -[documentation](/docs) provides more of a reference for all available +[documentation](/packer/docs) provides more of a reference for all available features. ## What is Packer? -Packer is an open source tool for creating identical machine images for multiple +Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration diff --git a/website/content/docs/intro/use-cases.mdx b/website/content/docs/intro/use-cases.mdx index d4f72f3a391..e6e3c63c673 100644 --- a/website/content/docs/intro/use-cases.mdx +++ b/website/content/docs/intro/use-cases.mdx @@ -33,7 +33,7 @@ stability and testability to infrastructure changes. Packer helps [keep development, staging, and production as similar as possible](http://www.12factor.net/dev-prod-parity). Packer can be used to generate images for multiple platforms at the same time. So if you use AWS for -production and VMware (perhaps with [Vagrant](https://www.vagrantup.com)) for +production and VMware (perhaps with [Vagrant](https://www.vagrantup.com/)) for development, you can generate both an AMI and a VMware machine using Packer at the same time from the same template. diff --git a/website/content/docs/partnerships.mdx b/website/content/docs/partnerships.mdx index d39268e57ae..97d1ec526f6 100644 --- a/website/content/docs/partnerships.mdx +++ b/website/content/docs/partnerships.mdx @@ -15,10 +15,10 @@ This program is intended to be largely a self-service process with links and gui ### Types of Packer Integrations -Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. +Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image. -A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. To know more about use cases of Packer click ([Use Cases - Introduction | Packer by HashiCorp](/#features)) +A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. To know more about use cases of Packer click ([Use Cases - Introduction | Packer by HashiCorp](/packer/docs/intro/use-cases)) The diagram below depicts the key Packer integration categories and types. @@ -31,7 +31,7 @@ The diagram below depicts the key Packer integration categories and types. Main Packer categories for partners to integrate with include: - **Data Sources** - - Data Sources allow users to retrieve values from a remote API and store them as variables in the Packer configuration template. An example is the [AWS secrets manager](/plugins/datasources/amazon/secretsmanager) data source. + - Data Sources allow users to retrieve values from a remote API and store them as variables in the Packer configuration template. An example is the [AWS secrets manager](/packer/plugins/datasources/amazon/secretsmanager) data source. - **Builders** - Builders manage the VM lifecycle. They manage launching a VM/instance, running provisioners against that instance, shutting the instance down, and saving an artifact image from that instance. Your builder handles all of the setup and cleanup costs associated with creating the output image artifact. - **Provisioners** @@ -68,7 +68,7 @@ While not mandatory, HashiCorp encourages vendors to sign an MNDA (Mutual Non-Di In an effort to support our self-serve model we’ve included links to resources, documentation, examples and best practices to guide you through the Packer integration development and testing process. -- [Writing vendor extension guide](/docs/plugins/creation) +- [Writing vendor extension guide](/packer/docs/plugins/creation) - Sample development implemented by a [partner](https://github.com/exoscale/packer-plugin-exoscale) - [Scaffolding plugin repository](https://github.com/hashicorp/packer-plugin-scaffolding) to help bootstrap a new contribution: - Contributing to Packer [guidelines](https://github.com/hashicorp/packer/blob/main/.github/CONTRIBUTING.md) @@ -83,22 +83,22 @@ Packer requires all code-level integrations to be written in the [Go](https://go Data Sources -- [Custom Data Sources documentation](/docs/plugins/creation/custom-datasources) +- [Custom Data Sources documentation](/packer/docs/plugins/creation/custom-datasources) - [Example Data Source](https://github.com/hashicorp/packer-plugin-hashicups/tree/main/datasource) Builders -- [Custom Builders documentation](/docs/plugins/creation/custom-builders) +- [Custom Builders documentation](/packer/docs/plugins/creation/custom-builders) - [Example Builder](https://github.com/hashicorp/packer-plugin-hashicups/tree/main/builder/order) Provisioners -- [Custom Provisioners documentation](/docs/plugins/creation/custom-provisioners) +- [Custom Provisioners documentation](/packer/docs/plugins/creation/custom-provisioners) - [Example Provisioner](https://github.com/hashicorp/packer-plugin-hashicups/tree/main/provisioner/toppings) Post-Processors -- [Custom Post-Processors documentation](/docs/plugins/creation/custom-post-processors) +- [Custom Post-Processors documentation](/packer/docs/plugins/creation/custom-post-processors) - [Example Post-Processor](https://github.com/hashicorp/packer-plugin-hashicups/tree/main/post-processor/receipt) Packer-Plugin-SDK @@ -109,12 +109,12 @@ Packer-Plugin-SDK During the review process, HashiCorp will provide feedback on the newly developed integration. This is an important step to allow HashiCorp to review and verify your Packer integration. Please send the integration code and other relevant logs for verification to: [Packer-integration-dev@hashicorp.com](mailto:packer-integration-dev@hashicorp.com). -In order to document your plugins with Packer, please submit a GitHub pull request (PR) against the [Packer project](https://github.com/hashicorp/packer). See [Registering Plugin Documentation](/docs/plugins/creation#registering-plugin-documentation) for instructions on how to register your remote plugin documentation with Packer. +In order to document your plugins with Packer, please submit a GitHub pull request (PR) against the [Packer project](https://github.com/hashicorp/packer). See [Registering Plugin Documentation](/packer/docs/plugins/creation#registering-plugin-documentation) for instructions on how to register your remote plugin documentation with Packer. The review process can take a while to complete and may require some iterations through the code to address any problems identified by the HashiCorp team. #### 5. Release -At this stage, it is expected that the integration is fully complete, the necessary documentation has been written, the acceptance tests have all passed, and that HashiCorp has reviewed the integration. Once the plugin has been validated and accepted by HashiCorp, the plugin can be hosted on GitHub so it can easily be [downloaded then installed within Packer](/docs/plugins/creation#creating-a-github-release). +At this stage, it is expected that the integration is fully complete, the necessary documentation has been written, the acceptance tests have all passed, and that HashiCorp has reviewed the integration. Once the plugin has been validated and accepted by HashiCorp, the plugin can be hosted on GitHub so it can easily be [downloaded then installed within Packer](/packer/docs/plugins/creation#creating-a-github-release). Once the integration has been released the vendor is requested to sign the HashiCorp Technology Partner Agreement so that we can have their integration be listed on the HashiCorp website. diff --git a/website/content/docs/plugins/creation/custom-builders.mdx b/website/content/docs/plugins/creation/custom-builders.mdx index 03e8ff2e853..efad53accd4 100644 --- a/website/content/docs/plugins/creation/custom-builders.mdx +++ b/website/content/docs/plugins/creation/custom-builders.mdx @@ -8,9 +8,9 @@ page_title: Custom Builders - Extending # Custom Builders Packer builders are responsible for creating a virtual machine, setting the virtual machine up for provisioning, and then turning that provisioned virtual machine into a machine image. We officially maintain and distribute several builders, including builders to create images on Amazon EC2, VMware, Google -Compute Engine, and many more. Refer to the [Builders](/docs/builders) documentation for details. +Compute Engine, and many more. Refer to the [Builders](/packer/docs/builders) documentation for details. -This page explains how to use the Packer plugin interface to write custom builders. If you want your builder to support HashiCorp Cloud Platform (HCP) Packer, you should also review the [HCP Packer Support](/docs/plugins/creation/hcp-support) documentation. +This page explains how to use the Packer plugin interface to write custom builders. If you want your builder to support HashiCorp Cloud Platform (HCP) Packer, you should also review the [HCP Packer Support](/packer/docs/plugins/creation/hcp-support) documentation. ~> **Warning:** This is an advanced topic that requires strong knowledge of Packer and Packer plugins. @@ -18,7 +18,7 @@ This page explains how to use the Packer plugin interface to write custom builde We recommend reviewing the following resources before you begin development: -- [Developing Plugins - Overview](/docs/plugins/creation) +- [Developing Plugins - Overview](/packer/docs/plugins/creation) - The [Go](https://go.dev/) language. You must write custom plugins in Go, so this guide assumes you are familiar with the language. ## The Interface @@ -39,7 +39,7 @@ type Builder interface { This method returns a hcldec.ObjectSpec, which is a spec necessary for using HCL2 templates with Packer. For information on how to use and implement this function, check our -[object spec docs](/guides/hcl/component-object-spec) +[object spec docs](/packer/guides/hcl/component-object-spec) ### The "Prepare" Method @@ -204,8 +204,8 @@ but it is recommended to avoid using them if you can. Packer JSON makes it possible to provide custom template engine variables to be shared with provisioners and post-processors using the `build` function. -JSON template `build` docs are [here](/docs/templates/legacy_json_templates/engine#build) -and HCL template build docs are [here](/docs/templates/hcl_templates/contextual-variables#build-variables). +JSON template `build` docs are [here](/packer/docs/templates/legacy_json_templates/engine#build) +and HCL template build docs are [here](/packer/docs/templates/hcl_templates/contextual-variables#build-variables). As of Packer v1.5.0, builder Prepare() methods return a list of custom variables which we call `generated data`. We use that list of variables to generate a @@ -306,5 +306,5 @@ order to make it available to the Packer core as a plugin. We have created a [scaffolding](https://github.com/hashicorp/packer-plugin-scaffolding/blob/main/builder/scaffolding/builder.go) repo to give you an idea of the relationship between the builder implementation and the server implementation within a repository, and then read -[basics of how Plugins work](/docs/plugins/install-plugins), which breaks down all the +[basics of how Plugins work](/packer/docs/plugins/install-plugins), which breaks down all the server details. diff --git a/website/content/docs/plugins/creation/custom-datasources.mdx b/website/content/docs/plugins/creation/custom-datasources.mdx index 2e297afcf9c..1111ac20c93 100644 --- a/website/content/docs/plugins/creation/custom-datasources.mdx +++ b/website/content/docs/plugins/creation/custom-datasources.mdx @@ -7,7 +7,7 @@ page_title: Custom Data Sources - Extending # Custom Data Sources -Packer data sources let Packer fetch data to use within the configuration, including information defined outside of Packer. For example, the [amazon-ami data source](/plugins/datasources/amazon/ami), outputs the data from an Amazon AMI. +Packer data sources let Packer fetch data to use within the configuration, including information defined outside of Packer. For example, the [amazon-ami data source](/packer/plugins/datasources/amazon/ami), outputs the data from an Amazon AMI. Data Source plugins implement the `packersdk.Datasource` interface and are registered within a plugin Set with `set.RegisterDatasource(...)` function and served using the `set.Run()`. @@ -18,7 +18,7 @@ with `set.RegisterDatasource(...)` function and served using the `set.Run()`. We recommend reviewing the following resources before you begin development: -- [Developing Plugins - Overview](/docs/plugins/creation) +- [Developing Plugins - Overview](/packer/docs/plugins/creation) - The [Go](https://go.dev/) language. You must write custom plugins in Go, so this guide assumes you are familiar with the language. ## The Interface @@ -42,11 +42,11 @@ type Datasource interface { This method returns a hcldec.ObjectSpec, which is a spec necessary for using HCL2 templates with Packer. For information on how to use and implement this function, check our -[object spec docs](/guides/hcl/component-object-spec) +[object spec docs](/packer/guides/hcl/component-object-spec) ### The "OutputSpec" Method -This method returns a [hcldec.ObjectSpec](/guides/hcl/component-object-spec) of the data source output. +This method returns a [hcldec.ObjectSpec](/packer/guides/hcl/component-object-spec) of the data source output. The object spec can be generated using the command [`packer-sdc mapstructure-to-hcl2`](https://github.com/hashicorp/packer-plugin-sdk/tree/main/cmd/packer-sdc) just like the configuration spec for the `ConfigSpec` method. diff --git a/website/content/docs/plugins/creation/custom-post-processors.mdx b/website/content/docs/plugins/creation/custom-post-processors.mdx index 734abb785ba..4a20496d2a7 100644 --- a/website/content/docs/plugins/creation/custom-post-processors.mdx +++ b/website/content/docs/plugins/creation/custom-post-processors.mdx @@ -20,14 +20,14 @@ those files, and returning an artifact with a single ID: the URL of the upload. Post-processor plugins implement the [`packer.PostProcessor`](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/packer#PostProcessor) interface and are served using the `plugin.ServePostProcessor` function. -This page explains how to implement and serve custom post-processors. If you want your post-processor to support HashiCorp Cloud Platform (HCP) Packer, you should also review the [HCP Packer Support](/docs/plugins/creation/hcp-support) documentation. +This page explains how to implement and serve custom post-processors. If you want your post-processor to support HashiCorp Cloud Platform (HCP) Packer, you should also review the [HCP Packer Support](/packer/docs/plugins/creation/hcp-support) documentation. ~> **Warning:** This is an advanced topic that requires strong knowledge of Packer and Packer plugins. ## Before You Begin We recommend reviewing the following resources before you begin development: -- [Developing Plugins - Overview](/docs/plugins/creation) +- [Developing Plugins - Overview](/packer/docs/plugins/creation) - The [Go](https://go.dev/) language. You must write custom plugins in Go, so this guide assumes you are familiar with the language. ## The Interface @@ -50,7 +50,7 @@ type PostProcessor interface { This method returns a hcldec.ObjectSpec, which is a spec necessary for using HCL2 templates with Packer. For information on how to use and implement this function, check our -[object spec docs](/guides/hcl/component-object-spec) +[object spec docs](/packer/guides/hcl/component-object-spec) ### The "Configure" Method diff --git a/website/content/docs/plugins/creation/custom-provisioners.mdx b/website/content/docs/plugins/creation/custom-provisioners.mdx index 1947d793497..30bb8312a2c 100644 --- a/website/content/docs/plugins/creation/custom-provisioners.mdx +++ b/website/content/docs/plugins/creation/custom-provisioners.mdx @@ -14,7 +14,7 @@ page_title: Custom Provisioners - Extending # Custom Provisioners Packer provisioners install and configure software into a running machine prior to turning that machine into an image. For example, the [shell -provisioner](/docs/provisioners/shell), which runs shell scripts within +provisioner](/packer/docs/provisioners/shell), which runs shell scripts within the machines. Provisioner plugins implement the [`packer.Provisioner`](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/packer#Provisioner) interface and are served @@ -25,7 +25,7 @@ using the `plugin.ServeProvisioner` function. ## Before You Begin We recommend reviewing the following resources before you begin development: -- [Developing Plugins - Overview](/docs/plugins/creation) +- [Developing Plugins - Overview](/packer/docs/plugins/creation) - The [Go](https://go.dev/) language. You must write custom plugins in Go, so this guide assumes you are familiar with the language. ## The Interface @@ -74,7 +74,7 @@ may be displayed to the user before anything actually happens. This method returns a hcldec.ObjectSpec, which is a spec necessary for using HCL2 templates with Packer. For information on how to use and implement this function, check our -[object spec docs](/guides/hcl/component-object-spec) +[object spec docs](/packer/guides/hcl/component-object-spec) ### The "Provision" Method diff --git a/website/content/docs/plugins/creation/hcp-support.mdx b/website/content/docs/plugins/creation/hcp-support.mdx index eb5d469b8b4..ed65ae15aa6 100644 --- a/website/content/docs/plugins/creation/hcp-support.mdx +++ b/website/content/docs/plugins/creation/hcp-support.mdx @@ -9,7 +9,7 @@ page_title: HCP Packer Support ~> **Note:** HCP Packer is under active development, and we suggest plugin maintainers to keep up with the SDK changes for more on HCP Packer support. -This page explains how to update a custom plugin so that it can publish image metadata to the [HCP Packer registry](https://cloud.hashicorp.com/docs/packer). Refer to [Custom Builders](/docs/plugins/creation/custom-builders) and [Custom Post-Processors](/docs/plugins/creation/custom-post-processors) for details about creating an external Packer plugin. +This page explains how to update a custom plugin so that it can publish image metadata to the [HCP Packer registry](/hcp/docs/packer). Refer to [Custom Builders](/packer/docs/plugins/creation/custom-builders) and [Custom Post-Processors](/packer/docs/plugins/creation/custom-post-processors) for details about creating an external Packer plugin. Before pushing metadata to the HCP Packer registry, Packer uses the [`par.artifact.metadata` key](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/packer/registry/image#pkg-constants) to query a builder artifact for the image metadata that a particular component would like to have stored in the registry. @@ -111,5 +111,5 @@ The following plugins currently support HCP Packer and are great references for ## HCP Packer To get to know HCP Packer, visit the -[HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the -[Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started). +[HCP Packer documentation](/hcp/docs/packer) or try the +[Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). diff --git a/website/content/docs/plugins/creation/index.mdx b/website/content/docs/plugins/creation/index.mdx index 93b265234c1..763877aa0fe 100644 --- a/website/content/docs/plugins/creation/index.mdx +++ b/website/content/docs/plugins/creation/index.mdx @@ -9,7 +9,7 @@ page_title: Extending # Developing Plugins Packer is extensible and supports plugins that let you -create and use custom builders, provisioners, post-processors, and data sources. This page explains how to develop Packer plugins. Before you begin, we recommend reviewing the Packer documentation and the instructions for [installing external plugins](/docs/plugins/install-plugins). +create and use custom builders, provisioners, post-processors, and data sources. This page explains how to develop Packer plugins. Before you begin, we recommend reviewing the Packer documentation and the instructions for [installing external plugins](https://developer.hashicorp.com/packer/docs/plugins/install-plugins). ~> **Warning** This is an advanced topic. You should have strong knowledge of Packer before you start writing plugins. @@ -49,15 +49,7 @@ danger of colliding dependencies. - [`github.com/hashicorp/packer-plugin-sdk/plugin`](https://pkg.go.dev/github.com/hashicorp/packer-plugin-sdk/plugin) - Contains the code to serve the plugin. This handles all the inter-process communication. -Basic examples of serving your component are shown below. Note that if you -define a multi-component plugin, you can (but do not need to) add more than one -component per plugin binary. The multi-component plugin is also compatible with -download and installation via `packer init`, whereas the single-component plugin -is not. - - - - +Basic examples of serving your component are shown below. ```go // main.go @@ -107,46 +99,9 @@ the following components available: - the `my-foo` post-processor - the `my-bar` provisioner - - - - -```go -// main.go - -import ( - "github.com/hashicorp/packer-plugin-sdk/plugin" -) - -// Assume this implements the packer.Builder interface -type Builder struct{} - -func main() { - server, err := plugin.Server() - if err != nil { - panic(err) - } - server.RegisterBuilder(new(Builder)) - server.Serve() -} -``` - -This `server.Serve()` invocation handles all the details of communicating with -Packer core and serving your component over RPC. As long as your struct being -registered implements one of the component interfaces, Packer will now be able -to launch your plugin and use it. - -Please note that single-component plugins exist for backwards-compatability. We -would rather you register your component using the multi-component method shown -in the other tab, even if you only have one component in your binary. This is -because the `packer init` command only supports multi-component plugins. - - - - Next, build your plugin as you would any other Go application. The resulting binary is the plugin that can be installed using -[standard installation procedures](/docs/plugins#installing-plugins). +[standard installation procedures](https://developer.hashicorp.com/packer/docs/plugins#installing-plugins). This documentation explains how to implement each type of plugin interface: builders, data sources, provisioners, and post-processors. @@ -212,89 +167,64 @@ Here's what you need to create releases using GitHub Actions: releaser is working. The tag must be a valid [Semantic Version](https://semver.org/) preceded with a `v`. Once the tag is pushed, the github actions you just configured will automatically build release binaries that Packer can download using `packer init`. For more details on how to install a plugin using `packer init`, see the - [init docs](/docs/commands/init). - -## Registering Plugin Documentation - -~> Note: Registering a remote plugin's plugin documentation requires the use of [Packer's plugin docs configuration](https://github.com/hashicorp/packer-plugin-scaffolding/tree/main/docs). - -`packer init` allows users to require and install remote Packer plugins, those not bundled with Packer core, that have been published to GitHub automatically. -To help with the discovery of remote Packer plugins on GitHub, plugins maintainers can choose to register plugin documentation for each component directly on the [Packer Documentation Page](https://packer.io/docs). - -The registration process requires the creation of a `docs.zip` file archive containing the `.mdx` files for each of the plugin components in the remote plugin's repository. A working example can be seen at the [packer-plugin-docker repository](https://github.com/hashicorp/packer-plugin-docker/releases/latest). - -Once in place the remote plugin can be added to Packer's website builds by opening a pull-request against [hashicorp/packer](https://github.com/hashicorp/packer), with the needed configuration for pulling in the remote documentation. - -Remote plugins will have their components listed under the respected types (i.e builders, provisioners, etc) using the names specified in the remote block configuration, and labeled with their respective [tier and namespace](/docs/plugins#tiers-and-namespaces). - -To register a plugin follow one of the following setups - - - - -Documentation for a plugin is maintained within the `docs` directory and served on GitHub. - -To include plugin docs on the website, a global pre-hook has been added to the main scaffolding [.goreleaser.yml](https://github.com/hashicorp/packer-plugin-scaffolding/blob/42e5b0b1e575879b0477cb6d4291e027f4d92f85/.goreleaser.yml#L10) file, that if uncommented will generate and include a docs.zip file as part of the plugin release. - -The `docs.zip` file contains all of the `.mdx` files under the plugins root `docs/` directory that the website can consume remotely. - - - - - -You can generate the required documentation structure manually by creating a zip file called `docs.zip` of the docs directory and including that zip file in the plugin release. - -```/bin/bash -[[ -d docs/ ]] && zip -r docs.zip docs/ + [init docs](https://developer.hashicorp.com/packer/docs/commands/init). + +## Registering Plugins + +~> Note: Registering a plugin as an integration requires the documentation to match the [Scaffolding example layout](https://github.com/hashicorp/packer-plugin-scaffolding/tree/main/.web-docs). + +To help with the discovery of Packer plugins, plugins maintainers can choose to register their plugin as a [Packer Integration](https://developer.hashicorp.com/packer/integrations). + +The registration process requires [metadata configuration](https://github.com/hashicorp/integration-template#metadata-configuration) to be added to your plugin repository for configuring the Packer integration pipeline and +a specific directory structure for plugin documentation to be rendered on the [Packer Integrations](https://developer.hashicorp.com/packer/integrations) portal. + +You can execute the following steps to register your plugin as an integration: + +1. Update your plugin documentation structure to match the [Scaffolding example layout](https://github.com/hashicorp/packer-plugin-scaffolding/tree/main/.web-docs). +New plugins generated from this template have the necessary structure in place. If so you can jump to step 3. +1. For the integrations library, only one top-level README per integration is supported. Any top-level index.mdx files that exist +within a plugin's existing documentation will need to migrate to a top-level README. +1. Update your top-level integration README to include a description, plugin installation steps, available components section, and, any, additional sections +needed to inform users on how to work with your integration. Refer to [Packer scaffolding plugin](https://github.com/hashicorp/packer-plugin-scaffolding/blob/main/docs/README.md) for an example. +1. Update the top-level README for each of the components within your integration to follow the structure defined in the scaffolding template. +1. Add the integration configuration file [metadata.hcl](https://github.com/hashicorp/packer-plugin-scaffolding/blob/main/.web-docs/metadata.hcl) to the plugins `.web-docs` directory. +1. Open a request for integration issue with the Packer team - [Open Request](https://github.com/hashicorp/packer/issues/new?labels=new-plugin-contribution&template=plugin_integration.md). +Provide all the requested information to help expedite the integration request. + +#### [Example] Add integration files to existing plugin repository + +```shell +## Update Plugin repository with integration config, workflows, and scripts +cd packer-plugin-name +mkdir -p .web-docs/scripts + +# Download packer-plugin-scaffolding repo copy files +wget https://github.com/hashicorp/packer-plugin-scaffolding/archive/refs/heads/main.zip +unzip main.zip +cp packer-plugin-scaffolding-main/.web-docs/metadata.hcl .web-docs/ +cp -r packer-plugin-scaffolding-main/.web-docs/scripts/ .web-docs/scripts/ +cp packer-plugin-scaffolding-main/.github/workflows/notify-integration-release-via-* .github/workflows/ + +# Remove downloaded scaffolding project +rm main.zip +rm -rf packer-plugin-scaffolding-main + +# Add the following commands to your plugin GNUmakefile +generate: install-packer-sdc + @go generate ./... + @rm -rf .docs + @packer-sdc renderdocs -src docs -partials docs-partials/ -dst .docs/ + @./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "" + @rm -r ".docs" ``` - - - -Once the first `docs.zip` file has been included into a release you will need to open a one time pull-request against [hashicorp/packer](https://github.com/hashicorp/packer) to register the plugin docs. +By opening an integration request, you are asking a member of the to Packer team to review your plugin integration configuration, plugin documentation, +and, finally, to open an internal pull-request to finalize the integration setup. -This is done by adding the block below for the respective plugin to the file [website/data/plugins-manifest.json](https://github.com/hashicorp/packer/blob/main/website/data/plugins-manifest.json). - -```json -{ - "title": "Scaffolding", - "path": "scaffolding", - "repo": "hashicorp/packer-plugin-scaffolding", - "version": "latest", - "sourceBranch": "main" -} -``` - -If a plugin maintainer wishes to only include a specific version of released docs, then the `"version"` key in the above configuration should be set to a released version of the plugin. Otherwise it should be set to `"latest"`. - -The `"sourceBranch"` key in the above configuration ensures potential contributors can link back to source files in the plugin repository from the Packer docs site. If a `"sourceBranch"` value is not present, it will default to `"main"`. - -### Testing Plugin Documentation - -Before publishing the `docs.zip` file, you might want to preview your documentation changes. -We provide a mechanism that allows to preview how the docs will look like within -the Packer documentation. - -Follow the next steps to get the Packer website running and preview the documentation changes: - -- Get the [Packer source code](https://github.com/hashicorp/packer). Our website code is under the [website folder](https://github.com/hashicorp/packer/tree/main/website). -- Generate the `docs.zip` file. You can find above the steps to do so. -- Add the `zipFile` attribute to the plugin entry in `plugins-manifest.json`. The value should be the full path of the `docs.zip` generated. For example: - -```json -{ - "title": "Scaffolding", - "path": "scaffolding", - "repo": "hashicorp/packer-plugin-scaffolding", - "version": "latest", - "sourceBranch": "main", - "zipFile": "/Users/myuser/Packer/plugins/packer-plugin-scaffolding/docs.zip" -} -``` +Plugin integrations will be listed as a [Packer Integration](https://developer.hashicorp.com/packer/integrations), with details on how to install and use your the plugin. -- Go to the [website folder](https://github.com/hashicorp/packer/tree/main/website). - In the website README, follow the steps to [run the website with node](https://github.com/hashicorp/packer/tree/main/website#with-node). -- Once the website is up and running, the plugin documentation should be available in `http://localhost:3000/docs`. +Plugin integrations, once deployed, can be updated manually, or automatically upon a new release, by the plugin authors. Changes to the defined documentation structure +or parent repository should be communicated to the Packer team to ensure a working integration pipeline. ## Plugin Development Tips and FAQs diff --git a/website/content/docs/plugins/index.mdx b/website/content/docs/plugins/index.mdx index 513198b3c00..4a11840d1b9 100644 --- a/website/content/docs/plugins/index.mdx +++ b/website/content/docs/plugins/index.mdx @@ -15,7 +15,7 @@ During a `packer build`, the process list shows `packer-` prefixed applications. The Packer binary has a set of built-in plugins that it can find and run automatically. You can also define a list of external plugins in your template for Packer to run and communicate with throughout the build. These external plugins extend Packer functionality without modifying the core source code. Refer to the following plugin documentation: -- **Built-in Plugins:** Use [builders](/docs/builders) to create machines and images, [data sources](/docs/datasources) to fetch data, [provisioners](/docs/provisioners) to install and configure machine images, and [post-processors](/docs/post-processors) to perform additional tasks after provisioning -- **External Plugins:** Review the documentation for [available external plugins](/plugins) not included with the Packer binary -- **Installing Plugins:** [Installation Guides](/docs/plugins/install-plugins) to add external plugins to your Packer template and install the binaries -- **Developing Plugins:** Get started [creating custom external plugins](/docs/plugins/creation) \ No newline at end of file +- **Built-in Plugins:** Use [builders](/packer/docs/builders) to create machines and images, [data sources](/packer/docs/datasources) to fetch data, [provisioners](/packer/docs/provisioners) to install and configure machine images, and [post-processors](/packer/docs/post-processors) to perform additional tasks after provisioning +- **External Plugins:** Review the documentation for [available external plugins](/packer/plugins) not included with the Packer binary +- **Installing Plugins:** [Installation Guides](/packer/docs/plugins/install-plugins) to add external plugins to your Packer template and install the binaries +- **Developing Plugins:** Get started [creating custom external plugins](/packer/docs/plugins/creation) \ No newline at end of file diff --git a/website/content/docs/plugins/install-plugins.mdx b/website/content/docs/plugins/install-plugins.mdx index 4e5c551655b..2413d025ffb 100644 --- a/website/content/docs/plugins/install-plugins.mdx +++ b/website/content/docs/plugins/install-plugins.mdx @@ -8,34 +8,113 @@ page_title: Install Plugins Packer plugins are separate, standalone applications that perform tasks during each build. -You do not need to install the builder, provisioner, or -post-processor components that ship with the Packer binary. Packer automatically knows how to find and launch these built-in plugins. +You do not need to install the components that ship with the Packer binary. +Packer automatically knows how to find and launch these built-in plugins. -This page explains how to install custom external plugins. Refer to [External Plugins](/plugins) for a list of available plugins and their documentation. +This page explains how to install custom external plugins. Refer to [External Plugins](/packer/integrations) for a list of available plugins and their documentation. -## Installation Guides +Depending on the template type you're using (HCL2 or legacy JSON), the methods for installing plugins may differ. + +If you're using HCL2, `packer init` is recommended as you can install all your requirements with one +command, and those requirements are explicitly documented in the template. + +`packer plugins install` is also used to automate the installation from a source, and will need to +be repeated for as many plugins as you need. +We recommend this for JSON as the template cannot contain the information about the required plugins. + +Finally, you can manually install any plugin. This is mostly useful if you're in an environment with +restricted internet access, or if you're installing non-final versions of plugins. + +Refer to the [Installation Guides](#installation-guides) section of this page for information about +each, including usage examples. + +The remainder of this document will serve as documentation on how Packer interacts with plugins. +We encourage you to read this to get familiar with this process, as it will help you troubleshoot +your builds if you encounter problems with that. + +## Source Addresses + +A plugin's source address is its global identifier. It also tells Packer where +to download it. + +Source addresses consist of three parts delimited by slashes (`/`), as +follows: + +`//` + +- **Hostname:** The hostname of the location/service that + distributes the plugin. Currently, the only valid "hostname" is github.com, + but we plan to eventually support plugins downloaded from other domains. + +- **Namespace:** An organizational namespace within the specified host. + This often is the organization that publishes the plugin. + +- **Type:** A short name for the platform or system the plugin manages. The + type is usually the plugin's preferred local name. + +For example, the fictional `myawesomecloud` plugin could belong to the +`hashicorp` namespace on `github.com`, so its `source` could be +`github.com/hashicorp/myawesomecloud`, + +-> Note: the actual _repository_ that myawesomecloud comes from must always have +the name format `github.com/hashicorp/packer-plugin-myawesomecloud`, but the +`required_plugins` block omits the redundant `packer-plugin-` repository prefix +for brevity. -Choose the tab that corresponds to the type of plugin you want to install. If you are not sure, check the plugin's name. -- Multi-component plugin names have the prefix `packer-plugin-`. -- Single-component plugin names have a prefix containing the component type, like `packer-provisioner-` or `packer-builder`. +The source address with all three components given explicitly is called the +plugin's _fully-qualified address_. You will see fully-qualified address in +various outputs, like error messages. + +## Plugin Loading Workflow + +At initialization, Packer attempts to discover the plugins installed locally. The +logic follows what's described in Configuring Packer's +[plugin directory](/packer/docs/configure#packer-s-plugin-directory) +section. + +While Packer is not verbose during this step, you can peek into what it is discovering +with `PACKER_LOG=1` enabled, where you can find log lines similar to the following: + +```shell +[TRACE] discovering plugins in [...] +[INFO] Discovered potential plugin: [...] +``` + +This logic however is ignored when plugins are defined in `required_plugins` blocks; +instead, for every plugin required in this way, Packer will only consider them if they're +installed in Packer's plugin directory, under a directory hierarchy that matches the +source, with the plugin name respecting a convention. + +For example, if we install the `github.com/hashicorp/amazon` plugin in version 1.2.8 through +either `packer init` or `packer plugins install`, this will yield the following (in a +Linux x86_64 environment): + +```shell + +└── github.com + └── hashicorp + └── amazon + ├── packer-plugin-amazon_v1.2.8_x5.0_linux_amd64 + └── packer-plugin-amazon_v1.2.8_x5.0_linux_amd64_SHA256SUM +``` + +Both the plugin's binary, and the related SHA256SUM file must be placed alongside +each other for Packer to consider them for a `required_plugins` constraint. + +## Installation Guides - + -~> **Note**: Only _multi-component plugin binaries_ -- that is plugins named -packer-plugin-\*, like the `packer-plugin-amazon` -- are expected to work with -Packer init. The legacy `builder`, `post-processor` and `provisioner` plugin -types will keep on being detected but Packer cannot install them automatically. -If a plugin you use has not been upgraded to use the multi-component plugin -architecture, contact your maintainer to request an upgrade. +In order to use `packer init` for managing installation of your plugins, there are +two steps required. -## Create a required_plugins block +First, add a [`required_plugins`](/packer/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) +block to your [packer block](/packer/docs/templates/hcl_templates/blocks/packer). -1. Add a - [`required_plugins`](/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) - block to your [packer block](/docs/templates/hcl_templates/blocks/packer). Each block will tell Packer what version(s) of a - particular plugin can be installed. Make sure to set a valid [version - constraint string](/docs/templates/hcl_templates/blocks/packer#version-constraints). +Each block will tell Packer what version(s) of a particular plugin can be installed. +Make sure to set a valid +[version constraint string](/packer/docs/templates/hcl_templates/blocks/packer#version-constraints). Here is an example `required_plugins` block: @@ -54,19 +133,19 @@ packer { } ``` -2. Run [`packer init`](/docs/commands/init) from your project directory (the - directory containing your Packer templates) to install all missing plugin - binaries. Given the above example, Packer will try to look for a GitHub - repository owned by user or organization `azr` named - `packer-plugin-myawesomecloud` and `packer-plugin-happycloud`. +Once your template contains those `required_plugins`, run +[`packer init`](/packer/docs/commands/init) to install all missing plugin +binaries. +Given the above example, Packer will try to look for a GitHub +repository owned by user or organization `azr` named +`packer-plugin-myawesomecloud` and `packer-plugin-happycloud`. ## Names and Addresses Each plugin has two identifiers: -- A `source` address, which is only necessary when requiring a plugin outside the HashiCorp domain. -- A unique **local name**, which is used everywhere else in a Packer - configuration. +- A `source` address, which is where the plugin is downloaded from. +- A unique **local name**, which is used everywhere else in a Packer configuration. ## Local Names @@ -112,156 +191,51 @@ source "foo-ebs" "example" { } ``` -## Source Addresses - -A plugin's source address is its global identifier. It also tells Packer where -to download it. - -Source addresses consist of three parts delimited by slashes (`/`), as -follows: - -`//` - -- **Hostname:** The hostname of the location/service that - distributes the plugin. Currently, the only valid "hostname" is github.com, - but we plan to eventually support plugins downloaded from other domains. - -- **Namespace:** An organizational namespace within the specified host. - This often is the organization that publishes the plugin. - -- **Type:** A short name for the platform or system the plugin manages. The - type is usually the plugin's preferred local name. - -For example, the fictional `myawesomecloud` plugin could belong to the -`hashicorp` namespace on `github.com`, so its `source` could be -`github.com/hashicorp/myawesomecloud`, -Note: the actual _repository_ that myawesomecloud comes from must always have -the name format `github.com/hashicorp/packer-plugin-myawesomecloud`, but the -`required_plugins` block omits the redundant `packer-plugin-` repository prefix -for brevity. - -The source address with all three components given explicitly is called the -plugin's _fully-qualified address_. You will see fully-qualified address in -various outputs, like error messages. - -## Plugin location - -@include "plugins/plugin-location.mdx" - -## Implicit Github urls - -Using the following example : - -```hcl - required_plugins { - happycloud = { - version = ">= 2.7.0" - source = "github.com/azr/happycloud" - } - } -``` - -The plugin getter will look for plugins located at: - -- github.com/azr/packer-plugin-happycloud - -Packer will error if you set the `packer-plugin-` prefix in a `source`. This -will avoid conflicting with other plugins for other tools, like Terraform. - - - --> The [`packer plugins`](/docs/commands/plugins) command allows to install plugins without going through -`init`. For manual installation of plugin binaries, without the `packer plugins` command, please continue reading. - -The easiest way to manually install a plugin is to name it correctly, then place -it in the proper directory. To name a plugin correctly, make sure the binary is -named `packer-plugin-NAME`. For example, `packer-plugin-amazon` for a "plugin" -binary named "amazon". This binary will make one or more components available to -use. Valid types for plugins are down this page. - -Once the plugin is named properly, Packer automatically discovers plugins in -the following directories in the given order. If a conflicting plugin is found -later, it will take precedence over one found earlier. - -1. The directory where `packer` is, or the executable directory. - -2. The `$HOME/.packer.d/plugins` directory, if `$HOME` is defined (Unix) - -3. The `%APPDATA%/packer.d/plugins` if `%APPDATA%` is defined (Windows) + -4. The `%USERPROFILE%/packer.d/plugins` if `%USERPROFILE%` is defined - (Windows) +Plugin installation via `packer plugins install` works similar to that of the `packer init` command, but +no `required_plugins` block are required, and thus can be used with both legacy JSON and HCL2 templates. -5. The current working directory. - -6. The directory defined in the env var `PACKER_PLUGIN_PATH`. There can be more - than one directory defined; for example, `~/custom-dir-1:~/custom-dir-2`. - Separate directories in the PATH string using a colon (`:`) on POSIX systems and - a semicolon (`;`) on Windows systems. The above example path would be able to - find a provisioner named `packer-provisioner-foo` in either - `~/custom-dir-1/packer-provisioner-foo` or - `~/custom-dir-2/packer-provisioner-foo`. - -The valid types for plugins are: - -- `plugin` - A plugin binary that can contain one or more of each Packer component - type. - -- `builder` - Plugins responsible for building images for a specific - platform. +```shell +packer plugins install github.com/hashicorp/vagrant +``` -- `post-processor` - A post-processor responsible for taking an artifact from - a builder and turning it into something else. +-> You can only install one plugin per invocation of the command. If you need to install + a specific version of a plugin, you can specify a version to install as an optional + argument to the command line. + e.g.: `packer plugins install "github.com/hashicorp/vagrant" "v1.0.1"` -- `provisioner` - A provisioner to install software on images created by a - builder. +The command will install the plugin in the `PACKER_CONFIG_DIR` set, or its +default location, which depends on the OS/environment, as documented in +[Configuring Packer](/packer/docs/configure#packer-s-plugin-directory). - - -The easiest way to manually install a plugin is to name it correctly, then place -it in the proper directory. To name a plugin correctly, make sure the binary is -named `packer-COMPONENT-NAME`. For example, `packer-provisioner-comment` for a "plugin" -binary named "comment". This binary will make a single provisioner named `comment` available to -use. Valid types for plugins are down this page. - -Once the plugin is named properly, Packer automatically discovers plugins in -the following directories in the given order. If a conflicting plugin is found -later, it will take precedence over one found earlier. + -1. The directory where `packer` is, or the executable directory. +If you have obtained or built a plugin binary for your OS/Architecture and want to +use it with Packer, you can install it manually. For Packer to load the plugin, +it must be named with the convention `packer-plugin-NAME`, and placed in Packer's plugin +directory, as documented in +[Configuring Packer](/packer/docs/configure#packer-s-plugin-directory). -2. The `$HOME/.packer.d/plugins` directory, if `$HOME` is defined (Unix) +For example, if your configuration directory is located in `~/.config/packer`, +you can copy the binary to `~/.config/packer/plugins/packer-plugin-NAME`, and +Packer will be able to load it afterwards. -3. The `%APPDATA%/packer.d/plugins` if `%APPDATA%` is defined (Windows) +If you have a `required_plugins` for the plugin you're manually installing, make sure +it respects the constraints described in the [Plugin loading workflow](#plugin-loading-workflow) +section, otherwise Packer will not be able to load it. -4. The `%USERPROFILE%/packer.d/plugins` if `%USERPROFILE%` is defined - (Windows) +Starting with v1.10.0 of Packer, you can also use `packer plugins install` with the +`--path` flag to install a plugin from a binary, following the layout that is required to +work with `required_plugins` block. -5. The current working directory. - -6. The directory defined in the env var `PACKER_PLUGIN_PATH`. There can be more - than one directory defined; for example, `~/custom-dir-1:~/custom-dir-2`. - Separate directories in the PATH string using a colon (`:`) on POSIX systems and - a semicolon (`;`) on Windows systems. The above example path would be able to - find a provisioner named `packer-provisioner-foo` in either - `~/custom-dir-1/packer-provisioner-foo` or - `~/custom-dir-2/packer-provisioner-foo`. - -The valid types for plugins are: - -- `plugin` - A plugin binary that can contain one or more of each Packer component - type. - -- `builder` - Plugins responsible for building images for a specific - platform. - -- `post-processor` - A post-processor responsible for taking an artifact from - a builder and turning it into something else. +```shell +packer plugins install --path github.com/hashicorp/vagrant +``` -- `provisioner` - A provisioner to install software on images created by a - builder. +-> packer plugins install --path only works with release versions of plugins. - \ No newline at end of file + diff --git a/website/content/docs/post-processors/checksum.mdx b/website/content/docs/post-processors/checksum.mdx index 15c0b9e155a..0f8056c64b5 100644 --- a/website/content/docs/post-processors/checksum.mdx +++ b/website/content/docs/post-processors/checksum.mdx @@ -25,9 +25,9 @@ verify it later. After computes checksum for artifacts, you can use new artifacts with other post-processors like -[artifice](/docs/post-processors/artifice), -[compress](/docs/post-processors/compress), -[docker-push](/plugins/post-processors/docker/docker-push), or +[artifice](/packer/docs/post-processors/artifice), +[compress](/packer/docs/post-processors/compress), +[docker-push](/packer/plugins/post-processors/docker/docker-push), or a third-party post-processor. ## Basic example @@ -74,7 +74,7 @@ Optional parameters: `packer_{{.BuildName}}_{{.BuilderType}}_{{.ChecksumType}}.checksum`. For example, if you had a builder named `database`, you might see the file written as `packer_database_docker_md5.checksum`. This is treated as a - [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you + [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. The following special variables are also available to use in the output template: diff --git a/website/content/docs/post-processors/community-supported.mdx b/website/content/docs/post-processors/community-supported.mdx index c3e2e1f8f11..1be070e2fa2 100644 --- a/website/content/docs/post-processors/community-supported.mdx +++ b/website/content/docs/post-processors/community-supported.mdx @@ -11,6 +11,6 @@ page_title: Community - Post-Processors The following post-processors are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -post-processors, see our docs on [extending Packer](/docs/plugins/creation). +post-processors, see our docs on [extending Packer](/packer/docs/plugins/creation). @include 'post-processors/community_post-processors.mdx' diff --git a/website/content/docs/post-processors/compress.mdx b/website/content/docs/post-processors/compress.mdx index c9311a3322f..0a45ad171d2 100644 --- a/website/content/docs/post-processors/compress.mdx +++ b/website/content/docs/post-processors/compress.mdx @@ -31,7 +31,7 @@ you will need to specify the `output` option. packer defaults to `.tar.gz` behavior but will not change the filename. This is treated as a - [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you + [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. The following special variables are also available to use in the output template: diff --git a/website/content/docs/post-processors/index.mdx b/website/content/docs/post-processors/index.mdx index 4add0ee0cd7..0db8b5c34c3 100644 --- a/website/content/docs/post-processors/index.mdx +++ b/website/content/docs/post-processors/index.mdx @@ -9,6 +9,6 @@ page_title: Post-Processors Post-processors run after builders and provisioners. Post-processors are optional, and you can use them to upload artifacts, re-package files, and more. The documentation includes a page for each type of post-processor. -Refer to the [`post-processor`](/docs/templates/hcl_templates/blocks/build/post-processor) and -[`post-processors`](/docs/templates/hcl_templates/blocks/build/post-processors) +Refer to the [`post-processor`](/packer/docs/templates/hcl_templates/blocks/build/post-processor) and +[`post-processors`](/packer/docs/templates/hcl_templates/blocks/build/post-processors) blocks documentation to learn more about working with post-processors. diff --git a/website/content/docs/post-processors/shell-local.mdx b/website/content/docs/post-processors/shell-local.mdx index ffe640bbdb1..e04cd512779 100644 --- a/website/content/docs/post-processors/shell-local.mdx +++ b/website/content/docs/post-processors/shell-local.mdx @@ -124,11 +124,11 @@ Optional parameters: ["cmd", "/V", "/C", "{{.Vars}}", "call", "{{.Script}}"] ``` - This is treated as a [template engine](/docs/templates/legacy_json_templates/engine). + This is treated as a [template engine](/packer/docs/templates/legacy_json_templates/engine). There are several available variables: `Script`, which is the path to the script to run, and `Vars`, which is the list of `environment_vars`, if configured. In addition, you may access any of the variables stored in the - generated data using the [build](/docs/templates/legacy_json_templates/engine) template + generated data using the [build](/packer/docs/templates/legacy_json_templates/engine) template function. If you choose to set this option, make sure that the first element in the array is the shell program you want to use (for example, "sh" or "/usr/local/bin/zsh" or even "powershell.exe" although anything @@ -164,7 +164,7 @@ Optional parameters: shell-local, since the shell-local post-processor merely passes forward the artifact it receives. If your shell-local post-processor produces a file or files which you would like to have replace the input artifact, you may - overwrite the input artifact using the [artifice](/docs/post-processors/artifice) + overwrite the input artifact using the [artifice](/packer/docs/post-processors/artifice) post-processor after your shell-local processor has run. - `only_on` (array of strings) - This is an array of [runtime operating @@ -285,7 +285,7 @@ In addition to being able to specify custom environmental variables using the commonly useful environmental variables: - `PACKER_BUILD_NAME` is set to the [name of the - build](/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. + build](/packer/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. This is most useful when Packer is making multiple builds and you want to distinguish them slightly from a common provisioning script. @@ -310,7 +310,7 @@ run twice. If you have 3 builders, it will run 3 times, once for each builder. ### Interacting with Build Artifacts In order to interact with build artifacts, you may want to use the [manifest -post-processor](/docs/post-processors/manifest). This will write the list +post-processor](/packer/docs/post-processors/manifest). This will write the list of files produced by a `builder` to a json file after each `builder` is run. For example, if you wanted to package a file from the file builder into a diff --git a/website/content/docs/provisioners/community-supported.mdx b/website/content/docs/provisioners/community-supported.mdx index ca71d42a255..1cb14aa97d8 100644 --- a/website/content/docs/provisioners/community-supported.mdx +++ b/website/content/docs/provisioners/community-supported.mdx @@ -9,6 +9,6 @@ page_title: Community - Provisioners The following provisioners are developed and maintained by various members of the Packer community, not by HashiCorp. For more information on how to use community -provisioners, see our docs on [extending Packer](/docs/plugins/creation). +provisioners, see our docs on [extending Packer](/packer/docs/plugins/creation). @include 'provisioners/community_provisioners.mdx' diff --git a/website/content/docs/provisioners/custom.mdx b/website/content/docs/provisioners/custom.mdx index 583a22b7c23..5606844347b 100644 --- a/website/content/docs/provisioners/custom.mdx +++ b/website/content/docs/provisioners/custom.mdx @@ -12,5 +12,5 @@ page_title: Custom - Provisioners Packer is extensible, allowing you to write new provisioners without having to modify the core source code of Packer itself. Documentation for creating new provisioners is covered in the [custom -provisioners](/docs/plugins/creation/custom-provisioners) page of the Packer +provisioners](/packer/docs/plugins/creation/custom-provisioners) page of the Packer plugin section. diff --git a/website/content/docs/provisioners/file.mdx b/website/content/docs/provisioners/file.mdx index 3f7d3c5ed1e..e123be997cf 100644 --- a/website/content/docs/provisioners/file.mdx +++ b/website/content/docs/provisioners/file.mdx @@ -17,7 +17,7 @@ Type: `file` The file Packer provisioner uploads files to machines built by Packer. The recommended usage of the file provisioner is to use it to upload files, and -then use [shell provisioner](/docs/provisioners/shell) to move them to the +then use [shell provisioner](/packer/docs/provisioners/shell) to move them to the proper place, set permissions, etc. Warning: You can only upload files to locations that the provisioning user @@ -185,7 +185,7 @@ build { Because of the way our WinRM transfers works, it can take a very long time to upload and download even moderately sized files. If you're experiencing slowness using the file provisioner on Windows, it's suggested that you set up an SSH -server and use the [ssh communicator](/docs/communicators/ssh). If you only want +server and use the [ssh communicator](/packer/docs/communicators/ssh). If you only want to transfer files to your guest, and if your builder supports it, you may also use the `http_directory` or `http_content` directives. This will cause that directory to be available to the guest over HTTP, and set the environment diff --git a/website/content/docs/provisioners/index.mdx b/website/content/docs/provisioners/index.mdx index ce2c038e0f6..e9fb2f8669e 100644 --- a/website/content/docs/provisioners/index.mdx +++ b/website/content/docs/provisioners/index.mdx @@ -15,5 +15,5 @@ machine image after booting. Provisioners prepare the system, so you may want to - creating users - downloading application code -Refer to the [`provisioner`](/docs/templates/hcl_templates/blocks/build/provisioner) block documentation to learn more +Refer to the [`provisioner`](/packer/docs/templates/hcl_templates/blocks/build/provisioner) block documentation to learn more about working with provisioners. The documentation includes details about each type of provisioner. diff --git a/website/content/docs/provisioners/powershell.mdx b/website/content/docs/provisioners/powershell.mdx index a5be652edac..c50b8515c9f 100644 --- a/website/content/docs/provisioners/powershell.mdx +++ b/website/content/docs/provisioners/powershell.mdx @@ -67,7 +67,7 @@ provisioner "powershell" { powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){$ProgressPreference='SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }" ``` - This is a [template engine](/docs/templates/legacy_json_templates/engine). + This is a [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. In addition, you may use two extra variables: @@ -88,7 +88,7 @@ provisioner "powershell" { - `use_pwsh` (boolean) - Run `pwsh.exe` instead of `powershell.exe`. Defaults to false. - This is a [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you + This is a [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. If you are running on AWS, Azure, Google Compute, or OpenStack and would like to access the autogenerated password that Packer uses to connect to the instance via @@ -127,7 +127,7 @@ provisioner "powershell" { powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){$ProgressPreference='SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }" ``` - This is a [template engine](/docs/templates/legacy_json_templates/engine). + This is a [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. In addition, you may use two extra variables: @@ -146,7 +146,7 @@ provisioner "powershell" { PowerShell script will be run with elevated privileges using the given Windows user. - This is a [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you + This is a [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. If you are running on AWS, Azure, Google Compute, or OpenStack and would like to access the autogenerated password that Packer uses to connect to the instance via @@ -258,7 +258,7 @@ In addition to being able to specify custom environmental variables using the commonly useful environmental variables: - `PACKER_BUILD_NAME` is set to the [name of the - build](/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. + build](/packer/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. This is most useful when Packer is making multiple builds and you want to distinguish them slightly from a common provisioning script. diff --git a/website/content/docs/provisioners/shell-local.mdx b/website/content/docs/provisioners/shell-local.mdx index 79fe1d7f440..a8bbea41312 100644 --- a/website/content/docs/provisioners/shell-local.mdx +++ b/website/content/docs/provisioners/shell-local.mdx @@ -20,7 +20,7 @@ Packer is being run - in other words, shell-local will run the shell script on your build server, or your desktop, etc., rather than the remote/guest machine being provisioned by Packer. -The [remote shell](/docs/provisioners/shell) provisioner executes shell +The [remote shell](/packer/docs/provisioners/shell) provisioner executes shell scripts on a remote machine. ## Basic Example @@ -128,7 +128,7 @@ Optional parameters: - `execute_command` (array of strings) - The command used to execute the script. By default this is `["/bin/sh", "-c", "{{.Vars}}", "{{.Script}}"]` on Unix and `["cmd", "/c", "{{.Vars}}", "{{.Script}}"]` on Windows. This is - treated as a [template engine](/docs/templates/legacy_json_templates/engine). There are two + treated as a [template engine](/packer/docs/templates/legacy_json_templates/engine). There are two available variables: `Script`, which is the path to the script to run, and `Vars`, which is the list of `environment_vars`, if configured. diff --git a/website/content/docs/provisioners/shell.mdx b/website/content/docs/provisioners/shell.mdx index eef98741ec5..ca10852cf6c 100644 --- a/website/content/docs/provisioners/shell.mdx +++ b/website/content/docs/provisioners/shell.mdx @@ -19,8 +19,8 @@ scripts. Shell provisioning is the easiest way to get software installed and configured on a machine. -> **Building Windows images?** You probably want to use the -[PowerShell](/docs/provisioners/powershell) or [Windows -Shell](/docs/provisioners/windows-shell) provisioners. +[PowerShell](/packer/docs/provisioners/powershell) or [Windows +Shell](/packer/docs/provisioners/windows-shell) provisioners. ## Basic Example @@ -80,7 +80,7 @@ provisioner "shell" { default this is `chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}`, unless the user has set `"use_env_var_file": true` -- in that case, the default `execute_command` is `chmod +x {{.Path}}; . {{.EnvVarFile}} && {{.Path}}`. - This is a [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you may + This is a [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. In addition, there are three available extra variables: @@ -175,7 +175,7 @@ In addition to being able to specify custom environmental variables using the commonly useful environmental variables: - `PACKER_BUILD_NAME` is set to the [name of the - build](/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. + build](/packer/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. This is most useful when Packer is making multiple builds and you want to distinguish them slightly from a common provisioning script. @@ -253,7 +253,7 @@ the agent will forward the request back to your `ssh-agent`. Note: when provisioning via git you should add the git server keys into the `~/.ssh/known_hosts` file otherwise the git command could hang awaiting input. This can be done by copying the file in via the [file -provisioner](/docs/provisioners/file) (more secure) or using `ssh-keyscan` +provisioner](/packer/docs/provisioners/file) (more secure) or using `ssh-keyscan` to populate the file (less secure). An example of the latter accessing github would be: diff --git a/website/content/docs/provisioners/windows-shell.mdx b/website/content/docs/provisioners/windows-shell.mdx index 158bad73e9b..2663aedf7cf 100644 --- a/website/content/docs/provisioners/windows-shell.mdx +++ b/website/content/docs/provisioners/windows-shell.mdx @@ -58,8 +58,8 @@ provisioner "windows-shell" { - `execute_command` (string) - The command to use to execute the script. By default this is `{{ .Vars }}"{{ .Path }}"`. The value of this is treated as - [template engine](/docs/templates/legacy_json_templates/engine). This is a - [template engine](/docs/templates/legacy_json_templates/engine). Therefore, you may + [template engine](/packer/docs/templates/legacy_json_templates/engine). This is a + [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. In addition, there are two available extra variables: @@ -84,7 +84,7 @@ In addition to being able to specify custom environmental variables using the commonly useful environmental variables: - `PACKER_BUILD_NAME` is set to the [name of the - build](/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. + build](/packer/docs/templates/legacy_json_templates/builders#named-builds) that Packer is running. This is most useful when Packer is making multiple builds and you want to distinguish them slightly from a common provisioning script. diff --git a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx index e4f6a9b6598..e374af650e4 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/hcp_packer_registry.mdx @@ -9,7 +9,7 @@ page_title: hcp_packer_registry - build - Blocks The `hcp_packer_registry` block lets you customize the metadata Packer sends to HCP Packer Registry. It configures the details of an image that is created or updated within the HCP Packer registry. -To get started with HCP Packer, refer to the [HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the [Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started). +To get started with HCP Packer, refer to the [HCP Packer documentation](/hcp/docs/packer) or try the [Get Started with HCP Packer tutorials](/packer/tutorials/hcp-get-started). ## Usage diff --git a/website/content/docs/templates/hcl_templates/blocks/build/index.mdx b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx index 302ab5f19ec..1ddef67ce40 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/index.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/index.mdx @@ -15,14 +15,14 @@ To use builders in a `build` block you can either: - Set the `sources` array of string with references to pre-defined sources. -- Define [build-level `source` blocks](/docs/templates/hcl_templates/blocks/build/source). +- Define [build-level `source` blocks](/packer/docs/templates/hcl_templates/blocks/build/source). This also allows you to set specific fields. `@include 'from-1.5/builds/example-block.mdx'` -Define [top-level `source` blocks](/docs/templates/hcl_templates/blocks/source) to configure +Define [top-level `source` blocks](/packer/docs/templates/hcl_templates/blocks/source) to configure your builders. The list of available builders can be found in the -[builders](/docs/builders) section. +[builders](/packer/docs/builders) section. ## Naming your builds @@ -75,7 +75,7 @@ matching **builders** (source) or all referenced builders 'except' the matching ones, for example with the same config file: ```shell-session -> packer build -only "*.second" ./folder +> packer build -only "*.second-example" ./folder Build 'null.second-example' finished. Build 'a.null.second-example' finished. @@ -92,6 +92,6 @@ this is soon going to be possible. So here "a.\*" will match nothing. ## Related - A list of [community - builders](/community-tools#community-builders) is available. + builders](https://packer.io/community-tools#community-builders) is available. -- Create your own [custom builder](/docs/plugins/creation/custom-builders) ! +- Create your own [custom builder](/packer/docs/plugins/creation/custom-builders) ! diff --git a/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx index 878e7a98260..9f7e981c5f4 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processor.mdx @@ -27,11 +27,11 @@ build { Each `post-processor` runs after each defined build. A post-processor takes the `Artifact` from a build. Post-processors are optional, and they can be used to upload artifacts, re-package, or more. The list of available post-processors -can be found in the [post-processors](/docs/post-processors) section. +can be found in the [post-processors](/packer/docs/post-processors) section. A `post-processor` can also take the `Artifact` from another post-processor when it is defined in a [`post-processors` -block](/docs/templates/hcl_templates/blocks/build/post-processor) list, that is a list of +block](/packer/docs/templates/hcl_templates/blocks/build/post-processor) list, that is a list of chained post processors. -> Note: The input 'artifact' received by a post-processor will be automatically @@ -98,11 +98,11 @@ to only run a post-processor for a given source build you must use the Packer allows to access connection information and basic instance state information from a post-processor. These information are stored in the `build` variable. Check out the [Contextual -Variables](/docs/templates/hcl_templates/contextual-variables) documentation to learn more +Variables](/packer/docs/templates/hcl_templates/contextual-variables) documentation to learn more about and see some examples of how to use them. ### Related -- The [`post-processors` block](/docs/templates/hcl_templates/blocks/build/post-processors) +- The [`post-processors` block](/packer/docs/templates/hcl_templates/blocks/build/post-processors) allows to define one or more chain of `post-processor`s that will take the output from the build and provision steps. diff --git a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx index 1ce8e7e5f61..181ac03a18e 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/post-processors.mdx @@ -10,7 +10,7 @@ page_title: post-processors - build - Blocks `@include 'from-1.5/beta-hcl2-note.mdx'` The `post-processors` block allows to define lists of -[`post-processor`s](/docs/templates/hcl_templates/blocks/build/post-processor), that will run +[`post-processors`](/packer/docs/templates/hcl_templates/blocks/build/post-processor), that will run from the artifact of each build. ```hcl @@ -33,7 +33,7 @@ build { } ``` -The [`post-processor` block](/docs/templates/hcl_templates/blocks/build/post-processor) +The [`post-processor` block](/packer/docs/templates/hcl_templates/blocks/build/post-processor) allows to define multiple post-processors that will run from the `Artifact` of each build. Read the `post-processor` documentation to know how to use a post-processor. diff --git a/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx index a7a866f56f2..fdf3648300c 100644 --- a/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx @@ -27,7 +27,7 @@ Provisioners use builtin and third-party software to install and configure the machine image after booting. Provisioners prepare the system for use. The list of available provisioners can be found in the -[provisioners](/docs/provisioners) section. +[provisioners](/packer/docs/provisioners) section. ## Run on Specific Sources @@ -135,8 +135,8 @@ build { ``` As you can see, the `override` key is used. The value of this key is another -HCL attribute map where the key is the name of a [builder -definition](/docs/templates/hcl_templates/blocks/source). The value of this is in turn +HCL attribute map where the key is the name of a [source +definition](/packer/docs/templates/hcl_templates/blocks/source). The value of this is in turn another HCL attribute map. This HCL attribute map simply contains the provisioner configuration as normal. This configuration is merged into the default provisioner configuration. @@ -259,4 +259,4 @@ Timeout has no effect in debug mode. ## Build Contextual Variables Packer allows to access connection information and basic instance state information from a provisioner. These information are stored in the `build` variable. -Check out the [Contextual Variables](/docs/templates/hcl_templates/contextual-variables) documentation to learn more about and see some examples of how to use them. +Check out the [Contextual Variables](/packer/docs/templates/hcl_templates/contextual-variables) documentation to learn more about and see some examples of how to use them. diff --git a/website/content/docs/templates/hcl_templates/blocks/data.mdx b/website/content/docs/templates/hcl_templates/blocks/data.mdx index 2bad0adbf98..b5a8e0f8909 100644 --- a/website/content/docs/templates/hcl_templates/blocks/data.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/data.mdx @@ -12,5 +12,5 @@ The `data` block defines data sources within your Packer configuration. # More on data sources -- Read the [full Data Sources](/docs/templates/hcl_templates/datasources) description for a more +- Read the [full Data Sources](/packer/docs/templates/hcl_templates/datasources) description for a more thorough read. diff --git a/website/content/docs/templates/hcl_templates/blocks/index.mdx b/website/content/docs/templates/hcl_templates/blocks/index.mdx index 18eb3a35396..9d2cb2fae76 100644 --- a/website/content/docs/templates/hcl_templates/blocks/index.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/index.mdx @@ -43,20 +43,20 @@ the language are available for use. The documentation includes all of the availa `@include 'from-1.5/variables/foo-block.mdx'` -- [Variable block documentation](/docs/templates/hcl_templates/blocks/variable). +- [Variable block documentation](/packer/docs/templates/hcl_templates/blocks/variable). `@include 'from-1.5/locals/example-block.mdx'` -- [Locals block documentation](/docs/templates/hcl_templates/blocks/locals). +- [Locals block documentation](/packer/docs/templates/hcl_templates/blocks/locals). `@include 'from-1.5/sources/example-block.mdx'` -- [source block documentation](/docs/templates/hcl_templates/blocks/source). +- [source block documentation](/packer/docs/templates/hcl_templates/blocks/source). `@include 'from-1.5/builds/example-block.mdx'` -- [build block documentation](/docs/templates/hcl_templates/blocks/build). +- [build block documentation](/packer/docs/templates/hcl_templates/blocks/build). `@include 'from-1.5/datasources/example-block.mdx'` -- [data block documentation](/docs/templates/hcl_templates/blocks/data). +- [data block documentation](/packer/docs/templates/hcl_templates/blocks/data). diff --git a/website/content/docs/templates/hcl_templates/blocks/locals.mdx b/website/content/docs/templates/hcl_templates/blocks/locals.mdx index d9ee768a673..be45efb7e7d 100644 --- a/website/content/docs/templates/hcl_templates/blocks/locals.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/locals.mdx @@ -16,6 +16,6 @@ your Packer configuration. # More on variables -- Read the [full locals](/docs/templates/hcl_templates/locals) description for a more +- Read the [full locals](/packer/docs/templates/hcl_templates/locals) description for a more thorough read. -- Read the [variables guide](/guides/hcl/variables) for more examples. +- Read the [variables guide](/packer/guides/hcl/variables) for more examples. diff --git a/website/content/docs/templates/hcl_templates/blocks/packer.mdx b/website/content/docs/templates/hcl_templates/blocks/packer.mdx index 7fa8156f16e..b3e590e93c6 100644 --- a/website/content/docs/templates/hcl_templates/blocks/packer.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/packer.mdx @@ -66,7 +66,7 @@ packer { } ``` -For more information, see [Plugins](/docs/plugins). +For more information, see [Plugins](/packer/docs/plugins). ## Version Constraints @@ -83,7 +83,7 @@ other dependency management systems like Bundler and NPM. required_version = ">= 1.2.0, < 2.0.0" ``` -A version constraint is a [string literal](/docs/templates/hcl_templates/expressions#string-literals) +A version constraint is a [string literal](/packer/docs/templates/hcl_templates/expressions#string-literals) containing one or more conditions, which are separated by commas. Each condition consists of an operator and a version number. diff --git a/website/content/docs/templates/hcl_templates/blocks/source.mdx b/website/content/docs/templates/hcl_templates/blocks/source.mdx index c92704ea6e3..d4b1070809e 100644 --- a/website/content/docs/templates/hcl_templates/blocks/source.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/source.mdx @@ -19,7 +19,7 @@ once. Builders are usually found in plugins, except for the `file` and the `null` builders that will remain in Packer core. You can start builders by referring to those source blocks from a [`build` -block](/docs/templates/hcl_templates/blocks/build) : +block](/packer/docs/templates/hcl_templates/blocks/build) : ```hcl build { @@ -32,7 +32,7 @@ build { ``` The build-level [`source` -block](/docs/templates/hcl_templates/blocks/build/source) allows to set specific +block](/packer/docs/templates/hcl_templates/blocks/build/source) allows to set specific source fields. Each field must be defined only once and it is currently not allowed to override a value. @@ -52,10 +52,10 @@ build { ## Related -- The list of available builders can be found in the [builders](/docs/builders) +- The list of available builders can be found in the [builders](/packer/docs/builders) section. - A list of [community - builders](/community-tools#community-builders) is available. + builders](https://packer.io/community-tools#community-builders) is available. -- Create your own [custom builder](/docs/plugins/creation/custom-builders) ! +- Create your own [custom builder](/packer/docs/plugins/creation/custom-builders) ! diff --git a/website/content/docs/templates/hcl_templates/blocks/variable.mdx b/website/content/docs/templates/hcl_templates/blocks/variable.mdx index e7d1df180e8..38b21aae6df 100644 --- a/website/content/docs/templates/hcl_templates/blocks/variable.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/variable.mdx @@ -11,7 +11,7 @@ page_title: variable - Blocks The `variable` block, also called the `input-variable` block, defines variables within your Packer configuration. An input-variable cannot be used in another -input variable: we recommend using [locals](/docs/templates/hcl_templates/blocks/locals) for that instead. +input variable: we recommend using [locals](/packer/docs/templates/hcl_templates/blocks/locals) for that instead. `@include 'from-1.5/variables/foo-block.mdx'` @@ -34,6 +34,6 @@ Example of a variable assignment from a file: # More on variables -- Read the [full variables](/docs/templates/hcl_templates/variables) description for a more +- Read the [full variables](/packer/docs/templates/hcl_templates/variables) description for a more thorough read. -- Read the [variables guide](/guides/hcl/variables) for more examples. +- Read the [variables guide](/packer/guides/hcl/variables) for more examples. diff --git a/website/content/docs/templates/hcl_templates/contextual-variables.mdx b/website/content/docs/templates/hcl_templates/contextual-variables.mdx index cb4d0f3b072..03c04d82c86 100644 --- a/website/content/docs/templates/hcl_templates/contextual-variables.mdx +++ b/website/content/docs/templates/hcl_templates/contextual-variables.mdx @@ -66,8 +66,8 @@ Here is the list of available build variables: For backwards compatibility, `WinRMPassword` is also available through this engine, though it is no different than using the more general `Password`. -All build variables are valid to use with any of the [HCL2 functions](/docs/templates/hcl_templates/functions). -Example of using [upper](/docs/templates/hcl_templates/functions/string/upper) to upper case the build ID: +All build variables are valid to use with any of the [HCL2 functions](/packer/docs/templates/hcl_templates/functions). +Example of using [upper](/packer/docs/templates/hcl_templates/functions/string/upper) to upper case the build ID: ```hcl post-processor "shell-local" { @@ -77,11 +77,11 @@ Example of using [upper](/docs/templates/hcl_templates/functions/string/upper) t For builder-specific builder variables, please also refer to the builder docs: -- Amazon EC2: [chroot](/plugins/builders/amazon/chroot#build-shared-information-variables), - [EBS Volume](/plugins/builders/amazon/ebsvolume#build-shared-information-variables), - [EBS](/plugins/builders/amazon/ebs#build-shared-information-variables), - [EBS Surrogate](/plugins/builders/amazon/ebssurrogate#build-shared-information-variables), - [Instance](/plugins/builders/amazon/instance#build-shared-information-variables). +- Amazon EC2: [chroot](/packer/plugins/builders/amazon/chroot#build-shared-information-variables), + [EBS Volume](/packer/plugins/builders/amazon/ebsvolume#build-shared-information-variables), + [EBS](/packer/plugins/builders/amazon/ebs#build-shared-information-variables), + [EBS Surrogate](/packer/plugins/builders/amazon/ebssurrogate#build-shared-information-variables), + [Instance](/packer/plugins/builders/amazon/instance#build-shared-information-variables). The HCL2 Special Build Variables is in beta; please report any issues or requests on the Packer issue tracker on GitHub. @@ -132,23 +132,92 @@ parenthesis may through off your shell escaping otherwise. # HCP Packer Iteration ID +~> **Note**: The `packer.iterationID` variable is now deprecated and will be removed in a future version of Packer. HCP Packer Versions should be accessed with their fingerprint instead. The `packer.versionFingerprint` variable is now exposed to be used in its stead with the new HCP Packer data sources. + If your build is pushing metadata to the HCP Packer registry, this variable is set to the value of the Iteration ID associated with this run. ```hcl -source "amazon-ebs" "cannonical-ubuntu-server" { - ami_name = "packer-example" - // ... - run_volume_tags = { - hcp_iteration_id = packer.iterationID +source "null" "example" { + communicator = "none" +} + +data "hcp-packer-version" "hardened-source" { + bucket_name = "example" + channel_name = "latest" +} + +data "hcp-packer-artifact" "file" { + bucket_name = "example" + version_fingerprint = "${data.hcp-packer-version.hardened-source.fingerprint}" + platform = "aws" + region = "us-east-1" +} + +build { + hcp_packer_registry { + bucket_name = "simple" + } + sources = [ + "source.null.example" + ] + + provisioner "shell-local" { + inline = [ + "echo data is ${packer.iterationID}" + ] + } +} + +``` + +```shell-session +==> mybuild.null.example: Running local shell script: /var/folders/cz/q3cr3tld2457gtlgw7qs1kqc0000gq/T/packer-shell842419427 + mybuild.null.example: data is 01HN3KCRPVKR5PBQ28TS6B12W0 +``` + +# HCP Packer Version Fingerprint + +If your build is pushing metadata to the HCP Packer registry, this variable is +set to the value of the Version Fingerprint associated with this run. + +```hcl +source "null" "example" { + communicator = "none" +} + +data "hcp-packer-version" "hardened-source" { + bucket_name = "example" + channel_name = "latest" +} + +data "hcp-packer-artifact" "file" { + bucket_name = "example" + version_fingerprint = "${data.hcp-packer-version.hardened-source.fingerprint}" + platform = "aws" + region = "us-east-1" +} + +build { + hcp_packer_registry { + bucket_name = "simple" + } + sources = [ + "source.null.example" + ] + + provisioner "shell-local" { + inline = [ + "echo data is ${packer.versionFingerprint}" + ] } } + ``` ```shell-session -==> vanilla.amazon-ebs.cannonical-ubuntu-server: Adding tags to source instance - vanilla.amazon-ebs.cannonical-ubuntu-server: Adding tag: "Name": "Packer Builder" - vanilla.amazon-ebs.cannonical-ubuntu-server: Adding tag: "hcp_iteration_id": "01FHGF3M2AK4TS6PCZES4VX5E7" +==> mybuild.null.example: Running local shell script: /var/folders/cz/q3cr3tld2457gtlgw7qs1kqc0000gq/T/packer-shell842419427 + mybuild.null.example: data is 01HN3KCRPVKR5PBQ28TS6B12W0 ``` You can also add this value to post-processors, for example to add to a manifest file: @@ -158,6 +227,7 @@ You can also add this value to post-processors, for example to add to a manifest output = "manifest.json" strip_path = true custom_data = { + version_fingerprint = "${packer.versionFingerprint}" iteration = "${packer.iterationID}" } } diff --git a/website/content/docs/templates/hcl_templates/datasources.mdx b/website/content/docs/templates/hcl_templates/datasources.mdx index d0c67e89c2e..d596c61fc04 100644 --- a/website/content/docs/templates/hcl_templates/datasources.mdx +++ b/website/content/docs/templates/hcl_templates/datasources.mdx @@ -10,8 +10,8 @@ description: >- -> **Note:** Data Sources is a feature included in Packer 1.7 and later. -Data sources allow data to be fetched or computed for use elsewhere in [locals](/docs/templates/hcl_templates/blocks/locals) and -[sources](/docs/templates/hcl_templates/blocks/source) configuration. +Data sources allow data to be fetched or computed for use elsewhere in [locals](/packer/docs/templates/hcl_templates/blocks/locals) and +[sources](/packer/docs/templates/hcl_templates/blocks/source) configuration. Use of data sources allows a Builder to make use of information defined outside of Packer. # Using Data Sources @@ -36,8 +36,8 @@ local name ("example"). The name is used to refer to this data source from elsew The data block creates a data instance of the given _type_ (first block label) and _name_ (second block label). The combination of the type and name must be unique within a configuration. -Within the block (the `{ }`) is the configuration for the data instance. The configuration is dependent on the type, -and is documented for each data source in the [data sources](/docs/datasources) section. +Within the block (the `{ }`) is the configuration for the data instance. The configuration is dependent on the data source type, +and is documented for each data source. For example the configuration of the `amazon-ami` data source can be found at [plugins/datasources/amazon/ami](/packer/plugins/datasources/amazon/ami#configuration-reference). A data source can output one or more attributes, which can be used by adding their key name to the data source unique identifier, like `data...`. @@ -81,6 +81,6 @@ source "amazon-ebs" "basic-example" { ## Related -- The list of available data sources can be found in the [data sources](/docs/datasources) +- The list of available data sources can be found in the [data sources](/packer/docs/datasources) section. -- Create your own [custom data source](/docs/plugins/creation/custom-datasources) ! +- Create your own [custom data source](/packer/docs/plugins/creation/custom-datasources) ! diff --git a/website/content/docs/templates/hcl_templates/expressions.mdx b/website/content/docs/templates/hcl_templates/expressions.mdx index 5eb7a3bd0af..4fb50126c02 100644 --- a/website/content/docs/templates/hcl_templates/expressions.mdx +++ b/website/content/docs/templates/hcl_templates/expressions.mdx @@ -123,7 +123,7 @@ types described above: Key/value pairs can be separated by either a comma or a line break. Values can be arbitrary expressions. Keys are strings; they can be left unquoted if - they are a valid [identifier](/docs/templates/hcl_templates/syntax#identifiers), but must be quoted + they are a valid [identifier](/packer/docs/templates/hcl_templates/syntax#identifiers), but must be quoted otherwise. You can use a non-literal expression as a key by wrapping it in parentheses, like `(var.business_unit_tag_name) = "SRE"`. @@ -134,13 +134,13 @@ Packer makes one named values available. The following named values are available: - `source..` is an object representing a - [source](/docs/templates/hcl_templates/blocks/source) of the given type + [source](/packer/docs/templates/hcl_templates/blocks/source) of the given type and name. ### Available Functions For a full list of available functions, see [the function -reference](/docs/templates/hcl_templates/functions). +reference](/packer/docs/templates/hcl_templates/functions). ## `for` Expressions @@ -233,7 +233,7 @@ The above expression is equivalent to the following `for` expression: Splat expressions are for lists only (and thus cannot be used [to reference resources created with -`for_each`](https://www.terraform.io/docs/configuration/resources.html#referring-to-instances), which +`for_each`](/terraform/docs/configuration/resources#referring-to-instances), which are represented as maps). However, if a splat expression is applied to a value that is _not_ a list or tuple then the value is automatically wrapped in a single-element list before processing. @@ -255,7 +255,7 @@ set. ## `dynamic` blocks -Within top-level block constructs like [source](/docs/templates/hcl_templates/blocks/source), expressions +Within top-level block constructs like [source](/packer/docs/templates/hcl_templates/blocks/source), expressions can usually be used only when assigning a value to an argument using the `name = expression` or `key = expression` form. This covers many uses, but some source types include repeatable _nested blocks_ in their arguments, which do not accept expressions: @@ -335,8 +335,8 @@ block. If you need to declare resource instances based on a nested data structure or combinations of elements from multiple data structures you can use expressions and functions to derive a suitable value. For some common examples of such situations, see the -[`flatten`](/docs/templates/hcl_templates/functions/collection/flatten) and -[`setproduct`](/docs/templates/hcl_templates/functions/collection/setproduct) +[`flatten`](/packer/docs/templates/hcl_templates/functions/collection/flatten) and +[`setproduct`](/packer/docs/templates/hcl_templates/functions/collection/setproduct) functions. ### Best Practices for `dynamic` Blocks diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx index 12f2f26b079..f46673c49d3 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalesce.mdx @@ -31,5 +31,5 @@ b ## Related Functions -- [`coalescelist`](/docs/templates/hcl_templates/functions/collection/coalescelist) performs a similar operation with +- [`coalescelist`](/packer/docs/templates/hcl_templates/functions/collection/coalescelist) performs a similar operation with list arguments rather than individual arguments. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx index 219e8d098bc..79d9d85c8dc 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/coalescelist.mdx @@ -38,5 +38,5 @@ symbol to expand the outer list as arguments: ## Related Functions -- [`coalesce`](/docs/templates/hcl_templates/functions/collection/coalesce) performs a similar operation with string +- [`coalesce`](/packer/docs/templates/hcl_templates/functions/collection/coalesce) performs a similar operation with string arguments rather than list arguments. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx index 038b47d9423..6373cc3940c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/element.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/element.mdx @@ -34,5 +34,5 @@ a ## Related Functions -- [`index`](/docs/templates/hcl_templates/functions/collection/index-fn) finds the index for a particular element value. -- [`lookup`](/docs/templates/hcl_templates/functions/collection/lookup) retrieves a value from a _map_ given its _key_. +- [`index`](/packer/docs/templates/hcl_templates/functions/collection/index-fn) finds the index for a particular element value. +- [`lookup`](/packer/docs/templates/hcl_templates/functions/collection/lookup) retrieves a value from a _map_ given its _key_. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx index bf7871fe210..a3bc2f4423e 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/flatten.mdx @@ -28,9 +28,9 @@ Indirectly-nested lists, such as those in maps, are _not_ flattened. ## Flattening nested structures for `for_each` The -[resource `for_each`](https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) +[resource `for_each`](/terraform/docs/configuration/resources#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) and -[`dynamic` block](/docs/templates/hcl_templates/expressions#dynamic-blocks) +[`dynamic` block](/packer/docs/templates/hcl_templates/expressions#dynamic-blocks) language features both require a collection value that has one element for each repetition. @@ -103,6 +103,6 @@ the associations between the subnets and their containing networks. ## Related Functions -- [`setproduct`](/docs/templates/hcl_templates/functions/collection/setproduct) finds all of the combinations of multiple +- [`setproduct`](/packer/docs/templates/hcl_templates/functions/collection/setproduct) finds all of the combinations of multiple lists or sets of values, which can also be useful when preparing collections for use with `for_each` constructs. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx index b9457a6c734..80c80ca056f 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/index-fn.mdx @@ -23,5 +23,5 @@ value is not present in the list. ## Related Functions -- [`element`](/docs/templates/hcl_templates/functions/collection/element) retrieves a particular element from a list given +- [`element`](/packer/docs/templates/hcl_templates/functions/collection/element) retrieves a particular element from a list given its index. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx index 58bebaf7cbd..cd955f9dfba 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/keys.mdx @@ -23,4 +23,4 @@ be identical as long as the keys in the map don't change. ## Related Functions -- [`values`](/docs/templates/hcl_templates/functions/collection/values) returns a list of the _values_ from a map. +- [`values`](/packer/docs/templates/hcl_templates/functions/collection/values) returns a list of the _values_ from a map. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx index c7cdb671cf8..0eb686063f1 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx @@ -6,7 +6,7 @@ description: The lookup function retrieves an element value from a map given its # `lookup` Function `lookup` retrieves the value of a single element from a map, given its key. -If the given key does not exist, a the given default value is returned instead. +If the given key does not exist, the given default value is returned instead. ```hcl lookup(map, key, default) @@ -23,4 +23,4 @@ what? ## Related Functions -- [`element`](/docs/templates/hcl_templates/functions/collection/element) retrieves a value from a _list_ given its _index_. +- [`element`](/packer/docs/templates/hcl_templates/functions/collection/element) retrieves a value from a _list_ given its _index_. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx index e591dc16d14..743a97a5d84 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/reverse.mdx @@ -21,4 +21,4 @@ with all of the same elements as the given sequence but in reverse order. ## Related Functions -- [`strrev`](/docs/templates/hcl_templates/functions/string/strrev) reverses a string. +- [`strrev`](/packer/docs/templates/hcl_templates/functions/string/strrev) reverses a string. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx index 4234ea78b6d..924b9a8b095 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setintersection.mdx @@ -30,9 +30,9 @@ the ordering of the given elements is not preserved. ## Related Functions -- [`contains`](/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains +- [`contains`](/packer/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains a given element value. -- [`setproduct`](/docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple +- [`setproduct`](/packer/docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple sets. -- [`setunion`](/docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of +- [`setunion`](/packer/docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of multiple sets. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx index 2da2ea0aa46..d9425f12027 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setproduct.mdx @@ -115,9 +115,9 @@ elements all have a consistent type: ## Finding combinations for `for_each` The -[resource `for_each`](https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) +[resource `for_each`](/terraform/docs/configuration/resources#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) and -[`dynamic` block](/docs/templates/hcl_templates/expressions/#dynamic-blocks) +[`dynamic` block](/packer/docs/templates/hcl_templates/expressions/#dynamic-blocks) language features both require a collection value that has one element for each repetition. @@ -211,12 +211,12 @@ elements in the input variables. ## Related Functions -- [`contains`](/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains +- [`contains`](/packer/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains a given element value. -- [`flatten`](/docs/templates/hcl_templates/functions/collection/flatten) is useful for flattening hierarchical data +- [`flatten`](/packer/docs/templates/hcl_templates/functions/collection/flatten) is useful for flattening hierarchical data into a single list, for situations where the relationships between two object types are defined explicitly. -- [`setintersection`](/docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of +- [`setintersection`](/packer/docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of multiple sets. -- [`setunion`](/docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of multiple +- [`setunion`](/packer/docs/templates/hcl_templates/functions/collection/setunion) computes the _union_ of multiple sets. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx index 5dce94c78cd..a78e2d4896d 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/setunion.mdx @@ -33,9 +33,9 @@ the ordering of the given elements is not preserved. ## Related Functions -- [`contains`](/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains +- [`contains`](/packer/docs/templates/hcl_templates/functions/collection/contains) tests whether a given list or set contains a given element value. -- [`setintersection`](/docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of +- [`setintersection`](/packer/docs/templates/hcl_templates/functions/collection/setintersection) computes the _intersection_ of multiple sets. -- [`setproduct`](/docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple +- [`setproduct`](/packer/docs/templates/hcl_templates/functions/collection/setproduct) computes the _Cartesian product_ of multiple sets. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx index eea7d7c12e4..f92ebc2ea9c 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/slice.mdx @@ -27,5 +27,5 @@ list. ## Related Functions -- [`substr`](/docs/templates/hcl_templates/functions/string/substr) performs a similar function for characters in a +- [`substr`](/packer/docs/templates/hcl_templates/functions/string/substr) performs a similar function for characters in a string, although it uses a length instead of an end index. diff --git a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx index a362d09c2c1..0fced24da20 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/values.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/values.mdx @@ -10,7 +10,7 @@ in that map. The values are returned in lexicographical order by their corresponding _keys_, so the values will be returned in the same order as their keys would be -returned from [`keys`](/docs/templates/hcl_templates/functions/collection/keys). +returned from [`keys`](/packer/docs/templates/hcl_templates/functions/collection/keys). ## Examples @@ -25,4 +25,4 @@ returned from [`keys`](/docs/templates/hcl_templates/functions/collection/keys). ## Related Functions -- [`keys`](/docs/templates/hcl_templates/functions/collection/keys) returns a list of the _keys_ from a map. +- [`keys`](/packer/docs/templates/hcl_templates/functions/collection/keys) returns a list of the _keys_ from a map. diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx index edc09053a52..73d5b06fcf5 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/aws_secretsmanager.mdx @@ -5,7 +5,7 @@ description: >- stores. --- -# `aws_secretsmanager_key` Function +# `aws_secretsmanager` Function Secrets can be read from the [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) and used within your template diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx index c40a525f13c..fff91894f2f 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/consul.mdx @@ -5,7 +5,7 @@ description: The consul function retrieves secrets from HashiCorp consul KV stor # `consul_key` Function -[Consul](https://www.consul.io) keys can be used within your template using the +[Consul](https://www.consul.io/) keys can be used within your template using the `consul_key` function. You can either use this function in a locals block or directly inline where you @@ -36,4 +36,4 @@ This will load the key stored at the path `myservice/version` from consul. The configuration for consul (address, tokens, ...) must be specified as environment variables, as specified in the -[Documentation](https://www.consul.io/docs/commands#environment-variables). +[Documentation](/consul/commands#environment-variables). diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx index 1085fe92a83..3749e899dfd 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/env.mdx @@ -18,7 +18,7 @@ other places. In the previous example, the value of `aws_region` will be what's stored in the `AWS_DEFAULT_REGION` env var, unless aws_region is also set in a [manner that takes -precedence](/docs/templates/hcl_templates/variables#variable-definition-precedence). +precedence](/packer/docs/templates/hcl_templates/variables#variable-definition-precedence). -> **Why can't I use environment variables elsewhere?** User variables are the single source of configurable input. We felt that having environment variables @@ -28,9 +28,9 @@ input variables, input variables remain as the single source of input to a template that a user can easily discover using `packer inspect`. When the environment variable is not set at all -- not even with the empty -string -- the value returned by `env` will be an an empty string. It will still +string -- the value returned by `env` will be an empty string. It will still be possible to set it using other means but you could use [custom validation -rules](/docs/templates/hcl_templates/variables#custom-validation-rules) to error in that case +rules](/packer/docs/templates/hcl_templates/variables#custom-validation-rules) to error in that case to make sure it is set, for example: ```hcl diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index e818b61575c..8136a10114d 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -49,11 +49,12 @@ local "foo" { expression = vault("secrets/hello", "foo") sensitive = true } +``` The `local` block example accesses the Vault path `secrets/foo` and returns the value stored at the key `foo`, storing it as the local variable `local.foo`. However, the output of the newly stored local variable will be filtered from the Packer build output, and replaced -with the value ''. See [Local Values](/docs/templates/hcl_templates/locals) for more details. +with the value ``. See [Local Values](/packer/docs/templates/hcl_templates/locals) for more details. ## Usage @@ -88,4 +89,4 @@ The full list of available environment variables is: ``` and detailed documentation for usage of each of those variables can be found -[here](https://www.vaultproject.io/docs/commands/#environment-variables). +[here](/vault/docs/commands#environment-variables). diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx index e3e80c772b2..4272cbbcbe5 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx @@ -12,7 +12,7 @@ whether the expression produced a result without any errors. This is a special function that is able to catch errors produced when evaluating its argument. For most situations where you could use `can` it's better to use -[`try`](/docs/templates/hcl_templates/functions/conversion/try) instead, because it allows for more concise definition of +[`try`](/packer/docs/templates/hcl_templates/functions/conversion/try) instead, because it allows for more concise definition of fallback values for failing expressions. The `can` function can only catch and handle _dynamic_ errors resulting from @@ -24,7 +24,7 @@ as a malformed resource reference. variable validation rules. Although it can technically accept any sort of expression and be used elsewhere in the configuration, we recommend against using it in other contexts. For error handling elsewhere in the configuration, -prefer to use [`try`](/docs/templates/hcl_templates/functions/conversion/try). +prefer to use [`try`](/packer/docs/templates/hcl_templates/functions/conversion/try). ## Examples @@ -53,5 +53,5 @@ A local value with the name "nonexist" has not been declared. ## Related Functions -- [`try`](/docs/templates/hcl_templates/functions/conversion/try), which tries evaluating a sequence of expressions and +- [`try`](/packer/docs/templates/hcl_templates/functions/conversion/try), which tries evaluating a sequence of expressions and returns the result of the first one that succeeds. diff --git a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx index 4dc68d8637b..a34e6e293c8 100644 --- a/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx +++ b/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx @@ -107,5 +107,5 @@ A local value with the name "nonexist" has not been declared. ## Related Functions -- [`can`](/docs/templates/hcl_templates/functions/conversion/can), which tries evaluating an expression and returns a +- [`can`](/packer/docs/templates/hcl_templates/functions/conversion/can), which tries evaluating an expression and returns a boolean value indicating whether it succeeded. diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx index f4fd6ae822e..708b6a6842b 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/formatdate.mdx @@ -99,7 +99,7 @@ configuration as needed: ## Related Functions -- [`format`](/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary +- [`format`](/packer/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary data. -- [`timestamp`](/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format +- [`timestamp`](/packer/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format suitable for input to `formatdate`. diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx index 05c39844a74..37217a5f4de 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_isotime.mdx @@ -9,13 +9,13 @@ description: |- The `legacy_isotime` function returns the current date and time using the given format string. The format string follows Go's datetime formatting. See -[isotime-function-format-reference](/docs/templates/legacy_json_templates/engine#isotime-function-format-reference) +[isotime-function-format-reference](/packer/docs/templates/legacy_json_templates/engine#isotime-function-format-reference) for more details. This function has been provided to create backwards compatibility with Packer's legacy JSON templates. However, we recommend that you upgrade your -HCL Packer template to use [`timestamp`](/docs/templates/hcl_templates/functions/datetime/timestamp) -and [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) together as soon as is convenient. +HCL Packer template to use [`timestamp`](/packer/docs/templates/hcl_templates/functions/datetime/timestamp) +and [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) together as soon as is convenient. -> **Note:** If you are using a large number of builders, provisioners or post-processors, the isotime may be slightly different for each one @@ -33,9 +33,9 @@ your plugins. ## Related Functions -- [`format`](/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary +- [`format`](/packer/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary data. -- [`timestamp`](/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format +- [`timestamp`](/packer/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format suitable for input to `formatdate`. -- [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to +- [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to other date and time formats. diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx index 852b89add82..c993315076c 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/legacy_strftime.mdx @@ -13,8 +13,8 @@ format string. The format string follows strftime's datetime formatting. This function has been provided to create backwards compatibility with Packer's legacy JSON templates. However, we recommend that you upgrade your HCL Packer template to use -[`timestamp`](/docs/templates/hcl_templates/functions/datetime/timestamp) and -[`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) +[`timestamp`](/packer/docs/templates/hcl_templates/functions/datetime/timestamp) and +[`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) together as soon as is convenient. -> **Note:** If you are using a large number of builders, provisioners or @@ -32,9 +32,9 @@ user variable and then access the user variable within your plugins. ## Related Functions -- [`format`](/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary +- [`format`](/packer/docs/templates/hcl_templates/functions/string/format) is a more general formatting function for arbitrary data. -- [`timestamp`](/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format +- [`timestamp`](/packer/docs/templates/hcl_templates/functions/datetime/timestamp) returns the current date and time in a format suitable for input to `formatdate`. -- [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to +- [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to other date and time formats. diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx index db1cfde5a5b..0a19c566b61 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timeadd.mdx @@ -29,7 +29,7 @@ of adding the given direction to the given timestamp. -> **Breaking change note:** Packer previously let you decide your own "Date and Time format" syntax. With HCL2 and for parity with Terraform, Packer will be using the [RFC 3339](https://tools.ietf.org/html/rfc3339) "Date and Time -format" syntax. As a string. [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) still allows you +format" syntax. As a string. [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) still allows you to format a date. ## Examples diff --git a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx index 5336e77f7dd..b27eb1123a4 100644 --- a/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/datetime/timestamp.mdx @@ -21,7 +21,7 @@ Packer run. -> **Breaking change note:** Packer previously let you decide your own "Date and Time format" syntax. With HCL2 and for parity with Terraform, Packer will be using the [RFC 3339](https://tools.ietf.org/html/rfc3339) "Date and Time -format" syntax. As a string. [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) still allows you +format" syntax. As a string. [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) still allows you to format a date. ## Examples @@ -33,5 +33,5 @@ to format a date. ## Related Functions -- [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to +- [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) can convert the resulting timestamp to other date and time formats. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx index 37832a0f6a7..8d918823047 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64decode.mdx @@ -32,5 +32,5 @@ Hello World ## Related Functions -- [`base64encode`](/docs/templates/hcl_templates/functions/encoding/base64encode) performs the opposite operation, +- [`base64encode`](/packer/docs/templates/hcl_templates/functions/encoding/base64encode) performs the opposite operation, encoding the UTF-8 bytes for a string as Base64. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx index c79efc8d800..2d3441d8887 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/base64encode.mdx @@ -33,5 +33,5 @@ SGVsbG8gV29ybGQ= ## Related Functions -- [`base64decode`](/docs/templates/hcl_templates/functions/encoding/base64decode) performs the opposite operation, +- [`base64decode`](/packer/docs/templates/hcl_templates/functions/encoding/base64decode) performs the opposite operation, decoding Base64 data and interpreting it as a UTF-8 string. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx index abd073ec665..88cb42d49e6 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/csvdecode.mdx @@ -39,7 +39,7 @@ number of fields, or this function will produce an error. ## Use with the `for_each` meta-argument You can use the result of `csvdecode` with -[the `for_each` meta-argument](https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) +[the `for_each` meta-argument](/terraform/docs/configuration/resources#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings) to describe a collection of similar objects whose differences are described by the rows in the given CSV file. @@ -87,7 +87,7 @@ create or destroy associated instances as appropriate. If there is no reasonable value you can use as a unique identifier in your CSV then you could instead use -[the `count` meta-argument](https://www.terraform.io/docs/configuration/resources.html#count-multiple-resource-instances-by-count) +[the `count` meta-argument](/terraform/docs/configuration/resources#count-multiple-resource-instances-by-count) to define an object for each CSV row, with each one identified by its index into the list returned by `csvdecode`. However, in that case any future updates to the CSV may be disruptive if they change the positions of particular objects in diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx index e8696b7e9a5..ade3fd2bd1d 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsondecode.mdx @@ -13,7 +13,7 @@ of the result of decoding that string. The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159). This function maps JSON values to -[Packer language values](/docs/templates/hcl_templates/expressions#types-and-values) +[Packer language values](/packer/docs/templates/hcl_templates/expressions#types-and-values) in the following way: | JSON type | Packer type | @@ -42,5 +42,5 @@ true ## Related Functions -- [`jsonencode`](/docs/templates/hcl_templates/functions/encoding/jsonencode) performs the opposite operation, _encoding_ +- [`jsonencode`](/packer/docs/templates/hcl_templates/functions/encoding/jsonencode) performs the opposite operation, _encoding_ a value as JSON. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx index e5c02f8916d..fb75ee7fa84 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/jsonencode.mdx @@ -10,7 +10,7 @@ description: The jsonencode function encodes a given value as a JSON string. The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159). This function maps -[Packer language values](/docs/templates/hcl_templates/expressions#types-and-values) +[Packer language values](/packer/docs/templates/hcl_templates/expressions#types-and-values) to JSON values in the following way: | Packer type | JSON type | @@ -39,5 +39,5 @@ rarely a problem in practice. ## Related Functions -- [`jsondecode`](/docs/templates/hcl_templates/functions/encoding/jsondecode) performs the opposite operation, _decoding_ +- [`jsondecode`](/packer/docs/templates/hcl_templates/functions/encoding/jsondecode) performs the opposite operation, _decoding_ a JSON string to obtain its represented value. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx index cb853e66a70..ea787ca2c06 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamldecode.mdx @@ -14,7 +14,7 @@ This function supports a subset of [YAML 1.2](https://yaml.org/spec/1.2/spec.htm as described below. This function maps YAML values to -[Packer language values](/docs/templates/hcl_templates/expressions#types-and-values) +[Packer language values](/packer/docs/templates/hcl_templates/expressions#types-and-values) in the following way: | YAML type | Packer type | @@ -93,7 +93,7 @@ Call to function "yamldecode" failed: unsupported tag "!not-supported". ## Related Functions -- [`jsondecode`](/docs/templates/hcl_templates/functions/encoding/jsondecode) is a similar operation using JSON instead +- [`jsondecode`](/packer/docs/templates/hcl_templates/functions/encoding/jsondecode) is a similar operation using JSON instead of YAML. -- [`yamlencode`](/docs/templates/hcl_templates/functions/encoding/yamlencode) performs the opposite operation, _encoding_ +- [`yamlencode`](/packer/docs/templates/hcl_templates/functions/encoding/yamlencode) performs the opposite operation, _encoding_ a value as YAML. diff --git a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx index 3627ebdbd01..2aa0174714c 100644 --- a/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx +++ b/website/content/docs/templates/hcl_templates/functions/encoding/yamlencode.mdx @@ -12,7 +12,7 @@ description: The yamlencode function encodes a given value as a YAML string. result format may change in future versions of Packer, based on feedback. Do not use `yamldecode` to construct a value for any resource argument where changes to the result would be disruptive. To get a consistent string -representation of a value use [`jsonencode`](/docs/templates/hcl_templates/functions/encoding/jsonencode) instead; its +representation of a value use [`jsonencode`](/packer/docs/templates/hcl_templates/functions/encoding/jsonencode) instead; its results are also valid YAML because YAML is a JSON superset. This function maps -[Packer language values](/docs/templates/hcl_templates/expressions#types-and-values) +[Packer language values](/packer/docs/templates/hcl_templates/expressions#types-and-values) to YAML tags in the following way: | Packer type | YAML type | @@ -74,12 +74,12 @@ mean that this is rarely a problem in practice. `yamlencode` always uses YAML's "block style" for mappings and sequences, unless the mapping or sequence is empty. To generate flow-style YAML, use -[`jsonencode`](/docs/templates/hcl_templates/functions/encoding/jsonencode) instead: YAML flow-style is a superset +[`jsonencode`](/packer/docs/templates/hcl_templates/functions/encoding/jsonencode) instead: YAML flow-style is a superset of JSON syntax. ## Related Functions -- [`jsonencode`](/docs/templates/hcl_templates/functions/encoding/jsonencode) is a similar operation using JSON instead +- [`jsonencode`](/packer/docs/templates/hcl_templates/functions/encoding/jsonencode) is a similar operation using JSON instead of YAML. -- [`yamldecode`](/docs/templates/hcl_templates/functions/encoding/yamldecode) performs the opposite operation, _decoding_ +- [`yamldecode`](/packer/docs/templates/hcl_templates/functions/encoding/yamldecode) performs the opposite operation, _decoding_ a YAML string to obtain its represented value. diff --git a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx index 243327e5b96..b9c28ca976f 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/abspath.mdx @@ -13,7 +13,7 @@ Referring directly to filesystem paths in resource arguments may cause spurious diffs if the same configuration is applied from multiple systems or on different host operating systems. We recommend using filesystem paths only for transient values, such as the argument to -[`file`](/docs/templates/hcl_templates/functions/file) (where only the contents are then +[`file`](/packer/docs/templates/hcl_templates/functions/file) (where only the contents are then stored). ## Examples diff --git a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx index c77be75b691..70a05e08a02 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/basename.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/basename.mdx @@ -24,7 +24,7 @@ it uses backslash `\` as the path segment separator. On Unix systems, the slash Referring directly to filesystem paths in resource arguments may cause spurious diffs if the same configuration is applied from multiple systems or on different host operating systems. We recommend using filesystem paths only -for transient values, such as the argument to [`file`](/docs/templates/hcl_templates/functions/file) (where +for transient values, such as the argument to [`file`](/packer/docs/templates/hcl_templates/functions/file) (where only the contents are then stored) or in `connection` and `provisioner` blocks. ## Examples @@ -36,6 +36,6 @@ baz.txt ## Related Functions -- [`dirname`](/docs/templates/hcl_templates/functions/file/dirname) returns all of the segments of a filesystem path +- [`dirname`](/packer/docs/templates/hcl_templates/functions/file/dirname) returns all of the segments of a filesystem path _except_ the last, discarding the portion that would be returned by `basename`. diff --git a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx index cb3b42a6e94..348c0363ab6 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/dirname.mdx @@ -23,7 +23,7 @@ any slashes in the given path will be replaced by backslashes before returning. Referring directly to filesystem paths in resource arguments may cause spurious diffs if the same configuration is applied from multiple systems or on different host operating systems. We recommend using filesystem paths only -for transient values, such as the argument to [`file`](/docs/templates/hcl_templates/functions/file) (where +for transient values, such as the argument to [`file`](/packer/docs/templates/hcl_templates/functions/file) (where only the contents are then stored) or in `connection` and `provisioner` blocks. ## Examples @@ -35,5 +35,5 @@ foo/bar ## Related Functions -- [`basename`](/docs/templates/hcl_templates/functions/file/basename) returns _only_ the last portion of a filesystem +- [`basename`](/packer/docs/templates/hcl_templates/functions/file/basename) returns _only_ the last portion of a filesystem path, discarding the portion that would be returned by `dirname`. diff --git a/website/content/docs/templates/hcl_templates/functions/file/file.mdx b/website/content/docs/templates/hcl_templates/functions/file/file.mdx index 3b146a3b718..6dd36ee3a5c 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/file.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/file.mdx @@ -33,5 +33,5 @@ Hello World ## Related Functions -- [`fileexists`](/docs/templates/hcl_templates/functions/file/fileexists) determines whether a file exists +- [`fileexists`](/packer/docs/templates/hcl_templates/functions/file/fileexists) determines whether a file exists at a given path. diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx index 772b7923626..b8b0b3fe2b4 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileexists.mdx @@ -31,5 +31,5 @@ fileexists("custom-section.sh") ? file("custom-section.sh") : local.default_cont ## Related Functions -- [`file`](/docs/templates/hcl_templates/functions/file/file) reads the contents +- [`file`](/packer/docs/templates/hcl_templates/functions/file/file) reads the contents of a file at a given path. diff --git a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx index 227a46873dc..e60dd126d33 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/fileset.mdx @@ -96,7 +96,7 @@ build { List of provisioners with a `scripts` field: -- [`shell`](/docs/provisioners/shell) -- [`powershell`](/docs/provisioners/powershell) -- [`shell-local`](/docs/provisioners/shell-local) -- [`windows-shell`](/docs/provisioners/windows-shell) +- [`shell`](/packer/docs/provisioners/shell) +- [`powershell`](/packer/docs/provisioners/powershell) +- [`shell-local`](/packer/docs/provisioners/shell-local) +- [`windows-shell`](/packer/docs/provisioners/windows-shell) diff --git a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx index f7e1907b15a..68cc8cf4706 100644 --- a/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx +++ b/website/content/docs/templates/hcl_templates/functions/file/templatefile.mdx @@ -132,7 +132,7 @@ For more information, see the main documentation for jsonencode and yamlencode. ## Related Functions -- [`file`](/docs/templates/hcl_templates/functions/file/file) reads the contents +- [`file`](/packer/docs/templates/hcl_templates/functions/file/file) reads the contents of a file at a given path. -- [`fileexists`](/docs/templates/hcl_templates/functions/file/fileexists) +- [`fileexists`](/packer/docs/templates/hcl_templates/functions/file/fileexists) determines whether a file exists at a given path. diff --git a/website/content/docs/templates/hcl_templates/functions/index.mdx b/website/content/docs/templates/hcl_templates/functions/index.mdx index 29f568aedaa..0a9ee2a9eee 100644 --- a/website/content/docs/templates/hcl_templates/functions/index.mdx +++ b/website/content/docs/templates/hcl_templates/functions/index.mdx @@ -18,9 +18,9 @@ arguments in parentheses: max(5, 12, 9) ``` -For more details on syntax, see -[_Function Calls_](/docs/templates/hcl_templates/expressions#function-calls) -on the Expressions page. +For information on invoking functions in string literals, refer to the +[String Literals](https://developer.hashicorp.com/packer/docs/templates/hcl_templates/expressions#string-literals) section +in the HCL2 expressions documentation. The HCL language does not support user-defined functions, and so only the functions built in to the language are available for use. The documentation includes all of the available built-in functions. diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx index e8096807ea7..77c5679990c 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrhost.mdx @@ -21,7 +21,7 @@ cidrhost(prefix, hostnum) no more than the number of digits remaining in the address after the given prefix. For more details on how this function interprets CIDR prefixes and populates host numbers, see the worked example for -[`cidrsubnet`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnet). +[`cidrsubnet`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnet). Conventionally host number zero is used to represent the address of the network itself and the host number that would fill all the host bits with @@ -45,5 +45,5 @@ fd00:fd12:3456:7890::22 ## Related Functions -- [`cidrsubnet`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a subnet address under a given +- [`cidrsubnet`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a subnet address under a given network address prefix. diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx index 388ce65db67..fbe916df750 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnet.mdx @@ -27,7 +27,7 @@ additional bits added to the prefix. This function accepts both IPv6 and IPv4 prefixes, and the result always uses the same addressing scheme as the given prefix. -Unlike the related function [`cidrsubnets`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnets), `cidrsubnet` +Unlike the related function [`cidrsubnets`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnets), `cidrsubnet` allows you to give a specific network number to use. `cidrsubnets` can allocate multiple network addresses at once, but numbers them automatically starting with zero. @@ -88,7 +88,7 @@ This gives us some additional information but also confirms (using a slightly different notation) the conversion from decimal to binary and shows the range of possible host addresses in this network. -While [`cidrhost`](/docs/templates/hcl_templates/functions/ipnet/cidrhost) allows calculating single host IP addresses, +While [`cidrhost`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrhost) allows calculating single host IP addresses, `cidrsubnet` on the other hand creates a new network prefix _within_ the given network prefix. In other words, it creates a subnet. @@ -143,7 +143,7 @@ Hosts/Net: 14 Class A, Private Internet The new subnet has four bits available for host numbering, which means that there are 14 host addresses available for assignment once we subtract the network's own address and the broadcast address. You can thus use -[`cidrhost`](/docs/templates/hcl_templates/functions/ipnet/cidrhost) function to calculate those host addresses by +[`cidrhost`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrhost) function to calculate those host addresses by providing it a value between 1 and 14: ```shell-session @@ -158,9 +158,9 @@ For more information on CIDR notation and subnetting, see ## Related Functions -- [`cidrhost`](/docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host +- [`cidrhost`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host within a given network address prefix. -- [`cidrnetmask`](/docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR +- [`cidrnetmask`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR notation into netmask notation. -- [`cidrsubnets`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnets) can allocate multiple consecutive +- [`cidrsubnets`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnets) can allocate multiple consecutive addresses under a prefix at once, numbering them automatically. diff --git a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx index 6eafaf12668..faac15f8b84 100644 --- a/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx +++ b/website/content/docs/templates/hcl_templates/functions/ipnet/cidrsubnets.mdx @@ -23,7 +23,7 @@ value is therefore a list with one element per `newbits` argument, each a string containing an address range in CIDR notation. For more information on IP addressing concepts, see the documentation for the -related function [`cidrsubnet`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnet). `cidrsubnet` calculates +related function [`cidrsubnet`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnet). `cidrsubnet` calculates a single subnet address within a prefix while allowing you to specify its subnet number, while `cidrsubnets` can calculate many at once, potentially of different sizes, and assigns subnet numbers automatically. @@ -58,7 +58,7 @@ the same addressing scheme as the given prefix. ``` You can use nested `cidrsubnets` calls with -[`for` expressions](/docs/templates/hcl_templates/expressions#for-expressions) +[`for` expressions](/packer/docs/templates/hcl_templates/expressions#for-expressions) to concisely allocate groups of network address blocks: ```shell-session @@ -85,9 +85,9 @@ to concisely allocate groups of network address blocks: ## Related Functions -- [`cidrhost`](/docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host +- [`cidrhost`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrhost) calculates the IP address for a single host within a given network address prefix. -- [`cidrnetmask`](/docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR +- [`cidrnetmask`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrnetmask) converts an IPv4 network prefix in CIDR notation into netmask notation. -- [`cidrsubnet`](/docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a single subnet address, allowing +- [`cidrsubnet`](/packer/docs/templates/hcl_templates/functions/ipnet/cidrsubnet) calculates a single subnet address, allowing you to specify its network number. diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx index 6701d086f38..2c3e9a70f10 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/ceil.mdx @@ -21,5 +21,5 @@ given value, which may be a fraction. ## Related Functions -- [`floor`](/docs/templates/hcl_templates/functions/numeric/floor), which rounds to the nearest whole number _less than_ +- [`floor`](/packer/docs/templates/hcl_templates/functions/numeric/floor), which rounds to the nearest whole number _less than_ or equal. diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx index 0737b815521..66faf73f200 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/floor.mdx @@ -21,5 +21,5 @@ given value, which may be a fraction. ## Related Functions -- [`ceil`](/docs/templates/hcl_templates/functions/numeric/ceil), which rounds to the nearest whole number _greater than_ +- [`ceil`](/packer/docs/templates/hcl_templates/functions/numeric/ceil), which rounds to the nearest whole number _greater than_ or equal. diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx index 3de1e4d09d3..36f8ac2554e 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/max.mdx @@ -24,4 +24,4 @@ to individual arguments: ## Related Functions -- [`min`](/docs/templates/hcl_templates/functions/numeric/min), which returns the _smallest_ number from a set. +- [`min`](/packer/docs/templates/hcl_templates/functions/numeric/min), which returns the _smallest_ number from a set. diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx index 53894266b0b..64e697143ab 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/min.mdx @@ -24,4 +24,4 @@ to individual arguments: ## Related Functions -- [`max`](/docs/templates/hcl_templates/functions/numeric/max), which returns the _greatest_ number from a set. +- [`max`](/packer/docs/templates/hcl_templates/functions/numeric/max), which returns the _greatest_ number from a set. diff --git a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx index 3ab7892b754..3b8ac241185 100644 --- a/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx +++ b/website/content/docs/templates/hcl_templates/functions/numeric/parseint.mdx @@ -46,5 +46,5 @@ Invalid value for "number" parameter: cannot parse "12" as a base 2 integer. ## Related Functions -- [`format`](/docs/templates/hcl_templates/functions/string/format) can format numbers and other values into strings, +- [`format`](/packer/docs/templates/hcl_templates/functions/string/format) can format numbers and other values into strings, with optional zero padding, alignment, etc. diff --git a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx index 3c902dec19c..9586ab280ed 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx @@ -23,5 +23,5 @@ hello ## Related Functions -- [`trimspace`](/docs/templates/hcl_templates/functions/string/trimspace), which removes all types of whitespace from +- [`trimspace`](/packer/docs/templates/hcl_templates/functions/string/trimspace), which removes all types of whitespace from both the start and the end of a string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/format.mdx b/website/content/docs/templates/hcl_templates/functions/string/format.mdx index 6ab8946711c..7ac645ffedf 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/format.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/format.mdx @@ -113,7 +113,7 @@ for an unsupported format verb. ## Related Functions -- [`formatdate`](/docs/templates/hcl_templates/functions/datetime/formatdate) is a specialized formatting function for +- [`formatdate`](/packer/docs/templates/hcl_templates/functions/datetime/formatdate) is a specialized formatting function for human-readable timestamps. -- [`formatlist`](/docs/templates/hcl_templates/functions/string/formatlist) uses the same specification syntax to +- [`formatlist`](/packer/docs/templates/hcl_templates/functions/string/formatlist) uses the same specification syntax to produce a list of strings. diff --git a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx index f13cad18216..6d110ae2065 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx @@ -15,7 +15,7 @@ formatlist(spec, values...) ``` The specification string uses -[the same syntax as `format`](/docs/templates/hcl_templates/functions/string/format#specification-syntax). +[the same syntax as `format`](/packer/docs/templates/hcl_templates/functions/string/format#specification-syntax). The given values can be a mixture of list and non-list arguments. Any given lists must be the same length, which decides the length of the resulting list. @@ -45,5 +45,5 @@ once per element of the list arguments. ## Related Functions -- [`format`](/docs/templates/hcl_templates/functions/string/format) defines the specification syntax used by this +- [`format`](/packer/docs/templates/hcl_templates/functions/string/format) defines the specification syntax used by this function and produces a single string as its result. diff --git a/website/content/docs/templates/hcl_templates/functions/string/join.mdx b/website/content/docs/templates/hcl_templates/functions/string/join.mdx index 96c0a6f0e08..acdbaa8ae03 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/join.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/join.mdx @@ -25,5 +25,5 @@ foo ## Related Functions -- [`split`](/docs/templates/hcl_templates/functions/string/split) performs the opposite operation: producing a list +- [`split`](/packer/docs/templates/hcl_templates/functions/string/split) performs the opposite operation: producing a list by separating a single string using a given delimiter. diff --git a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx index 4fbf6b1f88f..65482482207 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx @@ -22,5 +22,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase. ## Related Functions -- [`upper`](/docs/templates/hcl_templates/functions/string/upper) converts letters in a string to _uppercase_. -- [`title`](/docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase. +- [`upper`](/packer/docs/templates/hcl_templates/functions/string/upper) converts letters in a string to _uppercase_. +- [`title`](/packer/docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase. diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx index 571344254f8..74d55a647a4 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx @@ -30,7 +30,7 @@ It's not valid to mix both named and unnamed capture groups in the same pattern. If the given pattern does not match at all, the `regex` raises an error. To _test_ whether a given pattern matches a string, use -[`regexall`](/docs/templates/hcl_templates/functions/string/regexall) and test that the result has length greater than +[`regexall`](/packer/docs/templates/hcl_templates/functions/string/regexall) and test that the result has length greater than zero. The pattern is a string containing a mixture of literal characters and special @@ -152,8 +152,8 @@ string. ## Related Functions -- [`regexall`](/docs/templates/hcl_templates/functions/string/regexall) searches for potentially multiple matches of a given pattern in a string. -- [`replace`](/docs/templates/hcl_templates/functions/string/replace) replaces a substring of a string with another string, optionally matching using the same regular expression syntax as `regex`. +- [`regexall`](/packer/docs/templates/hcl_templates/functions/string/regexall) searches for potentially multiple matches of a given pattern in a string. +- [`replace`](/packer/docs/templates/hcl_templates/functions/string/replace) replaces a substring of a string with another string, optionally matching using the same regular expression syntax as `regex`. If Packer already has a more specialized function to parse the syntax you are trying to match, prefer to use that function instead. Regular expressions diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx index a679a2bc76f..29d10b8e095 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx @@ -34,7 +34,7 @@ hello everybody > regex_replace("hello world", "w.*d", "everybody") hello everybody -> regex_replace("-ab-axxb-", "a(x*)b", "$1W) +> regex_replace("-ab-axxb-", "a(x*)b", "$1W") --- > regex_replace("-ab-axxb-", "a(x*)b", "${1}W") @@ -43,5 +43,5 @@ hello everybody ## Related Functions -- [`replace`](/docs/templates/hcl_templates/functions/string/replace) searches a given string for another given +- [`replace`](/packer/docs/templates/hcl_templates/functions/string/replace) searches a given string for another given substring, and replaces all occurrences with a given replacement string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx index 6722588a881..96900698148 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx @@ -14,7 +14,7 @@ to a string and returns a list of all matches. regexall(pattern, string) ``` -`regexall` is a variant of [`regex`](/docs/templates/hcl_templates/functions/string/regex) and uses the same pattern +`regexall` is a variant of [`regex`](/packer/docs/templates/hcl_templates/functions/string/regex) and uses the same pattern syntax. For any given input to `regex`, `regexall` returns a list of whatever type `regex` would've returned, with one element per match. That is: @@ -47,7 +47,7 @@ false ## Related Functions -- [`regex`](/docs/templates/hcl_templates/functions/string/regex) searches for a single match of a given pattern, and +- [`regex`](/packer/docs/templates/hcl_templates/functions/string/regex) searches for a single match of a given pattern, and returns an error if no match is found. If Packer already has a more specialized function to parse the syntax you diff --git a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx index 2490a6ce03d..4097756f9b1 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx @@ -26,5 +26,5 @@ hello everybody ## Related Functions -- [`regex_replace`](/docs/templates/hcl_templates/functions/string/regex_replace) searches a given string for another given substring, +- [`regex_replace`](/packer/docs/templates/hcl_templates/functions/string/regex_replace) searches a given string for another given substring, and replaces each occurrence with a given replacement string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/split.mdx b/website/content/docs/templates/hcl_templates/functions/string/split.mdx index 0b19f6811d0..677b10a924b 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/split.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/split.mdx @@ -35,5 +35,5 @@ split(separator, string) ## Related Functions -- [`join`](/docs/templates/hcl_templates/functions/string/join) performs the opposite operation: producing a string +- [`join`](/packer/docs/templates/hcl_templates/functions/string/join) performs the opposite operation: producing a string joining together a list of strings with a given separator. diff --git a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx index 035fbd0698f..c543bfeb93a 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx @@ -23,4 +23,4 @@ olleh ## Related Functions -- [`reverse`](/docs/templates/hcl_templates/functions/collection/reverse) reverses a sequence. +- [`reverse`](/packer/docs/templates/hcl_templates/functions/collection/reverse) reverses a sequence. diff --git a/website/content/docs/templates/hcl_templates/functions/string/title.mdx b/website/content/docs/templates/hcl_templates/functions/string/title.mdx index bb1b9454e43..15d40f3d0b8 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/title.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/title.mdx @@ -20,5 +20,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase. ## Related Functions -- [`upper`](/docs/templates/hcl_templates/functions/string/upper) converts _all_ letters in a string to uppercase. -- [`lower`](/docs/templates/hcl_templates/functions/string/lower) converts all letters in a string to lowercase. +- [`upper`](/packer/docs/templates/hcl_templates/functions/string/upper) converts _all_ letters in a string to uppercase. +- [`lower`](/packer/docs/templates/hcl_templates/functions/string/lower) converts all letters in a string to lowercase. diff --git a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx index 273388a44ce..321a46eac0e 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx @@ -19,7 +19,7 @@ hello ## Related Functions -- [`trimprefix`](/docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string. -- [`trimsuffix`](/docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string. -- [`trimspace`](/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from +- [`trimprefix`](/packer/docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string. +- [`trimsuffix`](/packer/docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string. +- [`trimspace`](/packer/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from both the start and the end of a string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx index 337662d2be1..f9396edc0fd 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx @@ -18,7 +18,7 @@ world ## Related Functions -- [`trim`](/docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string. -- [`trimsuffix`](/docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string. -- [`trimspace`](/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from +- [`trim`](/packer/docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string. +- [`trimsuffix`](/packer/docs/templates/hcl_templates/functions/string/trimsuffix) removes a word from the end of a string. +- [`trimspace`](/packer/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from both the start and the end of a string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx index aa73177569b..a1f619083a9 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx @@ -23,5 +23,5 @@ hello ## Related Functions -- [`chomp`](/docs/templates/hcl_templates/functions/string/chomp) removes just line ending characters from the _end_ of +- [`chomp`](/packer/docs/templates/hcl_templates/functions/string/chomp) removes just line ending characters from the _end_ of a string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx index 8385f5d97b9..e69644ca374 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx @@ -18,7 +18,7 @@ hello ## Related Functions -- [`trim`](/docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string. -- [`trimprefix`](/docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string. -- [`trimspace`](/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from +- [`trim`](/packer/docs/templates/hcl_templates/functions/string/trim) removes characters at the start and end of a string. +- [`trimprefix`](/packer/docs/templates/hcl_templates/functions/string/trimprefix) removes a word from the start of a string. +- [`trimspace`](/packer/docs/templates/hcl_templates/functions/string/trimspace) removes all types of whitespace from both the start and the end of a string. diff --git a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx index 172da4e329e..7a6bb0a5b64 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx @@ -22,5 +22,5 @@ This function uses Unicode's definition of letters and of upper- and lowercase. ## Related Functions -- [`lower`](/docs/templates/hcl_templates/functions/string/lower) converts letters in a string to _lowercase_. -- [`title`](/docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase. +- [`lower`](/packer/docs/templates/hcl_templates/functions/string/lower) converts letters in a string to _lowercase_. +- [`title`](/packer/docs/templates/hcl_templates/functions/string/title) converts the first letter of each word in a string to uppercase. diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx index 6fc9430af6f..d3135ae2278 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv4.mdx @@ -24,4 +24,4 @@ b5ee72a3-54dd-c4b8-551c-4bdc0204cedb ## Related Functions -- [`uuidv5`](/docs/templates/hcl_templates/functions/uuid/uuidv5), which generates name-based UUIDs. +- [`uuidv5`](/packer/docs/templates/hcl_templates/functions/uuid/uuidv5), which generates name-based UUIDs. diff --git a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx index fa4e14c3260..310b4b1305c 100644 --- a/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx +++ b/website/content/docs/templates/hcl_templates/functions/uuid/uuidv5.mdx @@ -15,7 +15,7 @@ description: |- uuidv5(namespace, name) ``` -Unlike the pseudo-random UUIDs generated by [`uuidv4`](/docs/templates/hcl_templates/functions/uuid/uuidv4), +Unlike the pseudo-random UUIDs generated by [`uuidv4`](/packer/docs/templates/hcl_templates/functions/uuid/uuidv4), name-based UUIDs derive from namespace and an name, producing the same UUID value every time if the namespace and name are unchanged. @@ -75,4 +75,4 @@ human-significant manner, such as by reference to the standard that defined it. ## Related Functions -- [`uuidv4`](/docs/templates/hcl_templates/functions/uuid/uuidv4), which generates pseudorandom UUIDs. +- [`uuidv4`](/packer/docs/templates/hcl_templates/functions/uuid/uuidv4), which generates pseudorandom UUIDs. diff --git a/website/content/docs/templates/hcl_templates/index.mdx b/website/content/docs/templates/hcl_templates/index.mdx index 73869587c8c..72d845f8f29 100644 --- a/website/content/docs/templates/hcl_templates/index.mdx +++ b/website/content/docs/templates/hcl_templates/index.mdx @@ -14,7 +14,7 @@ Packer uses the HashiCorp Configuration Language - HCL - designed to allow concise descriptions of the required steps to get to a build file. This page describes the features of HCL2 exhaustively, if you would like to give a quick try to HCL2, you can also read the quicker [HCL2 getting started -guide](/guides/hcl). +guide](/packer/guides/hcl). ## Builds @@ -55,14 +55,14 @@ source "amazon-ebs" "main" { For full details about Packer's syntax, see: -- [Configuration Syntax](/docs/templates/hcl_templates/syntax) -- [Expressions](/docs/templates/hcl_templates/expressions) +- [Configuration Syntax](/packer/docs/templates/hcl_templates/syntax) +- [Expressions](/packer/docs/templates/hcl_templates/expressions) ## Code Organization The HCL language uses configuration files that are named with the `.pkr.hcl` file extension. There is also [a JSON-based variant of the -language](/docs/templates/hcl_templates/syntax-json) that is named with the `.pkr.json` file +language](/packer/docs/templates/hcl_templates/syntax-json) that is named with the `.pkr.json` file extension. Configuration files must always use UTF-8 encoding, and by convention are diff --git a/website/content/docs/templates/hcl_templates/locals.mdx b/website/content/docs/templates/hcl_templates/locals.mdx index 93f73c80a10..456f6af90ec 100644 --- a/website/content/docs/templates/hcl_templates/locals.mdx +++ b/website/content/docs/templates/hcl_templates/locals.mdx @@ -1,35 +1,34 @@ --- -page_title: Local Values - HCL Configuration Language +page_title: Local Variables - HCL Configuration Language description: >- - Local values assign a name to an expression that can then be used multiple + Local variables assign a name to an expression that you can use multiple times within a folder. --- -# Local Values +# Local Variables `@include 'from-1.5/beta-hcl2-note.mdx'` There are two kinds of variables in HCL Packer templates: Input variables, sometimes simply called "variables", and Local variables, also known as -"locals". Input variables may have defaults, but those defaults can -be overridden from the command line or special variable files. Local variables -can be thought of as constants, and are not able to be overridden at runtime. +"locals". Input variables may have defaults, but those defaults can be +overridden using command line options, environment variables, or variable +definitions files. Local variables can not be overridden. This page is about local variables. To learn about input variables, see the -[input variables](/docs/templates/hcl_templates/variables) page. +[input variables](/packer/docs/templates/hcl_templates/variables) page. -Local values assign a name to an expression, that can then be used multiple -times within a folder. - -If [variables](/docs/templates/hcl_templates/variables) are analogous to function arguments then -_local values_ are comparable to a function's local variables. +Local variables assign a name to an expression, which you can use multiple +times within a folder. The expression is evaluated at run time, and can +reference input variables, other local variables, data sources, and HCL +functions. Input variable and local variable usage are introduced in the [_Variables -Guide_](/guides/hcl/variables). +Guide_](/packer/guides/hcl/variables). ## Examples -Local values are defined in `local` or `locals` blocks: +Local variables are defined in a `local` or `locals` block: ```hcl # Using the local block allows you to mark locals as sensitive, which will @@ -51,7 +50,7 @@ locals { name_prefix = "${var.name_prefix != "" ? var.name_prefix : local.default_name_prefix}" } -# Local values can be interpolated elsewhere using the "local." prefix. +# Local variables can be referenced using the "local." prefix. source "virtualbox-iso" "example" { output = "${local.name_prefix}-files" # ... @@ -120,10 +119,10 @@ The expression of a local value can refer to other locals, but reference cycles are not allowed. That is, a local cannot refer to itself or to a variable that refers (directly or indirectly) back to it. -It's recommended to group together logically-related local values into a single +It's recommended to group together logically-related local variables into a single block, particularly if they depend on each other. This will help the reader understand the relationships between variables. Conversely, prefer to define -_unrelated_ local values in _separate_ blocks, and consider annotating each +_unrelated_ local variables in _separate_ blocks, and consider annotating each block with a comment describing any context common to all of the enclosed locals. diff --git a/website/content/docs/templates/hcl_templates/path-variables.mdx b/website/content/docs/templates/hcl_templates/path-variables.mdx index 5484b57a93f..fb9b74defc9 100644 --- a/website/content/docs/templates/hcl_templates/path-variables.mdx +++ b/website/content/docs/templates/hcl_templates/path-variables.mdx @@ -25,16 +25,16 @@ locals { ## Related Functions -- [`abspath`](/docs/templates/hcl_templates/functions/file/abspath) takes a string containing +- [`abspath`](/packer/docs/templates/hcl_templates/functions/file/abspath) takes a string containing a filesystem path and converts it to an absolute path. -- [`basename`](/docs/templates/hcl_templates/functions/file/basename) returns _only_ the last +- [`basename`](/packer/docs/templates/hcl_templates/functions/file/basename) returns _only_ the last portion of a filesystem path, discarding the portion that would be returned by `dirname`. -- [`fileset`](/docs/templates/hcl_templates/functions/file/fileset) enumerates a set of +- [`fileset`](/packer/docs/templates/hcl_templates/functions/file/fileset) enumerates a set of regular file names given a path and pattern. -- [`dirname`](/docs/templates/hcl_templates/functions/file/dirname) returns all of the +- [`dirname`](/packer/docs/templates/hcl_templates/functions/file/dirname) returns all of the segments of a filesystem path _except_ the last, discarding the portion that would be returned by `basename`. diff --git a/website/content/docs/templates/hcl_templates/syntax-json.mdx b/website/content/docs/templates/hcl_templates/syntax-json.mdx index 13bc168545b..414f864a0ec 100644 --- a/website/content/docs/templates/hcl_templates/syntax-json.mdx +++ b/website/content/docs/templates/hcl_templates/syntax-json.mdx @@ -10,7 +10,7 @@ description: |- `@include 'from-1.5/beta-hcl2-note.mdx'` Most Packer configurations are written in [the native HCL -syntax](/docs/templates/hcl_templates/syntax), which is designed to be easy for humans to read and +syntax](/packer/docs/templates/hcl_templates/syntax), which is designed to be easy for humans to read and update. Packer also supports an alternative syntax that is JSON-compatible. This @@ -96,7 +96,7 @@ different (see [block-type-specific exceptions](#block-type-specific-exceptions) correspond either to argument names or to nested block type names. - Where a property corresponds to an argument that accepts - [arbitrary expressions](/docs/templates/hcl_templates/expressions) in the native syntax, the + [arbitrary expressions](/packer/docs/templates/hcl_templates/expressions) in the native syntax, the property value is mapped to an expression as described under [_Expression Mapping_](#expression-mapping) below. For arguments that do _not_ accept arbitrary expressions, the interpretation of the property @@ -113,20 +113,20 @@ different (see [block-type-specific exceptions](#block-type-specific-exceptions) ## Expression Mapping Since JSON grammar is not able to represent all of the Packer language -[expression syntax](/docs/templates/hcl_templates/expressions), JSON values interpreted as expressions +[expression syntax](/packer/docs/templates/hcl_templates/expressions), JSON values interpreted as expressions are mapped as follows: | JSON | Packer Language Interpretation | | ------- | -------------------------------------------------------------------------------------------------------------------------------- | | Boolean | A literal `bool` value. | | Number | A literal `number` value. | -| String | Parsed as a [string template](/docs/templates/hcl_templates/expressions#string-templates) and then evaluated as described below. | +| String | Parsed as a [string template](/packer/docs/templates/hcl_templates/expressions#string-templates) and then evaluated as described below. | | Object | Each property value is mapped per this table, producing an `object(...)` value with suitable attribute types. | | Array | Each element is mapped per this table, producing a `tuple(...)` value with suitable element types. | | Null | A literal `null`. | When a JSON string is encountered in a location where arbitrary expressions are -expected, its value is first parsed as a [string template](/docs/templates/hcl_templates/expressions#string-templates) +expected, its value is first parsed as a [string template](/packer/docs/templates/hcl_templates/expressions#string-templates) and then it is evaluated to produce the final result. If the given template consists _only_ of a single interpolation sequence, diff --git a/website/content/docs/templates/hcl_templates/syntax.mdx b/website/content/docs/templates/hcl_templates/syntax.mdx index e031dd6300d..7ed024eca5d 100644 --- a/website/content/docs/templates/hcl_templates/syntax.mdx +++ b/website/content/docs/templates/hcl_templates/syntax.mdx @@ -17,7 +17,7 @@ are built from. This page describes the _native syntax_ of HCL, which is a rich language designed to be easy for humans to read and write. The constructs in HCL can -also be expressed in [JSON syntax](/docs/templates/hcl_templates/syntax-json), which is harder for +also be expressed in [JSON syntax](/packer/docs/templates/hcl_templates/syntax-json), which is harder for humans to read and edit but easier to generate and parse programmatically. This low-level syntax of HCL is defined in terms of a syntax called _HCL_, @@ -47,7 +47,7 @@ after the equals sign is the argument's value. The context where the argument appears determines what value types are valid (for example, each source type has a schema that defines the types of its arguments), but many arguments accept arbitrary -[expressions](/docs/templates/hcl_templates/expressions), which allow the value to +[expressions](/packer/docs/templates/hcl_templates/expressions), which allow the value to either be specified literally or generated from other values programmatically. ### Blocks diff --git a/website/content/docs/templates/hcl_templates/variables.mdx b/website/content/docs/templates/hcl_templates/variables.mdx index 5f465b8d791..4c8f856fafc 100644 --- a/website/content/docs/templates/hcl_templates/variables.mdx +++ b/website/content/docs/templates/hcl_templates/variables.mdx @@ -11,28 +11,26 @@ description: |- There are two kinds of variables in HCL Packer templates: Input variables, sometimes simply called "variables", and Local variables, also known as -"locals". Input variables may have defaults, but those defaults can -be overridden from the command line or special variable files. Local variables -can be thought of as constants, and are not able to be overridden at runtime. +"locals". Input variables may have defaults, but those defaults can be +overridden using command line options, environment variables, or variable +definitions files. However, nothing can change the value of an input variable +after the initial override. This page is about input variables. To learn about local variables, see the -[locals](/docs/templates/hcl_templates/locals) page. +[locals](/packer/docs/templates/hcl_templates/locals) page. Input variables serve as parameters for a Packer build, allowing aspects of the build to be customized without altering the build's own source code. -When you declare variables in the build of your configuration, you can set -their values using CLI options and environment variables. - Input variable and local variable usage are introduced in the [_Variables -Guide_](/guides/hcl/variables). +Guide_](/packer/guides/hcl/variables). -> **Note:** For brevity, input variables are often referred to as just "variables" or "Packer variables" when it is clear from context what sort of variable is being discussed. Other kinds of variables in Packer include _environment variables_ (set by the shell where Packer runs) and _expression variables_ (used to indirectly represent a value in an -[expression](/docs/templates/hcl_templates/expressions)). +[expression](/packer/docs/templates/hcl_templates/expressions)). ## Declaring an Input Variable @@ -98,7 +96,7 @@ Packer defines the following arguments for variable declarations: The variable declaration can also include a `default` argument. If present, the variable is considered to be _optional_ and the default value will be used -if no value is set when calling the module or running Terraform. The `default` +if no value is set when running Packer. The `default` argument requires a literal value and cannot reference other objects in the configuration. @@ -107,7 +105,7 @@ configuration. [inpage-type]: #type-constraints The `type` argument in a `variable` block allows you to restrict the [type of -value](/docs/templates/hcl_templates/expressions#types-and-values) that will be accepted as the value +value](/packer/docs/templates/hcl_templates/expressions#types-and-values) that will be accepted as the value for a variable. If no type constraint is set then a value of any type is accepted. @@ -133,7 +131,7 @@ The type constructors allow you to specify complex types such as collections: The keyword `any` may be used to indicate that any type is acceptable. For more information on the meaning and behavior of these different types, as well as detailed information about automatic conversion of complex types, see [Type -Constraints](https://www.terraform.io/docs/configuration/types.html). +Constraints](/terraform/docs/configuration/types). If both the `type` and `default` arguments are specified, the given default value must be convertible to the specified type. @@ -174,7 +172,7 @@ maintainers, use comments. ## Using Input Variable Values Within the build that declared a variable, its value can be accessed from -within [expressions](/docs/templates/hcl_templates/expressions) as `var.`, where `` +within [expressions](/packer/docs/templates/hcl_templates/expressions) as `var.`, where `` matches the label given in the declaration block: ```hcl @@ -282,7 +280,7 @@ case letters as in the above example. ### Complex-typed Values When variable values are provided in a variable definitions file, Packer's -[usual syntax](/docs/templates/hcl_templates/expressions) can be used to assign +[usual syntax](/packer/docs/templates/hcl_templates/expressions) can be used to assign complex-typed values, like lists and maps. Some special rules apply to the `-var` command line option and to environment diff --git a/website/content/docs/templates/index.mdx b/website/content/docs/templates/index.mdx index 6d064dd97ad..b3c0ccd661b 100644 --- a/website/content/docs/templates/index.mdx +++ b/website/content/docs/templates/index.mdx @@ -28,4 +28,4 @@ From version **1.7.0**, HCL2 becomes officially the preferred way to write Packe configuration(s). If you need help upgrading a JSON template to an HCL template, check -our upgrade guide [here](https://developer.hashicorp.com/packer/tutorials/configuration-language/hcl2-upgrade). +our upgrade guide [here](/packer/tutorials/configuration-language/hcl2-upgrade). diff --git a/website/content/docs/templates/json_to_hcl.mdx b/website/content/docs/templates/json_to_hcl.mdx new file mode 100644 index 00000000000..2be56685dcb --- /dev/null +++ b/website/content/docs/templates/json_to_hcl.mdx @@ -0,0 +1,158 @@ +--- +description: | + This section highlights the differences between JSON and HCL2 templates and explains the parallels between the specifications. +page_title: JSON to HCL +--- + +# Packer templates + +Packer uses templates to orchestrate builds for one or more images. +In [legacy JSON templates](/packer/docs/templates/legacy_json_templates), you would declare a series of builders, provisioners and post-processors to build images. +In [HCL2 templates](/packer/docs/templates/hcl_templates), things are different, as the configuration language allows you to specify builders through sources, and weave them in build blocks. + +This document aims to explain the parallels between the two configuration template types, and what you +should expect when moving a template away from JSON to HCL2. + +In addition to this document, you may find the `packer hcl2_upgrade` command useful when converting your existing JSON templates to HCL2. +Refer to the [hcl2_upgrade](/packer/docs/commands/hcl2_upgrade) page for more information on its usage. + +## Builders + +Builders are components that are specialized for a platform. +Their role is to set the stage for the steps that will let you build the final image from your configuration template. + +### JSON + +In JSON, the `builders` attribute declares how a builder will be invoked to build an image. + +```json +{ + "builders": [ + { + "type": "null", + "name": "test", + "communicator": "none" + } + ] +} +``` + +### HCL2 + +In HCL2, builders are declared through a `source` block. Sources on their own are not enough, and must be invoked in a `build` block. +The `build` block serves as a container for all the steps (i.e. `source`, `provisioners` and `post-processors`) to go from a blank image to a finished one. + +```hcl +source "null" "test" { + communicator = "none" +} + +build { + sources = ["null.test"] +} +``` + +## Provisioners + +Provisioners are components that modify the state of the machine image you are building. +They can be used for installing packages, writing data to the remote file system, or executing remote commands. +They can be defined in both JSON or HCL templates. + +### JSON + +In a JSON template, provisioners are declared at the top-level of the template as an array of sequentially +invoked components to provision the image you are building. They apply to all the builders defined in the template. + +```json +{ + "builders": [ + { + "type": "null", + "name": "test", + "communicator": "none" + } + ], + "provisioners": [ + { + "type": "shell-local", + "inline": ["echo test"] + } + ] +} +``` + +### HCL2 + +In HCL2, provisioners are declared in the `build` block, and apply only to the sources invoked as +part of this build block. +This lets you declare multiple build blocks, each with its own set of provisioners, which will +result in multiple different builds executed in parallel. + +```hcl +source "null" "test" { + communicator = "none" +} + +build { + sources = ["null.test"] + + provisioner "shell-local" { + inline = ["echo test"] + } +} +``` + +## Post-processors + +Post-processors are components that are invoked after the image was produced. Their +role is to consume an artifact produced by a builder, or another post-processor, and +build a new artifact from that. + +### JSON + +As with provisioners, in JSON templates, post-processors are sequentially invoked after a +build finished provisioning, and are declared in the template under "post-processors". + +```json +{ + "builders": [ + { + "type": "null", + "name": "test", + "communicator": "none" + } + ], + "provisioners": [ + { + "type": "shell-local", + "inline": ["echo test"] + } + ], + "post-processors": [ + { + "type": "manifest" + } + ] +} +``` + +### HCL2 + +In HCL2, much like provisioners, they are also part of the `build` block, and similar rules +apply as with provisioners. + +```hcl +source "null" "test" { + communicator = "none" +} + +build { + sources = ["null.test"] + + provisioner "shell-local" { + inline = ["echo test"] + } + + post-processor "manifest" {} +} +``` diff --git a/website/content/docs/templates/legacy_json_templates/builders.mdx b/website/content/docs/templates/legacy_json_templates/builders.mdx index bac3b52ebd0..42d3afa15b4 100644 --- a/website/content/docs/templates/legacy_json_templates/builders.mdx +++ b/website/content/docs/templates/legacy_json_templates/builders.mdx @@ -36,7 +36,7 @@ Within a template, a section of builder definitions looks like this: ## Builder Definition A single builder definition maps to exactly one -[build](/docs/terminology#builds). A builder definition is a +[build](/packer/docs/terminology#builds). A builder definition is a JSON object that requires at least a `type` key. The `type` is the name of the builder that will be used to create a machine image for the build. @@ -69,10 +69,10 @@ of them since the names must be unique. ## Communicators Every build is associated with a single -[communicator](/docs/templates/legacy_json_templates/communicator). Communicators are used to +[communicator](/packer/docs/templates/legacy_json_templates/communicator). Communicators are used to establish a connection for provisioning a remote machine (such as an AWS instance or local virtual machine). All the examples for the various builders show some communicator (usually SSH), but the communicators are highly customizable so we recommend reading the -[communicator documentation](/docs/templates/legacy_json_templates/communicator). +[communicator documentation](/packer/docs/templates/legacy_json_templates/communicator). diff --git a/website/content/docs/templates/legacy_json_templates/communicator.mdx b/website/content/docs/templates/legacy_json_templates/communicator.mdx index 7da238e849e..a1c32a9c69b 100644 --- a/website/content/docs/templates/legacy_json_templates/communicator.mdx +++ b/website/content/docs/templates/legacy_json_templates/communicator.mdx @@ -13,7 +13,7 @@ Communicators are the mechanism Packer uses to upload files, execute scripts, etc. with the machine being created. Communicators are configured within the -[builder](/docs/templates/legacy_json_templates/builders) section. +[builder](/packer/docs/templates/legacy_json_templates/builders) section. All communicators have the following options: @@ -32,7 +32,7 @@ the Packer template. However, if you are building from a brand-new and unconfigured operating system image, you will almost always have to perform some extra work to configure SSH on the guest machine. For most operating system distributions, this work will -be performed by a [boot_command](/plugins/builders/vmware/iso#boot-configuration) that references a file which +be performed by a [boot_command](/packer/plugins/builders/vmware/iso#boot-configuration) that references a file which provides answers to the normally-interactive questions you get asked when installing an operating system. The name of this file varies by operating system; some common examples are the "preseed" file required by Debian, the @@ -49,4 +49,4 @@ system is critical for being able to successfully use Packer. ## Communicator-Specific Options For more details on how to use each communicator, visit the -[communicators](/docs/communicators) page. +[communicators](/packer/docs/communicators) page. diff --git a/website/content/docs/templates/legacy_json_templates/engine.mdx b/website/content/docs/templates/legacy_json_templates/engine.mdx index f657ca09354..e603320c5ef 100644 --- a/website/content/docs/templates/legacy_json_templates/engine.mdx +++ b/website/content/docs/templates/legacy_json_templates/engine.mdx @@ -59,7 +59,7 @@ Here is a full list of the available functions for reference. each function will behave. - `env` - Returns environment variables. See example in [using home - variable](/docs/templates/legacy_json_templates/user-variables#using-home-variable) + variable](/packer/docs/templates/legacy_json_templates/user-variables#using-home-variable) - `build` - This engine will allow you to access, from provisioners and post-processors, special variables that provide connection information and basic instance state information. Usage example: @@ -109,11 +109,11 @@ Here is a full list of the available functions for reference. For builder-specific builder variables, please also refer to the builder docs: - - Amazon EC2: [chroot](/plugins/builders/amazon/chroot#build-shared-information-variables), - [EBS Volume](/plugins/builders/amazon/ebsvolume#build-shared-information-variables), - [EBS](/plugins/builders/amazon/ebs#build-shared-information-variables), - [EBS Surrogate](/plugins/builders/amazon/ebssurrogate#build-shared-information-variables), - [Instance](/plugins/builders/amazon/instance#build-shared-information-variables). + - Amazon EC2: [chroot](/packer/plugins/builders/amazon/chroot#build-shared-information-variables), + [EBS Volume](/packer/plugins/builders/amazon/ebsvolume#build-shared-information-variables), + [EBS](/packer/plugins/builders/amazon/ebs#build-shared-information-variables), + [EBS Surrogate](/packer/plugins/builders/amazon/ebssurrogate#build-shared-information-variables), + [Instance](/packer/plugins/builders/amazon/instance#build-shared-information-variables). This engine is in beta; please report any issues or requests on the Packer issue tracker on GitHub. @@ -121,7 +121,7 @@ Here is a full list of the available functions for reference. - `isotime [FORMAT]` - UTC time, which can be [formatted](https://pkg.go.dev/time#example_Time_Format). See more examples below in [the `isotime` format - reference](/docs/templates/legacy_json_templates/engine#isotime-function-format-reference). + reference](/packer/docs/templates/legacy_json_templates/engine#isotime-function-format-reference). `strftime FORMAT` - UTC time, formated using the ISO C standard format `FORMAT`. See [jehiah/go-strftime](https://github.com/jehiah/go-strftime) for a list @@ -209,9 +209,9 @@ Template variables are special variables automatically set by Packer at build time. Some builders, provisioners and other components have template variables that are available only for that component. Template variables are recognizable because they're prefixed by a period, such as `{{ .Name }}`. For example, when -using the [`shell`](/plugins/builders/vmware/iso) builder template variables +using the [`shell`](/packer/plugins/builders/vmware/iso) builder template variables are available to customize the -[`execute_command`](/docs/provisioners/shell#execute_command) parameter +[`execute_command`](/packer/docs/provisioners/shell#execute_command) parameter used to determine how Packer will run the shell command. ```json @@ -231,7 +231,7 @@ the list of the environment variables and the path to the script to be executed respectively. -> **Note:** In addition to template variables, you can specify your own -user variables. See the [user variable](/docs/templates/legacy_json_templates/user-variables) +user variables. See the [user variable](/packer/docs/templates/legacy_json_templates/user-variables) documentation for more information on user variables. # isotime Function Format Reference diff --git a/website/content/docs/templates/legacy_json_templates/index.mdx b/website/content/docs/templates/legacy_json_templates/index.mdx index 9f169963cb9..3a01ca7a5b6 100644 --- a/website/content/docs/templates/legacy_json_templates/index.mdx +++ b/website/content/docs/templates/legacy_json_templates/index.mdx @@ -31,11 +31,11 @@ Along with each key, it is noted whether it is required or not. builders that will be used to create machine images for this template, and configures each of those builders. For more information on how to define and configure a builder, read the sub-section on [configuring builders in - templates](/docs/templates/legacy_json_templates/builders). + templates](/packer/docs/templates/legacy_json_templates/builders). - `description` (optional) is a string providing a description of what the template does. This output is used only in the [inspect - command](/docs/commands/inspect). + command](/packer/docs/commands/inspect). - `min_packer_version` (optional) is a string that has a minimum Packer version that is required to parse the template. This can be used to ensure @@ -48,20 +48,20 @@ Along with each key, it is noted whether it is required or not. not specified, then no post-processing will be done. For more information on what post-processors do and how they're defined, read the sub-section on [configuring post-processors in - templates](/docs/templates/legacy_json_templates/post-processors). + templates](/packer/docs/templates/legacy_json_templates/post-processors). - `provisioners` (optional) is an array of one or more objects that defines the provisioners that will be used to install and configure software for the machines created by each of the builders. If it is not specified, then no provisioners will be run. For more information on how to define and configure a provisioner, read the sub-section on [configuring provisioners - in templates](/docs/templates/legacy_json_templates/provisioners). + in templates](/packer/docs/templates/legacy_json_templates/provisioners). - `variables` (optional) is an object of one or more key/value strings that defines user variables contained in the template. If it is not specified, then no variables are defined. For more information on how to define and use user variables, read the sub-section on [user variables in - templates](/docs/templates/legacy_json_templates/user-variables). + templates](/packer/docs/templates/legacy_json_templates/user-variables). ## Comments @@ -155,7 +155,7 @@ script to it and run that script using SSH. -> **Note:** This example requires an account with Amazon Web Services. There are a number of parameters which need to be provided for a functional -build to take place. See the [Amazon builder](/plugins/builders/amazon) +build to take place. See the [Amazon builder](/packer/plugins/builders/amazon) documentation for more information. ```json diff --git a/website/content/docs/templates/legacy_json_templates/provisioners.mdx b/website/content/docs/templates/legacy_json_templates/provisioners.mdx index 0b78248cdf2..5ecf6602391 100644 --- a/website/content/docs/templates/legacy_json_templates/provisioners.mdx +++ b/website/content/docs/templates/legacy_json_templates/provisioners.mdx @@ -150,7 +150,7 @@ This example is shown below: As you can see, the `override` key is used. The value of this key is another JSON object where the key is the name of a [builder -definition](/docs/templates/legacy_json_templates/builders). The value of this is in turn +definition](/packer/docs/templates/legacy_json_templates/builders). The value of this is in turn another JSON object. This JSON object simply contains the provisioner configuration as normal. This configuration is merged into the default provisioner configuration. diff --git a/website/content/docs/templates/legacy_json_templates/user-variables.mdx b/website/content/docs/templates/legacy_json_templates/user-variables.mdx index f7eda22a5bd..b3c00d620f4 100644 --- a/website/content/docs/templates/legacy_json_templates/user-variables.mdx +++ b/website/content/docs/templates/legacy_json_templates/user-variables.mdx @@ -19,7 +19,7 @@ environment-specific data, and other types of information out of your templates. This maximizes the portability of the template. Using user variables expects you to know how [configuration -templates](/docs/templates/legacy_json_templates/engine) work. If you don't know how +templates](/packer/docs/templates/legacy_json_templates/engine) work. If you don't know how configuration templates work yet, please read that page first. ## Usage @@ -117,7 +117,7 @@ This will default `soft_versions` to the value of the key The configuration for consul (address, tokens, ...) must be specified as environment variables, as specified in the -[Documentation](https://www.consul.io/docs/commands#environment-variables). +[Documentation](/consul/docs/commands#environment-variables). ## Vault Variables @@ -186,7 +186,7 @@ The full list of available environment variables is: ``` and detailed documentation for usage of each of those variables can be found -[here](https://www.vaultproject.io/docs/commands/#environment-variables). +[here](/vault/docs/commands#environment-variables). ## AWS Secrets Manager Variables diff --git a/website/content/docs/terminology.mdx b/website/content/docs/terminology.mdx index 27036a51929..31bee6ed6f6 100644 --- a/website/content/docs/terminology.mdx +++ b/website/content/docs/terminology.mdx @@ -28,7 +28,7 @@ for quick referencing. artifact is a set of AMI IDs (one per region). For the VMware builder, the artifact is a directory of files comprising the created virtual machine. -- `Builds` are a single task that eventually produces an image for a single +- `Builds` are a single task that eventually produces an artifact for a single platform. Multiple builds run in parallel. Example usage in a sentence: "The Packer build produced an AMI to run our web application." Or: "Packer is running the builds now for VMware, AWS, and VirtualBox." @@ -36,7 +36,7 @@ for quick referencing. - `Builders` are components of Packer that are able to create a machine image for a single platform. Builders read in some configuration and use that to run and generate a machine image. A builder is invoked as part of a build - in order to create the actual resulting images. Example builders include + in order to create the actual resulting artifacts. Example builders include VirtualBox, VMware, and Amazon EC2. - `Commands` are sub-commands for the `packer` program that perform some job. @@ -55,10 +55,10 @@ for quick referencing. - `Provisioners` are components of Packer that install and configure software within a running machine prior to that machine being turned into a static - image. They perform the major work of making the image contain useful + artifact. They perform the major work of making the artifact contain useful software. Example provisioners include shell scripts, Chef, Puppet, etc. -- `Templates` are either [HCL](templates/hcl_templates) or JSON files which +- `Templates` are either [HCL](https://packer.io/templates/hcl_templates) or JSON files which define one or more builds by configuring the various components of Packer. Packer is able to read a template and use that information to create multiple machine images in parallel. diff --git a/website/content/guides/1.7-plugin-upgrade.mdx b/website/content/guides/1.7-plugin-upgrade.mdx index 6e2e849e4c1..9739d054005 100644 --- a/website/content/guides/1.7-plugin-upgrade.mdx +++ b/website/content/guides/1.7-plugin-upgrade.mdx @@ -1,5 +1,7 @@ --- page_title: Upgrading your plugin to use the Packer plugin sdk +description: >- + Learn how to upgrade your plugin to support v1.7.0 and later. --- # Upgrading your plugin to be compatible with Packer v1.7.0 and later @@ -27,7 +29,7 @@ There are two main reasons we wrote the new server type. First, it enables multiple related components, for example a builder and a post-processor that share a hypervisor or cloud, to live together in the same plugin. This helps maintainers who are experts in a specific technology to focus on that technology without having to maintain several repositories that submodule the same common code. You can think of a multi-component plugin as being in some ways analogous to Terraform providers, in the sense that both frequently bundle common resources or components by hypervisor or cloud. -Second, the new server provides the Packer core with structured metadata that allows the new `packer init` feature to work. This data includes semantic versioning that we need to implement the new [`required_plugins`](/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) block, which allows us to ensure that users are using the correct _version_ of their plugin for a given Packer template. If you don't upgrade, your users cannot take advantage of the `packer init` tooling. +Second, the new server provides the Packer core with structured metadata that allows the new `packer init` feature to work. This data includes semantic versioning that we need to implement the new [`required_plugins`](/packer/docs/templates/hcl_templates/blocks/packer#specifying-plugin-requirements) block, which allows us to ensure that users are using the correct _version_ of their plugin for a given Packer template. If you don't upgrade, your users cannot take advantage of the `packer init` tooling. ### How to upgrade the plugin @@ -105,12 +107,12 @@ When you do this, if you install your plugin as `packer-plugin-foo`, the Packer ## Registering multiple components -The goal of this guide is to help you upgrade a single-component plugin to use the new SDK and plugin server; check out our [Plugin Development Basics](/docs/plugins/creation#plugin-development-basics) guide for details on how to add new components to your plugin. +The goal of this guide is to help you upgrade a single-component plugin to use the new SDK and plugin server; check out our [Plugin Development Basics](/packer/docs/plugins/creation#plugin-development-basics) guide for details on how to add new components to your plugin. ## Distributing migrated plugins -Once a plugin has been migrated to use the `packer-plugin-sdk` it can be released as it normally would and used by Packer by [installing the plugin](/docs/plugins#installing-plugins) manually into the Packer plugin directory. But this method will not allow your users to take advantage of the `packer init` command. +Once a plugin has been migrated to use the `packer-plugin-sdk` it can be released as it normally would and used by Packer by [installing the plugin](/packer/docs/plugins#installing-plugins) manually into the Packer plugin directory. But this method will not allow your users to take advantage of the `packer init` command. If you want Packer to be able to automatically install your plugin for your users via`packer init` -- the preferred method of installation -- you need to make the plugin available on GitHub in a repository named after the multi-component plugin. `https://github.com//packer-plugin-name`. We recognize that this may require you to rename or fork your plugin repository, but we think that it is worth the inconvenience to reduce ambiguity in the `init` call. -See our documentation on [Creating a GitHub Release](/docs/plugins/creation#creating-a-github-release) for details on the recommended practice for releasing Packer plugins on GitHub. +See our documentation on [Creating a GitHub Release](/packer/docs/plugins/creation#creating-a-github-release) for details on the recommended practice for releasing Packer plugins on GitHub. diff --git a/website/content/guides/1.7-template-upgrade.mdx b/website/content/guides/1.7-template-upgrade.mdx index 32b06c5a138..19d862c258e 100644 --- a/website/content/guides/1.7-template-upgrade.mdx +++ b/website/content/guides/1.7-template-upgrade.mdx @@ -1,5 +1,7 @@ --- page_title: Upgrading your template to use Packer init +description: >- + Use packer init and the required_plugins block to better control plugin usage within Packer templates. Learn how to update your template to work with these new features. --- # Upgrading your template to be compatible with `packer init` @@ -9,10 +11,10 @@ usage within a Packer template configuration. In short, `packer init` will look at the `required_plugins` block definition within a template, and download the correct binaries for that template. For details about how the command works and where the plugins will be installed, please -refer to the [`packer init`](/docs/commands/init) documentation. +refer to the [`packer init`](/packer/docs/commands/init) documentation. -> **Note:** `packer init` is only supported for HCL templates. You can -upgrade legacy JSON templates to HCL using the [hcl2_upgrade](/docs/commands/hcl2_upgrade) command. +upgrade legacy JSON templates to HCL using the [hcl2_upgrade](/packer/docs/commands/hcl2_upgrade) command. ## Updating your template with the `required_plugins` block @@ -25,7 +27,7 @@ won't work if no `required_plugins` is provided. We strongly encourage you to upgrade and start using `required_plugins` block within your templates to manage plugin installation, but if you prefer not to use the `required_plugins` block you can continue to -[install plugins manually](/docs/plugins#installing-plugins). +[install plugins manually](/packer/docs/plugins#installing-plugins). ### What if you only use components that are built into the Packer core? @@ -48,7 +50,7 @@ that the plugin is ready for use with `packer init`: `packer init`. If the repository has a name that references a specific Packer component (for example, `packer-provisioner-*`, `packer-builder-*`, or `packer-post-processor-*`) then the plugin likely still needs to be upgraded to be compatible with `packer init`. Reach out to your plugin maintainer to request that they upgrade; the - Packer team has written a maintainer-focused guide [here](/guides/1.7-plugin-upgrade). + Packer team has written a maintainer-focused guide [here](/packer/guides/1.7-plugin-upgrade). If the plugin(s) have been upgraded, then they can be used with the `required_plugins` block in your upgraded template. @@ -60,10 +62,10 @@ in touch with all currently known plugin maintainers to provide support during t If you are willing to upgrade your template but found out that the plugin you are using hasn't been upgraded yet, we suggest you reach out to the plugin maintainers and ask for an upgrade; the Packer team has written a -maintainer-focused guide [here](/guides/1.7-plugin-upgrade). +maintainer-focused guide [here](/packer/guides/1.7-plugin-upgrade). Check the table below to better understand whether your plugin is compatible with `packer init`, with manual -installation, or with both for the the Packer version you are using. +installation, or with both for the Packer version you are using. | Packer Core Version | Single Component Plugin - API v4 | Single Component Plugin - API v5.0 | Multi Component Plugin - API v5.0 | | ------------------- | ------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------- | @@ -133,13 +135,13 @@ in the rest of the template. Here it is a brief explanation of each field: -- `version` - Should follow the [version constraints](/docs/templates/hcl_templates/blocks/packer#version-constraints). +- `version` - Should follow the [version constraints](/packer/docs/templates/hcl_templates/blocks/packer#version-constraints). - `source` - Should have the GitHub hostname, the plugin's organizational namespace, and its short name. Packer will be responsible for determining the full GitHub address. For example, if the source is `github.com/sylviamoss/comment`, Packer will download the binaries from `github.com/sylviamoss/packer-plugin-comment`. To learn more about the source field, check out the [Source - Address](/docs/plugins#source-addresses) documentation. + Address](/packer/docs/plugins#source-addresses) documentation. - `local_name`- Can be replaced with whatever you want, and the new value will become the name of the plugin. For example: diff --git a/website/content/guides/automatic-operating-system-installs/autounattend_windows.mdx b/website/content/guides/automatic-operating-system-installs/autounattend_windows.mdx index 9f920a241ae..e36354dd4a2 100644 --- a/website/content/guides/automatic-operating-system-installs/autounattend_windows.mdx +++ b/website/content/guides/automatic-operating-system-installs/autounattend_windows.mdx @@ -23,9 +23,9 @@ for the official documentation. If you are installing the Windows Operating System from a mounted iso as part of your Packer build, you will need to use an Answer file. For example, you're -building an image from scratch using the [vmware-iso](/plugins/builders/vmware/iso), -[virtualbox-iso](/plugins/builders/virtualbox/iso), or -[hyperv-iso](/plugins/builders/hyperv/iso) builders. +building an image from scratch using the [vmware-iso](/packer/plugins/builders/vmware/iso), +[virtualbox-iso](/packer/plugins/builders/virtualbox/iso), or +[hyperv-iso](/packer/plugins/builders/hyperv/iso) builders. If you are not installing the operating system, you won't need to provide an answer file. If you are using a pre-built image @@ -67,7 +67,7 @@ disconnections can fail a build. The chef-maintained bento boxes are a great example of a Windows build that sets up openssh as part of the unattended installation so that Packer can connect using the SSH communicator. The functioning answer files for every -modern Windows version can be found [here](https://github.com/chef/bento/tree/master/packer_templates/windows/answer_files). +modern Windows version can be found [here](https://github.com/chef/bento/tree/master/packer_templates/win_answer_files). Stefan Scherer's [packer-windows repo](https://github.com/StefanScherer/packer-windows) is a great example of Windows builds that set up WinRM as part of the unattended diff --git a/website/content/guides/automatic-operating-system-installs/preseed_ubuntu.mdx b/website/content/guides/automatic-operating-system-installs/preseed_ubuntu.mdx index dedc5cd3690..c5c9ea2040f 100644 --- a/website/content/guides/automatic-operating-system-installs/preseed_ubuntu.mdx +++ b/website/content/guides/automatic-operating-system-installs/preseed_ubuntu.mdx @@ -23,9 +23,9 @@ for the official documentation. If you are installing the operating system from a mounted iso as part of your Packer build, you will need to use a preseed file. For example, you're -building an image from scratch using the [vmware-iso](/plugins/builders/vmware/iso), -[virtualbox-iso](/plugins/builders/virtualbox/iso), or -[hyperv-iso](/plugins/builders/hyperv/iso) builders. +building an image from scratch using the [vmware-iso](/packer/plugins/builders/vmware/iso), +[virtualbox-iso](/packer/plugins/builders/virtualbox/iso), or +[hyperv-iso](/packer/plugins/builders/hyperv/iso) builders. If you are not installing the operating system, you won't need to provide a preseed file. If you are using a pre-built image in a cloud, you don't need to diff --git a/website/content/guides/hcl/index.mdx b/website/content/guides/hcl/index.mdx index 7bdfc2d5a7e..aa8d779b499 100644 --- a/website/content/guides/hcl/index.mdx +++ b/website/content/guides/hcl/index.mdx @@ -1,5 +1,7 @@ --- page_title: Getting started configuring Packer with HCL2 files +description: >- + Use the HCL2 syntax for your Packer templates. Learn about arguments and blocks, comments, and multi-line strings. --- # Introduction to Packer HCL2 diff --git a/website/content/guides/index.mdx b/website/content/guides/index.mdx index 5e5f5915ba2..347e876c167 100644 --- a/website/content/guides/index.mdx +++ b/website/content/guides/index.mdx @@ -14,4 +14,4 @@ please see the [Packer introduction][intro] instead and then continue on to the guides. These guides provide examples for common Packer workflows and actions for users of Packer. -[intro]: /docs/intro +[intro]: /packer/docs/intro diff --git a/website/content/guides/packer-on-cicd/build-image-in-cicd.mdx b/website/content/guides/packer-on-cicd/build-image-in-cicd.mdx index bd998c731be..4efc595153f 100644 --- a/website/content/guides/packer-on-cicd/build-image-in-cicd.mdx +++ b/website/content/guides/packer-on-cicd/build-image-in-cicd.mdx @@ -1,5 +1,7 @@ --- page_title: Build Images in CI/CD +description: >- + Learn how to build Packer images within a continuous integration / continuous delivery pipeline. --- # Build Images in CI/CD @@ -10,18 +12,18 @@ images with Packer. - [How to Build Immutable Infrastructure with Packer and CircleCI Workflows](https://circleci.com/blog/how-to-build-immutable-infrastructure-with-packer-and-circleci-workflows/) - [Using Packer and Ansible to Build Immutable Infrastructure in CodeShip](https://blog.codeship.com/packer-ansible/) -The majority of the [Packer Builders](/docs/builders) can run just fine in a +The majority of the [Packer Builders](/packer/docs/builders) can run just fine in a container, a common model used by most CI/CD services. However, while it is possible to run many builders in containers or nested virtualization, this may require advanced configuration; examples include the [QEMU -builder](/plugins/builders/qemu) for +builder](/packer/plugins/builders/qemu) for [KVM](https://www.linux-kvm.org/page/Main_Page) or [Xen](https://www.xenproject.org/), the [VirtualBox -builder](/plugins/builders/virtualbox) for OVA or OVF virtual machines, and the -[VMware builder](/plugins/builders/vmware) for use with VMware products that are +builder](/packer/plugins/builders/virtualbox) for OVA or OVF virtual machines, and the +[VMware builder](/packer/plugins/builders/vmware) for use with VMware products that are all designed to run on a bare-metal machine or within nested virtualization. The [Building a VirtualBox Image with Packer in -TeamCity](/guides/packer-on-cicd/build-virtualbox-image) guide shows +TeamCity](/packer/guides/packer-on-cicd/build-virtualbox-image) guide shows how to create a VirtualBox image using TeamCity's support for running scripts on bare-metal machines. diff --git a/website/content/guides/packer-on-cicd/build-virtualbox-image.mdx b/website/content/guides/packer-on-cicd/build-virtualbox-image.mdx index d2445d04207..69e47018409 100644 --- a/website/content/guides/packer-on-cicd/build-virtualbox-image.mdx +++ b/website/content/guides/packer-on-cicd/build-virtualbox-image.mdx @@ -1,5 +1,7 @@ --- page_title: Build a VirtualBox Image with Packer in TeamCity +description: >- + Use Packer to build VirtualBox images in TeamCity. Learn how to provision a bare-metal machine, install dependencies, and create and run a build in TeamCity. --- # Build a VirtualBox Image with Packer in TeamCity @@ -12,7 +14,7 @@ The Packer VirtualBox builder requires access to VirtualBox. Virtualization is not universally supported on cloud instances, so we recommend you run these builds on either a bare metal server, or cloud instances which support nested virtualization, such as Azure or GCP. This is also true for the -[VMware](/plugins/builders/vmware) and the [QEMU](/plugins/builders/qemu) +[VMware](/packer/plugins/builders/vmware) and the [QEMU](/packer/plugins/builders/qemu) Packer builders. We will use Chef's [Bento boxes](https://github.com/chef/bento) to provision an @@ -71,7 +73,7 @@ $ dpkg -i virtualbox-5.2_5.2.2-119230~Ubuntu~xenial_amd64.deb ``` You can also use the [`remote-exec` -provisioner](https://www.terraform.io/docs/provisioners/remote-exec.html) in +provisioner](/terraform/docs/provisioners/remote-exec) in your Terraform configuration to automatically run these commands when provisioning the new instance. @@ -79,7 +81,7 @@ provisioning the new instance. The TeamCity Agent machine will also need Packer Installed. You can find the latest download link from the [Packer -Download](/downloads) page. +Download](/packer/downloads) page. ```shell-session $ curl -OL "https://releases.hashicorp.com/packer/1.1.2/packer_1.1.2_linux_amd64.zip" @@ -127,10 +129,10 @@ This will use the `build` command in Packer to build the image defined in using is a fork of [Chef/Bento](https://github.com/chef/bento). Packer defaults to building VirtualBox machines by launching a GUI that shows the console. Since this will run in CI/CD, use the [`headless` -variable](/plugins/builders/virtualbox/iso#headless) to instruct Packer to +variable](/packer/plugins/builders/virtualbox/iso#headless) to instruct Packer to start the machine without the console. Packer can build multiple image types, so the [`-only=virtualbox-iso` -option](/docs/commands/build#only-foo-bar-baz) instructs Packer to only +option](/packer/docs/commands/build#only-foo-bar-baz) instructs Packer to only build the builds with the name `virtualbox-iso`. ## 6. Run a build in TeamCity diff --git a/website/content/guides/packer-on-cicd/index.mdx b/website/content/guides/packer-on-cicd/index.mdx index 24719d95466..d083ed47668 100644 --- a/website/content/guides/packer-on-cicd/index.mdx +++ b/website/content/guides/packer-on-cicd/index.mdx @@ -1,5 +1,7 @@ --- page_title: Build Immutable Infrastructure with Packer in CI/CD +description: >- + Learn how to use Packer to build immutable infrastructure within a continuous integration / continuous delivery pipeline. --- # Build Immutable Infrastructure with Packer in CI/CD @@ -10,6 +12,6 @@ implemented with a variety of technologies. The goal of this guide is to show how this workflow can be fully automated using Packer for building images from a continuous integration/continuous deployment (CI/CD) pipeline. -1. [Build Images using Packer in CI/CD](/guides/packer-on-cicd/build-image-in-cicd) -2. [Upload the new image to S3](/guides/packer-on-cicd/upload-images-to-artifact) for future deployment or use during development -3. [Create new Terraform Enterprise runs](/guides/packer-on-cicd/trigger-tfe) to provision new instances with the images +1. [Build Images using Packer in CI/CD](/packer/guides/packer-on-cicd/build-image-in-cicd) +2. [Upload the new image to S3](/packer/guides/packer-on-cicd/upload-images-to-artifact) for future deployment or use during development +3. [Create new Terraform Enterprise runs](/packer/guides/packer-on-cicd/trigger-tfe) to provision new instances with the images diff --git a/website/content/guides/packer-on-cicd/pipelineing-builds.mdx b/website/content/guides/packer-on-cicd/pipelineing-builds.mdx index 53729d61315..2a7e6921094 100644 --- a/website/content/guides/packer-on-cicd/pipelineing-builds.mdx +++ b/website/content/guides/packer-on-cicd/pipelineing-builds.mdx @@ -1,8 +1,7 @@ --- page_title: Packer Build Pipelines -description: |- - Here we explore how to break your builds into discrete steps so that your - builds can be shorter and more reliable. +description: >- + Learn how to shorten Packer build times and improve reliability. Start from an ISO, customize using the virtualbox-ovf builder, and improve efficiency. --- # Why Create a Template Pipeline? @@ -117,7 +116,7 @@ build { In order to build using this template, create a directory named "http" in your current working directory. Copy the minimal example from our -[preseed guide](https://packer.io/guides/automatic-operating-system-installs/preseed_ubuntu#examples) +[preseed guide](/packer/guides/automatic-operating-system-installs/preseed_ubuntu#examples) into a file in your http directory and name it "ubuntu_preseed.cfg". Copy the above json template into your current working directory and save it as "example_virtualbox_iso.json" @@ -127,7 +126,7 @@ To run the build, call `packer build example_virtualbox_iso.json`. This example does not set the output_directory or output_filename, so the file will be placed in a default name of "output-virtualbox-iso/vbox-example.ovf" -- the builder will print this file name to the UI output, but in this example the -[manifest](/docs/post-processors/manifest) post-processor +[manifest](/packer/docs/post-processors/manifest) post-processor to will store build information, including the names of the output files, in a json file named "stage-1-manifest.json". From there, you can programmatically look up the output file information. @@ -135,7 +134,7 @@ look up the output file information. ## Customizing the iso using the virtualbox-ovf builder That output filename generated in the first stage can be used as the -[source_path](/plugins/builders/virtualbox/ovf#source_path) +[source_path](/packer/plugins/builders/virtualbox/ovf#source_path) for the virtualbox-ovf builder. diff --git a/website/content/guides/packer-on-cicd/trigger-tfe.mdx b/website/content/guides/packer-on-cicd/trigger-tfe.mdx index 6afe4bccc47..14b2643bd1e 100644 --- a/website/content/guides/packer-on-cicd/trigger-tfe.mdx +++ b/website/content/guides/packer-on-cicd/trigger-tfe.mdx @@ -1,5 +1,7 @@ --- page_title: Trigger Terraform Enterprise runs +description: >- + Learn how to Terraform Enterprise from your CI/CD pipeline to provision infrastructure. --- # Create Terraform Enterprise Runs @@ -10,7 +12,7 @@ and used locally in development, like is often done with VirtualBox images with Vagrant. In most other cases, the new image will be used to provision new infrastructure. -[Terraform](https://www.terraform.io/) is an open source tool that is ideal for +[Terraform](https://www.terraform.io/) is a community tool that is ideal for provisioning new infrastructure with images generated by Packer, and [Terraform Enterprise](https://www.hashicorp.com/products/terraform/) is the best way to perform automated Terraform runs. @@ -46,12 +48,12 @@ complete and uploaded. 1. Add a new step to the CI/CD pipeline. 2. In the new step add a `curl` call to update the variables in the workspace using the [update variables - API](https://www.terraform.io/docs/enterprise/api/variables.html#update-variables), + API](/terraform/docs/enterprise/api/variables#update-variables), so that Terraform has a reference to the latest image. For the sample configuration above, the `aws_ami_id` variable should be updated to the AMI ID of the latest image. 3. In that same step, add another `curl` call to [create a new run via the - API](https://www.terraform.io/docs/enterprise/api/run.html#create-a-run). + API](/terraform/docs/enterprise/api/run#create-a-run). A run performs a plan and apply on the last configuration version created, using the variables set in the workspace. In the previous step we update the variables, so the new run can be created using the previous configuration diff --git a/website/content/guides/packer-on-cicd/upload-images-to-artifact.mdx b/website/content/guides/packer-on-cicd/upload-images-to-artifact.mdx index f0486e7a214..6728a193382 100644 --- a/website/content/guides/packer-on-cicd/upload-images-to-artifact.mdx +++ b/website/content/guides/packer-on-cicd/upload-images-to-artifact.mdx @@ -1,5 +1,7 @@ --- page_title: Upload VirtualBox Image to S3 +description: >- + Learn how to upload a VirtualBox image built with Packer to S3 within a TeamCity build. --- # Upload VirtualBox Image to S3 diff --git a/website/content/partials/datasource/hcp-packer-artifact/Config-not-required.mdx b/website/content/partials/datasource/hcp-packer-artifact/Config-not-required.mdx new file mode 100644 index 00000000000..f8b0957fe28 --- /dev/null +++ b/website/content/partials/datasource/hcp-packer-artifact/Config-not-required.mdx @@ -0,0 +1,6 @@ + + +- `component_type` (string) - The specific Packer builder used to create the artifact. + For example, "amazon-ebs.example" + + diff --git a/website/content/partials/datasource/hcp-packer-artifact/Config-required.mdx b/website/content/partials/datasource/hcp-packer-artifact/Config-required.mdx new file mode 100644 index 00000000000..2053ddc1d66 --- /dev/null +++ b/website/content/partials/datasource/hcp-packer-artifact/Config-required.mdx @@ -0,0 +1,22 @@ + + +- `bucket_name` (string) - The name of the bucket your artifact is in. + +- `channel_name` (string) - The name of the channel to use when retrieving your artifact. + Either `channel_name` or `version_fingerprint` MUST be set. + If using several artifacts from a single version, you may prefer sourcing a version first, + and referencing it for subsequent uses, as every `hcp_packer_artifact` with the channel set will generate a + potentially billable HCP Packer request, but if several `hcp_packer_artifact`s use a shared `hcp_packer_version` + that will only generate one potentially billable request. + +- `version_fingerprint` (string) - The fingerprint of the version to use when retrieving your artifact. + Either this or `channel_name` MUST be set. + Mutually exclusive with `channel_name` + +- `platform` (string) - The name of the platform that your artifact is for. + For example, "aws", "azure", or "gce". + +- `region` (string) - The name of the region your artifact is in. + For example "us-east-1". + + diff --git a/website/content/partials/datasource/hcp-packer-artifact/DatasourceOutput.mdx b/website/content/partials/datasource/hcp-packer-artifact/DatasourceOutput.mdx new file mode 100644 index 00000000000..dcd90f59092 --- /dev/null +++ b/website/content/partials/datasource/hcp-packer-artifact/DatasourceOutput.mdx @@ -0,0 +1,31 @@ + + +- `platform` (string) - The name of the platform that the artifact exists in. + For example, "aws", "azure", or "gce". + +- `component_type` (string) - The specific Packer builder or post-processor used to create the artifact. + +- `created_at` (string) - The date and time at which the artifact was created. + +- `build_id` (string) - The ID of the build that created the artifact. This is a ULID, which is a + unique identifier similar to a UUID. It is created by the HCP Packer + Registry when a build is first created, and is unique to this build. + +- `version_id` (string) - The version ID. This is a ULID, which is a unique identifier similar + to a UUID. It is created by the HCP Packer Registry when a version is + first created, and is unique to this version. + +- `channel_id` (string) - The ID of the channel used to query the version. This value will be empty if the `version_fingerprint` was used + directly instead of a channel. + +- `packer_run_uuid` (string) - The UUID associated with the Packer run that created this artifact. + +- `external_identifier` (string) - Identifier or URL of the remote artifact as given by a build. + For example, ami-12345. + +- `region` (string) - The region as given by `packer build`. eg. "ap-east-1". + For locally managed clouds, this may map instead to a cluster, server or datastore. + +- `labels` (map[string]string) - The key:value metadata labels associated with this build. + + diff --git a/website/content/partials/datasource/hcp-packer-image/Config-required.mdx b/website/content/partials/datasource/hcp-packer-image/Config-required.mdx index cca6bec0984..95abfd1fe85 100644 --- a/website/content/partials/datasource/hcp-packer-image/Config-required.mdx +++ b/website/content/partials/datasource/hcp-packer-image/Config-required.mdx @@ -7,9 +7,9 @@ Mutually exclusive with `iteration_id`. If using several images from a single iteration, you may prefer sourcing an iteration first, and referencing it for subsequent uses, - as every `hcp_packer_image` with the channel set will generate a + as every `hcp-packer-image` with the channel set will generate a potentially billable HCP Packer request, but if several - `hcp_packer_image`s use a shared `hcp_packer_iteration` that will + `hcp-packer-image`s use a shared `hcp-packer-iteration` that will only generate one potentially billable request. - `iteration_id` (string) - The ID of the iteration to use when retrieving your image diff --git a/website/content/partials/datasource/hcp-packer-version/Config-required.mdx b/website/content/partials/datasource/hcp-packer-version/Config-required.mdx new file mode 100644 index 00000000000..f97aced7e3c --- /dev/null +++ b/website/content/partials/datasource/hcp-packer-version/Config-required.mdx @@ -0,0 +1,7 @@ + + +- `bucket_name` (string) - The bucket name in the HCP Packer Registry. + +- `channel_name` (string) - The channel name in the given bucket to use for retrieving the version. + + diff --git a/website/content/partials/datasource/hcp-packer-version/DatasourceOutput.mdx b/website/content/partials/datasource/hcp-packer-version/DatasourceOutput.mdx new file mode 100644 index 00000000000..3a14240ce03 --- /dev/null +++ b/website/content/partials/datasource/hcp-packer-version/DatasourceOutput.mdx @@ -0,0 +1,25 @@ + + +- `author_id` (string) - Name of the author who created this version. + +- `bucket_name` (string) - The name of the bucket that this version is associated with. + +- `status` (string) - Current state of the version. + +- `created_at` (string) - The date the version was created. + +- `fingerprint` (string) - The fingerprint of the version; this is a unique identifier set by the Packer build + that created this version. + +- `id` (string) - The version ID. This is a ULID, which is a unique identifier similar + to a UUID. It is created by the HCP Packer Registry when a version is + first created, and is unique to this version. + +- `name` (string) - The version name is created by the HCP Packer Registry once a version is + "complete". Incomplete or failed versions currently default to having a name "v0". + +- `updated_at` (string) - The date when this version was last updated. + +- `channel_id` (string) - The ID of the channel used to query this version. + + diff --git a/website/content/partials/from-1.5/beta-hcl2-note.mdx b/website/content/partials/from-1.5/beta-hcl2-note.mdx index 3d95218b6fa..190ee93e6ea 100644 --- a/website/content/partials/from-1.5/beta-hcl2-note.mdx +++ b/website/content/partials/from-1.5/beta-hcl2-note.mdx @@ -2,6 +2,6 @@ were first introduced as a beta feature into Packer version 1.5. As of v1.7, HCL2 support is no longer in beta, and is the preferred way to write Packer configuration. For the old-style stable configuration language see -[template docs](/docs/templates/legacy_json_templates). As of v1.6.2, you can +[template docs](/packer/docs/templates/legacy_json_templates). As of v1.6.2, you can convert your legacy JSON template into an HCL2 config file using the -[hcl2_upgrade command](/docs/commands/hcl2_upgrade). +[hcl2_upgrade command](/packer/docs/commands/hcl2_upgrade). diff --git a/website/content/partials/from-1.5/legacy-json-warning.mdx b/website/content/partials/from-1.5/legacy-json-warning.mdx index 0ca7245b738..026ac2368d9 100644 --- a/website/content/partials/from-1.5/legacy-json-warning.mdx +++ b/website/content/partials/from-1.5/legacy-json-warning.mdx @@ -3,4 +3,4 @@ templates are still supported by the Packer core, but new features added to the Packer core may not be implemented for JSON templates. We recommend you transition to HCL templates as soon as is convenient for you, in order to have the best possible experience with Packer. To help you upgrade your templates, -we have written an [hcl2_upgrade command](/docs/commands/hcl2_upgrade) command. +we have written an [hcl2_upgrade command](/packer/docs/commands/hcl2_upgrade) command. diff --git a/website/content/partials/from-1.5/variables/custom-validation.mdx b/website/content/partials/from-1.5/variables/custom-validation.mdx index c875a28d499..c89806fe1dd 100644 --- a/website/content/partials/from-1.5/variables/custom-validation.mdx +++ b/website/content/partials/from-1.5/variables/custom-validation.mdx @@ -24,7 +24,7 @@ The expression can refer only to the variable that the condition applies to, and _must not_ produce errors. If the failure of an expression is the basis of the validation decision, use -[the `can` function](/docs/templates/hcl_templates/functions/conversion/can) to detect such errors. For example: +[the `can` function](/packer/docs/templates/hcl_templates/functions/conversion/can) to detect such errors. For example: ```hcl variable "image_id" { diff --git a/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx index 622e739c1eb..74a6556eebf 100644 --- a/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx @@ -18,3 +18,5 @@ initialize the operating system installer. Special keys can be typed as well, and are covered in the section below on the boot command. If this is not specified, it is assumed the installer will start itself. + + diff --git a/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx b/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx index 52efd6fff27..3faa491f04d 100644 --- a/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx @@ -125,4 +125,6 @@ boot_command = [ ``` For more examples of various boot commands, see the sample projects from our -[community templates page](/community-tools#templates). +[community templates page](https://packer.io/community-tools#templates). + + diff --git a/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx index 0c9b8b381f3..c65d8ae5d48 100644 --- a/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx @@ -4,3 +4,5 @@ when this is true. Defaults to false. - `boot_key_interval` (duration string | ex: "1h5m2s") - Time in ms to wait between each key press + + diff --git a/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx b/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx index 0eb6bcd13f8..d699fdab36c 100644 --- a/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx @@ -7,3 +7,5 @@ Keystrokes are typed as separate key up/down events over VNC with a default 100ms delay. The delay alleviates issues with latency and CPU contention. You can tune this delay on a per-builder basis by specifying "boot_key_interval" in your Packer template. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/Config-not-required.mdx b/website/content/partials/packer-plugin-sdk/communicator/Config-not-required.mdx index 43413e44830..d7a9db5f99d 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/Config-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/Config-not-required.mdx @@ -26,3 +26,5 @@ can connect, as normal. But once a connection attempt is successful, it will disconnect and then wait 10 minutes before connecting to the guest and beginning provisioning. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/Config.mdx b/website/content/partials/packer-plugin-sdk/communicator/Config.mdx index b569865c0db..adc4de37d48 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/Config.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/Config.mdx @@ -3,3 +3,5 @@ Config is the common configuration a builder uses to define and configure a Packer communicator. Embed this struct in your builder config to implement communicator support. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSH-not-required.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSH-not-required.mdx index 61b1be6ac7c..7655eaa19b5 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/SSH-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/SSH-not-required.mdx @@ -9,7 +9,7 @@ - `ssh_password` (string) - A plaintext password to use to authenticate with SSH. -- `ssh_ciphers` ([]string) - This overrides the value of ciphers supported by default by Go. +- `ssh_ciphers` ([]string) - This overrides the value of ciphers supported by default by Golang. The default value is [ "aes128-gcm@openssh.com", "chacha20-poly1305@openssh.com", @@ -28,8 +28,8 @@ (unless the user has set the `-debug` flag). Defaults to "false"; currently only works on guests with `sed` installed. -- `ssh_key_exchange_algorithms` ([]string) - If set, Packer will override the value of key exchange (kex) altorighms - supported by default by Go. Acceptable values include: +- `ssh_key_exchange_algorithms` ([]string) - If set, Packer will override the value of key exchange (kex) algorithms + supported by default by Golang. Acceptable values include: "curve25519-sha256@libssh.org", "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "diffie-hellman-group14-sha1", and "diffie-hellman-group1-sha1". @@ -44,11 +44,12 @@ - `ssh_timeout` (duration string | ex: "1h5m2s") - The time to wait for SSH to become available. Packer uses this to determine when the machine has booted so this is usually quite long. Example value: `10m`. + This defaults to `5m`, unless `ssh_handshake_attempts` is set. - `ssh_disable_agent_forwarding` (bool) - If true, SSH agent forwarding will be disabled. Defaults to `false`. -- `ssh_handshake_attempts` (int) - The number of handshakes to attempt with SSH once it can connect. This - defaults to `10`. +- `ssh_handshake_attempts` (int) - The number of handshakes to attempt with SSH once it can connect. + This defaults to `10`, unless a `ssh_timeout` is set. - `ssh_bastion_host` (string) - A bastion host to use for the actual SSH connection. @@ -73,6 +74,11 @@ - `ssh_file_transfer_method` (string) - `scp` or `sftp` - How to transfer files, Secure copy (default) or SSH File Transfer Protocol. + + **NOTE**: Guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp + (the default protocol for copying data) returns a non-zero error code since the MOTW + cannot be set, which cause any file transfer to fail. As a workaround you can override the transfer protocol + with SFTP instead `ssh_file_transfer_protocol = "sftp"`. - `ssh_proxy_host` (string) - A SOCKS proxy host to use for SSH connection @@ -92,3 +98,5 @@ - `ssh_remote_tunnels` ([]string) - - `ssh_local_tunnels` ([]string) - + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSH.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSH.mdx new file mode 100644 index 00000000000..1749b71b82a --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/communicator/SSH.mdx @@ -0,0 +1,5 @@ + + +The SSH config defines configuration for the SSH communicator. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSHInterface-not-required.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSHInterface-not-required.mdx index a62a267c4cd..8a853482f34 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/SSHInterface-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/SSHInterface-not-required.mdx @@ -16,3 +16,5 @@ Useful on dual stacked instances where the default behavior is to connect via whichever IP address is returned first from the OpenStack API. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSHInterface.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSHInterface.mdx new file mode 100644 index 00000000000..2a49158b246 --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/communicator/SSHInterface.mdx @@ -0,0 +1,6 @@ + + +SSHInterface defines whether to use public or private, addresses, and whether +to use IPv4 or IPv6. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx index bc173365040..f0f5813ab42 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair-not-required.mdx @@ -13,3 +13,5 @@ bits. Attempting to use bit lengths other than these three values for ECDSA keys will fail. Ed25519 keys have a fixed length and bits will be ignored. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair.mdx b/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair.mdx index df1a1265863..61a6e430314 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/SSHTemporaryKeyPair.mdx @@ -1,5 +1,7 @@ -When no SSH credentials are specified, Packer will generate a temporary SSH +When no ssh credentials are specified, Packer will generate a temporary SSH keypair for the instance. You can change the algorithm type and bits settings. + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/WinRM-not-required.mdx b/website/content/partials/packer-plugin-sdk/communicator/WinRM-not-required.mdx index 6e51877e350..f6b5de07df0 100644 --- a/website/content/partials/packer-plugin-sdk/communicator/WinRM-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/communicator/WinRM-not-required.mdx @@ -5,10 +5,10 @@ - `winrm_password` (string) - The password to use to connect to WinRM. - `winrm_host` (string) - The address for WinRM to connect to. - + NOTE: If using an Amazon EBS builder, you can specify the interface WinRM connects to via - [`ssh_interface`](/plugins/builders/amazon/ebs#ssh_interface) + [`ssh_interface`](/packer/plugins/builders/amazon/ebs#ssh_interface) - `winrm_no_proxy` (bool) - Setting this to `true` adds the remote `host:port` to the `NO_PROXY` environment variable. This has the effect of @@ -30,4 +30,6 @@ for WinRM, rather than default (basic authentication), removing the requirement for basic authentication to be enabled within the target guest. Further reading for remote connection authentication can be found - [here](). + [here](https://msdn.microsoft.com/en-us/library/aa384295(v=vs.85).aspx). + + diff --git a/website/content/partials/packer-plugin-sdk/communicator/WinRM.mdx b/website/content/partials/packer-plugin-sdk/communicator/WinRM.mdx new file mode 100644 index 00000000000..82309b7b3c7 --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/communicator/WinRM.mdx @@ -0,0 +1,5 @@ + + +The WinRM config defines configuration for the WinRM communicator. + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx index d07273c70ea..686caf335e7 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx @@ -44,4 +44,22 @@ * hdiutil (normally found in macOS) * oscdimg (normally found in Windows as part of the Windows ADK) +- `cd_content` (map[string]string) - Key/Values to add to the CD. The keys represent the paths, and the values + contents. It can be used alongside `cd_files`, which is useful to add large + files without loading them into memory. If any paths are specified by both, + the contents in `cd_content` will take precedence. + + Usage example (HCL): + + ```hcl + cd_files = ["vendor-data"] + cd_content = { + "meta-data" = jsonencode(local.instance_data) + "user-data" = templatefile("user-data", { packages = ["nginx"] }) + } + cd_label = "cidata" + ``` + - `cd_label` (string) - CD Label + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx index 5a59e6eaf02..087804a6bdc 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx @@ -9,3 +9,5 @@ second CD device. This config exists to work around modern operating systems that have no way to mount floppy disks, which was our previous go-to for adding files at boot time. + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig-not-required.mdx index 607c6844831..325b13f40a7 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig-not-required.mdx @@ -13,4 +13,23 @@ characters (\\*, ?, and \[\]) are allowed. The maximum summary size of all files in the listed directories are the same as in `floppy_files`. +- `floppy_content` (map[string]string) - Key/Values to add to the floppy disk. The keys represent the paths, and + the values contents. It can be used alongside `floppy_files` or + `floppy_dirs`, which is useful to add large files without loading them + into memory. If any paths are specified by both, the contents in + `floppy_content` will take precedence. + + Usage example (HCL): + + ```hcl + floppy_files = ["vendor-data"] + floppy_content = { + "meta-data" = jsonencode(local.instance_data) + "user-data" = templatefile("user-data", { packages = ["nginx"] }) + } + floppy_label = "cidata" + ``` + - `floppy_label` (string) - Floppy Label + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig.mdx index e906b9ec8da..b7c307c32cc 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/FloppyConfig.mdx @@ -7,4 +7,6 @@ this setting get placed into the root directory of the floppy and the floppy is attached as the first floppy device. The summary size of the listed files must not exceed 1.44 MB. The supported ways to move large files into the OS are using `http_directory` or [the file -provisioner](/docs/provisioners/file). +provisioner](/packer/docs/provisioners/file). + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx index 44aec2280e7..b3cdfc96adc 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx @@ -1,9 +1,11 @@ -Packer will create an HTTP server serving `http_directory` when it is set, a +Packer will create an http server serving `http_directory` when it is set, a random free port will be selected and the architecture of the directory referenced will be available in your builder. Example usage from a builder: `wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/foo/bar/preseed.cfg` + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx index cd3a59aa277..63950176e8a 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx @@ -11,3 +11,5 @@ checksum as its name. - `iso_target_extension` (string) - The extension of the iso file after download. This defaults to `iso`. + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx index c2b104b6dc3..b8598ce3b21 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx @@ -23,3 +23,5 @@ - `iso_url` (string) - A URL to the ISO containing the installation image or virtual hard drive (VHD or VHDX) file to clone. + + diff --git a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig.mdx b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig.mdx index 87e8030d1be..58293cd774d 100644 --- a/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/multistep/commonsteps/ISOConfig.mdx @@ -60,3 +60,5 @@ In HCL2: iso_checksum = "file:./shasums.txt", iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" ``` + + diff --git a/website/content/partials/packer-plugin-sdk/provisioners/common-config.mdx b/website/content/partials/packer-plugin-sdk/provisioners/common-config.mdx new file mode 100644 index 00000000000..15cd1b81465 --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/provisioners/common-config.mdx @@ -0,0 +1,68 @@ +Parameters common to all provisioners: + +- `pause_before` (duration) - Sleep for duration before execution. + +- `max_retries` (int) - Max times the provisioner will retry in case of failure. Defaults to zero (0). Zero means an error will not be retried. + +- `only` (array of string) - Only run the provisioner for listed builder(s) + by name. + +- `override` (object) - Override the builder with different settings for a + specific builder, eg : + + In HCL2: + + ```hcl + source "null" "example1" { + communicator = "none" + } + + source "null" "example2" { + communicator = "none" + } + + build { + sources = ["source.null.example1", "source.null.example2"] + provisioner "shell-local" { + inline = ["echo not overridden"] + override = { + example1 = { + inline = ["echo yes overridden"] + } + } + } + } + ``` + + In JSON: + + ```json + { + "builders": [ + { + "type": "null", + "name": "example1", + "communicator": "none" + }, + { + "type": "null", + "name": "example2", + "communicator": "none" + } + ], + "provisioners": [ + { + "type": "shell-local", + "inline": ["echo not overridden"], + "override": { + "example1": { + "inline": ["echo yes overridden"] + } + } + } + ] + } + ``` + +- `timeout` (duration) - If the provisioner takes more than for example + `1h10m1s` or `10m` to finish, the provisioner will timeout and fail. diff --git a/website/content/partials/packer-plugin-sdk/provisioners/shell-config.mdx b/website/content/partials/packer-plugin-sdk/provisioners/shell-config.mdx new file mode 100644 index 00000000000..009040c5b96 --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/provisioners/shell-config.mdx @@ -0,0 +1,30 @@ +The reference of available configuration options is listed below. The only +required element is either "inline" or "script". Every other option is +optional. + +Exactly _one_ of the following is required: + +- `inline` (array of strings) - This is an array of commands to execute. The + commands are concatenated by newlines and turned into a single file, so + they are all executed within the same context. This allows you to change + directories in one command and use something in the directory in the next + and so on. Inline scripts are the easiest way to pull off simple tasks + within the machine. + +- `script` (string) - The path to a script to upload and execute in the + machine. This path can be absolute or relative. If it is relative, it is + relative to the working directory when Packer is executed. + +- `scripts` (array of strings) - An array of scripts to execute. The scripts + will be uploaded and executed in the order specified. Each script is + executed in isolation, so state such as variables from one script won't + carry on to the next. + +Optional parameters: + +- `binary` (boolean) - If true, specifies that the script(s) are binary + files, and Packer should therefore not convert Windows line endings to Unix + line endings (if there are any). By default this is false. + +- `valid_exit_codes` (list of ints) - Valid exit codes for the script. By + default this is just 0. diff --git a/website/content/partials/packer-plugin-sdk/provisioners/unmaintained-plugin.mdx b/website/content/partials/packer-plugin-sdk/provisioners/unmaintained-plugin.mdx new file mode 100644 index 00000000000..f59f4b39804 --- /dev/null +++ b/website/content/partials/packer-plugin-sdk/provisioners/unmaintained-plugin.mdx @@ -0,0 +1 @@ +~> **This community maintained provisioner is currently unmaintained**; if you are interested in contributing or taking ownership of it, please reach out to us at [packer@hashicorp.com](mailto://packer@hashicorp.com). More details can be found in the [README](https://github.com/hashicorp/packer/blob/master/README.md#unmaintained-plugins). diff --git a/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx b/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx index 8e83e72a1bb..9cabd8e00c3 100644 --- a/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx +++ b/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx @@ -13,3 +13,5 @@ virtual machine to actually shut down. If the machine doesn't shut down in this time it is considered an error. By default, the time out is "5m" (five minutes). + + diff --git a/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx b/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx index 2221fc1840e..51ceae9abea 100644 --- a/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx +++ b/website/content/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx @@ -8,3 +8,5 @@ consider implementing these options, which we believe are valuable for all builders. It also helps guarantee that option names for similar options are the same across the various builders. Embed it in your builder config using the `mapstructure:",squash"` struct tag. + + diff --git a/website/content/partials/plugins/plugin-location.mdx b/website/content/partials/plugins/plugin-location.mdx index 5fb7e80344c..d8e997c7d44 100644 --- a/website/content/partials/plugins/plugin-location.mdx +++ b/website/content/partials/plugins/plugin-location.mdx @@ -1,58 +1,25 @@ -Plugins will usually be located in the -[PACKER_HOME_DIR](/docs/configure#packer-s-home-directory). +Upon the initialization of Packer, any externally installed plugin will be automatically +discovered and loaded. -* [`packer init`](/docs/commands/init) will install plugins in the **last** directory -in the following numbered list. +Packer plugins will usually be located within a plugins sub-directory under Packer's main config directory +[PACKER_CONFIG_DIR](/packer/docs/configure#packer-s-config-directory). If `PACKER_CONFIG_DIR` is +either not set or empty, a default equal to `$HOME/.config/packer/plugins` on UNIX, or `%APPDATA%\packer.d\plugins` +for Windows, will be used. -* During the initialization of Packer, any plugin required in the -**`required_plugins`** section will be looked up in all entries of the following -list. **First** plugin found takes precedence. Two binaries of the same plugin -with two different version will be considered as two different plugins. Highest -found version matching `required_plugins` will be taken into consideration. +Where applicable, some installation processes such as `packer init` may override the plugin loading process. +Refer to the specific installation guides for any plugin loading overrides. -1. The directory where `packer` is, or the executable directory. -1. The current working directory. (`"."`) -1. The `PACKER_HOME_DIR/plugins` directory. `PACKER_HOME_DIR` refers to *[Packer's home -directory](/docs/configure#packer-s-home-directory)*, if it could be found. -1. The director(y/ies) under the `PACKER_PLUGIN_PATH` env var, if `PACKER_PLUGIN_PATH` -is set. +Packer uses the following process for loading the correct plugin: -~> **Note**: There can be more than one directory in the `PACKER_PLUGIN_PATH` -env var, it will be seperated by a semicolon (`;`) on Windows systems and a -colon (`:`) on other systems. The order priority will be kept. +1. All directories under the `PACKER_PLUGIN_PATH` environment variable, if `PACKER_PLUGIN_PATH` +is set. The `PACKER_PLUGIN_PATH` takes precedences over all other plugin directories; no other directories will be checked. +1. The directory where `packer` is installed, or the executable directory. +1. The current working directory, where `packer build` is being invoked. (`"."`) +1. The `PACKER_CONFIG_DIR/plugins` directory. `PACKER_CONFIG_DIR` refers to *[Packer's config +directory](/packer/docs/configure#packer-s-config-directory)*, if it could be found. -Using the following example : -```hcl - required_plugins { - happycloud = { - version = ">= 2.7.0" - source = "github.com/azr/happycloud" - } - } -``` +-> **Note:** The `PACKER_PLUGIN_PATH` environment variable can be set to more that one directories; +for example, ~/custom-dir-1:~/custom-dir-2. Separate directories in the PATH string using a colon (:) on UNIX systems +and a semicolon (;) on Windows systems. The above example path would be able to find a single or multi-component plugin +in either `~/custom-dir-1/packer/` or `~/custom-dir-2/`. -The plugin getter will then install the binaries in the following location for a -system with no `PACKER_PLUGIN_PATH` env var set. - -* `PACKER_HOME_DIR/plugins/github.com/hashicorp/happycloud/` - -During initialization, on a `darwin_amd64` system, Packer will look-up for the -following files: - -* `PACKER_EXEC_DIR/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `./github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `PACKER_HOME_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `PACKER_PLUGIN_PATH/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `./packer-plugin-happycloud` - -The first plugin-name/version files found will take precedence. - -For plugins located under the `github.com/azr/happycloud/` directory structure an accompanying SHA256SUM file -will be required in order for `packer init` to ensure the plugin being loaded has not been tampered with. -The SHA256SUM file will be automatically generated when a plugin is installed via `packer init` if the plugin -was installed manually into `PACKER_HOME_DIR/plugins/github.com/azr/happycloud/` then the file -`PACKER_HOME_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64_SHA256SUM` must be generated manually as well. - --> Note: `PACKER_HOME_DIR` is not an actual env var and refers to [Packer's home -directory](#packer-s-home-directory). `PACKER_EXEC_DIR` is not an actual env var -and refers to the directory where `packer` is, or the executable directory. diff --git a/website/content/partials/post-processor/manifest/Config-not-required.mdx b/website/content/partials/post-processor/manifest/Config-not-required.mdx index 10f37a6b575..060a79a9205 100644 --- a/website/content/partials/post-processor/manifest/Config-not-required.mdx +++ b/website/content/partials/post-processor/manifest/Config-not-required.mdx @@ -9,7 +9,7 @@ - `strip_time` (bool) - Don't write the `build_time` field from the output. - `custom_data` (map[string]string) - Arbitrary data to add to the manifest. This is a [template - engine](https://packer.io/docs/templates/legacy_json_templates/engine.html). Therefore, you + engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you may use user variables and template functions in this field. diff --git a/website/content/plugins/index.mdx b/website/content/plugins/index.mdx index 0ed8e857a54..92414fcbb3b 100644 --- a/website/content/plugins/index.mdx +++ b/website/content/plugins/index.mdx @@ -6,7 +6,7 @@ page_title: Packer plugins # External Packer Plugins -External Packer plugins are standalone applications that extend Packer functionality without modifying the core source code. Plugins can add new components to Packer, such as builders, provisioners, post-processors, and data sources. Refer to [Packer Plugins](/docs/plugins) for details about installing and developing external plugins. +External Packer plugins are standalone applications that extend Packer functionality without modifying the core source code. Plugins can add new components to Packer, such as builders, provisioners, post-processors, and data sources. Refer to [Packer Plugins](/packer/docs/plugins) for details about installing and developing external plugins. This section contains the documentation for available external Packer plugins. diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index f2c065c3db8..e5423f814c7 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -100,6 +100,10 @@ "title": "Overview", "path": "templates" }, + { + "title": "JSON to HCL2", + "path": "templates/json_to_hcl" + }, { "title": "HCL Templates", "routes": [ @@ -725,6 +729,14 @@ "title": "Overview", "path": "datasources/hcp" }, + { + "title": "Version", + "path": "datasources/hcp/hcp-packer-version" + }, + { + "title": "Artifact", + "path": "datasources/hcp/hcp-packer-artifact" + }, { "title": "Iteration", "path": "datasources/hcp/hcp-packer-iteration" @@ -844,10 +856,6 @@ "title": "Installing Plugins", "path": "plugins/install-plugins" }, - { - "title": "External Plugins", - "href": "/plugins" - }, { "title": "Developing Plugins", "routes": [ @@ -883,6 +891,10 @@ "title": "Integration Program", "path": "partnerships" }, + { + "title": "Community Tools", + "path": "community-tools" + }, { "divider": true }, diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index 68afb049c97..0d4f101c7a3 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -1,358 +1,2 @@ [ - { - "title": "1&1", - "path": "oneandone", - "repo": "hashicorp/packer-plugin-oneandone", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Alibaba Cloud", - "path": "alicloud", - "repo": "hashicorp/packer-plugin-alicloud", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Anka", - "path": "anka", - "repo": "veertuinc/packer-plugin-veertu-anka", - "pluginTier": "community", - "sourceBranch": "master", - "version": "latest" - }, - { - "title": "Ansible", - "path": "ansible", - "repo": "hashicorp/packer-plugin-ansible", - "version": "latest" - }, - { - "title": "Amazon EC2", - "path": "amazon", - "repo": "hashicorp/packer-plugin-amazon", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Azure", - "path": "azure", - "repo": "hashicorp/packer-plugin-azure", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Chef", - "path": "chef", - "repo": "hashicorp/packer-plugin-chef", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "CloudStack", - "path": "cloudstack", - "repo": "hashicorp/packer-plugin-cloudstack", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Converge", - "path": "converge", - "repo": "hashicorp/packer-plugin-converge", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "DigitalOcean", - "path": "digitalocean", - "repo": "digitalocean/packer-plugin-digitalocean", - "pluginTier": "verified", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Docker", - "path": "docker", - "repo": "hashicorp/packer-plugin-docker", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Git", - "path": "git", - "repo": "ethanmdavidson/packer-plugin-git", - "version": "latest", - "sourceBranch": "main" - }, - { - "title": "Google Cloud Platform", - "path": "googlecompute", - "repo": "hashicorp/packer-plugin-googlecompute", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Gridscale", - "path": "gridscale", - "repo": "gridscale/packer-plugin-gridscale", - "version": "latest", - "pluginTier": "verified", - "isHcpPackerReady": false - }, - { - "title": "HashiCups", - "path": "hashicups", - "repo": "hashicorp/packer-plugin-hashicups", - "version": "latest", - "isHcpPackerReady": false - }, - { - "title": "Hetzner Cloud", - "path": "hetzner-cloud", - "repo": "hashicorp/packer-plugin-hcloud", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "HyperOne", - "path": "hyperone", - "repo": "hashicorp/packer-plugin-hyperone", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "Hyper-V", - "path": "hyperv", - "repo": "hashicorp/packer-plugin-hyperv", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "InSpec", - "path": "inspec", - "repo": "hashicorp/packer-plugin-inspec", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "JD Cloud", - "path": "jdcloud", - "repo": "hashicorp/packer-plugin-jdcloud", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Kamatera", - "path": "kamatera", - "repo": "kamatera/packer-plugin-kamatera", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Linode", - "path": "linode", - "repo": "hashicorp/packer-plugin-linode", - "pluginTier": "community", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Libvirt", - "path": "libvirt", - "repo": "thomasklein94/packer-plugin-libvirt", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "LXC", - "path": "lxc", - "repo": "hashicorp/packer-plugin-lxc", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "LXD", - "path": "lxd", - "repo": "hashicorp/packer-plugin-lxd", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Mondoo", - "path": "mondoo", - "repo": "mondoohq/packer-plugin-mondoo", - "pluginTier": "verified", - "version": "latest" - }, - { - "title": "Naver Cloud", - "path": "ncloud", - "repo": "hashicorp/packer-plugin-ncloud", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Nutanix", - "path": "nutanix", - "repo": "nutanix-cloud-native/packer-plugin-nutanix", - "version": "latest", - "sourceBranch": "main" - }, - { - "title": "OpenStack", - "path": "openstack", - "repo": "hashicorp/packer-plugin-openstack", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Oracle", - "path": "oracle", - "repo": "hashicorp/packer-plugin-oracle", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Outscale", - "path": "outscale", - "repo": "outscale/packer-plugin-outscale", - "version": "v1.0.2", - "pluginTier": "verified" - }, - { - "title": "Parallels", - "path": "parallels", - "repo": "hashicorp/packer-plugin-parallels", - "version": "latest" - }, - { - "title": "Profitbricks", - "path": "profitbricks", - "repo": "hashicorp/packer-plugin-profitbricks", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Proxmox", - "path": "proxmox", - "repo": "hashicorp/packer-plugin-proxmox", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Puppet", - "path": "puppet", - "repo": "hashicorp/packer-plugin-puppet", - "version": "latest", - "pluginTier": "community", - "archived": true - }, - { - "title": "QEMU", - "path": "qemu", - "repo": "hashicorp/packer-plugin-qemu", - "version": "latest" - }, - { - "title": "Salt", - "path": "salt", - "repo": "hashicorp/packer-plugin-salt", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "Scaleway", - "path": "scaleway", - "repo": "scaleway/packer-plugin-scaleway", - "pluginTier": "verified", - "version": "latest" - }, - { - "title": "SSH Key", - "path": "sshkey", - "repo": "ivoronin/packer-plugin-sshkey", - "pluginTier": "community", - "version": "v1.0.1" - }, - { - "title": "Tart", - "path": "tart", - "repo": "cirruslabs/packer-plugin-tart", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Tencent Cloud", - "path": "tencentcloud", - "repo": "hashicorp/packer-plugin-tencentcloud", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Triton", - "path": "triton", - "repo": "hashicorp/packer-plugin-triton", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "UCloud", - "path": "ucloud", - "repo": "hashicorp/packer-plugin-ucloud", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "UpCloud", - "path": "upcloud", - "repo": "UpCloudLtd/packer-plugin-upcloud", - "version": "latest", - "pluginTier": "verified", - "sourceBranch": "master", - "isHcpPackerReady": true - }, - { - "title": "Vagrant", - "path": "vagrant", - "repo": "hashicorp/packer-plugin-vagrant", - "pluginTier": "official", - "version": "latest" - }, - { - "title": "VirtualBox", - "path": "virtualbox", - "repo": "hashicorp/packer-plugin-virtualbox", - "version": "latest" - }, - { - "title": "VMware vSphere", - "path": "vsphere", - "repo": "hashicorp/packer-plugin-vsphere", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "VMware", - "path": "vmware", - "repo": "hashicorp/packer-plugin-vmware", - "version": "latest" - }, - { - "title": "Vultr", - "path": "vultr", - "repo": "vultr/packer-plugin-vultr", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Yandex", - "path": "yandex", - "repo": "hashicorp/packer-plugin-yandex", - "version": "latest", - "pluginTier": "community" - } -] \ No newline at end of file +] diff --git a/website/package-lock.json b/website/package-lock.json index a739f371adb..e0082b29ed6 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -8,14 +8,14 @@ "name": "packer-docs", "version": "1.0.0", "devDependencies": { - "@hashicorp/platform-cli": "^2.1.0", + "@hashicorp/platform-cli": "^2.8.0", "dart-linkcheck": "2.0.15", "husky": "4.3.8", "next": "^12.3.1", "prettier": "2.2.1" }, "engines": { - "npm": ">=7.0.0" + "npm": ">=9.6.7" } }, "node_modules/@ampproject/remapping": { @@ -31,17 +31,80 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", @@ -91,28 +154,20 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", - "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", @@ -141,37 +196,34 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", - "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.16.7", - "@babel/types": "^7.17.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -209,11 +261,10 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", + "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", "dev": true, - "peer": true, "engines": { "node": ">=6.9.0" } @@ -231,21 +282,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -275,13 +335,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", - "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -326,13 +386,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -351,9 +411,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -362,6 +422,20 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", + "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.12.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -427,6 +501,18 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz", + "integrity": "sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -471,7 +557,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -522,58 +607,45 @@ } }, "node_modules/@babel/runtime": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", - "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/runtime-corejs3": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.9.tgz", - "integrity": "sha512-WxYHHUWF2uZ7Hp1K+D1xQgbgkGUfA+5UPOegEXGt2Y5SMog/rYCVaifLZDbw8UkNXozEqqrZTy6bglL7xTaCOw==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "dev": true, "dependencies": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", - "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.17.9", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.9", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -591,12 +663,13 @@ } }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -627,49 +700,94 @@ "node": ">=0.1.95" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "dev": true, + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@hashicorp/platform-cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-2.1.0.tgz", - "integrity": "sha512-orPreFHhkFXd84zouNnHvx6C2pT8cM2tTxwPEDkTDx7C2G+GRCQxKtBq+YXxLGj6AZOMa6cuF58eecEWJRW6TA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-2.8.0.tgz", + "integrity": "sha512-OD2o4vIQ4AnWD5ExVr//bZCadI4kRIa3Vk4d/1ugFhiyODlGSem4GEvt7/4hZutrEBOoDgAcKq8wVmWwrP/JiQ==", "dev": true, "dependencies": { - "@hashicorp/platform-cms": "0.3.0", - "@typescript-eslint/eslint-plugin": "5.10.2", - "@typescript-eslint/parser": "5.10.2", + "@hashicorp/platform-cms": "0.4.0", + "@typescript-eslint/eslint-plugin": "^5.48.0", + "@typescript-eslint/parser": "^5.48.0", "chalk": "4.1.0", "commander": "7.2.0", - "ejs": "3.1.5", - "eslint": "8.8.0", - "eslint-config-next": "12.0.10", - "eslint-config-prettier": "8.3.0", - "eslint-plugin-jsx-a11y": "6.5.1", - "eslint-plugin-prettier": "4.0.0", + "ejs": "^3.1.9", + "eslint": "^8.31.0", + "eslint-config-next": "^13.1.1", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-jsx-a11y": "^6.6.1", + "eslint-plugin-prettier": "^4.2.1", "fs-extra": "9.0.1", "globby": "11.0.1", "inquirer": "7.3.3", "lint-staged": "11.1.2", "open": "7.3.0", - "prettier": "2.5.1", + "prettier": "^2.8.7", "readdirp": "3.5.0", "signale": "1.4.0", "slugify": "1.4.6", @@ -688,44 +806,60 @@ } }, "node_modules/@hashicorp/platform-cli/node_modules/prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/@hashicorp/platform-cms": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@hashicorp/platform-cms/-/platform-cms-0.3.0.tgz", - "integrity": "sha512-sRX9A+kDEZvfZy8PvGFbEaHjn5G1mEsHwTri1vDnrmKG8apE+ELlug83b0iEkD5wIJi9OqaewMIb0NrLxg9s5A==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@hashicorp/platform-cms/-/platform-cms-0.4.0.tgz", + "integrity": "sha512-Q8fixx7JnzzDvuMEC1+UK8xO4bqMh/QxNX7lPusfMixVhnnyJaTF7xRhDRFWMG1bhUwI9TJxQYElWC2aDj7CmA==", "dev": true, "dependencies": { - "rivet-graphql": "0.3.1" + "rivet-graphql": "^0.6.0-canary-20230309231927" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1082,82 +1216,83 @@ "node": ">= 10.14.2" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.8.tgz", - "integrity": "sha512-zdpaWDz5IEyHlu1EO+B+qRHmJkSxMVV6SXngDry9n1ZqslLXFH9Dw6lRqDidm/sOJAWdRltJsmZ1SK28/uZKsw==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mdx-js/util": { + "version": "1.6.22", + "resolved": "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz", + "integrity": "sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/@next/env": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.3.1.tgz", - "integrity": "sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.4.tgz", + "integrity": "sha512-irQnbMLbUNQpP1wcE5NstJtbuA/69kRfzBrpAD7Gsn8zm/CY6YQYc3HQBz8QPxwISG26tIm5afvvVbu508oBeQ==", "dev": true }, "node_modules/@next/eslint-plugin-next": { - "version": "12.0.10", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.0.10.tgz", - "integrity": "sha512-PbGRnV5HGSfRGLjf8uTh1MaWgLwnjKjWiGVjK752ifITJbZ28/5AmLAFT2shDYeux8BHgpgVll5QXu7GN3YLFw==", + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.6.tgz", + "integrity": "sha512-ng7pU/DDsxPgT6ZPvuprxrkeew3XaRf4LAT4FabaEO/hAbvVx4P7wqnqdbTdDn1kgTvsI4tpIgT4Awn/m0bGbg==", "dev": true, "dependencies": { "glob": "7.1.7" } }, - "node_modules/@next/swc-android-arm-eabi": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", - "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-android-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", - "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@next/swc-darwin-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", - "integrity": "sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.4.tgz", + "integrity": "sha512-mF05E/5uPthWzyYDyptcwHptucf/jj09i2SXBPwNzbgBNc+XnwzrL0U6BmPjQeOL+FiB+iG1gwBeq7mlDjSRPg==", "cpu": [ "arm64" ], @@ -1171,9 +1306,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", - "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.4.tgz", + "integrity": "sha512-IZQ3C7Bx0k2rYtrZZxKKiusMTM9WWcK5ajyhOZkYYTCc8xytmwSzR1skU7qLgVT/EY9xtXDG0WhY6fyujnI3rw==", "cpu": [ "x64" ], @@ -1186,42 +1321,10 @@ "node": ">= 10" } }, - "node_modules/@next/swc-freebsd-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", - "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", - "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", - "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.4.tgz", + "integrity": "sha512-VwwZKrBQo/MGb1VOrxJ6LrKvbpo7UbROuyMRvQKTFKhNaXjUmKTu7wxVkIuCARAfiI8JpaWAnKR+D6tzpCcM4w==", "cpu": [ "arm64" ], @@ -1235,9 +1338,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", - "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.4.tgz", + "integrity": "sha512-8QftwPEW37XxXoAwsn+nXlodKWHfpMaSvt81W43Wh8dv0gkheD+30ezWMcFGHLI71KiWmHK5PSQbTQGUiidvLQ==", "cpu": [ "arm64" ], @@ -1251,9 +1354,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz", - "integrity": "sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.4.tgz", + "integrity": "sha512-/s/Pme3VKfZAfISlYVq2hzFS8AcAIOTnoKupc/j4WlvF6GQ0VouS2Q2KEgPuO1eMBwakWPB1aYFIA4VNVh667A==", "cpu": [ "x64" ], @@ -1267,9 +1370,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz", - "integrity": "sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.4.tgz", + "integrity": "sha512-m8z/6Fyal4L9Bnlxde5g2Mfa1Z7dasMQyhEhskDATpqr+Y0mjOBZcXQ7G5U+vgL22cI4T7MfvgtrM2jdopqWaw==", "cpu": [ "x64" ], @@ -1283,9 +1386,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", - "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.4.tgz", + "integrity": "sha512-7Wv4PRiWIAWbm5XrGz3D8HUkCVDMMz9igffZG4NB1p4u1KoItwx9qjATHz88kwCEal/HXmbShucaslXCQXUM5w==", "cpu": [ "arm64" ], @@ -1299,9 +1402,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", - "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.4.tgz", + "integrity": "sha512-zLeNEAPULsl0phfGb4kdzF/cAVIfaC7hY+kt0/d+y9mzcZHsMS3hAS829WbJ31DkSlVKQeHEjZHIdhN+Pg7Gyg==", "cpu": [ "ia32" ], @@ -1315,9 +1418,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", - "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.4.tgz", + "integrity": "sha512-yEh2+R8qDlDCjxVpzOTEpBLQTEFAcP2A8fUFLaWNap9GitYKkKv1//y2S6XY6zsR4rCOPRpU7plYDR+az2n30A==", "cpu": [ "x64" ], @@ -1365,22 +1468,65 @@ "node": ">= 8" } }, - "node_modules/@rushstack/eslint-patch": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz", - "integrity": "sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==", - "dev": true - }, - "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "node_modules/@pkgr/utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz", + "integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==", "dev": true, - "peer": true, "dependencies": { - "type-detect": "4.0.8" - } - }, + "cross-spawn": "^7.0.3", + "is-glob": "^4.0.3", + "open": "^8.4.0", + "picocolors": "^1.0.0", + "tiny-glob": "^0.2.9", + "tslib": "^2.4.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@pkgr/utils/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@pkgr/utils/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, + "node_modules/@rushstack/eslint-patch": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz", + "integrity": "sha512-hw437iINopmQuxWPSUEvqE56NCPsiU8N4AYtfHmJFckclktzK9YQJieD3XkDCDH4OjL+C7zgPUh73R/nrcHrqw==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "peer": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, "node_modules/@sinonjs/fake-timers": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", @@ -1420,18 +1566,18 @@ } }, "node_modules/@swc/helpers": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.11.tgz", - "integrity": "sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", "dev": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@swc/helpers/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, "node_modules/@tootallnate/once": { @@ -1524,15 +1670,15 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@types/mdast": { @@ -1575,6 +1721,12 @@ "dev": true, "peer": true }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -1582,6 +1734,12 @@ "dev": true, "peer": true }, + "node_modules/@types/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw==", + "dev": true + }, "node_modules/@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -1604,19 +1762,20 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", - "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/type-utils": "5.10.2", - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.2.0", - "semver": "^7.3.5", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -1637,15 +1796,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", - "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1664,13 +1823,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", - "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2" + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1681,13 +1840,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", - "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", "tsutils": "^3.21.0" }, "engines": { @@ -1707,9 +1867,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", - "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1720,17 +1880,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", - "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -1767,17 +1927,19 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", - "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "semver": "^7.3.7" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1791,13 +1953,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", - "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.2", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1807,6 +1969,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -1815,9 +1983,9 @@ "peer": true }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1992,16 +2160,12 @@ "dev": true }, "node_modules/aria-query": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", - "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, "dependencies": { - "@babel/runtime": "^7.10.2", - "@babel/runtime-corejs3": "^7.10.2" - }, - "engines": { - "node": ">=6.0" + "dequal": "^2.0.3" } }, "node_modules/arr-diff": { @@ -2034,16 +2198,33 @@ "node": ">=0.10.0" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -2072,15 +2253,55 @@ "node": ">=0.10.0" } }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", - "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2091,14 +2312,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", - "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2108,6 +2329,53 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.toreversed": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz", + "integrity": "sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz", + "integrity": "sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.1.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -2128,9 +2396,9 @@ } }, "node_modules/ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, "node_modules/astral-regex": { @@ -2143,9 +2411,9 @@ } }, "node_modules/async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, "node_modules/asynckit": { @@ -2221,20 +2489,38 @@ "url": "https://opencollective.com/postcss/" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axe-core": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.1.tgz", - "integrity": "sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/axobject-query": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", - "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } }, "node_modules/babel-jest": { "version": "26.6.3", @@ -2494,6 +2780,18 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2516,13 +2814,19 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2592,6 +2896,16 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/ccount": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz", + "integrity": "sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -2628,6 +2942,16 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-entities-html4": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", + "integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/character-entities-legacy": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", @@ -2826,6 +3150,12 @@ "node": ">= 10" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2885,6 +3215,16 @@ "node": ">= 0.12.0" } }, + "node_modules/collapse-white-space": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", + "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -2951,12 +3291,6 @@ "node": ">= 10" } }, - "node_modules/compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -2989,17 +3323,6 @@ "node": ">=0.10.0" } }, - "node_modules/core-js-pure": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.1.tgz", - "integrity": "sha512-TChjCtgcMDc8t12RiwAsThjqrS/VpBlEvDgL009ot4HESzBo3h2FSZNa6ZS1nWKZEPDoulnszxUll9n0/spflQ==", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", @@ -3017,12 +3340,12 @@ } }, "node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dev": true, "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, "node_modules/cross-spawn": { @@ -3110,6 +3433,57 @@ "node": ">=10" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3175,6 +3549,40 @@ "node": ">=0.10" } }, + "node_modules/deep-equal": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", + "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.2", + "get-intrinsic": "^1.1.3", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deep-equal/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -3191,12 +3599,30 @@ "node": ">=0.10.0" } }, - "node_modules/define-properties": { + "node_modules/define-data-property": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -3230,6 +3656,15 @@ "node": ">=0.4.0" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -3353,13 +3788,19 @@ "domelementtype": "1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/ejs": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.5.tgz", - "integrity": "sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "dependencies": { - "jake": "^10.6.1" + "jake": "^10.8.5" }, "bin": { "ejs": "bin/cli.js" @@ -3403,6 +3844,19 @@ "once": "^1.4.0" } }, + "node_modules/enhanced-resolve": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -3431,31 +3885,57 @@ } }, "node_modules/es-abstract": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", - "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -3464,13 +3944,85 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-shim-unscopables": { + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "node_modules/es-to-primitive": { @@ -3587,46 +4139,49 @@ } }, "node_modules/eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", - "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.0.5", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.2.0", - "espree": "^9.3.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -3639,24 +4194,23 @@ } }, "node_modules/eslint-config-next": { - "version": "12.0.10", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.0.10.tgz", - "integrity": "sha512-l1er6mwSo1bltjLwmd71p5BdT6k/NQxV1n4lKZI6xt3MDMrq7ChUBr+EecxOry8GC/rCRUtPpH8Ygs0BJc5YLg==", + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.5.6.tgz", + "integrity": "sha512-o8pQsUHTo9aHqJ2YiZDym5gQAMRf7O2HndHo/JZeY7TDD+W4hk6Ma8Vw54RHiBeb7OWWO5dPirQB+Is/aVQ7Kg==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "12.0.10", - "@rushstack/eslint-patch": "^1.0.8", - "@typescript-eslint/parser": "^5.0.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-import-resolver-typescript": "^2.4.0", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.27.0", - "eslint-plugin-react-hooks": "^4.3.0" + "@next/eslint-plugin-next": "13.5.6", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" }, "peerDependencies": { "eslint": "^7.23.0 || ^8.0.0", - "next": ">=10.2.0", "typescript": ">=3.3.1" }, "peerDependenciesMeta": { @@ -3666,9 +4220,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", - "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -3678,13 +4232,14 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -3696,57 +4251,63 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-typescript": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz", - "integrity": "sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==", + "node_modules/eslint-import-resolver-node/node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "debug": "^4.3.4", - "glob": "^7.2.0", - "is-glob": "^4.0.3", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" }, - "engines": { - "node": ">=4" + "bin": { + "resolve": "bin/resolve" }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/eslint-import-resolver-typescript/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" }, "engines": { - "node": "*" + "node": "^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" } }, "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -3759,24 +4320,28 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", - "has": "^1.0.3", - "is-core-module": "^2.8.1", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -3786,12 +4351,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { @@ -3806,30 +4371,37 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } }, "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz", - "integrity": "sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.3", - "aria-query": "^4.2.2", - "array-includes": "^3.1.4", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.3.5", - "axobject-query": "^2.2.0", - "damerau-levenshtein": "^1.0.7", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", + "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", - "has": "^1.0.3", - "jsx-ast-utils": "^3.2.1", - "language-tags": "^1.0.5", - "minimatch": "^3.0.4" + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" }, "engines": { "node": ">=4.0" @@ -3838,16 +4410,25 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" } }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=12.0.0" }, "peerDependencies": { "eslint": ">=7.28.0", @@ -3860,25 +4441,29 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.29.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.29.4.tgz", - "integrity": "sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ==", + "version": "7.34.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", + "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flatmap": "^1.2.5", + "array-includes": "^3.1.7", + "array.prototype.findlast": "^1.2.4", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.toreversed": "^1.1.2", + "array.prototype.tosorted": "^1.1.3", "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.17", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.5", - "object.fromentries": "^2.0.5", - "object.hasown": "^1.1.0", - "object.values": "^1.1.5", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7", + "object.hasown": "^1.1.3", + "object.values": "^1.1.7", "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.3", - "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.6" + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.10" }, "engines": { "node": ">=4" @@ -3888,9 +4473,9 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.4.0.tgz", - "integrity": "sha512-U3RVIfdzJaeKDQKEJbz5p3NW8/L80PCATJAfuojwbaEL+gBjfGdhUcGde+WGUW46Q5sr/NgxevsIiDtNXrvZaQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", "dev": true, "engines": { "node": ">=10" @@ -3912,22 +4497,26 @@ } }, "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3955,47 +4544,55 @@ "node": ">=4.0" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, "engines": { "node": ">=10" }, @@ -4003,31 +4600,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "p-locate": "^5.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -4045,9 +4662,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -4422,15 +5039,15 @@ "dev": true }, "node_modules/fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -4520,9 +5137,9 @@ } }, "node_modules/filelist": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.3.tgz", - "integrity": "sha512-LwjCsruLWQULGYKy7TX0OPtrL9kLpojOFKc5VCTxdFTV7w5zbsgqVKfnkKG7Qgjtq50gKfO56hJv88OfcGb70Q==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, "dependencies": { "minimatch": "^5.0.1" @@ -4538,9 +5155,9 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -4573,6 +5190,15 @@ "node": ">=4" } }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -4592,6 +5218,15 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -4666,16 +5301,31 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/functions-have-names": { "version": "1.2.3", @@ -4700,20 +5350,24 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4764,13 +5418,14 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -4779,6 +5434,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -4821,6 +5488,12 @@ "node": ">=10.13.0" } }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, "node_modules/global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -4860,9 +5533,9 @@ } }, "node_modules/globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -4874,6 +5547,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", @@ -4900,6 +5589,12 @@ "integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=", "dev": true }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, "node_modules/gonzales-pe": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", @@ -4915,28 +5610,53 @@ "node": ">=0.6.0" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, "node_modules/graphql": { - "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true, "engines": { - "node": ">= 10.x" + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, "node_modules/graphql-request": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", - "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-5.1.0.tgz", + "integrity": "sha512-0OeRVYigVwIiXhNmqnPDt+JhMzsjinxHE7TVy3Lm6jUzav0guVcL0lfSbi6jVTRAxcbwgyr6yrZioSHxf9gHzw==", "dev": true, "dependencies": { - "cross-fetch": "^3.0.6", + "@graphql-typed-document-node/core": "^3.1.1", + "cross-fetch": "^3.1.5", "extract-files": "^9.0.0", "form-data": "^3.0.0" }, @@ -4961,18 +5681,6 @@ "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -4992,12 +5700,36 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5016,12 +5748,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -5105,6 +5837,18 @@ "node": ">=0.10.0" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -5197,106 +5941,18 @@ } }, "node_modules/husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.7.tgz", + "integrity": "sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg==", "dev": true, - "hasInstallScript": true, - "dependencies": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, "bin": { - "husky-run": "bin/run.js", - "husky-upgrade": "lib/upgrader/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/husky" - } - }, - "node_modules/husky/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "dependencies": { - "semver-regex": "^3.1.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" + "husky": "bin.js" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0" - }, - "engines": { - "node": ">=10" + "url": "https://github.com/sponsors/typicode" } }, "node_modules/iconv-lite": { @@ -5430,13 +6086,13 @@ } }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { @@ -5475,6 +6131,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-alphanumeric": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "integrity": "sha512-ZmRL7++ZkcMOfDuWZuMJyIVLr2keE1o/DeNWh1EmgqGhUcV+9BIVsx0BcSBOHTZqzjs4+dISzr2KAeBEWGgXeA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-alphanumerical": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", @@ -5489,12 +6154,43 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -5547,9 +6243,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -5571,12 +6267,12 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5595,6 +6291,21 @@ "node": ">=0.10.0" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -5672,6 +6383,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -5691,6 +6414,21 @@ "node": ">=6" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -5713,10 +6451,22 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, "engines": { "node": ">= 0.4" @@ -5758,6 +6508,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -5812,13 +6571,28 @@ "node": ">=0.10.0" } }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5866,6 +6640,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -5896,14 +6685,42 @@ "node": ">=8" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5918,6 +6735,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-word-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", + "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -6033,16 +6860,29 @@ "node": ">=8" } }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "node_modules/jake": { - "version": "10.8.5", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", - "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "version": "10.8.7", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", + "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", "dev": true, "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", - "filelist": "^1.0.1", - "minimatch": "^3.0.4" + "filelist": "^1.0.4", + "minimatch": "^3.1.2" }, "bin": { "jake": "bin/cli.js" @@ -6627,6 +7467,16 @@ "node": ">= 10.13.0" } }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6725,13 +7575,13 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -6762,13 +7612,15 @@ } }, "node_modules/jsx-ast-utils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.2.tgz", - "integrity": "sha512-HDAyJ4MNQBboGpUnHAVUNJs6X0lh058s6FuixsFGP7MgJYpD6Vasd6nzSG5iIfXu1zAYlHJ/zsOKNlrenTUBnw==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "object.assign": "^4.1.2" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" }, "engines": { "node": ">=4.0" @@ -6800,18 +7652,21 @@ "dev": true }, "node_modules/language-subtag-registry": { - "version": "0.3.21", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", - "integrity": "sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", + "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==", "dev": true }, "node_modules/language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", "dev": true, "dependencies": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/leven": { @@ -7226,6 +8081,29 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-escapes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", + "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dev": true, + "dependencies": { + "repeat-string": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -7236,6 +8114,48 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/mdast-util-compact": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", + "dev": true, + "dependencies": { + "unist-util-visit": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-compact/node_modules/unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-compact/node_modules/unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-from-markdown": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", @@ -7503,10 +8423,16 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -7543,52 +8469,52 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/next": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/next/-/next-12.3.1.tgz", - "integrity": "sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/next/-/next-14.0.4.tgz", + "integrity": "sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==", "dev": true, "dependencies": { - "@next/env": "12.3.1", - "@swc/helpers": "0.4.11", + "@next/env": "14.0.4", + "@swc/helpers": "0.5.2", + "busboy": "1.6.0", "caniuse-lite": "^1.0.30001406", - "postcss": "8.4.14", - "styled-jsx": "5.0.7", - "use-sync-external-store": "1.2.0" + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1", + "watchpack": "2.4.0" }, "bin": { "next": "dist/bin/next" }, "engines": { - "node": ">=12.22.0" + "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-android-arm-eabi": "12.3.1", - "@next/swc-android-arm64": "12.3.1", - "@next/swc-darwin-arm64": "12.3.1", - "@next/swc-darwin-x64": "12.3.1", - "@next/swc-freebsd-x64": "12.3.1", - "@next/swc-linux-arm-gnueabihf": "12.3.1", - "@next/swc-linux-arm64-gnu": "12.3.1", - "@next/swc-linux-arm64-musl": "12.3.1", - "@next/swc-linux-x64-gnu": "12.3.1", - "@next/swc-linux-x64-musl": "12.3.1", - "@next/swc-win32-arm64-msvc": "12.3.1", - "@next/swc-win32-ia32-msvc": "12.3.1", - "@next/swc-win32-x64-msvc": "12.3.1" + "@next/swc-darwin-arm64": "14.0.4", + "@next/swc-darwin-x64": "14.0.4", + "@next/swc-linux-arm64-gnu": "14.0.4", + "@next/swc-linux-arm64-musl": "14.0.4", + "@next/swc-linux-x64-gnu": "14.0.4", + "@next/swc-linux-x64-musl": "14.0.4", + "@next/swc-win32-arm64-msvc": "14.0.4", + "@next/swc-win32-ia32-msvc": "14.0.4", + "@next/swc-win32-x64-msvc": "14.0.4" }, "peerDependencies": { - "fibers": ">= 3.1.0", - "node-sass": "^6.0.0 || ^7.0.0", - "react": "^17.0.2 || ^18.0.0-0", - "react-dom": "^17.0.2 || ^18.0.0-0", + "@opentelemetry/api": "^1.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", "sass": "^1.3.0" }, "peerDependenciesMeta": { - "fibers": { - "optional": true - }, - "node-sass": { + "@opentelemetry/api": { "optional": true }, "sass": { @@ -7604,9 +8530,9 @@ "peer": true }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -7626,19 +8552,19 @@ "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "dependencies": { "tr46": "~0.0.3", @@ -7747,7 +8673,7 @@ "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -7853,10 +8779,26 @@ } }, "node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7884,14 +8826,14 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { @@ -7902,28 +8844,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", - "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", - "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -7932,14 +8875,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object.hasown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", - "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.4.tgz", + "integrity": "sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==", "dev": true, "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7959,14 +8920,14 @@ } }, "node_modules/object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -8015,19 +8976,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true, - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { "deep-is": "^0.1.3", @@ -8035,7 +8987,7 @@ "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -8390,10 +9342,19 @@ "node": ">=0.10.0" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -8403,10 +9364,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -8689,15 +9654,18 @@ } }, "node_modules/prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { @@ -8786,6 +9754,13 @@ "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "peer": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -8816,9 +9791,9 @@ } }, "node_modules/react": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.0.0.tgz", - "integrity": "sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dev": true, "peer": true, "dependencies": { @@ -8829,17 +9804,17 @@ } }, "node_modules/react-dom": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.0.0.tgz", - "integrity": "sha512-XqX7uzmFo0pUceWFCt7Gff6IyIMzFUn7QMZrbrQfGxtaxXZIcGQzoNpRLE3fQLnS4XzLLPMZX2T9TRcSrasicw==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dev": true, "peer": true, "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.21.0" + "scheduler": "^0.23.0" }, "peerDependencies": { - "react": "^18.0.0" + "react": "^18.2.0" } }, "node_modules/react-is": { @@ -8990,10 +9965,31 @@ "node": ">=8" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dev": true }, "node_modules/regex-not": { @@ -9011,14 +10007,15 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -9027,18 +10024,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/remark": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", @@ -9054,70 +10039,199 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-parse": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz", - "integrity": "sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==", + "node_modules/remark-mdx": { + "version": "1.6.22", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz", + "integrity": "sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ==", "dev": true, "dependencies": { - "mdast-util-from-markdown": "^0.8.0" + "@babel/core": "7.12.9", + "@babel/helper-plugin-utils": "7.10.4", + "@babel/plugin-proposal-object-rest-spread": "7.12.1", + "@babel/plugin-syntax-jsx": "7.12.1", + "@mdx-js/util": "1.6.22", + "is-alphabetical": "1.0.4", + "remark-parse": "8.0.3", + "unified": "9.2.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-stringify": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", - "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", + "node_modules/remark-mdx/node_modules/@babel/core": { + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz", + "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==", "dev": true, "dependencies": { - "mdast-util-to-markdown": "^0.6.0" + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.7", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.9", + "@babel/types": "^7.12.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://opencollective.com/babel" } }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "peer": true + "node_modules/remark-mdx/node_modules/@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "node_modules/remark-mdx/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, - "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "node_modules/remark-mdx/node_modules/remark-parse": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", + "integrity": "sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==", "dev": true, - "engines": { - "node": ">=0.10" + "dependencies": { + "ccount": "^1.0.0", + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^2.0.0", + "vfile-location": "^3.0.0", + "xtend": "^4.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "node_modules/remark-mdx/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/remark-mdx/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", + "node_modules/remark-mdx/node_modules/unified": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", + "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", + "dev": true, + "dependencies": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz", + "integrity": "sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==", + "dev": true, + "dependencies": { + "mdast-util-from-markdown": "^0.8.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", + "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", + "dev": true, + "dependencies": { + "mdast-util-to-markdown": "^0.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true, + "peer": true + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, @@ -9132,6 +10246,13 @@ "dev": true, "peer": true }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "peer": true + }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -9181,6 +10302,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -9244,13 +10374,14 @@ } }, "node_modules/rivet-graphql": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/rivet-graphql/-/rivet-graphql-0.3.1.tgz", - "integrity": "sha512-HEov02XhZ6H1jOME+mO8CZwliu/UtgZSHixYUwvQ7HSx3gk8EOVaQY5c3zscOYjZECvP8cR4+1Ob3KHWJRWEMw==", + "version": "0.6.0-canary-20230309231927", + "resolved": "https://registry.npmjs.org/rivet-graphql/-/rivet-graphql-0.6.0-canary-20230309231927.tgz", + "integrity": "sha512-6+HlBIKGty0+XULdpQaXwFpXgItmNUOCSZ8a6Eit/kJzXPp7YVyBMvCN9ozaRVqHUK8PiToGB+jg+jo8/V+bgw==", "dev": true, "dependencies": { - "graphql": "^15.3.0", - "graphql-request": "^3.0.0" + "@graphql-typed-document-node/core": "^3.1.2", + "graphql": "^16.6.0", + "graphql-request": "~5.1.0" } }, "node_modules/rsvp": { @@ -9307,6 +10438,30 @@ "npm": ">=2.0.0" } }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -9323,6 +10478,23 @@ "ret": "~0.1.10" } }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -9666,9 +10838,9 @@ } }, "node_modules/scheduler": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", - "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dev": true, "peer": true, "dependencies": { @@ -9696,18 +10868,6 @@ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, - "node_modules/semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -9715,6 +10875,38 @@ "dev": true, "peer": true }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -9784,14 +10976,18 @@ "peer": true }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10294,6 +11490,16 @@ "node": ">=8" } }, + "node_modules/state-toggle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", + "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -10405,6 +11611,27 @@ "node": ">=0.10.0" } }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10478,50 +11705,95 @@ "dev": true }, "node_modules/string.prototype.matchall": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", - "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.4.1", - "side-channel": "^1.0.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-entities": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.1.0.tgz", + "integrity": "sha512-3FP+jGMmMV/ffZs86MoghGqAoqXAdxLrJP4GUdrDN1aIScYih5tuIO3eF4To5AJZ79KDZ8Fpdy7QJnK8SsL1Vg==", + "dev": true, + "dependencies": { + "character-entities-html4": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "xtend": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", @@ -10608,10 +11880,13 @@ "dev": true }, "node_modules/styled-jsx": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.7.tgz", - "integrity": "sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", "dev": true, + "dependencies": { + "client-only": "0.0.1" + }, "engines": { "node": ">= 12.0.0" }, @@ -10931,6 +12206,28 @@ "dev": true, "peer": true }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, "node_modules/table": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", @@ -10986,6 +12283,15 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -11021,7 +12327,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "node_modules/throat": { @@ -11037,6 +12343,16 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "node_modules/tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "dependencies": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, "node_modules/tlds": { "version": "1.231.0", "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.231.0.tgz", @@ -11136,24 +12452,25 @@ } }, "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "peer": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { "node": ">=6" } }, "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, "peer": true, "engines": { @@ -11173,6 +12490,13 @@ "node": ">=8" } }, + "node_modules/trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==", + "deprecated": "Use String.prototype.trim() instead", + "dev": true + }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -11182,6 +12506,16 @@ "node": ">=8" } }, + "node_modules/trim-trailing-lines": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz", + "integrity": "sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/trough": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", @@ -11221,21 +12555,21 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -11247,7 +12581,7 @@ "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -11308,21 +12642,94 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dev": true, "dependencies": { - "is-typedarray": "^1.0.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dev": true, - "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typescript": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11332,20 +12739,34 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/unherit": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", + "integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.0", + "xtend": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/unified": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", @@ -11364,6 +12785,116 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unified-lint-rule": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.1.1.tgz", + "integrity": "sha512-vsLHyLZFstqtGse2gvrGwasOmH8M2y+r2kQMoDSWzSqUkQx2MjHjvZuGSv5FUaiv4RQO1bHRajy7lSGp7XWq5A==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "trough": "^2.0.0", + "unified": "^10.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-lint-rule/node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified-lint-rule/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unified-lint-rule/node_modules/trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified-lint-rule/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-lint-rule/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-lint-rule/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-lint-rule/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unified/node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -11422,6 +12953,48 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-remove-position": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", + "integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", + "dev": true, + "dependencies": { + "unist-util-visit": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position/node_modules/unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position/node_modules/unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", @@ -11435,6 +13008,61 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/universalify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", @@ -11513,6 +13141,17 @@ "dev": true, "peer": true }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "peer": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/url-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-regex/-/url-regex-5.0.0.tgz", @@ -11536,97 +13175,455 @@ "node": ">=0.10.0" } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", + "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", + "dev": true, + "peer": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vfile": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", + "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", + "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-matter": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-matter/-/vfile-matter-4.0.1.tgz", + "integrity": "sha512-ZeACdaxCOxhePpoLO4A5y/VgI9EuWBXu+sUk65aQ7lXBZDFg7X0tuOzigLJUtsQzazFt6K2m9SdlDxZdfL5vVg==", + "dev": true, + "dependencies": { + "is-buffer": "^2.0.0", + "vfile": "^5.0.0", + "yaml": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-matter/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-matter/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-matter/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-matter/node_modules/yaml": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-7.0.5.tgz", + "integrity": "sha512-NdWWXkv6gcd7AZMvDomlQbK3MqFWL1RlGzMn++/O2TI+68+nqxCPTvLugdOtfSzXmjh+xUyhp07HhlrbJjT+mw==", + "dev": true, + "dependencies": { + "@types/supports-color": "^8.0.0", + "string-width": "^5.0.0", + "supports-color": "^9.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile": "^5.0.0", + "vfile-message": "^3.0.0", + "vfile-sort": "^3.0.0", + "vfile-statistics": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter-json": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/vfile-reporter-json/-/vfile-reporter-json-3.3.0.tgz", + "integrity": "sha512-/zgRtjxQ2UGJn+HViiZ7+nIXtUzkkXFQum3BmaS/bSyr10P0X41ETRqqwMJ95RtbKUah3m7pKb6oS1eZeXXHzQ==", + "dev": true, + "dependencies": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter-json/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter-json/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter-json/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vfile-reporter/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/supports-color": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.3.1.tgz", + "integrity": "sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-sort": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-3.0.1.tgz", + "integrity": "sha512-1os1733XY6y0D5x0ugqSeaVJm9lYgj0j5qdcZQFyxlZOSy1jYarL77lLyb5gK4Wqr1d5OxmuyflSO3zKyFnTFw==", "dev": true, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "dependencies": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "node_modules/vfile-sort/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dev": true, - "optional": true, - "peer": true, - "bin": { - "uuid": "dist/bin/uuid" + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "node_modules/vfile-sort/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", + "node_modules/vfile-sort/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dev": true, - "peer": true, "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" }, - "engines": { - "node": ">=10.10.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "node_modules/vfile-statistics": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-2.0.1.tgz", + "integrity": "sha512-W6dkECZmP32EG/l+dp2jCLdYzmnDBIw6jwiLZSER81oR5AHRcVqL+k3Z+pfH1R73le6ayDkJRMk0sutj1bMVeg==", "dev": true, - "peer": true, - "engines": { - "node": ">= 8" + "dependencies": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "node_modules/vfile-statistics/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dev": true, "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vfile": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", - "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", + "node_modules/vfile-statistics/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dev": true, "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^2.0.0", - "vfile-message": "^2.0.0" + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-message": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", - "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "node_modules/vfile-statistics/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dev": true, "dependencies": { "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^2.0.0" + "unist-util-stringify-position": "^3.0.0" }, "funding": { "type": "opencollective", @@ -11666,6 +13663,19 @@ "makeerror": "1.0.12" } }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", @@ -11739,6 +13749,56 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -11746,16 +13806,49 @@ "dev": true, "peer": true }, - "node_modules/which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -11832,6 +13925,15 @@ "dev": true, "peer": true }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -11968,6 +14070,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zod": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", + "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", @@ -11990,12 +14101,65 @@ } }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/compat-data": { @@ -12036,22 +14200,15 @@ } }, "@babel/generator": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", - "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" } }, "@babel/helper-compilation-targets": { @@ -12075,31 +14232,28 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, "@babel/helper-function-name": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", - "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/template": "^7.16.7", - "@babel/types": "^7.17.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-imports": { @@ -12128,11 +14282,10 @@ } }, "@babel/helper-plugin-utils": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", - "dev": true, - "peer": true + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", + "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "dev": true }, "@babel/helper-simple-access": { "version": "7.17.7", @@ -12144,18 +14297,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -12176,13 +14335,13 @@ } }, "@babel/highlight": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", - "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -12218,13 +14377,13 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -12239,11 +14398,22 @@ } }, "@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz", + "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.12.1" + } + }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -12291,7 +14461,16 @@ "dev": true, "peer": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz", + "integrity": "sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -12329,7 +14508,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "peer": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" } @@ -12365,49 +14543,39 @@ } }, "@babel/runtime": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", - "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/runtime-corejs3": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.9.tgz", - "integrity": "sha512-WxYHHUWF2uZ7Hp1K+D1xQgbgkGUfA+5UPOegEXGt2Y5SMog/rYCVaifLZDbw8UkNXozEqqrZTy6bglL7xTaCOw==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "dev": true, "requires": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" } }, "@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", - "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.9", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.17.9", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.9", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -12421,12 +14589,13 @@ } }, "@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -12448,46 +14617,74 @@ "minimist": "^1.2.0" } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true + }, "@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, + "@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true + }, + "@graphql-typed-document-node/core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "dev": true, + "requires": {} + }, "@hashicorp/platform-cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-2.1.0.tgz", - "integrity": "sha512-orPreFHhkFXd84zouNnHvx6C2pT8cM2tTxwPEDkTDx7C2G+GRCQxKtBq+YXxLGj6AZOMa6cuF58eecEWJRW6TA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-2.8.0.tgz", + "integrity": "sha512-OD2o4vIQ4AnWD5ExVr//bZCadI4kRIa3Vk4d/1ugFhiyODlGSem4GEvt7/4hZutrEBOoDgAcKq8wVmWwrP/JiQ==", "dev": true, "requires": { - "@hashicorp/platform-cms": "0.3.0", - "@typescript-eslint/eslint-plugin": "5.10.2", - "@typescript-eslint/parser": "5.10.2", + "@hashicorp/platform-cms": "0.4.0", + "@typescript-eslint/eslint-plugin": "^5.48.0", + "@typescript-eslint/parser": "^5.48.0", "chalk": "4.1.0", "commander": "7.2.0", - "ejs": "3.1.5", - "eslint": "8.8.0", - "eslint-config-next": "12.0.10", - "eslint-config-prettier": "8.3.0", - "eslint-plugin-jsx-a11y": "6.5.1", - "eslint-plugin-prettier": "4.0.0", + "ejs": "^3.1.9", + "eslint": "^8.31.0", + "eslint-config-next": "^13.1.1", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-jsx-a11y": "^6.6.1", + "eslint-plugin-prettier": "^4.2.1", "fs-extra": "9.0.1", "globby": "11.0.1", "inquirer": "7.3.3", "lint-staged": "11.1.2", "open": "7.3.0", - "prettier": "2.5.1", + "prettier": "^2.8.7", "readdirp": "3.5.0", "signale": "1.4.0", "slugify": "1.4.6", @@ -12503,37 +14700,43 @@ }, "dependencies": { "prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true } } }, "@hashicorp/platform-cms": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@hashicorp/platform-cms/-/platform-cms-0.3.0.tgz", - "integrity": "sha512-sRX9A+kDEZvfZy8PvGFbEaHjn5G1mEsHwTri1vDnrmKG8apE+ELlug83b0iEkD5wIJi9OqaewMIb0NrLxg9s5A==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@hashicorp/platform-cms/-/platform-cms-0.4.0.tgz", + "integrity": "sha512-Q8fixx7JnzzDvuMEC1+UK8xO4bqMh/QxNX7lPusfMixVhnnyJaTF7xRhDRFWMG1bhUwI9TJxQYElWC2aDj7CmA==", "dev": true, "requires": { - "rivet-graphql": "0.3.1" + "rivet-graphql": "^0.6.0-canary-20230309231927" } }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" } }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -12830,131 +15033,126 @@ "chalk": "^4.0.0" } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.8.tgz", - "integrity": "sha512-zdpaWDz5IEyHlu1EO+B+qRHmJkSxMVV6SXngDry9n1ZqslLXFH9Dw6lRqDidm/sOJAWdRltJsmZ1SK28/uZKsw==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@mdx-js/util": { + "version": "1.6.22", + "resolved": "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz", + "integrity": "sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==", + "dev": true + }, "@next/env": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.3.1.tgz", - "integrity": "sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.4.tgz", + "integrity": "sha512-irQnbMLbUNQpP1wcE5NstJtbuA/69kRfzBrpAD7Gsn8zm/CY6YQYc3HQBz8QPxwISG26tIm5afvvVbu508oBeQ==", "dev": true }, "@next/eslint-plugin-next": { - "version": "12.0.10", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.0.10.tgz", - "integrity": "sha512-PbGRnV5HGSfRGLjf8uTh1MaWgLwnjKjWiGVjK752ifITJbZ28/5AmLAFT2shDYeux8BHgpgVll5QXu7GN3YLFw==", + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.6.tgz", + "integrity": "sha512-ng7pU/DDsxPgT6ZPvuprxrkeew3XaRf4LAT4FabaEO/hAbvVx4P7wqnqdbTdDn1kgTvsI4tpIgT4Awn/m0bGbg==", "dev": true, "requires": { "glob": "7.1.7" } }, - "@next/swc-android-arm-eabi": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz", - "integrity": "sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==", - "dev": true, - "optional": true - }, - "@next/swc-android-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz", - "integrity": "sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==", - "dev": true, - "optional": true - }, "@next/swc-darwin-arm64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz", - "integrity": "sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.4.tgz", + "integrity": "sha512-mF05E/5uPthWzyYDyptcwHptucf/jj09i2SXBPwNzbgBNc+XnwzrL0U6BmPjQeOL+FiB+iG1gwBeq7mlDjSRPg==", "dev": true, "optional": true }, "@next/swc-darwin-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz", - "integrity": "sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==", - "dev": true, - "optional": true - }, - "@next/swc-freebsd-x64": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz", - "integrity": "sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==", - "dev": true, - "optional": true - }, - "@next/swc-linux-arm-gnueabihf": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz", - "integrity": "sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.4.tgz", + "integrity": "sha512-IZQ3C7Bx0k2rYtrZZxKKiusMTM9WWcK5ajyhOZkYYTCc8xytmwSzR1skU7qLgVT/EY9xtXDG0WhY6fyujnI3rw==", "dev": true, "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz", - "integrity": "sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.4.tgz", + "integrity": "sha512-VwwZKrBQo/MGb1VOrxJ6LrKvbpo7UbROuyMRvQKTFKhNaXjUmKTu7wxVkIuCARAfiI8JpaWAnKR+D6tzpCcM4w==", "dev": true, "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz", - "integrity": "sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.4.tgz", + "integrity": "sha512-8QftwPEW37XxXoAwsn+nXlodKWHfpMaSvt81W43Wh8dv0gkheD+30ezWMcFGHLI71KiWmHK5PSQbTQGUiidvLQ==", "dev": true, "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz", - "integrity": "sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.4.tgz", + "integrity": "sha512-/s/Pme3VKfZAfISlYVq2hzFS8AcAIOTnoKupc/j4WlvF6GQ0VouS2Q2KEgPuO1eMBwakWPB1aYFIA4VNVh667A==", "dev": true, "optional": true }, "@next/swc-linux-x64-musl": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz", - "integrity": "sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.4.tgz", + "integrity": "sha512-m8z/6Fyal4L9Bnlxde5g2Mfa1Z7dasMQyhEhskDATpqr+Y0mjOBZcXQ7G5U+vgL22cI4T7MfvgtrM2jdopqWaw==", "dev": true, "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz", - "integrity": "sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.4.tgz", + "integrity": "sha512-7Wv4PRiWIAWbm5XrGz3D8HUkCVDMMz9igffZG4NB1p4u1KoItwx9qjATHz88kwCEal/HXmbShucaslXCQXUM5w==", "dev": true, "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz", - "integrity": "sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.4.tgz", + "integrity": "sha512-zLeNEAPULsl0phfGb4kdzF/cAVIfaC7hY+kt0/d+y9mzcZHsMS3hAS829WbJ31DkSlVKQeHEjZHIdhN+Pg7Gyg==", "dev": true, "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz", - "integrity": "sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.4.tgz", + "integrity": "sha512-yEh2+R8qDlDCjxVpzOTEpBLQTEFAcP2A8fUFLaWNap9GitYKkKv1//y2S6XY6zsR4rCOPRpU7plYDR+az2n30A==", "dev": true, "optional": true }, @@ -12984,10 +15182,43 @@ "fastq": "^1.6.0" } }, + "@pkgr/utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz", + "integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "is-glob": "^4.0.3", + "open": "^8.4.0", + "picocolors": "^1.0.0", + "tiny-glob": "^0.2.9", + "tslib": "^2.4.0" + }, + "dependencies": { + "open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "requires": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + } + }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + } + } + }, "@rushstack/eslint-patch": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz", - "integrity": "sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz", + "integrity": "sha512-hw437iINopmQuxWPSUEvqE56NCPsiU8N4AYtfHmJFckclktzK9YQJieD3XkDCDH4OjL+C7zgPUh73R/nrcHrqw==", "dev": true }, "@sinonjs/commons": { @@ -13030,18 +15261,18 @@ } }, "@swc/helpers": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.11.tgz", - "integrity": "sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", "dev": true, "requires": { "tslib": "^2.4.0" }, "dependencies": { "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true } } @@ -13133,15 +15364,15 @@ } }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/mdast": { @@ -13184,6 +15415,12 @@ "dev": true, "peer": true }, + "@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, "@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -13191,6 +15428,12 @@ "dev": true, "peer": true }, + "@types/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw==", + "dev": true + }, "@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -13213,73 +15456,75 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", - "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/type-utils": "5.10.2", - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.2.0", - "semver": "^7.3.5", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", - "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", - "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2" + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" } }, "@typescript-eslint/type-utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", - "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.10.2", - "debug": "^4.3.2", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", - "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", - "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/visitor-keys": "5.10.2", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "dependencies": { @@ -13300,29 +15545,37 @@ } }, "@typescript-eslint/utils": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", - "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, "requires": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.2", - "@typescript-eslint/types": "5.10.2", - "@typescript-eslint/typescript-estree": "5.10.2", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", - "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.2", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" } }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -13331,9 +15584,9 @@ "peer": true }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, "acorn-globals": { @@ -13458,13 +15711,12 @@ "dev": true }, "aria-query": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", - "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, "requires": { - "@babel/runtime": "^7.10.2", - "@babel/runtime-corejs3": "^7.10.2" + "dequal": "^2.0.3" } }, "arr-diff": { @@ -13488,16 +15740,27 @@ "dev": true, "peer": true }, + "array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, "array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" } }, @@ -13514,30 +15777,99 @@ "dev": true, "peer": true }, + "array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, "array.prototype.flat": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", - "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" } }, "array.prototype.flatmap": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", - "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + } + }, + "array.prototype.toreversed": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz", + "integrity": "sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" } }, + "array.prototype.tosorted": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz", + "integrity": "sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.1.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -13552,9 +15884,9 @@ "peer": true }, "ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, "astral-regex": { @@ -13564,9 +15896,9 @@ "dev": true }, "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, "asynckit": { @@ -13621,17 +15953,29 @@ } } }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, "axe-core": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.1.tgz", - "integrity": "sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", "dev": true }, "axobject-query": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", - "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "dev": true, + "requires": { + "dequal": "^2.0.3" + } }, "babel-jest": { "version": "26.6.3", @@ -13836,6 +16180,15 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -13855,13 +16208,16 @@ } }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "callsites": { @@ -13903,6 +16259,12 @@ "rsvp": "^4.8.4" } }, + "ccount": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz", + "integrity": "sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==", + "dev": true + }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -13926,6 +16288,12 @@ "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", "dev": true }, + "character-entities-html4": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", + "integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==", + "dev": true + }, "character-entities-legacy": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", @@ -14083,6 +16451,12 @@ "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -14133,6 +16507,12 @@ "dev": true, "peer": true }, + "collapse-white-space": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", + "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", + "dev": true + }, "collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -14187,12 +16567,6 @@ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -14222,12 +16596,6 @@ "dev": true, "peer": true }, - "core-js-pure": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.1.tgz", - "integrity": "sha512-TChjCtgcMDc8t12RiwAsThjqrS/VpBlEvDgL009ot4HESzBo3h2FSZNa6ZS1nWKZEPDoulnszxUll9n0/spflQ==", - "dev": true - }, "cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", @@ -14242,12 +16610,12 @@ } }, "cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dev": true, "requires": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.12" } }, "cross-spawn": { @@ -14317,6 +16685,39 @@ "whatwg-url": "^8.0.0" } }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -14364,6 +16765,39 @@ "dev": true, "peer": true }, + "deep-equal": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", + "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.2", + "get-intrinsic": "^1.1.3", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -14377,12 +16811,24 @@ "dev": true, "peer": true }, - "define-properties": { + "define-data-property": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "requires": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } @@ -14404,6 +16850,12 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true + }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -14504,13 +16956,19 @@ "domelementtype": "1" } }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "ejs": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.5.tgz", - "integrity": "sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "requires": { - "jake": "^10.6.1" + "jake": "^10.8.5" } }, "electron-to-chromium": { @@ -14542,6 +17000,16 @@ "once": "^1.4.0" } }, + "enhanced-resolve": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, "enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -14567,40 +17035,123 @@ } }, "es-abstract": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", - "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" } }, - "es-shim-unscopables": { + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-iterator-helpers": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + } + }, + "es-object-atoms": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "es-to-primitive": { @@ -14686,46 +17237,49 @@ } }, "eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", - "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.0.5", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.2.0", - "espree": "^9.3.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { "escape-string-regexp": { @@ -14735,49 +17289,78 @@ "dev": true }, "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } } } }, "eslint-config-next": { - "version": "12.0.10", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.0.10.tgz", - "integrity": "sha512-l1er6mwSo1bltjLwmd71p5BdT6k/NQxV1n4lKZI6xt3MDMrq7ChUBr+EecxOry8GC/rCRUtPpH8Ygs0BJc5YLg==", + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.5.6.tgz", + "integrity": "sha512-o8pQsUHTo9aHqJ2YiZDym5gQAMRf7O2HndHo/JZeY7TDD+W4hk6Ma8Vw54RHiBeb7OWWO5dPirQB+Is/aVQ7Kg==", "dev": true, "requires": { - "@next/eslint-plugin-next": "12.0.10", - "@rushstack/eslint-patch": "^1.0.8", - "@typescript-eslint/parser": "^5.0.0", - "eslint-import-resolver-node": "^0.3.4", - "eslint-import-resolver-typescript": "^2.4.0", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.27.0", - "eslint-plugin-react-hooks": "^4.3.0" + "@next/eslint-plugin-next": "13.5.6", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" } }, "eslint-config-prettier": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", - "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true, "requires": {} }, "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "requires": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" }, "dependencies": { "debug": { @@ -14788,46 +17371,42 @@ "requires": { "ms": "^2.1.1" } + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } } } }, "eslint-import-resolver-typescript": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz", - "integrity": "sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", "dev": true, "requires": { "debug": "^4.3.4", - "glob": "^7.2.0", - "is-glob": "^4.0.3", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" - }, - "dependencies": { - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" } }, "eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", "dev": true, "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "dependencies": { "debug": { @@ -14842,33 +17421,37 @@ } }, "eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", - "has": "^1.0.3", - "is-core-module": "^2.8.1", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "doctrine": { @@ -14880,63 +17463,71 @@ "esutils": "^2.0.2" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } }, "eslint-plugin-jsx-a11y": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz", - "integrity": "sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.3", - "aria-query": "^4.2.2", - "array-includes": "^3.1.4", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.3.5", - "axobject-query": "^2.2.0", - "damerau-levenshtein": "^1.0.7", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", + "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", - "has": "^1.0.3", - "jsx-ast-utils": "^3.2.1", - "language-tags": "^1.0.5", - "minimatch": "^3.0.4" + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" } }, "eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, "eslint-plugin-react": { - "version": "7.29.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.29.4.tgz", - "integrity": "sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ==", + "version": "7.34.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", + "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "array.prototype.flatmap": "^1.2.5", + "array-includes": "^3.1.7", + "array.prototype.findlast": "^1.2.4", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.toreversed": "^1.1.2", + "array.prototype.tosorted": "^1.1.3", "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.17", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.5", - "object.fromentries": "^2.0.5", - "object.hasown": "^1.1.0", - "object.values": "^1.1.5", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7", + "object.hasown": "^1.1.3", + "object.values": "^1.1.7", "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.3", - "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.6" + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.10" }, "dependencies": { "doctrine": { @@ -14949,27 +17540,28 @@ } }, "resolve": { - "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } }, "eslint-plugin-react-hooks": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.4.0.tgz", - "integrity": "sha512-U3RVIfdzJaeKDQKEJbz5p3NW8/L80PCATJAfuojwbaEL+gBjfGdhUcGde+WGUW46Q5sr/NgxevsIiDtNXrvZaQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", "dev": true, "requires": {} }, @@ -14991,38 +17583,21 @@ } } }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true }, "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" } }, "esprima": { @@ -15033,9 +17608,9 @@ "peer": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -15337,15 +17912,15 @@ "dev": true }, "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -15422,9 +17997,9 @@ } }, "filelist": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.3.tgz", - "integrity": "sha512-LwjCsruLWQULGYKy7TX0OPtrL9kLpojOFKc5VCTxdFTV7w5zbsgqVKfnkKG7Qgjtq50gKfO56hJv88OfcGb70Q==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, "requires": { "minimatch": "^5.0.1" @@ -15440,9 +18015,9 @@ } }, "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -15468,6 +18043,12 @@ "locate-path": "^2.0.0" } }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -15484,6 +18065,15 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -15539,16 +18129,22 @@ "peer": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } }, "functions-have-names": { "version": "1.2.3", @@ -15566,18 +18162,19 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "peer": true + "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-own-enumerable-property-symbols": { @@ -15610,15 +18207,31 @@ } }, "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" } }, + "get-tsconfig": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", + "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "dev": true + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -15649,6 +18262,12 @@ "is-glob": "^4.0.3" } }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, "global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -15681,14 +18300,24 @@ } }, "globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, + "globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "requires": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + } + }, "globby": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", @@ -15709,6 +18338,12 @@ "integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=", "dev": true }, + "globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, "gonzales-pe": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", @@ -15718,25 +18353,47 @@ "minimist": "^1.2.5" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, "graphql": { - "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true }, "graphql-request": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", - "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-5.1.0.tgz", + "integrity": "sha512-0OeRVYigVwIiXhNmqnPDt+JhMzsjinxHE7TVy3Lm6jUzav0guVcL0lfSbi6jVTRAxcbwgyr6yrZioSHxf9gHzw==", "dev": true, "requires": { - "cross-fetch": "^3.0.6", + "@graphql-typed-document-node/core": "^3.1.1", + "cross-fetch": "^3.1.5", "extract-files": "^9.0.0", "form-data": "^3.0.0" } @@ -15755,15 +18412,6 @@ "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -15777,14 +18425,20 @@ "dev": true }, "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "requires": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" } }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -15792,12 +18446,12 @@ "dev": true }, "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "requires": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" } }, "has-value": { @@ -15864,6 +18518,15 @@ } } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -15938,70 +18601,10 @@ "peer": true }, "husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "requires": { - "semver-regex": "^3.1.2" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "requires": { - "find-up": "^5.0.0" - } - } - } + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.7.tgz", + "integrity": "sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg==", + "dev": true }, "iconv-lite": { "version": "0.4.24", @@ -16101,13 +18704,13 @@ } }, "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" } }, @@ -16133,6 +18736,12 @@ "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", "dev": true }, + "is-alphanumeric": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "integrity": "sha512-ZmRL7++ZkcMOfDuWZuMJyIVLr2keE1o/DeNWh1EmgqGhUcV+9BIVsx0BcSBOHTZqzjs4+dISzr2KAeBEWGgXeA==", + "dev": true + }, "is-alphanumerical": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", @@ -16143,12 +18752,31 @@ "is-decimal": "^1.0.0" } }, + "is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -16175,9 +18803,9 @@ "dev": true }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-ci": { @@ -16190,12 +18818,12 @@ } }, "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "is-data-descriptor": { @@ -16208,6 +18836,15 @@ "kind-of": "^6.0.0" } }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -16257,6 +18894,15 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -16270,6 +18916,15 @@ "dev": true, "peer": true }, + "is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -16285,10 +18940,16 @@ "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", "dev": true }, + "is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true + }, "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true }, "is-number": { @@ -16312,6 +18973,12 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -16351,13 +19018,19 @@ "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "dev": true }, + "is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true + }, "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" } }, "is-stream": { @@ -16384,6 +19057,15 @@ "has-symbols": "^1.0.2" } }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -16405,6 +19087,12 @@ "url-regex": "^5.0.0" } }, + "is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true + }, "is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -16414,6 +19102,16 @@ "call-bind": "^1.0.2" } }, + "is-weakset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -16421,6 +19119,12 @@ "dev": true, "peer": true }, + "is-word-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", + "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", + "dev": true + }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -16514,16 +19218,29 @@ "istanbul-lib-report": "^3.0.0" } }, + "iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "requires": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "jake": { - "version": "10.8.5", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", - "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "version": "10.8.7", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", + "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", "dev": true, "requires": { "async": "^3.2.3", "chalk": "^4.0.2", - "filelist": "^1.0.1", - "minimatch": "^3.0.4" + "filelist": "^1.0.4", + "minimatch": "^3.1.2" } }, "jest": { @@ -16988,6 +19705,12 @@ "supports-color": "^7.0.0" } }, + "js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -17066,13 +19789,13 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonfile": { @@ -17094,13 +19817,15 @@ } }, "jsx-ast-utils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.2.tgz", - "integrity": "sha512-HDAyJ4MNQBboGpUnHAVUNJs6X0lh058s6FuixsFGP7MgJYpD6Vasd6nzSG5iIfXu1zAYlHJ/zsOKNlrenTUBnw==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "object.assign": "^4.1.2" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" } }, "kind-of": { @@ -17123,18 +19848,18 @@ "dev": true }, "language-subtag-registry": { - "version": "0.3.21", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", - "integrity": "sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", + "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==", "dev": true }, "language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", "dev": true, "requires": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" } }, "leven": { @@ -17450,12 +20175,59 @@ "object-visit": "^1.0.0" } }, + "markdown-escapes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", + "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", + "dev": true + }, + "markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dev": true, + "requires": { + "repeat-string": "^1.0.0" + } + }, "mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", "dev": true }, + "mdast-util-compact": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", + "dev": true, + "requires": { + "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + } + }, + "unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + } + } + } + }, "mdast-util-from-markdown": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", @@ -17652,9 +20424,9 @@ "dev": true }, "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true }, "nanomatch": { @@ -17683,31 +20455,35 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "next": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/next/-/next-12.3.1.tgz", - "integrity": "sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==", - "dev": true, - "requires": { - "@next/env": "12.3.1", - "@next/swc-android-arm-eabi": "12.3.1", - "@next/swc-android-arm64": "12.3.1", - "@next/swc-darwin-arm64": "12.3.1", - "@next/swc-darwin-x64": "12.3.1", - "@next/swc-freebsd-x64": "12.3.1", - "@next/swc-linux-arm-gnueabihf": "12.3.1", - "@next/swc-linux-arm64-gnu": "12.3.1", - "@next/swc-linux-arm64-musl": "12.3.1", - "@next/swc-linux-x64-gnu": "12.3.1", - "@next/swc-linux-x64-musl": "12.3.1", - "@next/swc-win32-arm64-msvc": "12.3.1", - "@next/swc-win32-ia32-msvc": "12.3.1", - "@next/swc-win32-x64-msvc": "12.3.1", - "@swc/helpers": "0.4.11", + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/next/-/next-14.0.4.tgz", + "integrity": "sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==", + "dev": true, + "requires": { + "@next/env": "14.0.4", + "@next/swc-darwin-arm64": "14.0.4", + "@next/swc-darwin-x64": "14.0.4", + "@next/swc-linux-arm64-gnu": "14.0.4", + "@next/swc-linux-arm64-musl": "14.0.4", + "@next/swc-linux-x64-gnu": "14.0.4", + "@next/swc-linux-x64-musl": "14.0.4", + "@next/swc-win32-arm64-msvc": "14.0.4", + "@next/swc-win32-ia32-msvc": "14.0.4", + "@next/swc-win32-x64-msvc": "14.0.4", + "@swc/helpers": "0.5.2", + "busboy": "1.6.0", "caniuse-lite": "^1.0.30001406", - "postcss": "8.4.14", - "styled-jsx": "5.0.7", - "use-sync-external-store": "1.2.0" + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1", + "watchpack": "2.4.0" } }, "nice-try": { @@ -17718,9 +20494,9 @@ "peer": true }, "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "requires": { "whatwg-url": "^5.0.0" @@ -17729,19 +20505,19 @@ "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "requires": { "tr46": "~0.0.3", @@ -17842,7 +20618,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true }, "object-copy": { @@ -17928,11 +20704,21 @@ } }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -17950,47 +20736,60 @@ } }, "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, "object.entries": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", - "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "object.fromentries": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", - "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + } + }, + "object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" } }, "object.hasown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", - "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.4.tgz", + "integrity": "sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==", "dev": true, "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" } }, "object.pick": { @@ -18004,14 +20803,14 @@ } }, "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "once": { @@ -18042,16 +20841,10 @@ "is-wsl": "^2.1.1" } }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true - }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "requires": { "deep-is": "^0.1.3", @@ -18059,7 +20852,7 @@ "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" } }, "os-tmpdir": { @@ -18315,13 +21108,19 @@ "dev": true, "peer": true }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, "postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "requires": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } @@ -18544,9 +21343,9 @@ "dev": true }, "prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true }, "prettier-linter-helpers": { @@ -18625,6 +21424,13 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "peer": true + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -18638,9 +21444,9 @@ "dev": true }, "react": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.0.0.tgz", - "integrity": "sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dev": true, "peer": true, "requires": { @@ -18648,14 +21454,14 @@ } }, "react-dom": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.0.0.tgz", - "integrity": "sha512-XqX7uzmFo0pUceWFCt7Gff6IyIMzFUn7QMZrbrQfGxtaxXZIcGQzoNpRLE3fQLnS4XzLLPMZX2T9TRcSrasicw==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dev": true, "peer": true, "requires": { "loose-envify": "^1.1.0", - "scheduler": "^0.21.0" + "scheduler": "^0.23.0" } }, "react-is": { @@ -18771,10 +21577,25 @@ "strip-indent": "^3.0.0" } }, + "reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + } + }, "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dev": true }, "regex-not": { @@ -18789,22 +21610,17 @@ } }, "regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "remark": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", @@ -18816,6 +21632,110 @@ "unified": "^9.1.0" } }, + "remark-mdx": { + "version": "1.6.22", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz", + "integrity": "sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ==", + "dev": true, + "requires": { + "@babel/core": "7.12.9", + "@babel/helper-plugin-utils": "7.10.4", + "@babel/plugin-proposal-object-rest-spread": "7.12.1", + "@babel/plugin-syntax-jsx": "7.12.1", + "@mdx-js/util": "1.6.22", + "is-alphabetical": "1.0.4", + "remark-parse": "8.0.3", + "unified": "9.2.0" + }, + "dependencies": { + "@babel/core": { + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz", + "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.7", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.9", + "@babel/types": "^7.12.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "remark-parse": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", + "integrity": "sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==", + "dev": true, + "requires": { + "ccount": "^1.0.0", + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^2.0.0", + "vfile-location": "^3.0.0", + "xtend": "^4.0.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true + }, + "unified": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz", + "integrity": "sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==", + "dev": true, + "requires": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + } + } + } + }, "remark-parse": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz", @@ -18858,8 +21778,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "peer": true + "dev": true }, "require-from-string": { "version": "2.0.2", @@ -18874,6 +21793,13 @@ "dev": true, "peer": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "peer": true + }, "resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -18910,6 +21836,12 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -18956,13 +21888,14 @@ } }, "rivet-graphql": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/rivet-graphql/-/rivet-graphql-0.3.1.tgz", - "integrity": "sha512-HEov02XhZ6H1jOME+mO8CZwliu/UtgZSHixYUwvQ7HSx3gk8EOVaQY5c3zscOYjZECvP8cR4+1Ob3KHWJRWEMw==", + "version": "0.6.0-canary-20230309231927", + "resolved": "https://registry.npmjs.org/rivet-graphql/-/rivet-graphql-0.6.0-canary-20230309231927.tgz", + "integrity": "sha512-6+HlBIKGty0+XULdpQaXwFpXgItmNUOCSZ8a6Eit/kJzXPp7YVyBMvCN9ozaRVqHUK8PiToGB+jg+jo8/V+bgw==", "dev": true, "requires": { - "graphql": "^15.3.0", - "graphql-request": "^3.0.0" + "@graphql-typed-document-node/core": "^3.1.2", + "graphql": "^16.6.0", + "graphql-request": "~5.1.0" } }, "rsvp": { @@ -18996,6 +21929,26 @@ "tslib": "^1.9.0" } }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -19012,6 +21965,17 @@ "ret": "~0.1.10" } }, + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -19293,9 +22257,9 @@ } }, "scheduler": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", - "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dev": true, "peer": true, "requires": { @@ -19317,12 +22281,6 @@ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, - "semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", - "dev": true - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -19330,6 +22288,32 @@ "dev": true, "peer": true }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -19386,14 +22370,15 @@ "peer": true }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, "signal-exit": { @@ -19815,6 +22800,12 @@ } } }, + "state-toggle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", + "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -19908,6 +22899,21 @@ } } }, + "stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "requires": { + "internal-slot": "^1.0.4" + } + }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -19962,39 +22968,57 @@ } }, "string.prototype.matchall": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", - "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.4.1", - "side-channel": "^1.0.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "stringify-object": { @@ -20059,11 +23083,13 @@ "dev": true }, "styled-jsx": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.7.tgz", - "integrity": "sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", "dev": true, - "requires": {} + "requires": { + "client-only": "0.0.1" + } }, "stylelint": { "version": "13.8.0", @@ -20293,6 +23319,24 @@ "dev": true, "peer": true }, + "synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "requires": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "dependencies": { + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + } + } + }, "table": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", @@ -20337,6 +23381,12 @@ } } }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -20363,7 +23413,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "throat": { @@ -20379,6 +23429,16 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "requires": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, "tlds": { "version": "1.231.0", "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.231.0.tgz", @@ -20459,21 +23519,22 @@ } }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "peer": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "dependencies": { "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, "peer": true } @@ -20489,12 +23550,24 @@ "punycode": "^2.1.1" } }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==", + "dev": true + }, "trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true }, + "trim-trailing-lines": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz", + "integrity": "sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ==", + "dev": true + }, "trough": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", @@ -20520,21 +23593,21 @@ } }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "requires": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" @@ -20543,7 +23616,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true } } @@ -20585,6 +23658,58 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -20602,17 +23727,27 @@ "peer": true }, "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, + "unherit": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", + "integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", + "dev": true, + "requires": { + "inherits": "^2.0.0", + "xtend": "^4.0.0" + } + }, "unified": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", @@ -20635,6 +23770,84 @@ } } }, + "unified-lint-rule": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.1.1.tgz", + "integrity": "sha512-vsLHyLZFstqtGse2gvrGwasOmH8M2y+r2kQMoDSWzSqUkQx2MjHjvZuGSv5FUaiv4RQO1bHRajy7lSGp7XWq5A==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "trough": "^2.0.0", + "unified": "^10.0.0", + "vfile": "^5.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true + }, + "is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true + }, + "trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "dev": true + }, + "unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + }, + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + } + } + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -20672,6 +23885,38 @@ "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", "dev": true }, + "unist-util-remove-position": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", + "integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", + "dev": true, + "requires": { + "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + } + }, + "unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + } + } + } + }, "unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", @@ -20681,6 +23926,49 @@ "@types/unist": "^2.0.2" } }, + "unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "dependencies": { + "unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + } + } + }, + "unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "dependencies": { + "unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + } + } + }, "universalify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", @@ -20747,6 +24035,17 @@ "dev": true, "peer": true }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "peer": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "url-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-regex/-/url-regex-5.0.0.tgz", @@ -20764,13 +24063,6 @@ "dev": true, "peer": true }, - "use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "dev": true, - "requires": {} - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -20834,6 +24126,62 @@ "vfile-message": "^2.0.0" } }, + "vfile-location": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", + "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==", + "dev": true + }, + "vfile-matter": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-matter/-/vfile-matter-4.0.1.tgz", + "integrity": "sha512-ZeACdaxCOxhePpoLO4A5y/VgI9EuWBXu+sUk65aQ7lXBZDFg7X0tuOzigLJUtsQzazFt6K2m9SdlDxZdfL5vVg==", + "dev": true, + "requires": { + "is-buffer": "^2.0.0", + "vfile": "^5.0.0", + "yaml": "^2.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + }, + "yaml": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "dev": true + } + } + }, "vfile-message": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", @@ -20844,6 +24192,216 @@ "unist-util-stringify-position": "^2.0.0" } }, + "vfile-reporter": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-7.0.5.tgz", + "integrity": "sha512-NdWWXkv6gcd7AZMvDomlQbK3MqFWL1RlGzMn++/O2TI+68+nqxCPTvLugdOtfSzXmjh+xUyhp07HhlrbJjT+mw==", + "dev": true, + "requires": { + "@types/supports-color": "^8.0.0", + "string-width": "^5.0.0", + "supports-color": "^9.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile": "^5.0.0", + "vfile-message": "^3.0.0", + "vfile-sort": "^3.0.0", + "vfile-statistics": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "supports-color": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.3.1.tgz", + "integrity": "sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + } + } + }, + "vfile-reporter-json": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/vfile-reporter-json/-/vfile-reporter-json-3.3.0.tgz", + "integrity": "sha512-/zgRtjxQ2UGJn+HViiZ7+nIXtUzkkXFQum3BmaS/bSyr10P0X41ETRqqwMJ95RtbKUah3m7pKb6oS1eZeXXHzQ==", + "dev": true, + "requires": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + } + } + }, + "vfile-sort": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-3.0.1.tgz", + "integrity": "sha512-1os1733XY6y0D5x0ugqSeaVJm9lYgj0j5qdcZQFyxlZOSy1jYarL77lLyb5gK4Wqr1d5OxmuyflSO3zKyFnTFw==", + "dev": true, + "requires": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + } + } + }, + "vfile-statistics": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-2.0.1.tgz", + "integrity": "sha512-W6dkECZmP32EG/l+dp2jCLdYzmnDBIw6jwiLZSER81oR5AHRcVqL+k3Z+pfH1R73le6ayDkJRMk0sutj1bMVeg==", + "dev": true, + "requires": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + } + } + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -20874,6 +24432,16 @@ "makeerror": "1.0.12" } }, + "watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, "webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", @@ -20932,6 +24500,46 @@ "is-symbol": "^1.0.3" } }, + "which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "requires": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "requires": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -20939,16 +24547,37 @@ "dev": true, "peer": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true + "which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wrap-ansi": { @@ -21002,6 +24631,12 @@ "dev": true, "peer": true }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -21107,6 +24742,12 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true }, + "zod": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", + "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", + "dev": true + }, "zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", diff --git a/website/package.json b/website/package.json index 1ec08a0f6b9..9f528546709 100644 --- a/website/package.json +++ b/website/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "author": "HashiCorp", "devDependencies": { - "@hashicorp/platform-cli": "^2.1.0", + "@hashicorp/platform-cli": "^2.8.0", "dart-linkcheck": "2.0.15", "husky": "4.3.8", "next": "^12.3.1", @@ -21,9 +21,11 @@ "format": "next-hashicorp format", "lint": "next-hashicorp lint", "start": "./scripts/website-start.sh", - "linkcheck": "linkcheck https://packer.io" + "linkcheck": "linkcheck https://packer.io", + "content-check": "hc-content --config base-docs", + "prepare": "cd .. && husky website/.husky" }, "engines": { - "npm": ">=7.0.0" + "npm": ">=9.6.7" } } diff --git a/website/public/img/logo-hashicorp.svg b/website/public/img/logo-hashicorp.svg index 2e49a3d1545..597cd773d0c 100644 --- a/website/public/img/logo-hashicorp.svg +++ b/website/public/img/logo-hashicorp.svg @@ -1,6 +1,6 @@ - - + + diff --git a/website/public/img/logo-packer-padded.svg b/website/public/img/logo-packer-padded.svg index cbafec1f9c7..4261cc7b26c 100644 --- a/website/public/img/logo-packer-padded.svg +++ b/website/public/img/logo-packer-padded.svg @@ -1,5 +1,5 @@ - diff --git a/website/public/img/logo-text.svg b/website/public/img/logo-text.svg index c1a7cf7e11b..195e3d553fc 100644 --- a/website/public/img/logo-text.svg +++ b/website/public/img/logo-text.svg @@ -1,5 +1,5 @@ - - + +