diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..85ae471 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,29 @@ +*.dll +*.exe +.DS_Store +example.tf +terraform.tfplan +terraform.tfstate +bin/ +dist/ +modules-dev/ +/pkg/ +vendor +website/.vagrant +website/.bundle +website/build +website/node_modules +.vagrant/ +*.backup +.git +.github +./*.tfstate +.terraform/ +*.log +*.bak +*~ +.*.swp +.idea +*.iml +*.test +*.iml \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0c8b092 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Code of Conduct + +HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code. + +Please read the full text at https://www.hashicorp.com/community-guidelines diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6cb06e8..41634b2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,17 +13,15 @@ jobs: runs-on: ubuntu-latest env: GOPRIVATE: github.com/Mirantis/mcc - GH_ACCESS_TOKEN: ${{ secrets.GH_MCC_ACCESS_TOKEN }} - GH_USERNAME: ${{ secrets.GH_MCC_USERNAME }} steps: - uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: '1.20' - name: Setup MCC gitub repo private access - run: git config --global url."https://$GH_USERNAME:$GH_ACCESS_TOKEN@github.com/".insteadOf "https://github.com/" + run: git config --global url."https://${{ secrets.GH_MCC_USERNAME }}:${{ secrets.GH_MCC_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/" - name: Build run: go build -v ./... diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index c382f81..f8f0881 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -12,5 +12,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for submitting an issue to the Mirantis Terraform Provider' - pr-message: 'Thank you for contributing to the Mirantis Terraform Provider' + issue-message: 'Thank you for submitting an issue to the Mirantis Launchpad Provider' + pr-message: 'Thank you for contributing to the Mirantis Launchpad Provider' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c588253..2754673 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,13 +19,9 @@ permissions: jobs: goreleaser: runs-on: ubuntu-latest - env: - GH_ACCESS_TOKEN: ${{ secrets.GH_MCC_ACCESS_TOKEN }} - GH_USERNAME: ${{ secrets.GH_MCC_USERNAME }} - steps: - name: Setup MCC gitub repo private access - run: git config --global url."https://$GH_USERNAME:$GH_ACCESS_TOKEN@github.com/".insteadOf "https://github.com/" + run: git config --global url."https://${{ secrets.GH_MCC_USERNAME }}:${{ secrets.GH_MCC_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/" - name: Checkout uses: actions/checkout@v3 @@ -47,11 +43,11 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4.2.0 + uses: goreleaser/goreleaser-action@v4.3.0 with: version: latest args: release --rm-dist env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} # GitHub sets this automatically - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 04ab7f0..c67c5c8 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v6 + - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'Stale issue message' diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index d5740c5..c012902 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -16,7 +16,7 @@ jobs: - name: 'Checkout' uses: actions/checkout@v3 - name: 'Tag' - uses: anothrNick/github-tag-action@1.61.0 + uses: anothrNick/github-tag-action@1.67.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fa25671 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,91 @@ +# Terraform Provider testing workflow. +name: Tests + +# This GitHub action runs your tests for each pull request and push. +# Optionally, you can turn it on using a schedule for regular testing. +on: + pull_request: + paths-ignore: + - 'README.md' + push: + paths-ignore: + - 'README.md' + +# Testing only needs permissions to read the repository contents. +permissions: + contents: read + +jobs: + # Ensure project builds before running testing matrix + build: + name: Build + runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/Mirantis/mcc + timeout-minutes: 5 + steps: + - name: Setup MCC gitub repo private access + run: git config --global url."https://${{ secrets.GH_MCC_USERNAME }}:${{ secrets.GH_MCC_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - uses: actions/checkout@v3.5.2 + - uses: actions/setup-go@v4.0.1 + with: + go-version-file: 'go.mod' + cache: true + - run: go mod download + - run: go build -v . + - name: Run linters + uses: golangci/golangci-lint-action@v3.6.0 + with: + version: latest + + generate: + runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/Mirantis/mcc + steps: + - name: Setup MCC gitub repo private access + run: git config --global url."https://${{ secrets.GH_MCC_USERNAME }}:${{ secrets.GH_MCC_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - uses: actions/checkout@v3.5.2 + - uses: actions/setup-go@v4.0.1 + with: + go-version-file: 'go.mod' + cache: true + - run: go generate ./... + - name: git diff + run: | + git diff --compact-summary --exit-code || \ + (echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1) + + # Run acceptance tests in a matrix with Terraform CLI versions + test: + name: Terraform Provider Acceptance Tests + needs: build + runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/Mirantis/mcc + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + # list whatever Terraform versions here you would like to support + terraform: + - '1.4.*' + steps: + - name: Setup MCC gitub repo private access + run: git config --global url."https://${{ secrets.GH_MCC_USERNAME }}:${{ secrets.GH_MCC_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/" + + - uses: actions/checkout@v3.5.2 + - uses: actions/setup-go@v4.0.1 + with: + go-version-file: 'go.mod' + cache: true + - uses: hashicorp/setup-terraform@v2.0.3 + with: + terraform_version: ${{ matrix.terraform }} + terraform_wrapper: false + - run: go mod download + - name: run acceptance unit tests + run: TF_ACC=1 go test -v -cover ./internal/provider/ + timeout-minutes: 10 diff --git a/.gitignore b/.gitignore index 47cb178..f400e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,36 @@ -# Go related ignores -bin +*.dll +*.exe +.DS_Store +example.tf +terraform.tfplan +terraform.tfstate +bin/ +dist/ +modules-dev/ +/pkg/ vendor +website/.vagrant +website/.bundle +website/build +website/node_modules +.vagrant/ +*.backup +./*.tfstate +.terraform/ +*.log +*.bak +*~ +.*.swp +.idea +*.iml +*.test +*.iml + +website/vendor + +# Test exclusions +!command/test-fixtures/**/*.tfstate +!command/test-fixtures/**/.terraform/ + +# Keep windows files with windows line endings +*.winfile eol=crlf diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..28f6de2 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,26 @@ +# Visit https://golangci-lint.run/ for usage documentation +# and information on other useful linters +issues: + max-per-linter: 0 + max-same-issues: 0 + +linters: + disable-all: true + enable: + - durationcheck + - errcheck + - exportloopref + - forcetypeassert + - gofmt + - gosimple + - ineffassign + - makezero + - misspell + - nilerr + - predeclared + - staticcheck + - tenv + - unconvert + - unparam + - unused + - vet diff --git a/.goreleaser.yml b/.goreleaser.yml index d17df01..9bb0aa7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -5,10 +5,7 @@ before: # this is just an example and not a requirement for provider building/publishing - go mod tidy builds: -- main: ./cmd/mirantis-mke - id: "terraform-provider-mke" - binary: "terraform-provider-mke_v{{ .Version }}" - env: +- env: # goreleaser does not work with CGO, it could also complicate # usage by users in CI/CD systems like Terraform Cloud where # they are unable to install libraries. @@ -19,9 +16,9 @@ builds: ldflags: - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' goos: - - linux - freebsd - windows + - linux - darwin goarch: - amd64 @@ -31,14 +28,15 @@ builds: ignore: - goos: darwin goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' archives: - format: zip - name_template: 'terraform-provider-mke_{{ .Version }}_{{ .Os }}_{{ .Arch }}' + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' checksum: extra_files: - glob: 'terraform-registry-manifest.json' - name_template: 'terraform-provider-mke_{{ .Version }}_manifest.json' - name_template: 'terraform-provider-mke_{{ .Version }}_SHA256SUMS' + name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 signs: - artifacts: checksum @@ -55,7 +53,7 @@ signs: release: extra_files: - glob: 'terraform-registry-manifest.json' - name_template: 'terraform-provider-mke_{{ .Version }}_manifest.json' + name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' # If you want to manually examine the release before its live, uncomment this line: # draft: true changelog: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f9b52f1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +## 0.1.0 (Unreleased) + +FEATURES: + + 1. Initial mke config resource. + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 678b211..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,128 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -tools@mirantis.com. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index bd6ed78..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,46 +0,0 @@ -## Contributing - -Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. - -## Branching strategy - -In general, contributors should develop on branches based off of `main` and pull requests should be to `main`. - -See [Understanding the GitHub flow](https://guides.github.com/introduction/flow/) for more information. - -## Submitting a pull request - -1. Clone the repository on GitHub. -2. Create a named feature branch. (i.e. `add-new-module`) -3. Write your change. -4. Push to your branch and submit a pull request from your branch to `main`. - -## Building - -Builds happen with each push to a pull request. If you want to start building right away but you aren't ready for -code review you can open a _Draft Pull Request_. This will not notify any Reviewers that may be configured in -the [`CODEOWNERS`](CODEOWNERS) file until you change it to _Ready for Review_. - -All builds for this repo can be found under the **Actions** tab and are also located -under the **Checks** tab of the pull request. You may want to consider using the -[GitHub Slack Integration](https://github.com/integrations/slack) to get -Slack notifications of your build status. - -## Releasing - -Deployments are executed automatically when a pull request is merged into the `main` branch. -Deployment status is posted to the [deploy channel](https://app.slack.com/client/T04DBLC6L/CPMDV4KNU) in Slack. -You can also check the deployment status by selecting the **Environments** link under the **Code** tab. - -## Optional - -This repo uses [pre-commit](https://pre-commit.com/) for identifying simple issues before submission to code review. -The following tools are required to execute the hooks. For Mac OS X you can use [Homebrew](https://brew.sh/) and -for Windows you can use [Chocolatey](https://www.chocolatey.org/) to install. - -| Name | OS | Installation | -|:-----|:---|:-------------| -| [Terraform](https://www.terraform.io/downloads.html) | Mac | `$ brew install terraform` | -| | Windows | `$ choco install terraform-docs` | -| [TFLint](https://github.com/terraform-linters/tflint) | Mac | `$ brew install tflint` | -| | Windows | `$ choco install tfsec` | diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8f1998f..0000000 --- a/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM ubuntu:20.04 -## TODO WILL ADD IN MORE CONTENT -## WILL HAVE IT'S OWN IMAGE -## WILL OFFER A CONTAINERIZED VERSION AND SHELL SESSION TO TERRAFORM ENVIRONMNET -## WILL TEST TERAFORM PROVIDERS INSIDE THE CONTAINER -COPY . /app -RUN make /app -ENTRYPOINT ["/bin/bash"] diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..c214772 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,23 @@ +default: test + +LOCAL_TAG=$(shell git describe --tags) + +GOOS=$(shell go env GOOS) +GOARCH=$(shell go env .GOARCH) + +# Run local unit tests (which use the acceptance test suite) +# @NOTE these are run with the provider/resources in testing mode +.PHONY: testacc +testacc: + TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m + +# Lint by running golangci-lint in a docker container +.PHONY: lint +lint: + docker run -ti --rm -v "$(CURDIR):/data" -w "/data" golangci/golangci-lint:latest golangci-lint run + +# Local install of the plugin +.PHONY: local +local: + GORELEASER_CURRENT_TAG="$(LOCAL_TAG)" goreleaser build --clean --single-target --skip-validate + # @SEE README.md on how to use the locally built plugin diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index f87f5c1..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1 +0,0 @@ -# TODO \ No newline at end of file diff --git a/LICENSE b/LICENSE index d6f6994..15eba9d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,375 @@ -MIT License - -Copyright (c) 2022 Richard Barrett - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Copyright (c) 2021 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. diff --git a/Makefile b/Makefile deleted file mode 100644 index 561caa9..0000000 --- a/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -TERRAFORM_PROVIDER_ROOT=mirantis.com/providers -BINARY_ROOT=terraform-provider -INSTALL_ROOT?=$(HOME)/.terraform.d/plugins -LOCAL_BIN_PATH?=./bin -TEST_TF_CHART_ROOT?=${CURDIR}/test/launchpad -TF_LOCK_FILE?=${TEST_TF_CHART_ROOT}/.terraform.lock.hcl - -VERSION=0.9.0 - -PROVIDERS?=mirantis-mke -ARCHES?=amd64 arm64 -OSES?=linux darwin - -GO=$(shell which go) - -default: install - -.PHONY: clean -clean: - rm -rf "$(LOCAL_BIN_PATH)" - rm -rf "$(INSTALL_ROOT)/$(TERRAFORM_PROVIDER_ROOT)" - -.PHONY: build -build: - mkdir -p $(LOCAL_BIN_PATH) - for PROVIDER in $(PROVIDERS); do \ - for OS in $(OSES); do \ - for ARCH in $(ARCHES); do \ - GOOS=$$OS GOARCH=$$ARCH $(GO) build -v -o "$(LOCAL_BIN_PATH)/$(BINARY_ROOT)-$$PROVIDER-$$OS_$$ARCH" "./cmd/$$PROVIDER"; \ - done; \ - done; \ - done; - -.PHONY: release -release: - goreleaser release --rm-dist --snapshot --skip-publish --skip-sign - -.PHONY: install -install: build - for PROVIDER in $(PROVIDERS); do \ - for OS in $(OSES); do \ - for ARCH in $(ARCHES); do \ - mkdir -p "$(INSTALL_ROOT)/$(TERRAFORM_PROVIDER_ROOT)/$$PROVIDER/$(VERSION)/$${OS}_$${ARCH}"; \ - cp "$(LOCAL_BIN_PATH)/$(BINARY_ROOT)-$$PROVIDER-$$OS_$$ARCH" "$(INSTALL_ROOT)/$(TERRAFORM_PROVIDER_ROOT)/$$PROVIDER/$(VERSION)/$${OS}_$${ARCH}/$(BINARY_ROOT)-$$PROVIDER"; \ - done; \ - done; \ - done; - -.PHONY: test-unit -test-unit: - go test -v -cover ./... - -.PHONY: test-integration -test-integration: - # Running integration tests. - # - # You need the following env variables: - # -> MKE integration tests: - # MKE_HOST - # MKE_USERNAME - # MKE_PASSWORD - # - go test -v -cover --tags=integration ./... - -.PHONY: test-acc -test-acc: - TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m - -.PHONY: test-acceptance -test-acceptance: clean build install test-unit - rm -f ${TF_LOCK_FILE} - terraform -chdir=${TEST_TF_CHART_ROOT} init --upgrade - terraform -chdir=${TEST_TF_CHART_ROOT} apply -auto-approve - #terraform -chdir=${TEST_TF_CHART_ROOT} destroy -auto-approve - -.PHONY: tf-destroy -tf-destroy: - terraform -chdir=${TEST_TF_CHART_ROOT} destroy -auto-approve diff --git a/README.md b/README.md index 00507da..f82564d 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,123 @@ -# terraform-provider-mirantis +# Mirantis MKE provider -Terraform providers to manage Mirantis Products. +Mirantis MKE provider for managing resources in a running MKE stack. -[![CodeQL](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/codeql-analysis.yml) -[![Go](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/go.yml) -[![Go Reference](https://pkg.go.dev/badge/github.com/Mirantis/terraform-provider-mirantis.svg)](https://pkg.go.dev/github.com/Mirantis/terraform-provider-mirantis) -[![Greetings](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/greetings.yml/badge.svg?branch=main)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/greetings.yml) -[![Labeler](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/label.yml/badge.svg)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/label.yml) -[![tag](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/tag.yml/badge.svg)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/tag.yml) -[![tfsec](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/tfsec.yaml/badge.svg)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/tfsec.yaml) -[![validate](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/validate.yml/badge.svg)](https://github.com/Mirantis/terraform-provider-mirantis/actions/workflows/validate.yml) +This provider does not currently install MKE. -## contributions +## Requirements + +- [Terraform](https://www.terraform.io/downloads.html) >= 1.4 +- [Go](https://golang.org/doc/install) >= 1.20 +- [GoReleaser](https://goreleaser.com/) : If you want to use it locally + +## Building The Provider + +1. Clone the repository +2. Enter the repository directory +3. Build the provider using the `make local` command (uses goreleaser) + +```shell + $/> make local +``` + +## Adding Dependencies + +This provider uses [Go modules](https://github.com/golang/go/wiki/Modules). +Please see the Go documentation for the most up to date information about using +Go modules. + +To add a new dependency `github.com/author/dependency` to your Terraform provider: + +```shell +go get github.com/author/dependency +go mod tidy +``` + +Then commit the changes to `go.mod` and `go.sum`. + +## Using the provider + +The provider, once installed properly can be used in any terraform root/chart. + +### Using the released provider + +Go to the terraform registry page and follow the instructions for declaring +the provider version in your chart/module + +@see https://registry.terraform.io/providers/Mirantis/launchpad/latest + +### Using the local source code provider + +The `make local` target will use goreleaser to build the provider, and +then provide instructions on how to configure `terraform` to use the +provider locally, + +@see https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers + +## Developing the Provider + +### Using the local provider + +You can develop the provider locally, and test the development version by building +the plugin locally, and then configuring terraform to use the local version as a +`dev_override` for the production version. + +To build the local plugin: +``` +make local +``` + +It is recommended that you use the `dev_override` by using a special TF config file +and running terraform with an environment variable telling it to use the special file. +This avoids using the development version globally, preventing simple mistakes. + +First create a file like my_tf_config_file: + +``` +provider_installation { +# This disables the version and checksum verifications for this provider +# and forces Terraform to look for the launchpad provider plugin in the +# given directory. +dev_overrides { + "mirantis/mke" = "path/to/this/repo/dist/terraform-provider-mke_linux_amd64_v1" +} +# For all other providers, install them directly from their origin provider +# registries as normal. If you omit this, Terraform will _only_ use +# the dev_overrides block, and so no other providers will be available. +direct {} +} +``` + +@NOTE that you mus replace `linux` and `amd64` if you are on a Mac/Windows machine + or not on a 64bit intel/amd processor. See `go env GOOS` and `go env GOARCH` for + the correct values. + +then run terraform with a config file override pointing to the new file: +``` + $/> TF_CLI_CONFIG_FILE=my_tf_config_file terraform plan +``` +(or use an environment variable export) + +@see: https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers" + +### Contributing + +To generate or update documentation, run `go generate`. + +In order to run the testing mode unit test suite: -## directory structure overview +``` +make test +``` -## discussions +In order to run the full suite of Acceptance tests, run `make testacc`. -## docs +*Note:* Acceptance tests require that you have an environment set up for + testing that launchpad can use. -## workflows +```shell +make testacc +``` ## Requirements diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 83698b3..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,22 +0,0 @@ -# Security Policy - -## Supported Versions - -Use this section to tell people about which versions of your project are -currently being supported with security updates. - -| Version | Supported | -| ------- | ------------------ | -| 5.1.x | :white_check_mark: | -| 5.0.x | :x: | -| 4.0.x | :white_check_mark: | -| < 4.0 | :x: | - -## TODO -## Reporting a Vulnerability - -Use this section to tell people how to report a vulnerability. - -Tell them where to go, how often they can expect to get an update on a -reported vulnerability, what to expect if the vulnerability is accepted or -declined, etc. diff --git a/cmd/mirantis-mke/main.go b/cmd/mirantis-mke/main.go deleted file mode 100644 index c327162..0000000 --- a/cmd/mirantis-mke/main.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" - - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/connect" -) - -func main() { - plugin.Serve(&plugin.ServeOpts{ - ProviderFunc: func() *schema.Provider { - return connect.Provider() - }, - }) -} diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 85c4623..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,2 +0,0 @@ -# TODO NEED TO MAKE DOCKER-COMPOSE FILE -# WILL ENCAPSULATE THE ENTIRE CONTAINER AND OFFER A TESTING ENVIRONMENT FOR CHANGES TO THE TERRAFORM PROVIDER \ No newline at end of file diff --git a/docs/data-sources/instances.md b/docs/data-sources/instances.md deleted file mode 100644 index ab6bece..0000000 --- a/docs/data-sources/instances.md +++ /dev/null @@ -1 +0,0 @@ -# data-sources diff --git a/docs/index.md b/docs/index.md index 36eabee..e8682de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1 +1,36 @@ -# Mirantis Provider Docs +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "mke Provider" +subcategory: "" +description: |- + +--- + +# mke Provider + + + +## Example Usage + +```terraform +provider "mke" { + host = "https://my.mke.url" + username = "my-user" + password = "my-password" + + unsafeSSL = true +} +``` + + +## Schema + +### Required + +- `endpoint` (String) MKE API Endpoint address with schema; e.g. https://my.mke.com +- `password` (String, Sensitive) MKE API user password +- `username` (String) MKE API username + +### Optional + +- `unsafe_ssl_client` (Boolean) Bypass SSL validation for hte API server. Use only for development systems diff --git a/docs/resources/clientbundle.md b/docs/resources/clientbundle.md new file mode 100644 index 0000000..98b19a7 --- /dev/null +++ b/docs/resources/clientbundle.md @@ -0,0 +1,42 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "mke_clientbundle Resource - terraform-provider-mke" +subcategory: "" +description: |- + Client Bundle resource for access to MKE api/kubernetes/docker-swarm features. +--- + +# mke_clientbundle (Resource) + +Client Bundle resource for access to MKE api/kubernetes/docker-swarm features. + +## Example Usage + +```terraform +# install Mirantis products using parametrized launchpad +resource "mke_clientbundle" "example" { + label = "my terraform client bundle for admin user" +} +``` + + +## Schema + +### Required + +- `label` (String) Label used for the client bundle + +### Read-Only + +- `ca_cert` (String) MKE Server CA certificate +- `client_cert` (String) MKE Client certificate for the user +- `id` (String) The ID of this resource. +- `kube_ca_cert` (String) MKE Kubernetes API CA certificate +- `kube_client_cert` (String) MKE Kubernetes API client certificate +- `kube_client_key` (String, Sensitive) MKE Kubernetes API client key +- `kube_host` (String) MKE Kubernetes API host endpoint +- `kube_yaml` (String, Sensitive) MKE Kubernetes API client configuration yaml file +- `private_key` (String, Sensitive) MKE Private key for the user +- `public_key` (String) MKE Public key for the user + + diff --git a/docs/resources/instance.md b/docs/resources/instance.md deleted file mode 100644 index 3c1229e..0000000 --- a/docs/resources/instance.md +++ /dev/null @@ -1 +0,0 @@ -# Resources diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..189aa96 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,8 @@ +# Examples + +This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI. + +The document generation tool looks for files in the following locations by default. All other *.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or ar testable even if some parts are not relevant for the documentation. + +* **provider/provider.tf** example file for the provider index page +* **resources/`full resource name`/resource.tf** example file for the named data source page diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf new file mode 100644 index 0000000..b0d9f81 --- /dev/null +++ b/examples/provider/provider.tf @@ -0,0 +1,7 @@ +provider "mke" { + host = "https://my.mke.url" + username = "my-user" + password = "my-password" + + unsafeSSL = true +} diff --git a/examples/resources/mke_clientbundle/resource.tf b/examples/resources/mke_clientbundle/resource.tf new file mode 100644 index 0000000..8889ec1 --- /dev/null +++ b/examples/resources/mke_clientbundle/resource.tf @@ -0,0 +1,4 @@ +# install Mirantis products using parametrized launchpad +resource "mke_clientbundle" "example" { + label = "my terraform client bundle for admin user" +} diff --git a/go.mod b/go.mod index a3c2e17..45ce088 100644 --- a/go.mod +++ b/go.mod @@ -1,48 +1,76 @@ -module github.com/Mirantis/terraform-provider-mirantis +module github.com/Mirantis/terraform-provider-mke -go 1.17 +go 1.20 require ( - github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 + github.com/hashicorp/terraform-plugin-docs v0.14.1 + github.com/hashicorp/terraform-plugin-framework v1.3.2 + github.com/hashicorp/terraform-plugin-go v0.17.0 + github.com/hashicorp/terraform-plugin-log v0.9.0 + github.com/hashicorp/terraform-plugin-testing v1.2.0 gopkg.in/yaml.v2 v2.4.0 ) require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Microsoft/go-winio v0.6.0 // indirect github.com/agext/levenshtein v1.2.2 // indirect - github.com/apparentlymart/go-textseg v1.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/fatih/color v1.7.0 // indirect - github.com/golang/protobuf v1.4.2 // indirect - github.com/google/go-cmp v0.5.6 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/armon/go-radix v1.0.0 // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-hclog v0.16.1 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.1 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/hashicorp/go-version v1.3.0 // indirect - github.com/hashicorp/hcl/v2 v2.3.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.5.0 // indirect - github.com/hashicorp/terraform-plugin-log v0.2.0 // indirect - github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect - github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hc-install v0.5.0 // indirect + github.com/hashicorp/hcl/v2 v2.16.2 // indirect + github.com/hashicorp/logutils v1.0.0 // indirect + github.com/hashicorp/terraform-exec v0.18.1 // indirect + github.com/hashicorp/terraform-json v0.16.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 // indirect + github.com/hashicorp/terraform-registry-address v0.2.1 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/mattn/go-colorable v0.1.6 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect + github.com/posener/complete v1.2.3 // indirect + github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/russross/blackfriday v1.6.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/stretchr/testify v1.8.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/zclconf/go-cty v1.9.1 // indirect - golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect - golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect - golang.org/x/text v0.3.5 // indirect - google.golang.org/appengine v1.6.6 // indirect - google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect - google.golang.org/grpc v1.32.0 // indirect - google.golang.org/protobuf v1.25.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty v1.13.1 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/mod v0.8.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + google.golang.org/grpc v1.56.1 // indirect + google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/go.sum b/go.sum index 18c7bc0..02c9917 100644 --- a/go.sum +++ b/go.sum @@ -1,552 +1,296 @@ -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.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= -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/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/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= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +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/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/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +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/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/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -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/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= -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-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= 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/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +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/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/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-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/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/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= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +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/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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -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/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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/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/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +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/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-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= -github.com/hashicorp/go-hclog v0.16.1/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-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 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.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= -github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= +github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= github.com/hashicorp/go-uuid v1.0.0/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.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= -github.com/hashicorp/go-version v1.3.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/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +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/hc-install v0.5.0 h1:D9bl4KayIYKEeJ4vUDe9L5huqxZXczKaykSRcmQ0xY0= +github.com/hashicorp/hc-install v0.5.0/go.mod h1:JyzMfbzfSBSjoDCRPna1vi/24BEDxFaCPfdHtM5SCdo= +github.com/hashicorp/hcl/v2 v2.16.2 h1:mpkHZh/Tv+xet3sy3F9Ld4FyI2tUpWe9x3XtPx9f1a0= +github.com/hashicorp/hcl/v2 v2.16.2/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.15.0/go.mod h1:H4IG8ZxanU+NW0ZpDRNsvh9f0ul7C0nHP+rUR/CHs7I= -github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= -github.com/hashicorp/terraform-plugin-go v0.5.0 h1:+gCDdF0hcYCm0YBTxrP4+K1NGIS5ZKZBKDORBewLJmg= -github.com/hashicorp/terraform-plugin-go v0.5.0/go.mod h1:PAVN26PNGpkkmsvva1qfriae5Arky3xl3NfzKa8XFVM= -github.com/hashicorp/terraform-plugin-log v0.2.0 h1:rjflRuBqCnSk3UHOR25MP1G5BDLKktTA6lNjjcAnBfI= -github.com/hashicorp/terraform-plugin-log v0.2.0/go.mod h1:E1kJmapEHzqu1x6M++gjvhzM2yMQNXPVWZRCB8sgYjg= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 h1:B9AocC+dxrCqcf4vVhztIkSkt3gpRjUkEka8AmZWGlQ= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1/go.mod h1:FjM9DXWfP0w/AeOtJoSKHBZ01LqmaO6uP4bXhv3fekw= -github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw= -github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= -github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= -github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= +github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-json v0.16.0 h1:UKkeWRWb23do5LNAFlh/K3N0ymn1qTOO8c+85Albo3s= +github.com/hashicorp/terraform-json v0.16.0/go.mod h1:v0Ufk9jJnk6tcIZvScHvetlKfiNTC+WS21mnXIlc0B0= +github.com/hashicorp/terraform-plugin-docs v0.14.1 h1:MikFi59KxrP/ewrZoaowrB9he5Vu4FtvhamZFustiA4= +github.com/hashicorp/terraform-plugin-docs v0.14.1/go.mod h1:k2NW8+t113jAus6bb5tQYQgEAX/KueE/u8X2Z45V1GM= +github.com/hashicorp/terraform-plugin-framework v1.3.2 h1:aQ6GSD0CTnvoALEWvKAkcH/d8jqSE0Qq56NYEhCexUs= +github.com/hashicorp/terraform-plugin-framework v1.3.2/go.mod h1:oimsRAPJOYkZ4kY6xIGfR0PHjpHLDLaknzuptl6AvnY= +github.com/hashicorp/terraform-plugin-go v0.17.0 h1:OpqgPLvjW3vCDA9VUEmRKppCZOG/+Vkdp6ijkG8aJek= +github.com/hashicorp/terraform-plugin-go v0.17.0/go.mod h1:l7VK+2u5Kf2y+A+742GX0ouLut3gttudmvMgN0PA74Y= +github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= +github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ= +github.com/hashicorp/terraform-plugin-testing v1.2.0 h1:pASRAe6BOZFO4xSGQr9WzitXit0nrQAYDk8ziuRfn9E= +github.com/hashicorp/terraform-plugin-testing v1.2.0/go.mod h1:+8bp3O7xUb1UtBcdknrGdVRIuTw4b62TYSIgXHqlyew= +github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= +github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +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/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -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/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 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/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= 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 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= -github.com/mattn/go-colorable v0.1.6/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.4/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.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +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/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -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-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +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/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +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 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+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/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +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/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/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc= -github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -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= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= +github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/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-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 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-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -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-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/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/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/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/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -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-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/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 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-20191009170851-d66e71096ffb/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-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-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-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-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -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/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= 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-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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/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-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-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-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-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-20201119102817-f84b799fce68/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-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20210927094055-39ccf1dd6fa6/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= 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.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-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-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-20190606124116-d0a3d012864b/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-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-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-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-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-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -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.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/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 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -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-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-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-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -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.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/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.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -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= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -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 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +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-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +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.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -554,15 +298,7 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= +gopkg.in/yaml.v3 v3.0.0/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= diff --git a/mirantis/mke/client/api_auth.go b/internal/client/api_auth.go similarity index 87% rename from mirantis/mke/client/api_auth.go rename to internal/client/api_auth.go index 680ce18..7a454da 100644 --- a/mirantis/mke/client/api_auth.go +++ b/internal/client/api_auth.go @@ -10,12 +10,12 @@ const ( URLTargetForAuth = "auth/login" ) -// MKE API json response for successful token retrieval +// MKE API json response for successful token retrieval. type loginResponse struct { Token string `json:"auth_token"` } -// NewLoginResponse create a login response +// NewLoginResponse create a login response. func NewLoginResponse(token string) loginResponse { return loginResponse{Token: token} } @@ -25,7 +25,7 @@ func (lr loginResponse) Bytes() []byte { return lrb } -// apiLogin update client Auth with a new token from an API auth request +// apiLogin update client Auth with a new token from an API auth request. func (c *Client) ApiLogin(ctx context.Context) error { req, err := c.RequestFromTargetAndJSONBody(ctx, http.MethodPost, URLTargetForAuth, c.auth) if err != nil { diff --git a/mirantis/mke/client/api_auth_test.go b/internal/client/api_auth_test.go similarity index 95% rename from mirantis/mke/client/api_auth_test.go rename to internal/client/api_auth_test.go index ff693c9..30bb761 100644 --- a/mirantis/mke/client/api_auth_test.go +++ b/internal/client/api_auth_test.go @@ -5,7 +5,7 @@ import ( "net/url" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestGoodAuthRequest(t *testing.T) { diff --git a/mirantis/mke/client/api_clientbundle.go b/internal/client/api_clientbundle.go similarity index 86% rename from mirantis/mke/client/api_clientbundle.go rename to internal/client/api_clientbundle.go index 24a37af..6d69c61 100644 --- a/mirantis/mke/client/api_clientbundle.go +++ b/internal/client/api_clientbundle.go @@ -6,13 +6,14 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" "net/http" "strings" ) const ( - URLTargetForClientBundle = "api/clientbundle" + URLTargetForClientBundle = "api/clientbundle" + URLTargetForClientBundleQueryLabel = "label" filenameCAPem = "ca.pem" filenameCertPem = "cert.pem" @@ -26,8 +27,8 @@ var ( ErrFailedToFindClientBundleMKEPublicKey = errors.New("no MKE Public key was found that matches the client bundle") ) -// ApiClientBundle retrieve a client bundle( -func (c *Client) ApiClientBundleCreate(ctx context.Context) (ClientBundle, error) { +// ApiClientBundle retrieve a client bundle. +func (c *Client) ApiClientBundleCreate(ctx context.Context, label string) (ClientBundle, error) { var cb ClientBundle req, err := c.RequestFromTargetAndBytesBody(ctx, http.MethodPost, URLTargetForClientBundle, []byte{}) @@ -35,13 +36,18 @@ func (c *Client) ApiClientBundleCreate(ctx context.Context) (ClientBundle, error return cb, err } + // @SEE https://github.com/Mirantis/orca/blob/master/controller/api/bundle.go#L35 for source. + q := req.URL.Query() + q.Add(URLTargetForClientBundleQueryLabel, label) + req.URL.RawQuery = q.Encode() + resp, err := c.doAuthorizedRequest(req) if err != nil { return cb, err } defer resp.Body.Close() - zipBytes, err := ioutil.ReadAll(resp.Body) + zipBytes, err := io.ReadAll(resp.Body) if err != nil { return cb, err } @@ -107,7 +113,6 @@ func (c *Client) ApiClientBundleCreate(ctx context.Context) (ClientBundle, error } else { cb.Kube = &kube } - } } @@ -124,7 +129,7 @@ func (c *Client) ApiClientBundleCreate(ctx context.Context) (ClientBundle, error return cb, nil } -// ApiClientBundleGetPublicKey retrieve a client bundle by finding the matching public key +// ApiClientBundleGetPublicKey retrieve a client bundle by finding the matching public key. // There isn't really a great way of doing this. func (c *Client) ApiClientBundleGetPublicKey(ctx context.Context, cb ClientBundle) (AccountPublicKey, error) { var k AccountPublicKey @@ -149,7 +154,7 @@ func (c *Client) ApiClientBundleGetPublicKey(ctx context.Context, cb ClientBundl return k, fmt.Errorf("%w; Could not match key: \n%s\n in \n%s", ErrFailedToFindClientBundleMKEPublicKey, cb.PublicKey, strings.Join(foundKeys, "\n")) } -// ApiClientBundleDelete delete a client bundle by finding and deleting the matching public key +// ApiClientBundleDelete delete a client bundle by finding and deleting the matching public key. // There isn't really a great way of doing this. func (c *Client) ApiClientBundleDelete(ctx context.Context, cb ClientBundle) error { account := c.Username() diff --git a/mirantis/mke/client/api_clientbundle_integration_test.go b/internal/client/api_clientbundle_integration_test.go similarity index 100% rename from mirantis/mke/client/api_clientbundle_integration_test.go rename to internal/client/api_clientbundle_integration_test.go diff --git a/mirantis/mke/client/api_genericrequest.go b/internal/client/api_genericrequest.go similarity index 88% rename from mirantis/mke/client/api_genericrequest.go rename to internal/client/api_genericrequest.go index 4e1b198..94ac58a 100644 --- a/mirantis/mke/client/api_genericrequest.go +++ b/internal/client/api_genericrequest.go @@ -15,12 +15,12 @@ import ( "net/http" ) -// ApiGeneric send a generic http request to the MKE API +// ApiGeneric send a generic http request to the MKE API. func (c *Client) ApiGeneric(ctx context.Context, req *http.Request) (*Response, error) { return c.doRequest(req) } -// ApiAuthorizedGeneric send a authenticated generic http request to the MKE API +// ApiAuthorizedGeneric send a authenticated generic http request to the MKE API. func (c *Client) ApiAuthorizedGeneric(ctx context.Context, req *http.Request) (*Response, error) { return c.doAuthorizedRequest(req) } diff --git a/mirantis/mke/client/api_genericrequest_test.go b/internal/client/api_genericrequest_test.go similarity index 95% rename from mirantis/mke/client/api_genericrequest_test.go rename to internal/client/api_genericrequest_test.go index 0ae0d31..6f5356e 100644 --- a/mirantis/mke/client/api_genericrequest_test.go +++ b/internal/client/api_genericrequest_test.go @@ -3,12 +3,12 @@ package client_test import ( "context" "errors" - "io/ioutil" + "io" "net/http" "net/url" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestGoodGenericRequest(t *testing.T) { @@ -36,7 +36,7 @@ func TestGoodGenericRequest(t *testing.T) { resp, err := c.ApiGeneric(ctx, req) if err != nil { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) t.Fatalf("Generic request execute failed: %s; %s", err, b) } @@ -78,7 +78,7 @@ func TestGoodGenericRequestJSON(t *testing.T) { resp, err := c.ApiGeneric(ctx, req) if err != nil { b := []byte{} - resp.Body.Read(b) + resp.Body.Read(b) //nolint:errcheck t.Fatalf("Generic request execute failed: %s; %s", err, b) } @@ -156,7 +156,7 @@ func TestGoodGenericAuthenticatedRequest(t *testing.T) { resp, err := c.ApiAuthorizedGeneric(ctx, req) if err != nil { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) t.Fatalf("Authenticated request execute failed: %s; %s", err, b) } @@ -191,7 +191,7 @@ func TestAuthenticatedPreventsUnauthenticatedRequest(t *testing.T) { resp, err := c.ApiGeneric(ctx, req) if err == nil { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) t.Fatalf("UnAuthenticated request execute was allowed: %s; %s", err, b) } @@ -230,7 +230,7 @@ func TestBadGenericAuthenticatedRequest(t *testing.T) { resp, err := c.ApiGeneric(ctx, req) if err == nil { - b, _ := ioutil.ReadAll(resp.Body) + b, _ := io.ReadAll(resp.Body) t.Fatalf("Authenticated request execute passed when it should have failed: %s; %s", err, b) } diff --git a/mirantis/mke/client/api_helper_test.go b/internal/client/api_helper_test.go similarity index 86% rename from mirantis/mke/client/api_helper_test.go rename to internal/client/api_helper_test.go index 115af19..2f9ad23 100644 --- a/mirantis/mke/client/api_helper_test.go +++ b/internal/client/api_helper_test.go @@ -2,12 +2,12 @@ package client_test import ( "encoding/json" - "io/ioutil" + "io" "net/http" "net/http/httptest" "unicode/utf8" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) /** @@ -48,7 +48,7 @@ func MockTestServer(auth *client.Auth, handlers MockHandlerMap) *httptest.Server // if the request is for the authentication path, then handle it. if path == client.URLTargetForAuth { if auth != nil { - reqBodyBytes, err := ioutil.ReadAll(r.Body) + reqBodyBytes, err := io.ReadAll(r.Body) if err != nil { w.WriteHeader(http.StatusNotAcceptable) } @@ -65,7 +65,7 @@ func MockTestServer(auth *client.Auth, handlers MockHandlerMap) *httptest.Server lr := client.NewLoginResponse(auth.Token) - w.Write(lr.Bytes()) + w.Write(lr.Bytes()) //nolint:errcheck } else { w.WriteHeader(http.StatusNotAcceptable) } @@ -76,11 +76,11 @@ func MockTestServer(auth *client.Auth, handlers MockHandlerMap) *httptest.Server if handler, ok := handlers[reqMockHandlerKey]; !ok { w.WriteHeader(http.StatusNotFound) b, _ := json.Marshal(reqMockHandlerKey) - w.Write([]byte(b)) - w.Write([]byte(" NOT FOUND IN ")) + w.Write(b) //nolint:errcheck + w.Write([]byte(" NOT FOUND IN ")) //nolint:errcheck for k := range handlers { b, _ := json.Marshal(k) - w.Write([]byte(b)) + w.Write(b) //nolint:errcheck } } else { authHeader := r.Header.Get(client.HeaderKeyAuthorization) @@ -100,24 +100,24 @@ func MockTestServer(auth *client.Auth, handlers MockHandlerMap) *httptest.Server })) } -// MockServerHandlerGeneratorReturnResponseStatus generates a MockHandler which just sets http status +// MockServerHandlerGeneratorReturnResponseStatus generates a MockHandler which just sets http status. func MockServerHandlerGeneratorReturnResponseStatus(status int) MockHandler { return func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(status) } } -// MockServerHandlerGeneratorReturnBytes generates a MockHandler which just returns bytes +// MockServerHandlerGeneratorReturnBytes generates a MockHandler which just returns bytes. func MockServerHandlerGeneratorReturnBytes(expected []byte) MockHandler { return func(w http.ResponseWriter, r *http.Request) { - w.Write(expected) + w.Write(expected) //nolint:errcheck } } -// MockServerHandlerGeneratorReturnJson generatres a MockHandler which returns a JSON serialized argument +// MockServerHandlerGeneratorReturnJson generatres a MockHandler which returns a JSON serialized argument. func MockServerHandlerGeneratorReturnJson(expected interface{}) MockHandler { return func(w http.ResponseWriter, r *http.Request) { expectedBytes, _ := json.Marshal(expected) - w.Write(expectedBytes) + w.Write(expectedBytes) //nolint:errcheck } } diff --git a/mirantis/mke/client/api_ping.go b/internal/client/api_ping.go similarity index 84% rename from mirantis/mke/client/api_ping.go rename to internal/client/api_ping.go index a6e22e1..9657c51 100644 --- a/mirantis/mke/client/api_ping.go +++ b/internal/client/api_ping.go @@ -12,7 +12,8 @@ const ( // ApiPing Ping the endpoint // @note MKE allows node specific pings, and a loadbalancer ping will -// just connect to any node. This makes this precarious for cluster health. +// +// just connect to any node. This makes this precarious for cluster health. func (c *Client) ApiPing(ctx context.Context) error { req, err := c.RequestFromTargetAndBytesBody(ctx, http.MethodGet, URLTargetForPing, []byte{}) if err != nil { diff --git a/mirantis/mke/client/api_ping_test.go b/internal/client/api_ping_test.go similarity index 94% rename from mirantis/mke/client/api_ping_test.go rename to internal/client/api_ping_test.go index fab78c9..9165d9e 100644 --- a/mirantis/mke/client/api_ping_test.go +++ b/internal/client/api_ping_test.go @@ -6,7 +6,7 @@ import ( "net/url" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestGoodPing(t *testing.T) { diff --git a/mirantis/mke/client/api_publickeys.go b/internal/client/api_publickeys.go similarity index 87% rename from mirantis/mke/client/api_publickeys.go rename to internal/client/api_publickeys.go index 3ad545f..05601d9 100644 --- a/mirantis/mke/client/api_publickeys.go +++ b/internal/client/api_publickeys.go @@ -7,9 +7,9 @@ import ( ) const ( - // /accounts/{accountNameOrID}/publicKeys + // /accounts/{accountNameOrID}/publicKeys url. URLTargetPatternForPublicKeys = "accounts/%s/publicKeys" - // /accounts/{accountNameOrID}/publicKeys/{keyID} + // /accounts/{accountNameOrID}/publicKeys/{keyID} url. URLTargetPatternForPublicKey = "accounts/%s/publicKeys/%s" ) @@ -18,7 +18,7 @@ type GetKeysResponse struct { NextPageStart string `json:"nextPageStart"` } -// ApiPublicKeyList list all of the public keys +// ApiPublicKeyList list all of the public keys. func (c *Client) ApiPublicKeyList(ctx context.Context, account string) ([]AccountPublicKey, error) { u := fmt.Sprintf(URLTargetPatternForPublicKeys, account) @@ -56,7 +56,7 @@ func (c *Client) ApiPublicKeyList(ctx context.Context, account string) ([]Accoun return keys, nil } -// ApiPublicKeyRetrieve retrieve a specific account key +// ApiPublicKeyRetrieve retrieve a specific account key. func (c *Client) ApiPublicKeyRetrieve(ctx context.Context, account, keyid string) (AccountPublicKey, error) { u := fmt.Sprintf(URLTargetPatternForPublicKey, account, keyid) @@ -79,7 +79,7 @@ func (c *Client) ApiPublicKeyRetrieve(ctx context.Context, account, keyid string return k, nil } -// ApiPublicKeyDelete delete a specific account key +// ApiPublicKeyDelete delete a specific account key. func (c *Client) ApiPublicKeyDelete(ctx context.Context, account, keyid string) error { u := fmt.Sprintf(URLTargetPatternForPublicKey, account, keyid) diff --git a/mirantis/mke/client/api_publickeys_test.go b/internal/client/api_publickeys_test.go similarity index 95% rename from mirantis/mke/client/api_publickeys_test.go rename to internal/client/api_publickeys_test.go index c8c9951..ae936f9 100644 --- a/mirantis/mke/client/api_publickeys_test.go +++ b/internal/client/api_publickeys_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestSimpleGetKeys(t *testing.T) { diff --git a/mirantis/mke/client/auth.go b/internal/client/auth.go similarity index 84% rename from mirantis/mke/client/auth.go rename to internal/client/auth.go index e0bac9d..58bc89d 100644 --- a/mirantis/mke/client/auth.go +++ b/internal/client/auth.go @@ -21,8 +21,8 @@ const ( HeaderKeyAuthorization = "Authorization" ) -// Auth container for data related to authentication -// @see MKE Auth struct for auth/login +// Auth container for data related to authentication. +// @see MKE Auth struct for auth/login. type Auth struct { Code string `json:"code"` Password string `json:"password"` @@ -31,7 +31,7 @@ type Auth struct { Username string `json:"username"` } -// NewAuthSimple constructor for Auth from username and password +// NewAuthSimple constructor for Auth from username and password. func NewAuthUP(username, password string) Auth { return Auth{ Username: username, @@ -39,9 +39,9 @@ func NewAuthUP(username, password string) Auth { } } -// authorizeRequest adds a token header to a request to authenticate it -// this will retrieve a request if none has been retrieved. -// this does not validate the token in any way (yet) +// authorizeRequest adds a token header to a request to authenticate it. +// This will retrieve a request if none has been retrieved. +// This does not validate the token in any way (yet). func (c *Client) authorizeRequest(req *http.Request) error { if c.auth.Token == "" { if err := c.ApiLogin(req.Context()); err != nil { @@ -54,7 +54,7 @@ func (c *Client) authorizeRequest(req *http.Request) error { return nil } -// BearerTokenHeaderValue convert an auth token into the auth header value +// BearerTokenHeaderValue convert an auth token into the auth header value. func BearerTokenHeaderValue(token string) string { return fmt.Sprintf("Bearer %s", token) } diff --git a/mirantis/mke/client/auth_test.go b/internal/client/auth_test.go similarity index 96% rename from mirantis/mke/client/auth_test.go rename to internal/client/auth_test.go index 090c9e6..1989180 100644 --- a/mirantis/mke/client/auth_test.go +++ b/internal/client/auth_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestGoodAuthorizedRequest(t *testing.T) { diff --git a/mirantis/mke/client/client.go b/internal/client/client.go similarity index 92% rename from mirantis/mke/client/client.go rename to internal/client/client.go index f02cfdd..57b207a 100644 --- a/mirantis/mke/client/client.go +++ b/internal/client/client.go @@ -16,14 +16,14 @@ var ( ErrCouldNotCreateClient = errors.New("could not create a client") ) -// Client MSR client +// Client MKE client. type Client struct { apiURL *url.URL auth *Auth HTTPClient *http.Client } -// NewClient from a string URL and u/p +// NewClient from a string URL and u/p. func NewClientSimple(endpoint, username, password string) (Client, error) { HTTPClient := &http.Client{} auth := NewAuthUP(username, password) @@ -36,7 +36,7 @@ func NewClientSimple(endpoint, username, password string) (Client, error) { return NewClient(apiURL, &auth, HTTPClient) } -// NewUnsafeSSLClient that allows self-signed SSL from a string URL and u/p +// NewUnsafeSSLClient that allows self-signed SSL from a string URL and u/p. func NewUnsafeSSLClient(endpoint, username, password string) (Client, error) { HTTPClient := &http.Client{ Transport: &http.Transport{ @@ -53,7 +53,7 @@ func NewUnsafeSSLClient(endpoint, username, password string) (Client, error) { return NewClient(apiURL, &auth, HTTPClient) } -// NewClient creates a new MKE API Client from raw components +// NewClient creates a new MKE API Client from raw components. func NewClient(apiURL *url.URL, auth *Auth, HTTPClient *http.Client) (Client, error) { if apiURL == nil { return Client{}, fmt.Errorf("%w; empty endpoint", ErrCouldNotCreateClient) @@ -65,7 +65,7 @@ func NewClient(apiURL *url.URL, auth *Auth, HTTPClient *http.Client) (Client, er }, nil } -// Build a request URL string from the client endpoint and an API target path +// Build a request URL string from the client endpoint and an API target path. func (c *Client) reqURLFromTarget(target string) string { // target should be a relative path, and will be treated as a relative reference // to the client URL @@ -85,7 +85,7 @@ func (c *Client) reqURLFromTarget(target string) string { return relativeURL.String() } -// Username retrieve username string for auth, so that we don't expose the whole auth struct +// Username retrieve username string for auth, so that we don't expose the whole auth struct. func (c *Client) Username() string { return c.auth.Username } diff --git a/mirantis/mke/client/client_integration_test.go b/internal/client/client_integration_test.go similarity index 96% rename from mirantis/mke/client/client_integration_test.go rename to internal/client/client_integration_test.go index 5731365..7dc5813 100644 --- a/mirantis/mke/client/client_integration_test.go +++ b/internal/client/client_integration_test.go @@ -13,7 +13,7 @@ import ( "os" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) const ( diff --git a/mirantis/mke/client/client_test.go b/internal/client/client_test.go similarity index 82% rename from mirantis/mke/client/client_test.go rename to internal/client/client_test.go index e485970..ff75c83 100644 --- a/mirantis/mke/client/client_test.go +++ b/internal/client/client_test.go @@ -3,7 +3,7 @@ package client_test import ( "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestClientSimple(t *testing.T) { diff --git a/mirantis/mke/client/clientbundle.go b/internal/client/clientbundle.go similarity index 89% rename from mirantis/mke/client/clientbundle.go rename to internal/client/clientbundle.go index 3f7c857..9d9dfea 100644 --- a/mirantis/mke/client/clientbundle.go +++ b/internal/client/clientbundle.go @@ -2,13 +2,13 @@ package client import ( "encoding/base64" + "encoding/json" "io" - "io/ioutil" "gopkg.in/yaml.v2" ) -// ClientBundle interpretation of the ClientBundle data in memory +// ClientBundle interpretation of the ClientBundle data in memory. type ClientBundle struct { ID string `json:"id"` PrivateKey string `json:"private_key"` @@ -18,8 +18,14 @@ type ClientBundle struct { Kube *ClientBundleKube `json:"kube"` } -// ClientBundleKube Kubernetes parts of the client bundle -// primarily we are focused on satisfying requirements for a kubernetes provider +// ToJSON stringify client bundle as json for debugging. +func (cb ClientBundle) ToJSON() []byte { + b, _ := json.Marshal(cb) + return b +} + +// ClientBundleKube Kubernetes parts of the client bundle. +// primarily we are focused on satisfying requirements for a kubernetes provider. // such as https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/kubernetes/provider.go type ClientBundleKube struct { Config string `json:"config"` @@ -30,27 +36,27 @@ type ClientBundleKube struct { Insecure string `json:"insecure"` } -// ClientBundleRetrieveValue read a value +// ClientBundleRetrieveValue read a value. func ClientBundleRetrieveValue(val io.Reader) (string, error) { - allBytes, err := ioutil.ReadAll(val) + allBytes, err := io.ReadAll(val) if err != nil { return "", err } return string(allBytes), nil } -// ClientBundleDecodeBase64Value read a value and base64 decode it +// ClientBundleDecodeBase64Value read a value and base64 decode it. func ClientBundleDecodeBase64Value(val io.Reader) (string, error) { - allBytes, err := ioutil.ReadAll(val) + allBytes, err := io.ReadAll(val) if err != nil { return "", err } return helperStringBase64Decode(string(allBytes)), nil } -// NewClientBundleKubeFromKubeYml ClientBundleKube constructor from byte list of a kubeconfig file +// NewClientBundleKubeFromKubeYml ClientBundleKube constructor from byte list of a kubeconfig file. func NewClientBundleKubeFromKubeYml(val io.Reader) (ClientBundleKube, error) { - k8bytes, _ := ioutil.ReadAll(val) + k8bytes, _ := io.ReadAll(val) var cbk ClientBundleKube @@ -121,7 +127,7 @@ func NewClientBundleKubeFromKubeYml(val io.Reader) (ClientBundleKube, error) { return cbk, nil } -// this decodes some strings in the file that are base64 encoded +// this decodes some strings in the file that are base64 encoded. func helperStringBase64Decode(val string) string { valDecodedBytes, _ := base64.StdEncoding.DecodeString(val) return string(valDecodedBytes) diff --git a/mirantis/mke/client/clientbundle_test.go b/internal/client/clientbundle_test.go similarity index 94% rename from mirantis/mke/client/clientbundle_test.go rename to internal/client/clientbundle_test.go index aa2720a..f3a7803 100644 --- a/mirantis/mke/client/clientbundle_test.go +++ b/internal/client/clientbundle_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) var ( diff --git a/mirantis/mke/client/do.go b/internal/client/do.go similarity index 88% rename from mirantis/mke/client/do.go rename to internal/client/do.go index 5e69541..718dd61 100644 --- a/mirantis/mke/client/do.go +++ b/internal/client/do.go @@ -2,15 +2,15 @@ package client import ( "fmt" - "io/ioutil" + "io" "net/http" ) /** -This is tested via the api_genericrequest.go public methods +This is tested via the api_genericrequest.go public methods. */ -// doAuthorizedRequest perform an http request for an endpoint that requires auth +// doAuthorizedRequest perform an http request for an endpoint that requires auth. func (c *Client) doAuthorizedRequest(req *http.Request) (*Response, error) { if err := c.authorizeRequest(req); err != nil { return nil, err @@ -19,7 +19,7 @@ func (c *Client) doAuthorizedRequest(req *http.Request) (*Response, error) { return c.doRequest(req) } -// doRequest perform http request, catch http errors and return body as io.ReaderCloser +// doRequest perform http request, catch http errors and return body as io.ReaderCloser. func (c *Client) doRequest(req *http.Request) (*Response, error) { apiRes, err := c.HTTPClient.Do(req) if err != nil { @@ -31,7 +31,7 @@ func (c *Client) doRequest(req *http.Request) (*Response, error) { } if res.StatusCode >= http.StatusBadRequest { - b, _ := ioutil.ReadAll(res.Body) + b, _ := io.ReadAll(res.Body) if res.StatusCode == http.StatusUnauthorized { return res, fmt.Errorf("%w: Unauthorized: %d : %s", ErrUnauthorizedReq, res.StatusCode, b) diff --git a/mirantis/mke/client/errors.go b/internal/client/errors.go similarity index 75% rename from mirantis/mke/client/errors.go rename to internal/client/errors.go index a4f9caa..3474dd7 100644 --- a/mirantis/mke/client/errors.go +++ b/internal/client/errors.go @@ -6,13 +6,13 @@ var ( ErrEmptyUsernamePass = errors.New("no username or password provided in MKE client") ErrEmptyEndpoint = errors.New("no endpoint provided in MKE client") ErrRequestCreation = errors.New("error creating request in MKE client") - ErrMarshaling = errors.New("error occured while marshalling struct in MKE client") - ErrUnmarshaling = errors.New("error occured while unmarshalling struct in MKE client") + ErrMarshaling = errors.New("error occurred while marshalling struct in MKE client") + ErrUnmarshaling = errors.New("error occurred while unmarshalling struct in MKE client") ErrEmptyResError = errors.New("request returned empty ResponseError struct in MKE client") ErrResponseError = errors.New("request returned ResponseError in MKE client") ErrUnauthorizedReq = errors.New("unauthorized request in MKE client") ErrUnknownTarget = errors.New("unknown API target") - ErrServerError = errors.New("server error occured") + ErrServerError = errors.New("server error occurred") ErrEmptyStruct = errors.New("empty struct passed in MKE client") ErrInvalidFilter = errors.New("passing invalid account retrieval filter in MKE client") ) diff --git a/mirantis/mke/client/publickeys.go b/internal/client/publickeys.go similarity index 100% rename from mirantis/mke/client/publickeys.go rename to internal/client/publickeys.go diff --git a/mirantis/mke/client/request.go b/internal/client/request.go similarity index 89% rename from mirantis/mke/client/request.go rename to internal/client/request.go index d2a081d..9104e52 100644 --- a/mirantis/mke/client/request.go +++ b/internal/client/request.go @@ -7,12 +7,12 @@ import ( "net/http" ) -// RequestFromTarget build simple http.Request from relative API target and bytes array for a body +// RequestFromTarget build simple http.Request from relative API target and bytes array for a body. func (c *Client) RequestFromTargetAndBytesBody(ctx context.Context, method, target string, body []byte) (*http.Request, error) { return http.NewRequestWithContext(ctx, method, c.reqURLFromTarget(target), bytes.NewBuffer(body)) } -// RequestFromTarget build simple http.Request from relative API target and JSON serialized struct for a body +// RequestFromTarget build simple http.Request from relative API target and JSON serialized struct for a body. func (c *Client) RequestFromTargetAndJSONBody(ctx context.Context, method, target string, body interface{}) (*http.Request, error) { bodyBytes, err := json.Marshal(body) if err != nil { diff --git a/mirantis/mke/client/request_test.go b/internal/client/request_test.go similarity index 88% rename from mirantis/mke/client/request_test.go rename to internal/client/request_test.go index 3a31892..fc5f9ba 100644 --- a/mirantis/mke/client/request_test.go +++ b/internal/client/request_test.go @@ -3,12 +3,12 @@ package client_test import ( "context" "encoding/json" - "io/ioutil" + "io" "net/http" "net/url" "testing" - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" + "github.com/Mirantis/terraform-provider-mke/internal/client" ) func TestRequestBodyBytes(t *testing.T) { @@ -24,7 +24,7 @@ func TestRequestBodyBytes(t *testing.T) { t.Error("Failed to read request bytes") } - bodyBytes, err := ioutil.ReadAll(r.Body) + bodyBytes, err := io.ReadAll(r.Body) if err != nil { t.Error("Failed to read request bytes") } @@ -52,7 +52,7 @@ func TestRequestBodyJson(t *testing.T) { expectedBodyBytes, _ := json.Marshal(body) - bodyBytes, err := ioutil.ReadAll(r.Body) + bodyBytes, err := io.ReadAll(r.Body) if err != nil { t.Error("Failed to read request bytes") } diff --git a/mirantis/mke/client/response.go b/internal/client/response.go similarity index 80% rename from mirantis/mke/client/response.go rename to internal/client/response.go index a4150ee..a7ec51a 100644 --- a/mirantis/mke/client/response.go +++ b/internal/client/response.go @@ -2,21 +2,21 @@ package client import ( "encoding/json" - "io/ioutil" + "io" "net/http" ) -// Response http.Response wrapper that can interpret the body more +// Response http.Response wrapper that can interpret the body more. type Response struct { *http.Response } -// BodyBytes return http.Response body as a []byte +// BodyBytes return http.Response body as a []byte. func (r *Response) BodyBytes() ([]byte, error) { - return ioutil.ReadAll(r.Body) + return io.ReadAll(r.Body) } -// JSONMarshallBody unmarshall http.Response body as json to passed target +// JSONMarshallBody unmarshall http.Response body as json to passed target. func (r *Response) JSONMarshallBody(target interface{}) error { bodyBytes, err := r.BodyBytes() if err != nil { diff --git a/internal/provider/mke_clientbundle_resource.go b/internal/provider/mke_clientbundle_resource.go new file mode 100644 index 0000000..abe640b --- /dev/null +++ b/internal/provider/mke_clientbundle_resource.go @@ -0,0 +1,298 @@ +package provider + +import ( + "context" + "errors" + "fmt" + + "github.com/Mirantis/terraform-provider-mke/internal/client" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var ( + ErrCBNotFound = errors.New("Client bundle was not found on the MKE host cluster") +) + +// ClientBundleResourceModel describes the resource data model. +type ClientBundleResourceModel struct { + Id types.String `tfsdk:"id"` + + Label types.String `tfsdk:"label"` + + PublicKey types.String `tfsdk:"public_key"` + PrivateKey types.String `tfsdk:"private_key"` + ClientCert types.String `tfsdk:"client_cert"` + CaCert types.String `tfsdk:"ca_cert"` + + KubeYaml types.String `tfsdk:"kube_yaml"` + KubeHost types.String `tfsdk:"kube_host"` + KubeClientKey types.String `tfsdk:"kube_client_key"` + KubeClientCert types.String `tfsdk:"kube_client_cert"` + KubeCaCert types.String `tfsdk:"kube_ca_cert"` +} + +// FromClientBundle interpret a client.ClientBundle to populate this model. +func (m *ClientBundleResourceModel) FromClientBundle(cb client.ClientBundle) diag.Diagnostics { + diags := diag.Diagnostics{} + + m.Id = types.StringValue(cb.ID) + + m.PublicKey = types.StringValue(cb.PublicKey) + m.PrivateKey = types.StringValue(cb.PrivateKey) + m.ClientCert = types.StringValue(cb.Kube.ClientCertificate) + m.CaCert = types.StringValue(cb.Kube.CACertificate) + + m.KubeYaml = types.StringValue(cb.Kube.Config) + m.KubeHost = types.StringValue(cb.Kube.Host) + m.KubeClientKey = types.StringValue(cb.Kube.ClientKey) + m.KubeClientCert = types.StringValue(cb.Kube.ClientCertificate) + m.KubeCaCert = types.StringValue(cb.Kube.CACertificate) + + return diags +} + +// ToClientBundle convert this model to a client.ClientBundle struct. +func (m ClientBundleResourceModel) ToClientBundle(cb *client.ClientBundle) diag.Diagnostics { + diags := diag.Diagnostics{} + return diags +} + +type MKEClientBundleResource struct { + providerModel MKEProviderModel +} + +func NewMKEClientBundleResource() resource.Resource { + return &MKEClientBundleResource{} +} + +func (r *MKEClientBundleResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_clientbundle" +} + +func (r *MKEClientBundleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Client Bundle resource for access to MKE api/kubernetes/docker-swarm features.", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + + "label": schema.StringAttribute{ + MarkdownDescription: "Label used for the client bundle", + Required: true, + }, + + "public_key": schema.StringAttribute{ + MarkdownDescription: "MKE Public key for the user", + Computed: true, + }, + "private_key": schema.StringAttribute{ + MarkdownDescription: "MKE Private key for the user", + Computed: true, + Sensitive: true, + }, + "client_cert": schema.StringAttribute{ + MarkdownDescription: "MKE Client certificate for the user", + Computed: true, + }, + "ca_cert": schema.StringAttribute{ + MarkdownDescription: "MKE Server CA certificate", + Computed: true, + }, + + "kube_yaml": schema.StringAttribute{ + MarkdownDescription: "MKE Kubernetes API client configuration yaml file", + Computed: true, + Sensitive: true, + }, + "kube_host": schema.StringAttribute{ + MarkdownDescription: "MKE Kubernetes API host endpoint", + Computed: true, + }, + "kube_client_key": schema.StringAttribute{ + MarkdownDescription: "MKE Kubernetes API client key", + Computed: true, + Sensitive: true, + }, + "kube_client_cert": schema.StringAttribute{ + MarkdownDescription: "MKE Kubernetes API client certificate", + Computed: true, + }, + "kube_ca_cert": schema.StringAttribute{ + MarkdownDescription: "MKE Kubernetes API CA certificate", + Computed: true, + }, + }, + } +} + +func (r *MKEClientBundleResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + lpm, ok := req.ProviderData.(MKEProviderModel) + + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *MKEProviderModel, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + tflog.Debug(ctx, "Successfully interpeted provider model", map[string]interface{}{}) + r.providerModel = lpm +} + +func (r *MKEClientBundleResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var m ClientBundleResourceModel = ClientBundleResourceModel{} + + resp.Diagnostics.Append(req.Plan.Get(ctx, &m)...) + if resp.Diagnostics.HasError() { + resp.Diagnostics.AddError("Failed to interpret plan", "Could not interpret plan into ClientBundle request") + return + } + + cl, err := r.providerModel.Client() + if err != nil { + resp.Diagnostics.AddError("MKE provider could not create a client", fmt.Sprintf("An error occurred creating the client: %s", err.Error())) + return + } + + if r.providerModel.testingMode.ValueBool() { + cb := dummyClientBundleForTest(m.Id.ValueString()) + resp.Diagnostics.AddWarning("ClientBundle in testing mode", fmt.Sprintf("Client Bundle creation not executed because the resource is in testing mode: %s", cb.ToJSON())) + + m.FromClientBundle(cb) + } else { + cb, err := cl.ApiClientBundleCreate(ctx, m.Label.ValueString()) + if err != nil { + resp.Diagnostics.AddError("MKE client could not create a client bundle", fmt.Sprintf("An error occurred creating the client bundle: %s", err.Error())) + return + } + + resp.Diagnostics.Append(m.FromClientBundle(cb)...) + if resp.Diagnostics.HasError() { + tflog.Error(ctx, "Failed to convert ClientBundle response from the API into the ClientBundle models", map[string]interface{}{}) + return + } + } + + resp.Diagnostics.Append(resp.State.Set(ctx, m)...) +} + +func (r *MKEClientBundleResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + m := ClientBundleResourceModel{} + + resp.Diagnostics.Append(req.State.Get(ctx, &m)...) + if resp.Diagnostics.HasError() { + resp.Diagnostics.AddError("Failed to interpret plan", "Could not interpret plan into ClientBundle model") + return + } + + // If there is no existing state, then there is nothing to read. + if m.Id.IsNull() { + return + } + + cl, err := r.providerModel.Client() + if err != nil { + resp.Diagnostics.AddError("MKE provider could not create a client", fmt.Sprintf("An error occurred creating the client: %s", err.Error())) + return + } + + cb := client.ClientBundle{} + resp.Diagnostics.Append(m.ToClientBundle(&cb)...) + if resp.Diagnostics.HasError() { + resp.Diagnostics.AddError("Failed to convert Client Bundle Model", "Could not interpret plan Client Bundle model into client ClientBundle") + return + } + + if r.providerModel.testingMode.ValueBool() { + resp.Diagnostics.AddWarning("ClientBundle in testing mode", "ClientBundle read/confirm not executed because the resource is in testing mode") + return + } + + if _, err := cl.ApiClientBundleGetPublicKey(ctx, cb); err != nil { + if errors.Is(err, client.ErrFailedToFindClientBundleMKEPublicKey) { + // we have a bundle in state, but it doesn't exist in MKE so it should be removed + // @todo check that we haven't suffered from a connectivity failure + resp.Diagnostics.AddWarning("Client Bundle in state not found in MKE API", fmt.Errorf("%w; %s", ErrCBNotFound, err).Error()) + resp.State.RemoveResource(ctx) + } + } +} + +func (r *MKEClientBundleResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // There is no option to urdate a client bundle, but at the same time there is no schema that can be changed, so an update shouldn't be needed. + // There is an issue of expiry options on client bundles, but this is a new feature in MKE that wasn't rolled out 2023/08 +} + +func (r *MKEClientBundleResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + m := ClientBundleResourceModel{} + + resp.Diagnostics.Append(req.State.Get(ctx, &m)...) + if resp.Diagnostics.HasError() { + resp.Diagnostics.AddError("Failed to interpret plan", "Could not interpret plan into ClientBundle model") + return + } + + cl, err := r.providerModel.Client() + if err != nil { + resp.Diagnostics.AddError("MKE provider could not create a client", fmt.Sprintf("An error occurred creating the client: %s", err.Error())) + return + } + + cb := client.ClientBundle{} + resp.Diagnostics.Append(m.ToClientBundle(&cb)...) + if resp.Diagnostics.HasError() { + resp.Diagnostics.AddError("Failed to convert Client Bundle Model", "Could not interpret plan Client Bundle model into client ClientBundle") + } + + if r.providerModel.testingMode.ValueBool() { + resp.Diagnostics.AddWarning("ClientBundle in testing mode", "ClientBundle deletion not executed because the resource is in testing mode") + resp.Diagnostics.Append(resp.State.Set(ctx, m)...) + } else { + + if err := cl.ApiClientBundleDelete(ctx, cb); err != nil { + resp.Diagnostics.AddError("Failed to delete Client Bundle", fmt.Sprintf("MKE Client could not delete the client bundle: %s", err.Error())) + return + } + } + + // Remove resource from state + resp.State.RemoveResource(ctx) +} + +func dummyClientBundleForTest(id string) client.ClientBundle { + return client.ClientBundle{ + ID: id, + + PrivateKey: "", + PublicKey: "", + Cert: "", + CACert: "", + Kube: &client.ClientBundleKube{ + Config: "", + Host: "", + ClientKey: "", + ClientCertificate: "", + CACertificate: "", + Insecure: "", + }, + } +} diff --git a/internal/provider/mke_clientbundle_resource_test.go b/internal/provider/mke_clientbundle_resource_test.go new file mode 100644 index 0000000..19b5cad --- /dev/null +++ b/internal/provider/mke_clientbundle_resource_test.go @@ -0,0 +1,53 @@ +package provider_test + +import ( + "testing" + + fr_resource "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/Mirantis/terraform-provider-mke/internal/provider" +) + +func TestClientBundleResourceSanity(t *testing.T) { + // Throw an exception if this resources doesn't meet the requirements of a Resource + var _ fr_resource.Resource = &provider.MKEClientBundleResource{} //nolint:typecheck +} + +func TestClientBundleToModel(t *testing.T) { + +} + +func TestClientBundleFromModel(t *testing.T) { + +} + +func TestAccLaunchpadConfigResource(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create and Read testing + { + Config: testAccMKEClientBundleResource_minimal(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("mke_clientbundle.test", "label", "my client bundle"), + ), + }, + }, + }) +} + +func testAccMKEClientBundleResource_minimal() string { + return ` +provider "mke" { + endpoint = "https://my.mke.test" + username = "user" + password = "password" +} + +resource "mke_clientbundle" "test" { + label = "my client bundle" +} +` +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go new file mode 100644 index 0000000..171b25a --- /dev/null +++ b/internal/provider/provider.go @@ -0,0 +1,119 @@ +package provider + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/provider" + "github.com/hashicorp/terraform-plugin-framework/provider/schema" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/Mirantis/terraform-provider-mke/internal/client" +) + +const ( + // ProviderName name for the provider in the Mirantis namespace. + ProviderName = "mke" + + // TestingVersion if the provider version is this, then the provider + // will start in testing mode, where it never reaches the API. + TestingVersion = "test" +) + +func New(version string) func() provider.Provider { + return func() provider.Provider { + return &MKEProvider{ + version: version, + } + } +} + +// MKEProvider defines the provider implementation. +type MKEProvider struct { + // version is set to the provider version on release, "dev" when the + // provider is built and ran locally, and "test" when running acceptance + // testing. + version string +} + +func (p *MKEProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) { + resp.TypeName = ProviderName + resp.Version = p.version +} + +func (p *MKEProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "endpoint": schema.StringAttribute{ + MarkdownDescription: "MKE API Endpoint address with schema; e.g. https://my.mke.com", + Required: true, + }, + "username": schema.StringAttribute{ + MarkdownDescription: "MKE API username", + Required: true, + }, + "password": schema.StringAttribute{ + MarkdownDescription: "MKE API user password", + Required: true, + Sensitive: true, + }, + + "unsafe_ssl_client": schema.BoolAttribute{ + MarkdownDescription: "Bypass SSL validation for hte API server. Use only for development systems", + Optional: true, + }, + }, + } +} + +func (p *MKEProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { + var model MKEProviderModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &model)...) + + if resp.Diagnostics.HasError() { + return + } + + if p.version == TestingVersion { + model.testingMode = types.BoolValue(true) + } + + resp.ResourceData = model + resp.DataSourceData = model + +} + +func (p *MKEProvider) Resources(ctx context.Context) []func() resource.Resource { + return []func() resource.Resource{ + NewMKEClientBundleResource, + } +} + +func (p *MKEProvider) DataSources(ctx context.Context) []func() datasource.DataSource { + return []func() datasource.DataSource{} +} + +// MKEProviderModel describes the provider data model. +type MKEProviderModel struct { + testingMode types.Bool + + Endpoint types.String `tfsdk:"endpoint"` + Username types.String `tfsdk:"username"` + Password types.String `tfsdk:"password"` + UnsafeSSL types.Bool `tfsdk:"unsafe_ssl_client"` +} + +// Client MKE client generation. +func (pm MKEProviderModel) Client() (client.Client, error) { + if pm.UnsafeSSL.ValueBool() { + return client.NewUnsafeSSLClient(pm.Endpoint.ValueString(), pm.Username.ValueString(), pm.Password.ValueString()) + } + return client.NewClientSimple(pm.Endpoint.ValueString(), pm.Username.ValueString(), pm.Password.ValueString()) +} + +// TestingMode is the provider in testing mode? +func (pm MKEProviderModel) TestingMode() bool { + return pm.testingMode.ValueBool() +} diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go new file mode 100644 index 0000000..e654d7c --- /dev/null +++ b/internal/provider/provider_test.go @@ -0,0 +1,31 @@ +package provider_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-framework/provider" + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + + mke_provider "github.com/Mirantis/terraform-provider-mke/internal/provider" +) + +// testAccProtoV6ProviderFactories are used to instantiate a provider during +// acceptance testing. The factory function will be invoked for every Terraform +// CLI command executed to create a provider server to which the CLI can +// reattach. +var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ + "mke": providerserver.NewProtocol6WithError(mke_provider.New(mke_provider.TestingVersion)()), +} + +func testAccPreCheck(t *testing.T) { + // You can add code here to run prior to any test case execution, for example assertions + // about the appropriate environment variables being set are common to see in a pre-check + // function. + +} + +func TestProviderSanity(t *testing.T) { + // Ensure Provider satisfies various provider interfaces. + var _ provider.Provider = &mke_provider.MKEProvider{} +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..8898bfa --- /dev/null +++ b/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "context" + "flag" + "log" + + "github.com/hashicorp/terraform-plugin-framework/providerserver" + + "github.com/Mirantis/terraform-provider-mke/internal/provider" +) + +const ( + ProviderAddress = "registry.terraform.io/mirantis/mke" +) + +// If you do not have terraform installed, you can remove the formatting command, but its suggested to +// ensure the documentation is formatted properly. +//go:generate terraform fmt -recursive ./examples/ + +// Run the docs generation tool, check its repository for more information on how it works and how docs +// can be customized. +//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs + +var ( + // these will be set by the goreleaser configuration + // to appropriate values for the compiled binary. + version string = "dev" + + // goreleaser can pass other information to the main package, such as the specific commit + // https://goreleaser.com/cookbooks/using-main.version/ +) + +func main() { + var debug bool + + flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") + flag.Parse() + + opts := providerserver.ServeOpts{ + Address: ProviderAddress, + Debug: debug, + } + + err := providerserver.Serve(context.Background(), provider.New(version), opts) + + if err != nil { + log.Fatal(err.Error()) + } +} diff --git a/mirantis/mke/connect/README.md b/mirantis/mke/connect/README.md deleted file mode 100644 index dce82ea..0000000 --- a/mirantis/mke/connect/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# MKE Terraform Provider - -This terraform provider integrates MKE into terraform via the MKE API. - -The API provides nearly all functionality needed, although not all of it is -usabled. - -## Implementations - -### Provider - -The provider is configured per MKE user, pointed at either a load balancer or -one of the MKE master nodes. - -``` -provider "mke" { - endpoint = "https://${module.managers.lb_dns_name}" - username = var.admin_username - password = var.admin_password -} -``` - -### Resources - -#### ClientBundle - -This resource retrieves a new client bundle from MKE. - -The resource aims to provide sufficient information to allow configuration -of other providers such as the `kubernetes` provides. - -``` -resource "mke_clientbundle" "admin" { - name = "admin" # this actually doesn't do anything, but TF needs at least one attribute. -} -``` - -This will give you enough data to configure some other providers such as kubernetes: - -``` -provider "kubernetes" { - host = resource.mke_clientbundle.admin.kube[0].host - client_certificate = resource.mke_clientbundle.admin.kube[0].client_cert - client_key = resource.mke_clientbundle.admin.kube[0].client_key - cluster_ca_certificate = resource.mke_clientbundle.admin.kube[0].ca_cert -} -``` -If your MKE cluster is swarm-only then .kube will be an empty array, so this will fail. - -For docker context you can use something like: - -``` -provider "docker" { - host = "tcp://${module.managers.lb_dns_name}:443" - ca_material = resource.mke_clientbundle.admin.ca_cert - cert_material = resource.mke_clientbundle.admin.client_cert - key_material = resource.mke_clientbundle.admin.private_key -} -``` - -to get a docker provider configured, which will allow you to run docker containers: - -``` -# Find the latest nginx precise image. -resource "docker_image" "nginx" { - name = "nginx" -} - -# Start an nginx container -resource "docker_container" "nginx-server" { - name = "my-nginx-server" - image = docker_image.nginx.latest -} -``` - - -The resource is still under development, and can be considered naive. \ No newline at end of file diff --git a/mirantis/mke/connect/provider.go b/mirantis/mke/connect/provider.go deleted file mode 100644 index cdc7d5a..0000000 --- a/mirantis/mke/connect/provider.go +++ /dev/null @@ -1,93 +0,0 @@ -package connect - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" -) - -func Provider() *schema.Provider { - return &schema.Provider{ - Schema: map[string]*schema.Schema{ - "endpoint": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("MKE_ENDPOINT", nil), - }, - "username": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("MKE_USER", nil), - }, - "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - DefaultFunc: schema.EnvDefaultFunc("MKE_PASS", nil), - }, - "unsafe_ssl_client": { - Type: schema.TypeBool, - Optional: true, - Default: false, - DefaultFunc: schema.EnvDefaultFunc("MKE_UNSAFE_CLIENT", nil), - }, - }, - ResourcesMap: map[string]*schema.Resource{ - "mke_clientbundle": ResourceClientBundle(), - }, - ConfigureContextFunc: providerConfigure, - } -} - -func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - // Warning or errors can be collected in a slice type - var diags diag.Diagnostics - - endpoint := d.Get("endpoint").(string) - username := d.Get("username").(string) - password := d.Get("password").(string) - unsafeClient := d.Get("unsafe_ssl_client").(bool) - - if (username == "") || (password == "") || (endpoint == "") { - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Unable to create MKE client", - Detail: "Unable to create anonymous MKE client", - }) - - return nil, diags - } - - var c client.Client - var clientErr error - - if unsafeClient { - c, clientErr = client.NewUnsafeSSLClient(endpoint, username, password) - } else { - c, clientErr = client.NewClientSimple(endpoint, username, password) - } - - if clientErr != nil { - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Unable to create MKE client", - Detail: "Unable to authenticate user for authenticated MKE client", - }) - - return nil, diags - } - - if err := c.ApiPing(ctx); err != nil { - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "MKE endpoint is not healthy", - Detail: err.Error(), - }) - return nil, diags - } - - return c, diags -} diff --git a/mirantis/mke/connect/provider_test.go b/mirantis/mke/connect/provider_test.go deleted file mode 100644 index f23e802..0000000 --- a/mirantis/mke/connect/provider_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package connect_test - -import ( - "testing" - - connect "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/connect" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func TestProvider(t *testing.T) { - if err := connect.Provider().InternalValidate(); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestProvider_impl(t *testing.T) { - var _ *schema.Provider = connect.Provider() -} diff --git a/mirantis/mke/connect/resource_clientbundle.go b/mirantis/mke/connect/resource_clientbundle.go deleted file mode 100644 index 489ab1e..0000000 --- a/mirantis/mke/connect/resource_clientbundle.go +++ /dev/null @@ -1,197 +0,0 @@ -package connect - -import ( - "context" - "errors" - "fmt" - - "github.com/Mirantis/terraform-provider-mirantis/mirantis/mke/client" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -var ( - ErrCBNotFound = errors.New("Client bundle was not found on the MKE host") -) - -// ResourceClientBundle for managing MKE Client Bundles -func ResourceClientBundle() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceClientBundleCreate, - ReadContext: resourceClientBundleRead, - UpdateContext: resourceClientBundleUpdate, - DeleteContext: resourceClientBundleDelete, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - - "private_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - "public_key": { - Type: schema.TypeString, - Computed: true, - }, - "ca_cert": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - "client_cert": { - Type: schema.TypeString, - Computed: true, - }, - - "kube": { - Type: schema.TypeList, - Description: "Kubernetes components from the client bundle.", - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "config_yml": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - "host": { - Type: schema.TypeString, - Computed: true, - }, - "client_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - "client_cert": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - "ca_cert": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, - }, - }, - }, - }, - }, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - } -} - -func resourceClientBundleCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - var diags diag.Diagnostics - - c, ok := m.(client.Client) - if !ok { - diags = append(diags, diag.Errorf("unable to cast meta interface to MKE Client")...) - return diags - } - - cb, err := c.ApiClientBundleCreate(ctx) - if err != nil { - diags = append(diags, diag.FromErr(err)...) - return diags - } - - if err := d.Set("private_key", cb.PrivateKey); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("public_key", cb.PublicKey); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("ca_cert", cb.CACert); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("client_cert", cb.Cert); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - - kc := cb.Kube - if kc == nil { - diags = append(diags, diag.Errorf("MKE Client produced no kube configuration. Is it a kube cluster?")...) - } else { - - m := make(map[string]interface{}) - - m["config_yml"] = kc.Config - m["host"] = kc.Host - m["client_key"] = kc.ClientKey - m["client_cert"] = kc.ClientCertificate - m["ca_cert"] = kc.CACertificate - - if err := d.Set("kube", []interface{}{m}); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - - } - - if !diags.HasError() { - d.SetId(d.Get("name").(string)) - } - - return diags -} - -func resourceClientBundleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - var diags diag.Diagnostics - - c, ok := m.(client.Client) - if !ok { - diags = append(diags, diag.Errorf("unable to cast meta interface to MKE Client")...) - return diags - } - - cb := client.ClientBundle{ - PrivateKey: d.Get("public_key").(string), - PublicKey: d.Get("private_key").(string), - } - - if err := c.ApiPing(ctx); err != nil { - // state confirmation failed because we couldn't reach the client - diags = append(diags, diag.FromErr(err)...) - } else if _, err := c.ApiClientBundleGetPublicKey(ctx, cb); err == nil { - d.SetId(d.Get("name").(string)) - } else if cb.PrivateKey == "" { - // we have a bundle in state, but it doesn't exist in MKE so it should be removed - // @todo check that we haven't suffered from a connectivity failure - d.SetId("") - diags = append(diags, diag.FromErr(fmt.Errorf("%w; %s", ErrCBNotFound, err))...) - } - - return diag.Diagnostics{} -} - -// Resources can't be done as it is imposible to update a public key, it can just be recreated -func resourceClientBundleUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - return diag.Diagnostics{} -} - -func resourceClientBundleDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - var diags diag.Diagnostics - - c, ok := m.(client.Client) - if !ok { - diags = append(diags, diag.Errorf("unable to cast meta interface to MKE Client")...) - return diags - } - - cb := client.ClientBundle{ - PublicKey: d.Get("public_key").(string), - } - - if err := c.ApiClientBundleDelete(ctx, cb); err != nil { - diags = append(diags, diag.Errorf("MKE Client could not delete the client bundle: %s", err)...) - } else { - d.SetId("") - } - - return diag.Diagnostics{} -} diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json index acf1daa..fec2a56 100644 --- a/terraform-registry-manifest.json +++ b/terraform-registry-manifest.json @@ -1,6 +1,6 @@ { - "version": 1, - "metadata": { - "protocol_versions": ["5.0"] - } -} \ No newline at end of file + "version": 1, + "metadata": { + "protocol_versions": ["6.0"] + } +} diff --git a/test/launchpad/.gitignore b/test/launchpad/.gitignore deleted file mode 100644 index f462a68..0000000 --- a/test/launchpad/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Local .terraform directories and lock files -**/.terraform/* -**/.terraform.* -**/terraform.* - -# .tfstate files -*.tfstate -*.tfstate.* - -# any created PEMs -ssh_keys/*.pem - -# Crash log files -crash.log -crash.*.log - -# Exclude all .tfvars files, which are likely to contain sensitive data, such as -# password, private keys, and other secrets. These should not be part of version -# control as they are data points which are potentially sensitive and subject -# to change depending on the environment. -*.tfvars -*.tfvars.json - -# Ignore override files as they are usually used to override resources locally and so -# are not checked in -override.tf -override.tf.json -*_override.tf -*_override.tf.json - -# Include override files you do wish to add to version control using negated pattern -# !example_override.tf - -# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan -# example: *tfplan* - -# Ignore CLI configuration files -.terraformrc -terraform.rc \ No newline at end of file diff --git a/test/launchpad/README.md b/test/launchpad/README.md deleted file mode 100644 index 4569971..0000000 --- a/test/launchpad/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Jenkins MKE Cluster Terraform config - diff --git a/test/launchpad/launchpad.tf b/test/launchpad/launchpad.tf deleted file mode 100644 index ad8e5e4..0000000 --- a/test/launchpad/launchpad.tf +++ /dev/null @@ -1,91 +0,0 @@ - -// Mirantis installing terraform provider -provider "mirantis-installers" {} - -// Launchpad installer -resource "mirantis-installers_launchpad" "test" { - - skip_destroy = true - - metadata { - name = var.cluster_name - } - spec { - cluster { - prune = true - } - - dynamic "host" { - for_each = module.managers.machines - content { - role = host.value.tags["Role"] - ssh { - address = host.value.public_ip - user = "ubuntu" - key_path = var.keypath - } - } - } - - dynamic "host" { - for_each = module.workers.machines - content { - role = host.value.tags["Role"] - ssh { - address = host.value.public_ip - user = "ubuntu" - key_path = var.keypath - } - } - } - - dynamic "host" { - for_each = module.msrs.machines - content { - role = host.value.tags["Role"] - ssh { - address = host.value.public_ip - user = "ubuntu" - key_path = var.keypath - } - } - } - - mcr { - channel = "stable" - install_url_linux = var.mcr_install_url_linux - install_url_windows = var.mcr_install_url_windows - repo_url = var.mcr_repo_url - version = var.mcr_version - } // mcr - - mke { - admin_password = var.admin_password - admin_username = var.admin_username - image_repo = var.mke_image_org - version = var.mke_version - install_flags = [ - "--san=${module.managers.lb_dns_name}", - "--default-node-orchestrator=${var.mke_default_orchestrator}", - "--nodeport-range=${var.nodeport_range}", - "--cloud-provider=aws" - ] - upgrade_flags = [ - "--force-recent-backup", - "--force-minimums" - ] - } // mke - - msr { - image_repo = var.msr_image_org - version = var.msr_version - replica_ids = "sequential" - install_flags = ["--ucp-insecure-tls", - "--dtr-external-url ${module.msrs.lb_dns_name}"] - } // msr - } // spec -} - -output "mke_cluster_name" { - value = mirantis-installers_launchpad.test.metadata[0].name -} diff --git a/test/launchpad/main.tf b/test/launchpad/main.tf deleted file mode 100644 index 3795683..0000000 --- a/test/launchpad/main.tf +++ /dev/null @@ -1,89 +0,0 @@ -locals { - global_tags = merge( - { - "Name" = var.cluster_name - "kubernetes.io/cluster/${var.cluster_name}" = "shared" - }, - var.extra_tags - ) -} - -provider "aws" { - region = var.aws_region - # shared_credentials_file = var.aws_shared_credentials_file - # profile = var.aws_profile -} - -module "vpc" { - source = "./modules/vpc" - cluster_name = var.cluster_name - host_cidr = var.vpc_cidr - extra_tags = local.global_tags -} - -module "common" { - source = "./modules/common" - cluster_name = var.cluster_name - vpc_id = module.vpc.id - keypath = var.keypath - extra_tags = local.global_tags -} - -module "managers" { - source = "./modules/manager" - manager_count = var.manager_count - vpc_id = module.vpc.id - cluster_name = var.cluster_name - subnet_ids = module.vpc.public_subnet_ids - security_group_id = module.common.security_group_id - image_id = module.common.image_id - kube_cluster_tag = module.common.kube_cluster_tag - ssh_key = var.cluster_name - instance_profile_name = module.common.instance_profile_name - extra_tags = local.global_tags -} - -module "msrs" { - source = "./modules/msr" - msr_count = var.msr_count - vpc_id = module.vpc.id - cluster_name = var.cluster_name - subnet_ids = module.vpc.public_subnet_ids - security_group_id = module.common.security_group_id - image_id = module.common.image_id - kube_cluster_tag = module.common.kube_cluster_tag - ssh_key = var.cluster_name - instance_profile_name = module.common.instance_profile_name - extra_tags = local.global_tags -} - -module "workers" { - source = "./modules/worker" - worker_count = var.worker_count - vpc_id = module.vpc.id - cluster_name = var.cluster_name - subnet_ids = module.vpc.public_subnet_ids - security_group_id = module.common.security_group_id - image_id = module.common.image_id - kube_cluster_tag = module.common.kube_cluster_tag - ssh_key = var.cluster_name - instance_profile_name = module.common.instance_profile_name - worker_type = var.worker_type - extra_tags = local.global_tags -} - -module "windows_workers" { - source = "./modules/windows_worker" - worker_count = var.windows_worker_count - vpc_id = module.vpc.id - cluster_name = var.cluster_name - subnet_ids = module.vpc.public_subnet_ids - security_group_id = module.common.security_group_id - image_id = module.common.windows_2019_image_id - kube_cluster_tag = module.common.kube_cluster_tag - instance_profile_name = module.common.instance_profile_name - worker_type = var.worker_type - windows_administrator_password = var.windows_administrator_password -} - - diff --git a/test/launchpad/mke.tf.disabled b/test/launchpad/mke.tf.disabled deleted file mode 100644 index 67d5a86..0000000 --- a/test/launchpad/mke.tf.disabled +++ /dev/null @@ -1,44 +0,0 @@ -# Disabled due to coupling failures - -provider "mke" { - endpoint = "https://${module.managers.lb_dns_name}" - username = var.admin_username - password = var.admin_password - unsafe_ssl_client = true -} - - -resource "mke_clientbundle" "admin" { - name = "admin" # this actually doesn't do anything, but TF needs at least one attribute. -} - -provider "kubernetes" { - host = resource.mke_clientbundle.admin.kube[0].host - client_certificate = resource.mke_clientbundle.admin.kube[0].client_cert - client_key = resource.mke_clientbundle.admin.kube[0].client_key - cluster_ca_certificate = resource.mke_clientbundle.admin.kube[0].ca_cert -} - -resource "kubernetes_namespace" "mke-provider" { - metadata { - name = "mke-provider" - } -} - -provider "docker" { - host = "tcp://${module.managers.lb_dns_name}:443" - ca_material = resource.mke_clientbundle.admin.ca_cert - cert_material = resource.mke_clientbundle.admin.client_cert - key_material = resource.mke_clientbundle.admin.private_key -} - -# Find the latest nginx image. -resource "docker_image" "nginx" { - name = "nginx" -} - -# Start an nginx container -resource "docker_container" "nginx-server" { - name = "my-nginx-server" - image = docker_image.nginx.latest -} \ No newline at end of file diff --git a/test/launchpad/modules/common/main.tf b/test/launchpad/modules/common/main.tf deleted file mode 100644 index 36e3fb5..0000000 --- a/test/launchpad/modules/common/main.tf +++ /dev/null @@ -1,144 +0,0 @@ - -data "aws_availability_zones" "available" {} - -resource "tls_private_key" "ssh_key" { - algorithm = "RSA" - rsa_bits = "4096" -} - -resource "local_file" "ssh_public_key" { - content = tls_private_key.ssh_key.private_key_pem - filename = var.keypath - provisioner "local-exec" { - command = "chmod 0600 ${local_file.ssh_public_key.filename}" - } -} - -resource "aws_key_pair" "key" { - key_name = var.cluster_name - public_key = tls_private_key.ssh_key.public_key_openssh -} - -data "aws_ami" "ubuntu" { - most_recent = true - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - owners = ["099720109477"] # Canonical -} - -data "aws_ami" "windows_2019" { - most_recent = true - - filter { - name = "name" - values = ["Windows_Server-2022-English-Core-ContainersLatest-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - owners = ["801119661308"] # Amazon -} - -resource "aws_security_group" "common" { - name = "${var.cluster_name}-common" - description = "mke cluster common rules" - vpc_id = var.vpc_id - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - self = true - } - - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_iam_role" "role" { - name = "${var.cluster_name}_host" - - assume_role_policy = < /etc/hostname -sed -i "s|\(127\.0\..\.. *\)localhost|\1$HOSTNAME|" /etc/hosts -hostname $HOSTNAME -EOF - - lifecycle { - ignore_changes = [ami] - } - - root_block_device { - volume_type = "gp2" - volume_size = var.manager_volume_size - } -} - -resource "aws_lb" "mke_manager" { - name = "${var.cluster_name}-manager-lb" - internal = false - load_balancer_type = "network" - subnets = var.subnet_ids - - tags = merge( - var.extra_tags, - tomap({ - "Cluster" = var.cluster_name - }) - ) -} - -resource "aws_lb_target_group" "mke_manager_api" { - name = "${var.cluster_name}-api" - port = 443 - protocol = "TCP" - vpc_id = var.vpc_id -} - -resource "aws_lb_listener" "mke_manager_api" { - load_balancer_arn = aws_lb.mke_manager.arn - port = 443 - protocol = "TCP" - - default_action { - target_group_arn = aws_lb_target_group.mke_manager_api.arn - type = "forward" - } -} - -resource "aws_lb_target_group_attachment" "mke_manager_api" { - count = var.manager_count - target_group_arn = aws_lb_target_group.mke_manager_api.arn - target_id = aws_instance.mke_manager[count.index].id - port = 443 -} - -resource "aws_lb_target_group" "mke_kube_api" { - name = "${var.cluster_name}-kube-api" - port = 6443 - protocol = "TCP" - vpc_id = var.vpc_id -} - -resource "aws_lb_listener" "mke_kube_api" { - load_balancer_arn = aws_lb.mke_manager.arn - port = 6443 - protocol = "TCP" - - default_action { - target_group_arn = aws_lb_target_group.mke_kube_api.arn - type = "forward" - } -} - -resource "aws_lb_target_group_attachment" "mke_kube_api" { - count = var.manager_count - target_group_arn = aws_lb_target_group.mke_kube_api.arn - target_id = aws_instance.mke_manager[count.index].id - port = 6443 -} diff --git a/test/launchpad/modules/manager/outputs.tf b/test/launchpad/modules/manager/outputs.tf deleted file mode 100644 index a863031..0000000 --- a/test/launchpad/modules/manager/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "lb_dns_name" { - value = aws_lb.mke_manager.dns_name -} - -output "public_ips" { - value = aws_instance.mke_manager.*.public_ip -} - -output "private_ips" { - value = aws_instance.mke_manager.*.private_ip -} - -output "machines" { - value = aws_instance.mke_manager -} diff --git a/test/launchpad/modules/manager/variables.tf b/test/launchpad/modules/manager/variables.tf deleted file mode 100644 index bb0e0fd..0000000 --- a/test/launchpad/modules/manager/variables.tf +++ /dev/null @@ -1,37 +0,0 @@ -variable "cluster_name" {} - -variable "vpc_id" {} - -variable "instance_profile_name" {} - -variable "security_group_id" {} - -variable "subnet_ids" { - type = list(string) -} - -variable "image_id" {} - -variable "kube_cluster_tag" {} - -variable "ssh_key" { - description = "SSH key name" -} - -variable "manager_count" { - default = 3 -} - -variable "manager_type" { - default = "m5.large" -} - -variable "manager_volume_size" { - default = 100 -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/modules/msr/main.tf b/test/launchpad/modules/msr/main.tf deleted file mode 100644 index 54bc358..0000000 --- a/test/launchpad/modules/msr/main.tf +++ /dev/null @@ -1,106 +0,0 @@ -resource "aws_security_group" "msr" { - count = var.msr_count > 0 ? 1 : 0 - - name = "${var.cluster_name}-msr" - description = "mke cluster msrs" - vpc_id = var.vpc_id - - ingress { - from_port = 443 - to_port = 443 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = merge( - var.extra_tags, - tomap({ - "Role" = "msr", - }) - ) -} - -locals { - subnet_count = length(var.subnet_ids) -} - - -resource "aws_instance" "msr" { - count = var.msr_count - - tags = merge( - var.extra_tags, - tomap({ - "Name" = "${var.cluster_name}-msr-${count.index + 1}", - "Role" = "msr", - (var.kube_cluster_tag) = "shared" - }) - ) - - instance_type = var.msr_type - iam_instance_profile = var.instance_profile_name - ami = var.image_id - key_name = var.ssh_key - vpc_security_group_ids = [var.security_group_id, aws_security_group.msr[0].id] - subnet_id = var.subnet_ids[count.index % local.subnet_count] - ebs_optimized = true - user_data = < /etc/hostname -sed -i "s|\(127\.0\..\.. *\)localhost|\1$HOSTNAME|" /etc/hosts -hostname $HOSTNAME -EOF - - lifecycle { - ignore_changes = [ami] - } - - root_block_device { - volume_type = "gp2" - volume_size = var.msr_volume_size - } -} - -resource "aws_lb" "msr" { - count = var.msr_count > 0 ? 1 : 0 - - name = "${var.cluster_name}-msr-lb" - internal = false - load_balancer_type = "network" - subnets = var.subnet_ids - - tags = { - Cluster = var.cluster_name - } -} - -resource "aws_lb_target_group" "mke_msr_api" { - count = var.msr_count > 0 ? 1 : 0 - - name = "${var.cluster_name}-msr-api" - port = 443 - protocol = "TCP" - vpc_id = var.vpc_id -} - -resource "aws_lb_listener" "mke_msr_api" { - count = var.msr_count > 0 ? 1 : 0 - - load_balancer_arn = aws_lb.msr[0].arn - port = 443 - protocol = "TCP" - - default_action { - target_group_arn = aws_lb_target_group.mke_msr_api[0].arn - type = "forward" - } -} - -resource "aws_lb_target_group_attachment" "mke_msr_api" { - count = var.msr_count - target_group_arn = aws_lb_target_group.mke_msr_api[0].arn - target_id = aws_instance.msr[count.index].id - port = 443 -} diff --git a/test/launchpad/modules/msr/outputs.tf b/test/launchpad/modules/msr/outputs.tf deleted file mode 100644 index 80551dd..0000000 --- a/test/launchpad/modules/msr/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "lb_dns_name" { - value = var.msr_count > 0 ? aws_lb.msr[0].dns_name : "" -} - -output "public_ips" { - value = aws_instance.msr.*.public_ip -} - -output "private_ips" { - value = aws_instance.msr.*.private_ip -} - -output "machines" { - value = aws_instance.msr -} diff --git a/test/launchpad/modules/msr/variables.tf b/test/launchpad/modules/msr/variables.tf deleted file mode 100644 index ea1b2ce..0000000 --- a/test/launchpad/modules/msr/variables.tf +++ /dev/null @@ -1,37 +0,0 @@ -variable "cluster_name" {} - -variable "vpc_id" {} - -variable "instance_profile_name" {} - -variable "security_group_id" {} - -variable "subnet_ids" { - type = list(string) -} - -variable "image_id" {} - -variable "kube_cluster_tag" {} - -variable "ssh_key" { - description = "SSH key name" -} - -variable "msr_count" { - default = 1 -} - -variable "msr_type" { - default = "m5.large" -} - -variable "msr_volume_size" { - default = 100 -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/modules/vpc/main.tf b/test/launchpad/modules/vpc/main.tf deleted file mode 100644 index 1386263..0000000 --- a/test/launchpad/modules/vpc/main.tf +++ /dev/null @@ -1,74 +0,0 @@ -data "aws_availability_zones" "all" {} - -# Network VPC, gateway, and routes - -resource "aws_vpc" "network" { - cidr_block = var.host_cidr - assign_generated_ipv6_cidr_block = true - enable_dns_support = true - enable_dns_hostnames = true - - tags = merge( - var.extra_tags, - tomap({ - "Name" = var.cluster_name - }) - ) -} - -resource "aws_internet_gateway" "gateway" { - vpc_id = aws_vpc.network.id - - tags = merge( - var.extra_tags, - tomap({ - "Name" = var.cluster_name - }) - ) -} - -resource "aws_route_table" "default" { - vpc_id = aws_vpc.network.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.gateway.id - } - - tags = merge( - var.extra_tags, - tomap({ - "Name" = var.cluster_name - }) - ) -} - -locals { - kube_cluster_tag = "kubernetes.io/cluster/${var.cluster_name}" -} - - -# Subnets (one per availability zone) -resource "aws_subnet" "public" { - count = 2 - - vpc_id = aws_vpc.network.id - availability_zone = data.aws_availability_zones.all.names[count.index] - - cidr_block = cidrsubnet(var.host_cidr, 8, count.index) - map_public_ip_on_launch = true - - tags = merge( - var.extra_tags, - tomap({ - "Name" = "${var.cluster_name}-${data.aws_availability_zones.all.names[count.index]}" - (local.kube_cluster_tag) = "true" - }) - ) -} - -resource "aws_route_table_association" "public" { - count = length(aws_subnet.public) - route_table_id = aws_route_table.default.id - subnet_id = element(aws_subnet.public.*.id, count.index) -} diff --git a/test/launchpad/modules/vpc/outputs.tf b/test/launchpad/modules/vpc/outputs.tf deleted file mode 100644 index 024cfd3..0000000 --- a/test/launchpad/modules/vpc/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "id" { - value = aws_vpc.network.id -} - -output "public_subnet_ids" { - value = aws_subnet.public.*.id -} diff --git a/test/launchpad/modules/vpc/variables.tf b/test/launchpad/modules/vpc/variables.tf deleted file mode 100644 index f7e13c5..0000000 --- a/test/launchpad/modules/vpc/variables.tf +++ /dev/null @@ -1,12 +0,0 @@ -variable "cluster_name" {} - -variable "host_cidr" { - description = "CIDR IPv4 range to assign to EC2 nodes" - default = "172.31.0.0/16" -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/modules/windows_worker/main.tf b/test/launchpad/modules/windows_worker/main.tf deleted file mode 100644 index 1b7df77..0000000 --- a/test/launchpad/modules/windows_worker/main.tf +++ /dev/null @@ -1,109 +0,0 @@ -resource "aws_security_group" "worker" { - name = "${var.cluster_name}-win-workers" - description = "mke cluster windows workers" - vpc_id = var.vpc_id - - ingress { - from_port = 5985 - to_port = 5986 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = var.extra_tags -} - -locals { - subnet_count = length(var.subnet_ids) -} - -resource "aws_instance" "mke_worker" { - count = var.worker_count - - tags = merge( - var.extra_tags, - tomap({ - "Name" = "${var.cluster_name}-win-worker-${count.index + 1}", - "Role" = "worker", - }) - ) - - instance_type = var.worker_type - iam_instance_profile = var.instance_profile_name - ami = var.image_id - vpc_security_group_ids = [var.security_group_id, aws_security_group.worker.id] - subnet_id = var.subnet_ids[count.index % local.subnet_count] - ebs_optimized = true - user_data = < -$admin = [adsi]("WinNT://./administrator, user") -$admin.psbase.invoke("SetPassword", "${var.windows_administrator_password}") - -# Snippet to enable WinRM over HTTPS with a self-signed certificate -# from https://gist.github.com/TechIsCool/d65017b8427cfa49d579a6d7b6e03c93 -Write-Output "Disabling WinRM over HTTP..." -Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP" -Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -Get-ChildItem WSMan:\Localhost\listener | Remove-Item -Recurse - -Write-Output "Configuring WinRM for HTTPS..." -Set-Item -Path WSMan:\LocalHost\MaxTimeoutms -Value '1800000' -Set-Item -Path WSMan:\LocalHost\Shell\MaxMemoryPerShellMB -Value '1024' -Set-Item -Path WSMan:\LocalHost\Service\AllowUnencrypted -Value 'false' -Set-Item -Path WSMan:\LocalHost\Service\Auth\Basic -Value 'true' -Set-Item -Path WSMan:\LocalHost\Service\Auth\CredSSP -Value 'true' - -New-NetFirewallRule -Name "WINRM-HTTPS-In-TCP" ` - -DisplayName "Windows Remote Management (HTTPS-In)" ` - -Description "Inbound rule for Windows Remote Management via WS-Management. [TCP 5986]" ` - -Group "Windows Remote Management" ` - -Program "System" ` - -Protocol TCP ` - -LocalPort "5986" ` - -Action Allow ` - -Profile Domain,Private - -New-NetFirewallRule -Name "WINRM-HTTPS-In-TCP-PUBLIC" ` - -DisplayName "Windows Remote Management (HTTPS-In)" ` - -Description "Inbound rule for Windows Remote Management via WS-Management. [TCP 5986]" ` - -Group "Windows Remote Management" ` - -Program "System" ` - -Protocol TCP ` - -LocalPort "5986" ` - -Action Allow ` - -Profile Public - -$Hostname = [System.Net.Dns]::GetHostByName((hostname)).HostName.ToUpper() -$pfx = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName $Hostname -$certThumbprint = $pfx.Thumbprint -$certSubjectName = $pfx.SubjectName.Name.TrimStart("CN = ").Trim() - -New-Item -Path WSMan:\LocalHost\Listener -Address * -Transport HTTPS -Hostname $certSubjectName -CertificateThumbPrint $certThumbprint -Port "5986" -force - -Write-Output "Restarting WinRM Service..." -Stop-Service WinRM -Set-Service WinRM -StartupType "Automatic" -Start-Service WinRM - -EOF - - - lifecycle { - ignore_changes = [ami] - } - - root_block_device { - volume_type = "gp2" - volume_size = var.worker_volume_size - } - - connection { - type = "winrm" - user = "Administrator" - password = var.administrator_password - timeout = "10m" - https = "true" - insecure = "true" - port=5986 - } -} diff --git a/test/launchpad/modules/windows_worker/outputs.tf b/test/launchpad/modules/windows_worker/outputs.tf deleted file mode 100644 index 38009c1..0000000 --- a/test/launchpad/modules/windows_worker/outputs.tf +++ /dev/null @@ -1,6 +0,0 @@ -output "private_ips" { - value = aws_instance.mke_worker.*.private_ip -} -output "machines" { - value = aws_instance.mke_worker.* -} diff --git a/test/launchpad/modules/windows_worker/variables.tf b/test/launchpad/modules/windows_worker/variables.tf deleted file mode 100644 index 5e3b951..0000000 --- a/test/launchpad/modules/windows_worker/variables.tf +++ /dev/null @@ -1,36 +0,0 @@ -variable "cluster_name" {} - -variable "vpc_id" {} - -variable "instance_profile_name" {} - -variable "security_group_id" {} - -variable "subnet_ids" { - type = list(string) -} - -variable "image_id" {} - -variable "kube_cluster_tag" {} - -variable "worker_count" { - default = 0 -} - -variable "worker_type" { - default = "m5.large" -} - -variable "worker_volume_size" { - default = 100 -} - -variable "windows_administrator_password" { -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/modules/worker/main.tf b/test/launchpad/modules/worker/main.tf deleted file mode 100644 index eb7f9ff..0000000 --- a/test/launchpad/modules/worker/main.tf +++ /dev/null @@ -1,47 +0,0 @@ -resource "aws_security_group" "worker" { - name = "${var.cluster_name}-workers" - description = "mke cluster workers" - vpc_id = var.vpc_id -} - -locals { - subnet_count = length(var.subnet_ids) -} - - -resource "aws_instance" "mke_worker" { - count = var.worker_count - - tags = merge( - tomap({ - "Name" = "${var.cluster_name}-worker-${count.index + 1}", - "Role" = "worker", - }), - var.extra_tags - ) - - instance_type = var.worker_type - iam_instance_profile = var.instance_profile_name - ami = var.image_id - key_name = var.ssh_key - vpc_security_group_ids = [var.security_group_id, aws_security_group.worker.id] - subnet_id = var.subnet_ids[count.index % local.subnet_count] - ebs_optimized = true - user_data = < /etc/hostname -sed -i "s|\(127\.0\..\.. *\)localhost|\1$HOSTNAME|" /etc/hosts -hostname $HOSTNAME -EOF - - lifecycle { - ignore_changes = [ami] - } - - root_block_device { - volume_type = "gp2" - volume_size = var.worker_volume_size - } -} diff --git a/test/launchpad/modules/worker/outputs.tf b/test/launchpad/modules/worker/outputs.tf deleted file mode 100644 index 38009c1..0000000 --- a/test/launchpad/modules/worker/outputs.tf +++ /dev/null @@ -1,6 +0,0 @@ -output "private_ips" { - value = aws_instance.mke_worker.*.private_ip -} -output "machines" { - value = aws_instance.mke_worker.* -} diff --git a/test/launchpad/modules/worker/variables.tf b/test/launchpad/modules/worker/variables.tf deleted file mode 100644 index 5d27187..0000000 --- a/test/launchpad/modules/worker/variables.tf +++ /dev/null @@ -1,37 +0,0 @@ -variable "cluster_name" {} - -variable "vpc_id" {} - -variable "instance_profile_name" {} - -variable "security_group_id" {} - -variable "subnet_ids" { - type = list(string) -} - -variable "image_id" {} - -variable "kube_cluster_tag" {} - -variable "ssh_key" { - description = "SSH key name" -} - -variable "worker_count" { - default = 3 -} - -variable "worker_type" { - default = "m5.large" -} - -variable "worker_volume_size" { - default = 100 -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/msr.tf.disabled b/test/launchpad/msr.tf.disabled deleted file mode 100644 index 213696b..0000000 --- a/test/launchpad/msr.tf.disabled +++ /dev/null @@ -1,12 +0,0 @@ -# Disabled due to coupling failures - -provider "mirantis-msr-connect" { - host = "https://${module.msrs.lb_dns_name}" - username = var.admin_username - password = var.admin_password - unsafe_ssl_client = true -} - -resource "mirantis-msr-connect_org" "myorg" { - name = "my-org" -} \ No newline at end of file diff --git a/test/launchpad/output.tf b/test/launchpad/output.tf deleted file mode 100644 index 3850c96..0000000 --- a/test/launchpad/output.tf +++ /dev/null @@ -1,8 +0,0 @@ - -output "mke_lb_dns" { - value = module.managers.lb_dns_name -} - -output "msr_lb_dns" { - value = module.msrs.lb_dns_name -} \ No newline at end of file diff --git a/test/launchpad/variables.tf b/test/launchpad/variables.tf deleted file mode 100644 index 27c5aad..0000000 --- a/test/launchpad/variables.tf +++ /dev/null @@ -1,160 +0,0 @@ -variable "cluster_name" { - default = "tf-mcc-provider-test" -} - -variable "aws_region" { - default = "us-west-2" -} - -variable "vpc_cidr" { - default = "172.31.0.0/16" -} - -variable "admin_username" { - default = "admin" -} -variable "admin_password" { - default = "tum40PJ9lGIFySvPeNQYsUBGz8zIKlia" -} - -variable "keypath" { - description = "Path to the PEM used as an ssh key to each host." - type = string - default = "./ssh_keys/privatekey.pem" -} - - -variable "manager_count" { - default = 1 -} - -variable "worker_count" { - default = 3 -} - -variable "windows_worker_count" { - default = 0 -} - -variable "msr_count" { - default = 1 -} - -variable "manager_type" { - default = "m5.large" -} - -variable "worker_type" { - default = "m5.large" -} - -variable "msr_type" { - default = "m5.large" -} -variable "manager_volume_size" { - default = 100 -} - -variable "worker_volume_size" { - default = 100 -} - -variable "msr_volume_size" { - default = 100 -} - - -variable "mcr_version" { - type = string - default = "20.10.7" - description = "The mcr version to deploy across all nodes in the cluster." -} - -variable "mcr_channel" { - type = string - default = "stable" - description = "The channel to pull the mcr installer from." -} - -variable "mcr_repo_url" { - type = string - default = "https://s3.amazonaws.com/repos-internal.mirantis.com" - description = "The repository to source the mcr installer." -} - -variable "mcr_install_url_linux" { - type = string - default = "https://get.mirantis.com/" - description = "Location of Linux installer script." -} - -variable "mcr_install_url_windows" { - type = string - default = "https://get.mirantis.com/install.ps1" - description = "Location of Windows installer script." -} - -variable "mke_version" { - type = string - default = "3.5.2" - description = "The UCP version to deploy." -} - -variable "mke_image_org" { - type = string - default = "docker.io/mirantis" - description = "The repository to pull the UCP images from." -} - -variable "mke_install_flags" { - type = list(string) - default = [] - description = "The UCP installer flags to use." -} - -variable "mke_default_orchestrator" { - type = string - default = "swarm" - description = "Set the MKE default orchestrator." -} - -variable "nodeport_range" { - type = string - default = "32768-35535" - description = "Kubernetes nodeport range." -} - -variable "msr_version" { - type = string - default = "2.9.0" - description = "The DTR version to deploy." -} - -variable "msr_image_org" { - type = string - default = "docker.io/mirantis" - description = "The repository to pull the DTR images from." -} - -variable "msr_install_flags" { - type = list(string) - default = ["--ucp-insecure-tls"] - description = "The DTR installer flags to use." -} - -variable "msr_replica_config" { - type = string - default = "sequential" - description = "Set to 'sequential' to generate sequential replica id's for cluster members, for example 000000000001, 000000000002, etc. ('random' otherwise)" -} - - -variable "windows_administrator_password" { - default = "w!ndozePassw0rd" -} - -variable "extra_tags" { - type = map(string) - default = {} - description = "A map of arbitrary, customizable string key/value pairs to be included alongside a preset map of tags to be used across myriad AWS resources." -} diff --git a/test/launchpad/versions.tf b/test/launchpad/versions.tf deleted file mode 100644 index fcc749b..0000000 --- a/test/launchpad/versions.tf +++ /dev/null @@ -1,22 +0,0 @@ - -terraform { - required_version = ">= 1.0.0" - required_providers { - mirantis-installers = { - version = ">= 0.9.0" - source = "mirantis.com/providers/mirantis-installers" - } - mirantis-msr-connect = { - version = ">= 0.9.0" - source = "mirantis.com/providers/mirantis-msr-connect" - } - mke = { - version = ">= 0.9.0" - source = "mirantis.com/providers/mke" - } - docker = { - source = "kreuzwerker/docker" - version = "2.16.0" - } - } -} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..2c4f8fb --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,8 @@ +//go:build tools + +package tools + +import ( + // Documentation generation + _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" +)