├── .github ├── dependabot.yml └── workflows │ ├── comment-pr.yml │ ├── labeled-pr-testing.yml │ └── release.yml ├── .gitignore ├── .goreleaser.yml ├── LICENSE ├── Makefile ├── NOTICE.md ├── README.md ├── before-commit.sh ├── docs ├── DEVELOPMENT.md ├── FAQ.md ├── USAGE.md ├── index.md └── resources │ └── cluster.md ├── example ├── .gitignore └── main.tf ├── go.mod ├── go.sum ├── kind ├── provider.go ├── provider_test.go ├── resource_cluster.go ├── resource_cluster_test.go ├── schema_kind_config.go ├── structure.go ├── structure_kind_config.go ├── structure_test.go ├── validation.go └── validation_test.go └── main.go /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gomod" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/workflows/comment-pr.yml: -------------------------------------------------------------------------------- 1 | name: comment-pr 2 | 3 | on: 4 | pull_request: 5 | branches: [ master ] 6 | types: [opened] 7 | 8 | jobs: 9 | comment: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | pull-requests: 'write' 13 | steps: 14 | - uses: actions/github-script@v6 15 | with: 16 | script: | 17 | github.rest.issues.createComment({ 18 | issue_number: context.issue.number, 19 | owner: context.repo.owner, 20 | repo: context.repo.repo, 21 | body: '👋 Thank you for the PR! A maintainer will have to add the `ok-to-test` label to run tests before this can get merged.' 22 | }) 23 | -------------------------------------------------------------------------------- /.github/workflows/labeled-pr-testing.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | pull_request_target: 5 | types: [labeled, synchronize] 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | ref: ${{ github.event.pull_request.head.sha }} 16 | - uses: actions/setup-go@v4 17 | with: 18 | go-version: 1.22 19 | 20 | - name: Run tests 21 | run: make testacc 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | goreleaser: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - 16 | name: Checkout 17 | uses: actions/checkout@v4 18 | with: 19 | fetch-depth: 0 20 | - 21 | name: Fetch --prune 22 | run: git fetch --prune 23 | - 24 | name: Set up Go 25 | uses: actions/setup-go@v4 26 | with: 27 | go-version: 1.22 28 | - 29 | name: Import GPG key 30 | id: import_gpg 31 | uses: crazy-max/ghaction-import-gpg@v6 32 | with: 33 | gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} 34 | passphrase: ${{ secrets.PASSPHRASE }} 35 | - 36 | name: Run GoReleaser 37 | uses: goreleaser/goreleaser-action@v5 38 | with: 39 | # either 'goreleaser' (default) or 'goreleaser-pro' 40 | distribution: goreleaser 41 | version: '~> v1' 42 | args: release --clean 43 | env: 44 | GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} 45 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | # 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | 20 | # Go workspace file 21 | go.work 22 | 23 | # Local .terraform directories 24 | **/.terraform/* 25 | 26 | # .tfstate files 27 | *.tfstate 28 | *.tfstate.* 29 | 30 | # Crash log files 31 | crash.log 32 | crash.*.log 33 | 34 | # Exclude all .tfvars files, which are likely to contain sensitive data, such as 35 | # password, private keys, and other secrets. These should not be part of version 36 | # control as they are data points which are potentially sensitive and subject 37 | # to change depending on the environment. 38 | *.tfvars 39 | *.tfvars.json 40 | 41 | # Ignore override files as they are usually used to override resources locally and so 42 | # are not checked in 43 | override.tf 44 | override.tf.json 45 | *_override.tf 46 | *_override.tf.json 47 | 48 | # Include override files you do wish to add to version control using negated pattern 49 | # !example_override.tf 50 | 51 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 52 | # example: *tfplan* 53 | 54 | # Ignore CLI configuration files 55 | .terraformrc 56 | terraform.rc -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # This is an example goreleaser.yaml file with some sane defaults. 2 | # Make sure to check the documentation at http://goreleaser.com 3 | before: 4 | hooks: 5 | # You may remove this if you don't use go modules. 6 | - go mod download 7 | # you may remove this if you don't need go generate 8 | - go generate ./... 9 | builds: 10 | - env: 11 | - CGO_ENABLED=0 12 | mod_timestamp: '{{ .CommitTimestamp }}' 13 | flags: 14 | - -trimpath 15 | ldflags: 16 | - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}' 17 | goos: 18 | - linux 19 | - windows 20 | - darwin 21 | goarch: 22 | - amd64 23 | - arm64 24 | archives: 25 | - format: zip 26 | name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' 27 | checksum: 28 | name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' 29 | algorithm: sha256 30 | signs: 31 | - artifacts: checksum 32 | args: 33 | # if you are using this is a GitHub action or some other automated pipeline, you 34 | # need to pass the batch flag to indicate its not interactive. 35 | - "--batch" 36 | - "--local-user" 37 | - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key 38 | - "--output" 39 | - "${signature}" 40 | - "--detach-sign" 41 | - "${artifact}" 42 | release: 43 | # Visit your project's GitHub Releases page to publish this release. 44 | draft: false 45 | changelog: 46 | skip: true 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build 2 | build: 3 | ./before-commit.sh 4 | 5 | .PHONY: ci-build 6 | ci-build: 7 | ./before-commit.sh ci 8 | 9 | .PHONY: ci-pr 10 | ci-pr: build 11 | 12 | .PHONY: ci-master 13 | ci-master: build 14 | 15 | .PHONY: ci-release 16 | ci-release: build 17 | 18 | .PHONY: clean 19 | clean: 20 | rm -rf bin 21 | 22 | ci-testacc: 23 | ./before-commit.sh ci testacc 24 | 25 | testacc: 26 | ./before-commit.sh testacc 27 | 28 | install: GOOS=$(shell go env GOOS) 29 | install: GOARCH=$(shell go env GOARCH) 30 | ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... 31 | install: DESTINATION=$(APPDATA)/terraform.d/plugins/$(GOOS)_$(GOARCH) 32 | else 33 | install: DESTINATION=$(HOME)/.terraform.d/plugins/$(GOOS)_$(GOARCH) 34 | endif 35 | install: build 36 | @echo "==> Installing plugin to $(DESTINATION)" 37 | @mkdir -p $(DESTINATION) 38 | @cp ./bin/terraform-provider-kind $(DESTINATION) 39 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Terraform Provider for kind 2 | 3 | 4 | ## Overview 5 | 6 | The Terraform Provider for kind enables [Terraform](https://www.terraform.io) to provision local [Kubernetes](https://kubernetes.io) clusters on base of [Kubernetes IN Docker (kind)](https://github.com/kubernetes-sigs/kind). 7 | 8 | ## Quick Starts 9 | - [Using the provider](./docs/USAGE.md) 10 | - [Provider development](./docs/DEVELOPMENT.md) 11 | 12 | > **Note** 13 | > 14 | > For the `runtimeConfig` field there's special behaviour for options containing a `/` character. Since this is not allowed in HCL you can just use `_` which is internally replaced with a `/` for generating the kind config. E.g. for the option `api/alpha` you'd name the field `api_alpha` and it will set it to `api/alpha` when creating the corresponding kind config. 15 | 16 | ## Example Usage 17 | 18 | Copy the following code into a file with the extension `.tf` to create a kind cluster with only default values. 19 | ```hcl 20 | provider "kind" {} 21 | 22 | resource "kind_cluster" "default" { 23 | name = "test-cluster" 24 | } 25 | ``` 26 | 27 | Then run `terraform init`, `terraform plan` & `terraform apply` and follow the on screen instructions. For more details on how to influence creation of the kind resource check out the Quick Start section above. 28 | -------------------------------------------------------------------------------- /before-commit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o pipefail 3 | 4 | readonly CI_FLAG=ci 5 | readonly TEST_ACC_FLAG=testacc 6 | 7 | RED='\033[0;31m' 8 | GREEN='\033[0;32m' 9 | INVERTED='\033[7m' 10 | NC='\033[0m' # No Color 11 | 12 | echo -e "${INVERTED}" 13 | echo "USER: " + $USER 14 | echo "PATH: " + $PATH 15 | echo "GOPATH:" + $GOPATH 16 | echo -e "${NC}" 17 | 18 | ## 19 | # Tidy dependencies 20 | ## 21 | go mod tidy 22 | tidyResult=$? 23 | if [ ${tidyResult} != 0 ]; then 24 | echo -e "${RED}✗ go mod tidy${NC}\n$tidyResult${NC}" 25 | exit 1 26 | else echo -e "${GREEN}√ go mod tidy${NC}" 27 | fi 28 | 29 | ## 30 | # GO BUILD 31 | ## 32 | if [ "$1" == "$CI_FLAG" ] || [ "$2" == "$CI_FLAG" ]; then 33 | # build all binaries 34 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/terraform-provider-kind-windows-amd64 35 | goBuildResult=$? 36 | if [ ${goBuildResult} != 0 ]; then 37 | echo -e "${RED}✗ go build (windows)${NC}\n$goBuildResult${NC}" 38 | exit 1 39 | else echo -e "${GREEN}√ go build (windows)${NC}" 40 | fi 41 | 42 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/terraform-provider-kind-linux-amd64 43 | goBuildResult=$? 44 | if [ ${goBuildResult} != 0 ]; then 45 | echo -e "${RED}✗ go build (linux)${NC}\n$goBuildResult${NC}" 46 | exit 1 47 | else echo -e "${GREEN}√ go build (linux)${NC}" 48 | fi 49 | 50 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/terraform-provider-kind-darwin-amd64 51 | goBuildResult=$? 52 | if [ ${goBuildResult} != 0 ]; then 53 | echo -e "${RED}✗ go build (mac)${NC}\n$goBuildResult${NC}" 54 | exit 1 55 | else echo -e "${GREEN}√ go build (mac)${NC}" 56 | fi 57 | else 58 | # build just current arch 59 | CGO_ENABLED=0 go build -o bin/terraform-provider-kind 60 | goBuildResult=$? 61 | if [ ${goBuildResult} != 0 ]; then 62 | echo -e "${RED}✗ go build (dev)${NC}\n$goBuildResult${NC}" 63 | exit 1 64 | else echo -e "${GREEN}√ go build (dev)${NC}" 65 | fi 66 | fi 67 | 68 | 69 | ## 70 | # Verify dependencies 71 | ## 72 | echo "? go mod verify" 73 | depResult=$(go mod verify) 74 | if [ $? != 0 ]; then 75 | echo -e "${RED}✗ go mod verify\n$depResult${NC}" 76 | exit 1 77 | else echo -e "${GREEN}√ go mod verify${NC}" 78 | fi 79 | 80 | ## 81 | # GO TEST 82 | ## 83 | echo "? go test" 84 | go test ./... 85 | # Check if tests passed 86 | if [ $? != 0 ]; then 87 | echo -e "${RED}✗ go test\n${NC}" 88 | exit 1 89 | else echo -e "${GREEN}√ go test${NC}" 90 | fi 91 | 92 | goFilesToCheck=$(find . -type f -name "*.go" | egrep -v "\/vendor\/|_*/automock/|_*/testdata/|_*export_test.go") 93 | 94 | ## 95 | # TF ACCEPTANCE TESTS 96 | ## 97 | if [ "$1" == "$TEST_ACC_FLAG" ] || [ "$2" == "$TEST_ACC_FLAG" ]; then 98 | # run terraform acceptance tests 99 | if [ "$1" == "$CI_FLAG" ] || [ "$2" == "$CI_FLAG" ]; then 100 | TF_ACC=1 go test ./kind -v -count 1 -parallel 20 -timeout 120m 101 | else 102 | TF_ACC=1 go test ./kind -v -count 1 -parallel 1 -timeout 120m 103 | fi 104 | fi 105 | 106 | # 107 | # GO FMT 108 | # 109 | goFmtResult=$(echo "${goFilesToCheck}" | xargs -L1 go fmt) 110 | if [ $(echo ${#goFmtResult}) != 0 ] 111 | then 112 | echo -e "${RED}✗ go fmt${NC}\n$goFmtResult${NC}" 113 | exit 1; 114 | else echo -e "${GREEN}√ go fmt${NC}" 115 | fi 116 | 117 | ## 118 | # GO VET 119 | ## 120 | packagesToVet=("./kind/...") 121 | 122 | for vPackage in "${packagesToVet[@]}"; do 123 | vetResult=$(go vet ${vPackage}) 124 | if [ $(echo ${#vetResult}) != 0 ]; then 125 | echo -e "${RED}✗ go vet ${vPackage} ${NC}\n$vetResult${NC}" 126 | exit 1 127 | else echo -e "${GREEN}√ go vet ${vPackage} ${NC}" 128 | fi 129 | done 130 | -------------------------------------------------------------------------------- /docs/DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | # Development Environment Setup 2 | 3 | ## Requirements 4 | 5 | - [Terraform](https://www.terraform.io/downloads.html) 0.12+ 6 | - [Go](https://golang.org/doc/install) 1.19 or higher 7 | - Make sure that your Docker Engine has enough memory assigned to run multi-node kind clusters. 8 | 9 | ## Development 10 | 11 | Perform the following steps to build the providers: 12 | 13 | 1. Build the provider: 14 | ```bash 15 | go build -o terraform-provider-kind 16 | ``` 17 | 2. Move the provider binary into the terraform plugins folder. 18 | 19 | >**NOTE**: For details on Terraform plugins see [this](https://www.terraform.io/docs/plugins/basics.html#installing-plugins) document. 20 | 21 | ## Testing 22 | 23 | In order to test the provider you can run `go test ./...` for the unit tests as well as `make testacc` for the Acceptance Tests. If you prefer to only run tests and skip linting and formatting when running Acceptance Tests start them by running `TF_ACC=1 go test ./kind -v -count 1 -parallel 20 -timeout 120m`. 24 | 25 | *Note:* Acceptance tests create real resources, and will consume significant resources on the machine they run on. 26 | 27 | ## Release 28 | 29 | In order to be able to release a new version this repository needs signed git commits when pushing a tag in order to pick that up and start a new goreleaser run. 30 | 31 | To set this up on Windows, follow [this tutorial](https://tau.gr/posts/2018-06-29-how-to-set-up-signing-commits-with-git/). 32 | -------------------------------------------------------------------------------- /docs/FAQ.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | Add questions as they arise... -------------------------------------------------------------------------------- /docs/USAGE.md: -------------------------------------------------------------------------------- 1 | # Using The Provider 2 | 3 | ## Usage 4 | 5 | Perform the following steps to use the provider: 6 | 7 | 1. Go to the provider [example](https://github.com/tehcyx/terraform-provider-kind/tree/master/example) folder: 8 | ```bash 9 | cd example 10 | ``` 11 | 2. Edit the `main.tf` file and change the config as needed. 12 | 13 | 14 | 1. Initialize Terraform: 15 | ```bash 16 | terraform init 17 | ``` 18 | 2. Plan the provisioning: 19 | ```bash 20 | terraform plan 21 | ``` 22 | 3. Deploy the cluster: 23 | ```bash 24 | terraform apply 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Kind Provider 2 | 3 | The Kind provider is used to interact with [Kubernetes IN Docker 4 | (kind)](https://github.com/kubernetes-sigs/kind) to provision local 5 | [Kubernetes](https://kubernetes.io) clusters. 6 | 7 | > **Note** 8 | > 9 | > For the `runtimeConfig` field there's special behaviour for options containing a `/` character. Since this is not allowed in HCL you can just use `_` which is internally replaced with a `/` for generating the kind config. E.g. for the option `api/alpha` you'd name the field `api_alpha` and it will set it to `api/alpha` when creating the corresponding kind config. 10 | 11 | ## Example Usage 12 | 13 | ```hcl 14 | # Configure the Kind Provider 15 | provider "kind" {} 16 | 17 | # Create a cluster 18 | resource "kind_cluster" "default" { 19 | name = "test-cluster" 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /docs/resources/cluster.md: -------------------------------------------------------------------------------- 1 | # kind_cluster 2 | 3 | Provides a Kind cluster resource. This can be used to create and delete Kind 4 | clusters. It does NOT support modification to an existing kind cluster. 5 | 6 | ## Example Usage 7 | 8 | ```hcl 9 | # Create a kind cluster of the name "test-cluster" with default kubernetes 10 | # version specified in kind 11 | # ref: https://github.com/kubernetes-sigs/kind/blob/master/pkg/apis/config/defaults/image.go#L21 12 | resource "kind_cluster" "default" { 13 | name = "test-cluster" 14 | } 15 | ``` 16 | 17 | To override the node image used: 18 | 19 | ```hcl 20 | provider "kind" {} 21 | 22 | # Create a cluster with kind of the name "test-cluster" with kubernetes version v1.27.1 23 | resource "kind_cluster" "default" { 24 | name = "test-cluster" 25 | node_image = "kindest/node:v1.27.1" 26 | } 27 | ``` 28 | 29 | To configure the cluster for nginx's ingress controller based on [kind's docs](https://kind.sigs.k8s.io/docs/user/ingress/): 30 | 31 | ```hcl 32 | provider "kind" {} 33 | 34 | resource "kind_cluster" "default" { 35 | name = "test-cluster" 36 | wait_for_ready = true 37 | 38 | kind_config { 39 | kind = "Cluster" 40 | api_version = "kind.x-k8s.io/v1alpha4" 41 | 42 | node { 43 | role = "control-plane" 44 | 45 | kubeadm_config_patches = [ 46 | "kind: InitConfiguration\nnodeRegistration:\n kubeletExtraArgs:\n node-labels: \"ingress-ready=true\"\n" 47 | ] 48 | 49 | extra_port_mappings { 50 | container_port = 80 51 | host_port = 80 52 | } 53 | extra_port_mappings { 54 | container_port = 443 55 | host_port = 443 56 | } 57 | } 58 | 59 | node { 60 | role = "worker" 61 | } 62 | } 63 | } 64 | ``` 65 | 66 | To override the default kind config: 67 | 68 | ```hcl 69 | provider "kind" {} 70 | 71 | # creating a cluster with kind of the name "test-cluster" with kubernetes version v1.27.1 and two nodes 72 | resource "kind_cluster" "default" { 73 | name = "test-cluster" 74 | node_image = "kindest/node:v1.27.1" 75 | kind_config { 76 | kind = "Cluster" 77 | api_version = "kind.x-k8s.io/v1alpha4" 78 | node { 79 | role = "control-plane" 80 | } 81 | node { 82 | role = "worker" 83 | } 84 | } 85 | } 86 | ``` 87 | 88 | 89 | ```hcl 90 | provider "kind" {} 91 | 92 | # Create a cluster with patches applied to the containerd config 93 | resource "kind_cluster" "default" { 94 | name = "test-cluster" 95 | node_image = "kindest/node:v1.27.1" 96 | kind_config = { 97 | containerd_config_patches = [ 98 | <<-TOML 99 | [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] 100 | endpoint = ["http://kind-registry:5000"] 101 | TOML 102 | ] 103 | } 104 | } 105 | ``` 106 | 107 | If specifying a kubeconfig path containing a `~/some/random/path` character, be aware that terraform is not expanding the path unless you specify it via `pathexpand("~/some/random/path")` 108 | 109 | ```hcl 110 | locals { 111 | k8s_config_path = pathexpand("~/folder/config") 112 | } 113 | 114 | resource "kind_cluster" "default" { 115 | name = "test-cluster" 116 | kubeconfig_path = local.k8s_config_path 117 | # ... 118 | } 119 | ``` 120 | 121 | ## Argument Reference 122 | 123 | * `name` - (Required) The kind name that is given to the created cluster. 124 | * `node_image` - (Optional) The node_image that kind will use (ex: kindest/node:v1.27.1). 125 | * `wait_for_ready` - (Optional) Defines wether or not the provider will wait for the control plane to be ready. Defaults to false. 126 | * `kind_config` - (Optional) The kind_config that kind will use. 127 | * `kubeconfig_path` - kubeconfig path set after the the cluster is created or by the user to override defaults. 128 | 129 | ## Attributes Reference 130 | 131 | In addition to the arguments listed above, the following computed attributes are 132 | exported: 133 | 134 | * `kubeconfig` - The kubeconfig for the cluster after it is created 135 | * `client_certificate` - Client certificate for authenticating to cluster. 136 | * `client_key` - Client key for authenticating to cluster. 137 | * `cluster_ca_certificate` - Client verifies the server certificate with this CA cert. 138 | * `endpoint` - Kubernetes APIServer endpoint. 139 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform.lock.hcl -------------------------------------------------------------------------------- /example/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | kind = { 4 | source = "tehcyx/kind" 5 | version = "~> 0.0.19" 6 | } 7 | } 8 | } 9 | 10 | provider "kind" { 11 | } 12 | 13 | resource "kind_cluster" "default" { 14 | name = "new-cluster" 15 | wait_for_ready = true 16 | kind_config { 17 | kind = "Cluster" 18 | api_version = "kind.x-k8s.io/v1alpha4" 19 | 20 | node { 21 | role = "control-plane" 22 | } 23 | 24 | node { 25 | role = "worker" 26 | } 27 | 28 | node { 29 | role = "worker" 30 | } 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/tehcyx/terraform-provider-kind 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.1 6 | 7 | require ( 8 | github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 9 | github.com/pelletier/go-toml v1.9.5 10 | k8s.io/client-go v12.0.0+incompatible 11 | sigs.k8s.io/kind v0.29.0 12 | ) 13 | 14 | require ( 15 | al.essio.dev/pkg/shellescape v1.5.1 // indirect 16 | github.com/BurntSushi/toml v1.4.0 // indirect 17 | github.com/ProtonMail/go-crypto v1.1.6 // indirect 18 | github.com/agext/levenshtein v1.2.2 // indirect 19 | github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect 20 | github.com/cloudflare/circl v1.6.0 // indirect 21 | github.com/davecgh/go-spew v1.1.1 // indirect 22 | github.com/evanphx/json-patch/v5 v5.6.0 // indirect 23 | github.com/fatih/color v1.16.0 // indirect 24 | github.com/go-logr/logr v1.4.2 // indirect 25 | github.com/gogo/protobuf v1.3.2 // indirect 26 | github.com/golang/protobuf v1.5.4 // indirect 27 | github.com/google/go-cmp v0.7.0 // indirect 28 | github.com/google/gofuzz v1.1.0 // indirect 29 | github.com/hashicorp/errwrap v1.0.0 // indirect 30 | github.com/hashicorp/go-checkpoint v0.5.0 // indirect 31 | github.com/hashicorp/go-cleanhttp v0.5.2 // indirect 32 | github.com/hashicorp/go-cty v1.5.0 // indirect 33 | github.com/hashicorp/go-hclog v1.6.3 // indirect 34 | github.com/hashicorp/go-multierror v1.1.1 // indirect 35 | github.com/hashicorp/go-plugin v1.6.3 // indirect 36 | github.com/hashicorp/go-retryablehttp v0.7.7 // indirect 37 | github.com/hashicorp/go-uuid v1.0.3 // indirect 38 | github.com/hashicorp/go-version v1.7.0 // indirect 39 | github.com/hashicorp/hc-install v0.9.2 // indirect 40 | github.com/hashicorp/hcl/v2 v2.23.0 // indirect 41 | github.com/hashicorp/logutils v1.0.0 // indirect 42 | github.com/hashicorp/terraform-exec v0.23.0 // indirect 43 | github.com/hashicorp/terraform-json v0.25.0 // indirect 44 | github.com/hashicorp/terraform-plugin-go v0.27.0 // indirect 45 | github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect 46 | github.com/hashicorp/terraform-registry-address v0.2.5 // indirect 47 | github.com/hashicorp/terraform-svchost v0.1.1 // indirect 48 | github.com/hashicorp/yamux v0.1.1 // indirect 49 | github.com/imdario/mergo v0.3.15 // indirect 50 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 51 | github.com/json-iterator/go v1.1.11 // indirect 52 | github.com/mattn/go-colorable v0.1.13 // indirect 53 | github.com/mattn/go-isatty v0.0.20 // indirect 54 | github.com/mitchellh/copystructure v1.2.0 // indirect 55 | github.com/mitchellh/go-testing-interface v1.14.1 // indirect 56 | github.com/mitchellh/go-wordwrap v1.0.0 // indirect 57 | github.com/mitchellh/mapstructure v1.5.0 // indirect 58 | github.com/mitchellh/reflectwalk v1.0.2 // indirect 59 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 60 | github.com/modern-go/reflect2 v1.0.1 // indirect 61 | github.com/oklog/run v1.0.0 // indirect 62 | github.com/pkg/errors v0.9.1 // indirect 63 | github.com/spf13/cobra v1.8.0 // indirect 64 | github.com/spf13/pflag v1.0.5 // indirect 65 | github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect 66 | github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect 67 | github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect 68 | github.com/zclconf/go-cty v1.16.2 // indirect 69 | golang.org/x/crypto v0.38.0 // indirect 70 | golang.org/x/mod v0.24.0 // indirect 71 | golang.org/x/net v0.39.0 // indirect 72 | golang.org/x/oauth2 v0.26.0 // indirect 73 | golang.org/x/sync v0.14.0 // indirect 74 | golang.org/x/sys v0.33.0 // indirect 75 | golang.org/x/term v0.32.0 // indirect 76 | golang.org/x/text v0.25.0 // indirect 77 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect 78 | golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect 79 | google.golang.org/appengine v1.6.8 // indirect 80 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect 81 | google.golang.org/grpc v1.72.1 // indirect 82 | google.golang.org/protobuf v1.36.6 // indirect 83 | gopkg.in/inf.v0 v0.9.1 // indirect 84 | gopkg.in/yaml.v2 v2.4.0 // indirect 85 | k8s.io/apimachinery v0.20.2 // indirect 86 | k8s.io/klog/v2 v2.130.1 // indirect 87 | k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect 88 | sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect 89 | sigs.k8s.io/yaml v1.4.0 // indirect 90 | ) 91 | 92 | replace k8s.io/client-go => k8s.io/client-go v0.20.2 93 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho= 2 | al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= 3 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 4 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 5 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 6 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 7 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 8 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 9 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 10 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 11 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 12 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 13 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 14 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 15 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 16 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 17 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 18 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 19 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 20 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 21 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 22 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 23 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 24 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 25 | dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= 26 | dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= 27 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 28 | github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 29 | github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= 30 | github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= 31 | github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= 32 | github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= 33 | github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= 34 | github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= 35 | github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= 36 | github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= 37 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 38 | github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= 39 | github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= 40 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 41 | github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= 42 | github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= 43 | github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 44 | github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw= 45 | github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= 46 | github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 47 | github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 48 | github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= 49 | github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= 50 | github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= 51 | github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= 52 | github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= 53 | github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 54 | github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= 55 | github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= 56 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 57 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 58 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 59 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 60 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 61 | github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= 62 | github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= 63 | github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 64 | github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= 65 | github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= 66 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 67 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 68 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 69 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 70 | github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= 71 | github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= 72 | github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= 73 | github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 74 | github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= 75 | github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= 76 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 77 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 78 | github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 79 | github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= 80 | github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= 81 | github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= 82 | github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= 83 | github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= 84 | github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= 85 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 86 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 87 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 88 | github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= 89 | github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= 90 | github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM= 91 | github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= 92 | github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= 93 | github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= 94 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 95 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 96 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 97 | github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= 98 | github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= 99 | github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= 100 | github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 101 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 102 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 103 | github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= 104 | github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= 105 | github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= 106 | github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= 107 | github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= 108 | github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 109 | github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 110 | github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= 111 | github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= 112 | github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 113 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= 114 | github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 115 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 116 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 117 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 118 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 119 | github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= 120 | github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= 121 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 122 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 123 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 124 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 125 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 126 | github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 127 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 128 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 129 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 130 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 131 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 132 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 133 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 134 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 135 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 136 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 137 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 138 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 139 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 140 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 141 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= 142 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= 143 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 144 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 145 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 146 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 147 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 148 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 149 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 150 | github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 151 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 152 | github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 153 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 154 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 155 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 156 | github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= 157 | github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 158 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 159 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 160 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 161 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 162 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 163 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 164 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 165 | github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= 166 | github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= 167 | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 168 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 169 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 170 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 171 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 172 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 173 | github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= 174 | github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 175 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= 176 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 177 | github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= 178 | github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= 179 | github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 180 | github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= 181 | github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= 182 | github.com/hashicorp/go-cty v1.5.0 h1:EkQ/v+dDNUqnuVpmS5fPqyY71NXVgT5gf32+57xY8g0= 183 | github.com/hashicorp/go-cty v1.5.0/go.mod h1:lFUCG5kd8exDobgSfyj4ONE/dc822kiYMguVKdHGMLM= 184 | github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= 185 | github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= 186 | github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= 187 | github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= 188 | github.com/hashicorp/go-plugin v1.6.3 h1:xgHB+ZUSYeuJi96WtxEjzi23uh7YQpznjGh0U0UUrwg= 189 | github.com/hashicorp/go-plugin v1.6.3/go.mod h1:MRobyh+Wc/nYy1V4KAXUiYfzxoYhs7V1mlH1Z7iY2h0= 190 | github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= 191 | github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= 192 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 193 | github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= 194 | github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 195 | github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= 196 | github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 197 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 198 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 199 | github.com/hashicorp/hc-install v0.9.2 h1:v80EtNX4fCVHqzL9Lg/2xkp62bbvQMnvPQ0G+OmtO24= 200 | github.com/hashicorp/hc-install v0.9.2/go.mod h1:XUqBQNnuT4RsxoxiM9ZaUk0NX8hi2h+Lb6/c0OZnC/I= 201 | github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= 202 | github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= 203 | github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= 204 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 205 | github.com/hashicorp/terraform-exec v0.23.0 h1:MUiBM1s0CNlRFsCLJuM5wXZrzA3MnPYEsiXmzATMW/I= 206 | github.com/hashicorp/terraform-exec v0.23.0/go.mod h1:mA+qnx1R8eePycfwKkCRk3Wy65mwInvlpAeOwmA7vlY= 207 | github.com/hashicorp/terraform-json v0.25.0 h1:rmNqc/CIfcWawGiwXmRuiXJKEiJu1ntGoxseG1hLhoQ= 208 | github.com/hashicorp/terraform-json v0.25.0/go.mod h1:sMKS8fiRDX4rVlR6EJUMudg1WcanxCMoWwTLkgZP/vc= 209 | github.com/hashicorp/terraform-plugin-go v0.27.0 h1:ujykws/fWIdsi6oTUT5Or4ukvEan4aN9lY+LOxVP8EE= 210 | github.com/hashicorp/terraform-plugin-go v0.27.0/go.mod h1:FDa2Bb3uumkTGSkTFpWSOwWJDwA7bf3vdP3ltLDTH6o= 211 | github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= 212 | github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= 213 | github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM= 214 | github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA= 215 | github.com/hashicorp/terraform-registry-address v0.2.5 h1:2GTftHqmUhVOeuu9CW3kwDkRe4pcBDq0uuK5VJngU1M= 216 | github.com/hashicorp/terraform-registry-address v0.2.5/go.mod h1:PpzXWINwB5kuVS5CA7m1+eO2f1jKb5ZDIxrOPfpnGkg= 217 | github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= 218 | github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= 219 | github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= 220 | github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= 221 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 222 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 223 | github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 224 | github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= 225 | github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= 226 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 227 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 228 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= 229 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= 230 | github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 231 | github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= 232 | github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= 233 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 234 | github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 235 | github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= 236 | github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 237 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 238 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 239 | github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= 240 | github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= 241 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 242 | github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 243 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 244 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 245 | github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 246 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 247 | github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= 248 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 249 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 250 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 251 | github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 252 | github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 253 | github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 254 | github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 255 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= 256 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 257 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 258 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 259 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 260 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 261 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 262 | github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= 263 | github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= 264 | github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= 265 | github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= 266 | github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= 267 | github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 268 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 269 | github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= 270 | github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 271 | github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= 272 | github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= 273 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 274 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 275 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 276 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 277 | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= 278 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 279 | github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 280 | github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= 281 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= 282 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 283 | github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= 284 | github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= 285 | github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 286 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 287 | github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 288 | github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= 289 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 290 | github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= 291 | github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= 292 | github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 293 | github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= 294 | github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= 295 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 296 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 297 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 298 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 299 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 300 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 301 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 302 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 303 | github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= 304 | github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= 305 | github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= 306 | github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= 307 | github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 308 | github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= 309 | github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= 310 | github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 311 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 312 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 313 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 314 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 315 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 316 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 317 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 318 | github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= 319 | github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= 320 | github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 321 | github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= 322 | github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= 323 | github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= 324 | github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= 325 | github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= 326 | github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= 327 | github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= 328 | github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= 329 | github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= 330 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 331 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 332 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 333 | github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70= 334 | github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= 335 | github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= 336 | github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= 337 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 338 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 339 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 340 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 341 | go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= 342 | go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= 343 | go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= 344 | go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= 345 | go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= 346 | go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= 347 | go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= 348 | go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= 349 | go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= 350 | go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= 351 | go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= 352 | go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= 353 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 354 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 355 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 356 | golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 357 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 358 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 359 | golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 360 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 361 | golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= 362 | golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= 363 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 364 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 365 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 366 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 367 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 368 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 369 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 370 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 371 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 372 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 373 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 374 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 375 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 376 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 377 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 378 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 379 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 380 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 381 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 382 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 383 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 384 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 385 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 386 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 387 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 388 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 389 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 390 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 391 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 392 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 393 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 394 | golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= 395 | golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= 396 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 397 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 398 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 399 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 400 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 401 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 402 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 403 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 404 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 405 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 406 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 407 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 408 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 409 | golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 410 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 411 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 412 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 413 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 414 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 415 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 416 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 417 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 418 | golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 419 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 420 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 421 | golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= 422 | golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= 423 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 424 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 425 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 426 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 427 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 428 | golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= 429 | golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 430 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 431 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 432 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 433 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 434 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 435 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 436 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 437 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 438 | golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= 439 | golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 440 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 441 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 442 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 443 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 444 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 445 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 446 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 447 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 448 | golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 449 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 450 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 451 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 452 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 453 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 454 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 455 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 456 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 457 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 458 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 459 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 460 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 461 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 462 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 463 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 464 | golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 465 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 466 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 467 | golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 468 | golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 469 | golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 470 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 471 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 472 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 473 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 474 | golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= 475 | golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 476 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 477 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 478 | golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= 479 | golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= 480 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 481 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 482 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 483 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 484 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 485 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 486 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 487 | golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= 488 | golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= 489 | golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= 490 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 491 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 492 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 493 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= 494 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 495 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 496 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 497 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 498 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 499 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 500 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 501 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 502 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 503 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 504 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 505 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 506 | golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 507 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 508 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 509 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 510 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 511 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 512 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 513 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 514 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 515 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 516 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 517 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 518 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 519 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 520 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 521 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 522 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 523 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 524 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 525 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 526 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 527 | golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 528 | golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 529 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 530 | golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= 531 | golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= 532 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 533 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 534 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 535 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 536 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 537 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 538 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 539 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 540 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 541 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 542 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 543 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 544 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 545 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 546 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 547 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 548 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 549 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 550 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 551 | google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= 552 | google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= 553 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 554 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 555 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 556 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 557 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 558 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 559 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 560 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 561 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 562 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 563 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 564 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 565 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 566 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 567 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 568 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 569 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 570 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 571 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 572 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= 573 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= 574 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 575 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 576 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 577 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 578 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 579 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 580 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 581 | google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= 582 | google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= 583 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 584 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 585 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 586 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 587 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 588 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 589 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 590 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 591 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 592 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 593 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 594 | google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= 595 | google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= 596 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 597 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 598 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 599 | gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= 600 | gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 601 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 602 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 603 | gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= 604 | gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 605 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 606 | gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= 607 | gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= 608 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 609 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 610 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 611 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 612 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 613 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 614 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 615 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 616 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 617 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 618 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 619 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 620 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 621 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 622 | k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= 623 | k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= 624 | k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= 625 | k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= 626 | k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= 627 | k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= 628 | k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 629 | k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= 630 | k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= 631 | k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= 632 | k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= 633 | k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= 634 | k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= 635 | k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= 636 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 637 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 638 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 639 | sigs.k8s.io/kind v0.29.0 h1:3TpCsyh908IkXXpcSnsMjWdwdWjIl7o9IMZImZCWFnI= 640 | sigs.k8s.io/kind v0.29.0/go.mod h1:ldWQisw2NYyM6k64o/tkZng/1qQW7OlzcN5a8geJX3o= 641 | sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= 642 | sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= 643 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 644 | sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= 645 | sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= 646 | sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= 647 | -------------------------------------------------------------------------------- /kind/provider.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 7 | ) 8 | 9 | const ( 10 | defaultCreateTimeout = time.Minute * 5 11 | defaultUpdateTimeout = time.Minute * 5 12 | defaultDeleteTimeout = time.Minute * 5 13 | ) 14 | 15 | func Provider() *schema.Provider { 16 | return &schema.Provider{ 17 | ResourcesMap: map[string]*schema.Resource{ 18 | "kind_cluster": resourceCluster(), 19 | }, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kind/provider_test.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "testing" 7 | 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 9 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 10 | "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" 11 | ) 12 | 13 | var testAccProvider *schema.Provider 14 | var testAccProviders map[string]*schema.Provider 15 | var testAccProviderFunc func() *schema.Provider 16 | 17 | func init() { 18 | testAccProvider = Provider() 19 | testAccProviders = map[string]*schema.Provider{ 20 | "kind": testAccProvider, 21 | } 22 | testAccProviderFunc = func() *schema.Provider { return testAccProvider } 23 | } 24 | 25 | func TestProvider(t *testing.T) { 26 | if err := Provider().InternalValidate(); err != nil { 27 | t.Fatalf("err: %s", err) 28 | } 29 | } 30 | 31 | func TestProvider_impl(t *testing.T) { 32 | var _ *schema.Provider = Provider() 33 | } 34 | 35 | // testAccPreCheck validates the necessary test API keys exist 36 | // in the testing environment 37 | func testAccPreCheck(t *testing.T) { 38 | err := testAccProvider.Configure(context.Background(), terraform.NewResourceConfigRaw(nil)) 39 | if err != nil { 40 | t.Fatal(err) 41 | } 42 | } 43 | 44 | func testAccCheckClusterName(resourceName, attributeName, clusterName string) resource.TestCheckFunc { 45 | return func(s *terraform.State) error { 46 | return resource.TestCheckResourceAttr(resourceName, attributeName, clusterName)(s) 47 | } 48 | } 49 | 50 | func testAccSimpleClusterProviderConfig() string { 51 | return fmt.Sprintf(` 52 | provider "kind" {} 53 | `) 54 | } 55 | -------------------------------------------------------------------------------- /kind/resource_cluster.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 9 | clientcmd "k8s.io/client-go/tools/clientcmd" 10 | "sigs.k8s.io/kind/pkg/cluster" 11 | "sigs.k8s.io/kind/pkg/cmd" 12 | ) 13 | 14 | func resourceCluster() *schema.Resource { 15 | return &schema.Resource{ 16 | Create: resourceKindClusterCreate, 17 | Read: resourceKindClusterRead, 18 | // Update: resourceKindClusterUpdate, 19 | Delete: resourceKindClusterDelete, 20 | 21 | Timeouts: &schema.ResourceTimeout{ 22 | Create: schema.DefaultTimeout(defaultCreateTimeout), 23 | Update: schema.DefaultTimeout(defaultUpdateTimeout), 24 | Delete: schema.DefaultTimeout(defaultDeleteTimeout), 25 | }, 26 | 27 | Schema: map[string]*schema.Schema{ 28 | "name": { 29 | Type: schema.TypeString, 30 | Description: "The kind name that is given to the created cluster.", 31 | Required: true, 32 | ForceNew: true, 33 | }, 34 | "node_image": { 35 | Type: schema.TypeString, 36 | Description: `The node_image that kind will use (ex: kindest/node:v1.29.7).`, 37 | Optional: true, 38 | ForceNew: true, 39 | Computed: true, 40 | }, 41 | "wait_for_ready": { 42 | Type: schema.TypeBool, 43 | Description: `Defines wether or not the provider will wait for the control plane to be ready. Defaults to false`, 44 | Default: false, 45 | ForceNew: true, // TODO remove this once we have the update method defined. 46 | Optional: true, 47 | }, 48 | "kind_config": { 49 | Type: schema.TypeList, 50 | Description: `The kind_config that kind will use to bootstrap the cluster.`, 51 | Optional: true, 52 | ForceNew: true, 53 | MaxItems: 1, 54 | Elem: &schema.Resource{ 55 | Schema: kindConfigFields(), 56 | }, 57 | }, 58 | "kubeconfig_path": { 59 | Type: schema.TypeString, 60 | Description: `Kubeconfig path set after the the cluster is created or by the user to override defaults.`, 61 | ForceNew: true, 62 | Optional: true, 63 | Computed: true, 64 | }, 65 | "kubeconfig": { 66 | Type: schema.TypeString, 67 | Description: `Kubeconfig set after the the cluster is created.`, 68 | Computed: true, 69 | }, 70 | "client_certificate": { 71 | Type: schema.TypeString, 72 | Description: `Client certificate for authenticating to cluster.`, 73 | Computed: true, 74 | }, 75 | "client_key": { 76 | Type: schema.TypeString, 77 | Description: `Client key for authenticating to cluster.`, 78 | Computed: true, 79 | }, 80 | "cluster_ca_certificate": { 81 | Type: schema.TypeString, 82 | Description: `Client verifies the server certificate with this CA cert.`, 83 | Computed: true, 84 | }, 85 | "endpoint": { 86 | Type: schema.TypeString, 87 | Description: `Kubernetes APIServer endpoint.`, 88 | Computed: true, 89 | }, 90 | "completed": { 91 | Type: schema.TypeBool, 92 | Description: `Cluster successfully created.`, 93 | Computed: true, 94 | }, 95 | }, 96 | } 97 | } 98 | 99 | func resourceKindClusterCreate(d *schema.ResourceData, meta interface{}) error { 100 | log.Println("Creating local Kubernetes cluster...") 101 | name := d.Get("name").(string) 102 | nodeImage := d.Get("node_image").(string) 103 | config := d.Get("kind_config") 104 | waitForReady := d.Get("wait_for_ready").(bool) 105 | kubeconfigPath := d.Get("kubeconfig_path") 106 | 107 | var copts []cluster.CreateOption 108 | 109 | if kubeconfigPath != nil { 110 | path := kubeconfigPath.(string) 111 | if path != "" { 112 | copts = append(copts, cluster.CreateWithKubeconfigPath(path)) 113 | } 114 | } 115 | 116 | if config != nil { 117 | cfg := config.([]interface{}) 118 | if len(cfg) == 1 { // there is always just one kind_config allowed 119 | if data, ok := cfg[0].(map[string]interface{}); ok { 120 | opts := flattenKindConfig(data) 121 | copts = append(copts, cluster.CreateWithV1Alpha4Config(opts)) 122 | } 123 | } 124 | } 125 | 126 | if nodeImage != "" { 127 | copts = append(copts, cluster.CreateWithNodeImage(nodeImage)) 128 | log.Printf("Using defined node_image: %s\n", nodeImage) 129 | } 130 | 131 | if waitForReady { 132 | copts = append(copts, cluster.CreateWithWaitForReady(defaultCreateTimeout)) 133 | log.Printf("Will wait for cluster nodes to report ready: %t\n", waitForReady) 134 | } 135 | 136 | log.Println("=================== Creating Kind Cluster ==================") 137 | provider := cluster.NewProvider(cluster.ProviderWithLogger(cmd.NewLogger())) 138 | err := provider.Create(name, copts...) 139 | if err != nil { 140 | return err 141 | } 142 | 143 | d.SetId(fmt.Sprintf("%s-%s", name, nodeImage)) 144 | return resourceKindClusterRead(d, meta) 145 | } 146 | 147 | func resourceKindClusterRead(d *schema.ResourceData, meta interface{}) error { 148 | name := d.Get("name").(string) 149 | provider := cluster.NewProvider(cluster.ProviderWithLogger(cmd.NewLogger())) 150 | id := d.Id() 151 | log.Printf("ID: %s\n", id) 152 | 153 | kconfig, err := provider.KubeConfig(name, false) 154 | if err != nil { 155 | d.SetId("") 156 | return err 157 | } 158 | d.Set("kubeconfig", kconfig) 159 | 160 | currentPath, err := os.Getwd() 161 | if err != nil { 162 | d.SetId("") 163 | return err 164 | } 165 | 166 | if _, ok := d.GetOk("kubeconfig_path"); !ok { 167 | exportPath := fmt.Sprintf("%s%s%s-config", currentPath, string(os.PathSeparator), name) 168 | err = provider.ExportKubeConfig(name, exportPath, false) 169 | if err != nil { 170 | d.SetId("") 171 | return err 172 | } 173 | d.Set("kubeconfig_path", exportPath) 174 | } 175 | 176 | // use the current context in kubeconfig 177 | config, err := clientcmd.RESTConfigFromKubeConfig([]byte(kconfig)) 178 | if err != nil { 179 | return err 180 | } 181 | 182 | d.Set("client_certificate", string(config.CertData)) 183 | d.Set("client_key", string(config.KeyData)) 184 | d.Set("cluster_ca_certificate", string(config.CAData)) 185 | d.Set("endpoint", string(config.Host)) 186 | 187 | d.Set("completed", true) 188 | 189 | return nil 190 | } 191 | 192 | func resourceKindClusterDelete(d *schema.ResourceData, meta interface{}) error { 193 | log.Println("Deleting local Kubernetes cluster...") 194 | name := d.Get("name").(string) 195 | kubeconfigPath := d.Get("kubeconfig_path").(string) 196 | provider := cluster.NewProvider(cluster.ProviderWithLogger(cmd.NewLogger())) 197 | 198 | log.Println("=================== Deleting Kind Cluster ==================") 199 | err := provider.Delete(name, kubeconfigPath) 200 | if err != nil { 201 | return err 202 | } 203 | d.SetId("") 204 | return nil 205 | } 206 | -------------------------------------------------------------------------------- /kind/resource_cluster_test.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" 9 | "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" 10 | kindDefaults "sigs.k8s.io/kind/pkg/apis/config/defaults" 11 | "sigs.k8s.io/kind/pkg/cluster" 12 | ) 13 | 14 | func init() { 15 | resource.AddTestSweepers("kind_cluster", &resource.Sweeper{ 16 | Name: "kind_cluster", 17 | F: testSweepKindCluster, 18 | }) 19 | } 20 | 21 | func testSweepKindCluster(name string) error { 22 | //TODO: needs code to cleanup test clusters 23 | 24 | return nil 25 | } 26 | 27 | const nodeImage = "kindest/node:v1.29.7@sha256:f70ab5d833fca132a100c1f95490be25d76188b053f49a3c0047ff8812360baf" 28 | 29 | func TestAccCluster(t *testing.T) { 30 | resourceName := "kind_cluster.test" 31 | clusterName := acctest.RandomWithPrefix("tf-acc-cluster-test") 32 | 33 | resource.ParallelTest(t, resource.TestCase{ 34 | PreCheck: func() { testAccPreCheck(t) }, 35 | Providers: testAccProviders, 36 | CheckDestroy: testAccCheckKindClusterResourceDestroy(clusterName), 37 | Steps: []resource.TestStep{ 38 | { 39 | Config: testAccBasicClusterConfig(clusterName), 40 | Check: resource.ComposeTestCheckFunc( 41 | testAccCheckClusterCreate(resourceName), 42 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 43 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 44 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 45 | resource.TestCheckNoResourceAttr(resourceName, "kind_config.#"), 46 | ), 47 | }, 48 | { 49 | Config: testAccBasicClusterConfigWithKubeconfigPath(clusterName), 50 | Check: resource.ComposeTestCheckFunc( 51 | testAccCheckClusterCreate(resourceName), 52 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 53 | resource.TestCheckResourceAttr(resourceName, "kubeconfig_path", "/tmp/kind-provider-test/new_file"), 54 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 55 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 56 | resource.TestCheckNoResourceAttr(resourceName, "kind_config.#"), 57 | ), 58 | }, 59 | { 60 | Config: testAccBasicWaitForReadyClusterConfig(clusterName), 61 | Check: resource.ComposeTestCheckFunc( 62 | testAccCheckClusterCreate(resourceName), 63 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 64 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 65 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 66 | resource.TestCheckNoResourceAttr(resourceName, "kind_config.#"), 67 | ), 68 | }, 69 | { 70 | Config: testAccNodeImageClusterConfig(clusterName), 71 | Check: resource.ComposeTestCheckFunc( 72 | testAccCheckClusterCreate(resourceName), 73 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 74 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 75 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 76 | resource.TestCheckNoResourceAttr(resourceName, "kind_config.#"), 77 | ), 78 | }, 79 | { 80 | Config: testAccNodeImageWaitForReadyClusterConfig(clusterName), 81 | Check: resource.ComposeTestCheckFunc( 82 | testAccCheckClusterCreate(resourceName), 83 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 84 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 85 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 86 | resource.TestCheckNoResourceAttr(resourceName, "kind_config.#"), 87 | ), 88 | }, 89 | // TODO: add this for when resource update is implemented 90 | // { 91 | // ResourceName: resourceName, 92 | // ImportState: true, 93 | // ImportStateVerify: true, 94 | // }, 95 | }, 96 | }) 97 | } 98 | 99 | func TestAccClusterConfigBase(t *testing.T) { 100 | resourceName := "kind_cluster.test" 101 | clusterName := acctest.RandomWithPrefix("tf-acc-config-base-test") 102 | 103 | resource.ParallelTest(t, resource.TestCase{ 104 | PreCheck: func() { testAccPreCheck(t) }, 105 | Providers: testAccProviders, 106 | CheckDestroy: testAccCheckKindClusterResourceDestroy(clusterName), 107 | Steps: []resource.TestStep{ 108 | { 109 | Config: testAccClusterConfigAndExtra(clusterName), 110 | Check: resource.ComposeTestCheckFunc( 111 | testAccCheckClusterCreate(resourceName), 112 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 113 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 114 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 115 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 116 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 117 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 118 | ), 119 | }, 120 | { 121 | Config: testAccWaitForReadyClusterConfigAndExtra(clusterName), 122 | Check: resource.ComposeTestCheckFunc( 123 | testAccCheckClusterCreate(resourceName), 124 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 125 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 126 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 127 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 128 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 129 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 130 | ), 131 | }, 132 | { 133 | Config: testAccNodeImageClusterConfigAndExtra(clusterName), 134 | Check: resource.ComposeTestCheckFunc( 135 | testAccCheckClusterCreate(resourceName), 136 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 137 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 138 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 139 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 140 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 141 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 142 | ), 143 | }, 144 | { 145 | Config: testAccNodeImageWaitForReadyClusterConfigAndExtra(clusterName), 146 | Check: resource.ComposeTestCheckFunc( 147 | testAccCheckClusterCreate(resourceName), 148 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 149 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 150 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 151 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 152 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 153 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 154 | ), 155 | }, 156 | { 157 | Config: testAccClusterConfigAndExtraWithEmptyNetwork(clusterName), 158 | Check: resource.ComposeTestCheckFunc( 159 | testAccCheckClusterCreate(resourceName), 160 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 161 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 162 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 163 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 164 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 165 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 166 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.#", "1"), 167 | ), 168 | }, 169 | { 170 | Config: testAccClusterConfigAndExtraWithNetworkValues(clusterName), 171 | Check: resource.ComposeTestCheckFunc( 172 | testAccCheckClusterCreate(resourceName), 173 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 174 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 175 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 176 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 177 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 178 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 179 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.#", "1"), 180 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.0.api_server_address", "127.0.0.1"), 181 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.0.api_server_port", "6443"), 182 | ), 183 | }, 184 | { 185 | Config: testAccClusterConfigAndExtraWithNetworkValuesKubeProxyDisabled(clusterName), 186 | Check: resource.ComposeTestCheckFunc( 187 | testAccCheckClusterCreate(resourceName), 188 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 189 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 190 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 191 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 192 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 193 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 194 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.#", "1"), 195 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.networking.0.kube_proxy_mode", "none"), 196 | ), 197 | }, 198 | { 199 | Config: testAccClusterConfigAndRuntimeConfig(clusterName), 200 | Check: resource.ComposeTestCheckFunc( 201 | testAccCheckClusterCreate(resourceName), 202 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 203 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 204 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 205 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 206 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 207 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 208 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.runtime_config.%", "1"), 209 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.runtime_config.api_alpha", "false"), 210 | ), 211 | }, 212 | }, 213 | }) 214 | } 215 | 216 | func TestAccClusterConfigNodes(t *testing.T) { 217 | resourceName := "kind_cluster.test" 218 | clusterName := acctest.RandomWithPrefix("tf-acc-config-nodes-test") 219 | 220 | resource.ParallelTest(t, resource.TestCase{ 221 | PreCheck: func() { testAccPreCheck(t) }, 222 | Providers: testAccProviders, 223 | CheckDestroy: testAccCheckKindClusterResourceDestroy(clusterName), 224 | Steps: []resource.TestStep{ 225 | { 226 | Config: testAccBasicExtraConfigClusterConfig(clusterName), 227 | Check: resource.ComposeTestCheckFunc( 228 | testAccCheckClusterCreate(resourceName), 229 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 230 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 231 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 232 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 233 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 234 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 235 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "2"), 236 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 237 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 238 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.labels.name", "node0"), 239 | ), 240 | }, 241 | { 242 | Config: testAccBasicWaitForReadyExtraConfigClusterConfig(clusterName), 243 | Check: resource.ComposeTestCheckFunc( 244 | testAccCheckClusterCreate(resourceName), 245 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 246 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 247 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 248 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 249 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 250 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 251 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "2"), 252 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 253 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 254 | ), 255 | }, 256 | { 257 | Config: testAccNodeImageExtraConfigClusterConfig(clusterName), 258 | Check: resource.ComposeTestCheckFunc( 259 | testAccCheckClusterCreate(resourceName), 260 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 261 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 262 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "false"), 263 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 264 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 265 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 266 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "2"), 267 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 268 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 269 | ), 270 | }, 271 | { 272 | Config: testAccNodeImageWaitForReadyExtraConfigClusterConfig(clusterName), 273 | Check: resource.ComposeTestCheckFunc( 274 | testAccCheckClusterCreate(resourceName), 275 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 276 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 277 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 278 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 279 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 280 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 281 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "2"), 282 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 283 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 284 | ), 285 | }, 286 | { 287 | Config: testAccThreeNodesClusterConfig(clusterName), 288 | Check: resource.ComposeTestCheckFunc( 289 | testAccCheckClusterCreate(resourceName), 290 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 291 | resource.TestCheckResourceAttr(resourceName, "node_image", kindDefaults.Image), 292 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 293 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 294 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 295 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 296 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "3"), 297 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 298 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 299 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.2.role", "worker"), 300 | ), 301 | }, 302 | { 303 | Config: testAccThreeNodesImageOnNodeClusterConfig(clusterName), 304 | Check: resource.ComposeTestCheckFunc( 305 | testAccCheckClusterCreate(resourceName), 306 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 307 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 308 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 309 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 310 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 311 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 312 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.#", "3"), 313 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.0.role", "control-plane"), 314 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.role", "worker"), 315 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.1.image", nodeImage), 316 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.node.2.role", "worker"), 317 | ), 318 | }, 319 | }, 320 | }) 321 | } 322 | 323 | func TestAccClusterContainerdPatches(t *testing.T) { 324 | resourceName := "kind_cluster.test" 325 | clusterName := acctest.RandomWithPrefix("tf-acc-containerd-test") 326 | 327 | resource.ParallelTest(t, resource.TestCase{ 328 | PreCheck: func() { testAccPreCheck(t) }, 329 | Providers: testAccProviders, 330 | CheckDestroy: testAccCheckKindClusterResourceDestroy(clusterName), 331 | Steps: []resource.TestStep{ 332 | { 333 | Config: testSingleContainerdConfigPatch(clusterName), 334 | Check: resource.ComposeTestCheckFunc( 335 | testAccCheckClusterCreate(resourceName), 336 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 337 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 338 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 339 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 340 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 341 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 342 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.containerd_config_patches.#", "1"), 343 | ), 344 | }, 345 | }, 346 | }) 347 | } 348 | 349 | func TestAccContainerdPatchFormatOnlyChangeIsNoop(t *testing.T) { 350 | resourceName := "kind_cluster.test" 351 | clusterName := acctest.RandomWithPrefix("tf-acc-containerd-formatting") 352 | 353 | resource.ParallelTest(t, resource.TestCase{ 354 | PreCheck: func() { testAccPreCheck(t) }, 355 | Providers: testAccProviders, 356 | CheckDestroy: testAccCheckKindClusterResourceDestroy(clusterName), 357 | Steps: []resource.TestStep{ 358 | { 359 | Config: testTwoContainerdConfigPatches(clusterName), 360 | Check: resource.ComposeTestCheckFunc( 361 | testAccCheckClusterCreate(resourceName), 362 | resource.TestCheckResourceAttr(resourceName, "name", clusterName), 363 | resource.TestCheckNoResourceAttr(resourceName, "node_image"), 364 | resource.TestCheckResourceAttr(resourceName, "wait_for_ready", "true"), 365 | resource.TestCheckResourceAttr(resourceName, "kind_config.#", "1"), 366 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.kind", "Cluster"), 367 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.api_version", "kind.x-k8s.io/v1alpha4"), 368 | resource.TestCheckResourceAttr(resourceName, "kind_config.0.containerd_config_patches.#", "2"), 369 | ), 370 | }, 371 | { 372 | Config: testContainerdPatchWithSameContentButDifferentFormat(clusterName), 373 | PlanOnly: true, 374 | }, 375 | }, 376 | }) 377 | } 378 | 379 | // testAccCheckKindClusterResourceDestroy verifies the kind cluster 380 | // has been destroyed 381 | func testAccCheckKindClusterResourceDestroy(clusterName string) resource.TestCheckFunc { 382 | return func(s *terraform.State) error { 383 | prov := cluster.NewProvider() 384 | list, err := prov.List() 385 | if err != nil { 386 | return fmt.Errorf("cannot get kind provider cluster list") 387 | } 388 | for _, c := range list { 389 | if c == clusterName { 390 | return fmt.Errorf("list cannot contain cluster of name %s", clusterName) 391 | } 392 | } 393 | 394 | return nil 395 | } 396 | } 397 | 398 | func testAccCheckClusterCreate(name string) resource.TestCheckFunc { 399 | return func(s *terraform.State) error { 400 | _, ok := s.RootModule().Resources[name] 401 | if !ok { 402 | return fmt.Errorf("root module has no resource called %s", name) 403 | } 404 | 405 | return nil 406 | } 407 | } 408 | 409 | func testAccBasicClusterConfig(name string) string { 410 | 411 | return fmt.Sprintf(` 412 | resource "kind_cluster" "test" { 413 | name = "%s" 414 | } 415 | `, name) 416 | } 417 | 418 | func testAccBasicClusterConfigWithKubeconfigPath(name string) string { 419 | 420 | return fmt.Sprintf(` 421 | resource "kind_cluster" "test" { 422 | name = "%s" 423 | kubeconfig_path = "/tmp/kind-provider-test/new_file" 424 | } 425 | `, name) 426 | } 427 | 428 | func testAccNodeImageClusterConfig(name string) string { 429 | return fmt.Sprintf(` 430 | resource "kind_cluster" "test" { 431 | name = "%s" 432 | node_image = "%s" 433 | } 434 | `, name, kindDefaults.Image) 435 | } 436 | 437 | func testAccBasicWaitForReadyClusterConfig(name string) string { 438 | return fmt.Sprintf(` 439 | resource "kind_cluster" "test" { 440 | name = "%s" 441 | wait_for_ready = true 442 | } 443 | `, name) 444 | } 445 | 446 | func testAccNodeImageWaitForReadyClusterConfig(name string) string { 447 | return fmt.Sprintf(` 448 | resource "kind_cluster" "test" { 449 | name = "%s" 450 | node_image = "%s" 451 | wait_for_ready = true 452 | } 453 | `, name, kindDefaults.Image) 454 | } 455 | 456 | func testAccNodeImageWaitForReadyClusterConfigAndExtra(name string) string { 457 | return fmt.Sprintf(` 458 | resource "kind_cluster" "test" { 459 | name = "%s" 460 | node_image = "%s" 461 | wait_for_ready = true 462 | kind_config { 463 | kind = "Cluster" 464 | api_version = "kind.x-k8s.io/v1alpha4" 465 | } 466 | } 467 | `, name, kindDefaults.Image) 468 | } 469 | 470 | func testAccNodeImageClusterConfigAndExtra(name string) string { 471 | return fmt.Sprintf(` 472 | resource "kind_cluster" "test" { 473 | name = "%s" 474 | node_image = "%s" 475 | wait_for_ready = false 476 | kind_config { 477 | kind = "Cluster" 478 | api_version = "kind.x-k8s.io/v1alpha4" 479 | } 480 | } 481 | `, name, kindDefaults.Image) 482 | } 483 | 484 | func testAccWaitForReadyClusterConfigAndExtra(name string) string { 485 | return fmt.Sprintf(` 486 | resource "kind_cluster" "test" { 487 | name = "%s" 488 | wait_for_ready = true 489 | kind_config { 490 | kind = "Cluster" 491 | api_version = "kind.x-k8s.io/v1alpha4" 492 | } 493 | } 494 | `, name) 495 | } 496 | 497 | func testAccClusterConfigAndExtra(name string) string { 498 | return fmt.Sprintf(` 499 | resource "kind_cluster" "test" { 500 | name = "%s" 501 | wait_for_ready = false 502 | kind_config { 503 | kind = "Cluster" 504 | api_version = "kind.x-k8s.io/v1alpha4" 505 | } 506 | } 507 | `, name) 508 | } 509 | 510 | func testAccBasicExtraConfigClusterConfig(name string) string { 511 | return fmt.Sprintf(` 512 | resource "kind_cluster" "test" { 513 | name = "%s" 514 | kind_config { 515 | kind = "Cluster" 516 | api_version = "kind.x-k8s.io/v1alpha4" 517 | 518 | node { 519 | role = "control-plane" 520 | 521 | labels = { 522 | name = "node0" 523 | } 524 | } 525 | 526 | node { 527 | role = "worker" 528 | } 529 | } 530 | } 531 | `, name) 532 | } 533 | 534 | func testAccBasicWaitForReadyExtraConfigClusterConfig(name string) string { 535 | return fmt.Sprintf(` 536 | resource "kind_cluster" "test" { 537 | name = "%s" 538 | wait_for_ready = true 539 | kind_config { 540 | kind = "Cluster" 541 | api_version = "kind.x-k8s.io/v1alpha4" 542 | 543 | node { 544 | role = "control-plane" 545 | } 546 | 547 | node { 548 | role = "worker" 549 | } 550 | } 551 | } 552 | `, name) 553 | } 554 | 555 | func testAccNodeImageExtraConfigClusterConfig(name string) string { 556 | return fmt.Sprintf(` 557 | resource "kind_cluster" "test" { 558 | name = "%s" 559 | node_image = "%s" 560 | kind_config { 561 | kind = "Cluster" 562 | api_version = "kind.x-k8s.io/v1alpha4" 563 | 564 | node { 565 | role = "control-plane" 566 | } 567 | 568 | node { 569 | role = "worker" 570 | } 571 | } 572 | } 573 | `, name, kindDefaults.Image) 574 | } 575 | 576 | func testAccNodeImageWaitForReadyExtraConfigClusterConfig(name string) string { 577 | return fmt.Sprintf(` 578 | resource "kind_cluster" "test" { 579 | name = "%s" 580 | node_image = "%s" 581 | wait_for_ready = true 582 | kind_config { 583 | kind = "Cluster" 584 | api_version = "kind.x-k8s.io/v1alpha4" 585 | 586 | node { 587 | role = "control-plane" 588 | } 589 | 590 | node { 591 | role = "worker" 592 | } 593 | } 594 | } 595 | `, name, kindDefaults.Image) 596 | } 597 | 598 | func testAccThreeNodesClusterConfig(name string) string { 599 | return fmt.Sprintf(` 600 | resource "kind_cluster" "test" { 601 | name = "%s" 602 | node_image = "%s" 603 | wait_for_ready = true 604 | kind_config { 605 | kind = "Cluster" 606 | api_version = "kind.x-k8s.io/v1alpha4" 607 | 608 | node { 609 | role = "control-plane" 610 | } 611 | 612 | node { 613 | role = "worker" 614 | } 615 | 616 | node { 617 | role = "worker" 618 | } 619 | } 620 | } 621 | `, name, kindDefaults.Image) 622 | } 623 | 624 | func testAccThreeNodesImageOnNodeClusterConfig(name string) string { 625 | return fmt.Sprintf(` 626 | resource "kind_cluster" "test" { 627 | name = "%s" 628 | wait_for_ready = true 629 | kind_config { 630 | kind = "Cluster" 631 | api_version = "kind.x-k8s.io/v1alpha4" 632 | 633 | node { 634 | role = "control-plane" 635 | } 636 | 637 | node { 638 | role = "worker" 639 | image = "%s" 640 | } 641 | 642 | node { 643 | role = "worker" 644 | } 645 | } 646 | } 647 | `, name, nodeImage) 648 | } 649 | 650 | func testSingleContainerdConfigPatch(name string) string { 651 | return fmt.Sprintf(` 652 | resource "kind_cluster" "test" { 653 | name = "%s" 654 | wait_for_ready = true 655 | kind_config { 656 | kind = "Cluster" 657 | api_version = "kind.x-k8s.io/v1alpha4" 658 | containerd_config_patches = [ 659 | <<-TOML 660 | [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] 661 | endpoint = ["http://kind-registry:5000"] 662 | TOML 663 | ] 664 | } 665 | } 666 | `, name) 667 | } 668 | 669 | func testTwoContainerdConfigPatches(name string) string { 670 | return fmt.Sprintf(` 671 | resource "kind_cluster" "test" { 672 | name = "%s" 673 | wait_for_ready = true 674 | kind_config { 675 | kind = "Cluster" 676 | api_version = "kind.x-k8s.io/v1alpha4" 677 | containerd_config_patches = [ 678 | <<-TOML 679 | [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] 680 | endpoint = ["http://kind-registry:5000"] 681 | TOML 682 | , 683 | <<-TOML 684 | [plugins."io.containerd.grpc.v1.cri"] 685 | sandbox_image = "k8s.gcr.io/pause:3.2" 686 | TOML 687 | ] 688 | } 689 | } 690 | `, name) 691 | } 692 | 693 | func testContainerdPatchWithSameContentButDifferentFormat(name string) string { 694 | return fmt.Sprintf(` 695 | resource "kind_cluster" "test" { 696 | name = "%s" 697 | wait_for_ready = true 698 | kind_config { 699 | kind = "Cluster" 700 | api_version = "kind.x-k8s.io/v1alpha4" 701 | containerd_config_patches = [ 702 | <<-TOML 703 | [plugins] 704 | 705 | [plugins."io.containerd.grpc.v1.cri"] 706 | 707 | [plugins."io.containerd.grpc.v1.cri".registry] 708 | 709 | [plugins."io.containerd.grpc.v1.cri".registry.mirrors] 710 | 711 | [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] 712 | endpoint = ["http://kind-registry:5000"] 713 | TOML 714 | , 715 | <<-TOML 716 | [plugins."io.containerd.grpc.v1.cri"] 717 | sandbox_image = "k8s.gcr.io/pause:3.2" 718 | TOML 719 | ] 720 | } 721 | } 722 | `, name) 723 | } 724 | 725 | func testAccClusterConfigAndExtraWithEmptyNetwork(name string) string { 726 | return fmt.Sprintf(` 727 | resource "kind_cluster" "test" { 728 | name = "%s" 729 | wait_for_ready = false 730 | kind_config { 731 | kind = "Cluster" 732 | api_version = "kind.x-k8s.io/v1alpha4" 733 | 734 | networking {} 735 | } 736 | } 737 | `, name) 738 | } 739 | 740 | func testAccClusterConfigAndExtraWithNetworkValues(name string) string { 741 | return fmt.Sprintf(` 742 | resource "kind_cluster" "test" { 743 | name = "%s" 744 | wait_for_ready = false 745 | kind_config { 746 | kind = "Cluster" 747 | api_version = "kind.x-k8s.io/v1alpha4" 748 | 749 | networking { 750 | api_server_address = "127.0.0.1" 751 | api_server_port = 6443 752 | } 753 | } 754 | } 755 | `, name) 756 | } 757 | 758 | func testAccClusterConfigAndExtraWithNetworkValuesKubeProxyDisabled(name string) string { 759 | return fmt.Sprintf(` 760 | resource "kind_cluster" "test" { 761 | name = "%s" 762 | wait_for_ready = false 763 | kind_config { 764 | kind = "Cluster" 765 | api_version = "kind.x-k8s.io/v1alpha4" 766 | 767 | networking { 768 | kube_proxy_mode = "none" 769 | } 770 | } 771 | } 772 | `, name) 773 | } 774 | 775 | func testAccClusterConfigAndRuntimeConfig(name string) string { 776 | return fmt.Sprintf(` 777 | resource "kind_cluster" "test" { 778 | name = "%s" 779 | wait_for_ready = true 780 | kind_config { 781 | kind = "Cluster" 782 | api_version = "kind.x-k8s.io/v1alpha4" 783 | 784 | runtime_config = { 785 | api_alpha = "false" 786 | } 787 | } 788 | } 789 | `, name) 790 | } 791 | -------------------------------------------------------------------------------- /kind/schema_kind_config.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" 5 | ) 6 | 7 | //Schemas 8 | 9 | func kindConfigFields() map[string]*schema.Schema { 10 | s := map[string]*schema.Schema{ 11 | "kind": { 12 | Type: schema.TypeString, 13 | Required: true, 14 | Optional: false, 15 | ForceNew: true, 16 | }, 17 | "api_version": { 18 | Type: schema.TypeString, 19 | Required: true, 20 | Optional: false, 21 | ForceNew: true, 22 | }, 23 | "node": { 24 | Type: schema.TypeList, 25 | Optional: true, 26 | ForceNew: true, 27 | Elem: &schema.Resource{ 28 | Schema: kindConfigNodeFields(), 29 | }, 30 | }, 31 | "networking": { 32 | Type: schema.TypeList, 33 | Optional: true, 34 | ForceNew: true, 35 | MaxItems: 1, 36 | Elem: &schema.Resource{ 37 | Schema: kindConfigNetworkingFields(), 38 | }, 39 | }, 40 | "containerd_config_patches": { 41 | Type: schema.TypeList, 42 | Optional: true, 43 | Elem: &schema.Schema{ 44 | Type: schema.TypeString, 45 | ValidateFunc: stringIsValidToml, 46 | DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { 47 | // We can ignore these errors for two reasons: 48 | // 1. normalizeToml returns the input in case of error 49 | // 2. the ValidateFunc should ensure an early exit 50 | normalizedOld, _ := normalizeToml(old) 51 | normalizedNew, _ := normalizeToml(new) 52 | return normalizedOld == normalizedNew 53 | }, 54 | }, 55 | }, 56 | "runtime_config": { 57 | Type: schema.TypeMap, 58 | Optional: true, 59 | Elem: &schema.Schema{Type: schema.TypeString}, 60 | }, 61 | "feature_gates": { 62 | Type: schema.TypeMap, 63 | Optional: true, 64 | Elem: &schema.Schema{Type: schema.TypeString}, 65 | }, 66 | } 67 | return forceNewAll(s) 68 | } 69 | 70 | // forceNewAll will take a schema and mark every attribute as ForceNew recursively. 71 | // This is a hack because we don't support updates to any part of the kind_config 72 | // but ForceNew at the top level still allows in-line updates of attributes. 73 | func forceNewAll(s map[string]*schema.Schema) map[string]*schema.Schema { 74 | for _, ss := range s { 75 | ss.ForceNew = true 76 | if ss.Elem != nil { 77 | switch ss.Elem.(type) { 78 | case *schema.Resource: 79 | forceNewAll(ss.Elem.(*schema.Resource).Schema) 80 | } 81 | } 82 | } 83 | return s 84 | } 85 | 86 | func kindConfigNodeFields() map[string]*schema.Schema { 87 | s := map[string]*schema.Schema{ 88 | "role": { 89 | Type: schema.TypeString, 90 | Optional: true, 91 | }, 92 | "image": { 93 | Type: schema.TypeString, 94 | Optional: true, 95 | }, 96 | "extra_mounts": { 97 | Type: schema.TypeList, 98 | Optional: true, 99 | Elem: &schema.Resource{ 100 | Schema: kindConfigNodeMountFields(), 101 | }, 102 | }, 103 | "extra_port_mappings": { 104 | Type: schema.TypeList, 105 | Optional: true, 106 | Elem: &schema.Resource{ 107 | Schema: kindConfigNodeExtraPortMappingsFields(), 108 | }, 109 | }, 110 | "labels": { 111 | Type: schema.TypeMap, 112 | Optional: true, 113 | Elem: &schema.Schema{Type: schema.TypeString}, 114 | }, 115 | "kubeadm_config_patches": { 116 | Type: schema.TypeList, 117 | Optional: true, 118 | Elem: &schema.Schema{Type: schema.TypeString}, 119 | }, 120 | } 121 | return s 122 | } 123 | 124 | func kindConfigNetworkingFields() map[string]*schema.Schema { 125 | s := map[string]*schema.Schema{ 126 | "ip_family": { 127 | Type: schema.TypeString, 128 | Optional: true, 129 | }, 130 | "api_server_address": { 131 | Type: schema.TypeString, 132 | Description: `WARNING: It is _strongly_ recommended that you keep this the default (127.0.0.1) for security reasons. However it is possible to change this.`, 133 | Optional: true, 134 | }, 135 | "api_server_port": { 136 | Type: schema.TypeInt, 137 | Description: `By default the API server listens on a random open port. You may choose a specific port but probably don't need to in most cases. Using a random port makes it easier to spin up multiple clusters.`, 138 | Optional: true, 139 | }, 140 | "pod_subnet": { 141 | Type: schema.TypeString, 142 | Optional: true, 143 | }, 144 | "service_subnet": { 145 | Type: schema.TypeString, 146 | Optional: true, 147 | }, 148 | "disable_default_cni": { 149 | Type: schema.TypeBool, 150 | Optional: true, 151 | }, 152 | "kube_proxy_mode": { 153 | Type: schema.TypeString, 154 | Optional: true, 155 | }, 156 | "dns_search": { 157 | Type: schema.TypeList, 158 | Optional: true, 159 | Elem: &schema.Schema{Type: schema.TypeString}, 160 | }, 161 | } 162 | return s 163 | } 164 | 165 | func kindConfigNodeMountFields() map[string]*schema.Schema { 166 | s := map[string]*schema.Schema{ 167 | "host_path": { 168 | Type: schema.TypeString, 169 | Optional: true, 170 | }, 171 | "container_path": { 172 | Type: schema.TypeString, 173 | Optional: true, 174 | }, 175 | "propagation": { 176 | Type: schema.TypeString, 177 | Optional: true, 178 | }, 179 | "read_only": { 180 | Type: schema.TypeBool, 181 | Optional: true, 182 | }, 183 | "selinux_relabel": { 184 | Type: schema.TypeBool, 185 | Optional: true, 186 | }, 187 | } 188 | return s 189 | } 190 | 191 | func kindConfigNodeExtraPortMappingsFields() map[string]*schema.Schema { 192 | s := map[string]*schema.Schema{ 193 | "container_port": { 194 | Type: schema.TypeInt, 195 | Optional: true, 196 | }, 197 | "host_port": { 198 | Type: schema.TypeInt, 199 | Optional: true, 200 | }, 201 | "listen_address": { 202 | Type: schema.TypeString, 203 | Description: `optional: set the bind address on the host, 0.0.0.0 is the current default`, 204 | Optional: true, 205 | }, 206 | "protocol": { 207 | Type: schema.TypeString, 208 | Description: `optional: set the protocol to one of TCP, UDP, SCTP. TCP is the default`, 209 | Optional: true, 210 | }, 211 | } 212 | return s 213 | } 214 | -------------------------------------------------------------------------------- /kind/structure.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import "github.com/pelletier/go-toml" 4 | 5 | func normalizeToml(tomlString interface{}) (string, error) { 6 | if tomlString == nil || tomlString.(string) == "" { 7 | return "", nil 8 | } 9 | 10 | s := tomlString.(string) 11 | tree, err := toml.Load(s) 12 | if err != nil { 13 | return s, err 14 | } 15 | return tree.ToTomlString() 16 | } 17 | -------------------------------------------------------------------------------- /kind/structure_kind_config.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "strings" 5 | 6 | "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" 7 | ) 8 | 9 | // Flatteners 10 | 11 | func flattenKindConfig(d map[string]interface{}) *v1alpha4.Cluster { 12 | obj := &v1alpha4.Cluster{} 13 | 14 | obj.Kind = mapKeyIfExists(d, "kind").(string) 15 | obj.APIVersion = mapKeyIfExists(d, "api_version").(string) 16 | 17 | nodes := mapKeyIfExists(d, "node") 18 | if nodes != nil { 19 | for _, n := range nodes.([]interface{}) { 20 | data := n.(map[string]interface{}) 21 | obj.Nodes = append(obj.Nodes, flattenKindConfigNodes(data)) 22 | } 23 | } 24 | 25 | networking := mapKeyIfExists(d, "networking") 26 | if networking != nil { 27 | if n := networking.([]interface{}); len(n) == 1 { // MaxItems: 1, no more than one allowed so we don't have to loop here 28 | if n[0] != nil { 29 | data := n[0].(map[string]interface{}) 30 | obj.Networking = flattenKindConfigNetworking(data) 31 | } 32 | } 33 | } 34 | 35 | containerdConfigPatches := mapKeyIfExists(d, "containerd_config_patches") 36 | if containerdConfigPatches != nil { 37 | for _, p := range containerdConfigPatches.([]interface{}) { 38 | patch := p.(string) 39 | obj.ContainerdConfigPatches = append(obj.ContainerdConfigPatches, patch) 40 | } 41 | } 42 | 43 | runtimeConfig := mapKeyIfExists(d, "runtime_config") 44 | if runtimeConfig != nil { 45 | data := runtimeConfig.(map[string]interface{}) 46 | obj.RuntimeConfig = make(map[string]string) 47 | for k, v := range data { 48 | k = strings.ReplaceAll(k, "_", "/") // slash is not allowed in hcl, if there's an underscore replace with slash, e.g. `api_alpha` to `api/alpha` 49 | obj.RuntimeConfig[k] = v.(string) 50 | } 51 | } 52 | 53 | featureGates := mapKeyIfExists(d, "feature_gates") 54 | if featureGates != nil { 55 | data := featureGates.(map[string]interface{}) 56 | obj.FeatureGates = make(map[string]bool) 57 | for k, v := range data { 58 | if strings.ToLower(v.(string)) == "true" { 59 | obj.FeatureGates[k] = true 60 | } else { 61 | obj.FeatureGates[k] = false 62 | } 63 | } 64 | } 65 | 66 | return obj 67 | } 68 | 69 | func flattenKindConfigNodes(d map[string]interface{}) v1alpha4.Node { 70 | obj := v1alpha4.Node{} 71 | 72 | role := mapKeyIfExists(d, "role") 73 | if role != nil && role.(string) != "" { 74 | switch role.(string) { 75 | case string(v1alpha4.ControlPlaneRole): 76 | obj.Role = v1alpha4.ControlPlaneRole 77 | case string(v1alpha4.WorkerRole): 78 | obj.Role = v1alpha4.WorkerRole 79 | } 80 | } 81 | image := mapKeyIfExists(d, "image") 82 | if image != nil && image.(string) != "" { 83 | obj.Image = image.(string) 84 | } 85 | 86 | extraMounts := mapKeyIfExists(d, "extra_mounts") 87 | if extraMounts != nil { 88 | for _, m := range extraMounts.([]interface{}) { 89 | data := m.(map[string]interface{}) 90 | obj.ExtraMounts = append(obj.ExtraMounts, flattenKindConfigExtraMounts(data)) 91 | } 92 | } 93 | 94 | labels := mapKeyIfExists(d, "labels") 95 | if labels != nil { 96 | if obj.Labels == nil { 97 | obj.Labels = make(map[string]string) 98 | } 99 | for labelName, labelValue := range labels.(map[string]interface{}) { 100 | if labelValue, ok := labelValue.(string); ok { 101 | obj.Labels[labelName] = labelValue 102 | } 103 | } 104 | } 105 | 106 | extraPortMappings := mapKeyIfExists(d, "extra_port_mappings") 107 | if extraPortMappings != nil { 108 | for _, m := range extraPortMappings.([]interface{}) { 109 | data := m.(map[string]interface{}) 110 | obj.ExtraPortMappings = append(obj.ExtraPortMappings, flattenKindConfigExtraPortMappings(data)) 111 | } 112 | } 113 | 114 | kubeadmConfigPatches := mapKeyIfExists(d, "kubeadm_config_patches") 115 | if kubeadmConfigPatches != nil { 116 | for _, k := range kubeadmConfigPatches.([]interface{}) { 117 | data := k.(string) 118 | obj.KubeadmConfigPatches = append(obj.KubeadmConfigPatches, data) 119 | } 120 | } 121 | 122 | return obj 123 | } 124 | 125 | func flattenKindConfigNetworking(d map[string]interface{}) v1alpha4.Networking { 126 | obj := v1alpha4.Networking{} 127 | 128 | apiServerAddress := mapKeyIfExists(d, "api_server_address") 129 | if apiServerAddress != nil && apiServerAddress.(string) != "" { 130 | obj.APIServerAddress = apiServerAddress.(string) 131 | } 132 | 133 | apiServerPort := mapKeyIfExists(d, "api_server_port") 134 | if apiServerPort != nil { 135 | obj.APIServerPort = int32(apiServerPort.(int)) 136 | } 137 | 138 | disableDefaultCNI := mapKeyIfExists(d, "disable_default_cni") 139 | if disableDefaultCNI != nil { 140 | obj.DisableDefaultCNI = disableDefaultCNI.(bool) 141 | } 142 | 143 | ipFamily := mapKeyIfExists(d, "ip_family") 144 | if ipFamily != nil && ipFamily.(string) != "" { 145 | switch ipFamily.(string) { 146 | case string(v1alpha4.IPv4Family): 147 | obj.IPFamily = v1alpha4.IPv4Family 148 | case string(v1alpha4.IPv6Family): 149 | obj.IPFamily = v1alpha4.IPv6Family 150 | case string(v1alpha4.DualStackFamily): 151 | obj.IPFamily = v1alpha4.DualStackFamily 152 | } 153 | } 154 | 155 | kubeProxyMode := mapKeyIfExists(d, "kube_proxy_mode") 156 | if kubeProxyMode != nil && kubeProxyMode.(string) != "" { 157 | switch kubeProxyMode.(string) { 158 | case string(v1alpha4.IPTablesProxyMode): 159 | obj.KubeProxyMode = v1alpha4.IPTablesProxyMode 160 | case string(v1alpha4.IPVSProxyMode): 161 | obj.KubeProxyMode = v1alpha4.IPVSProxyMode 162 | case "none": 163 | obj.KubeProxyMode = "none" 164 | } 165 | 166 | } 167 | 168 | podSubnet := mapKeyIfExists(d, "pod_subnet") 169 | if podSubnet != nil && podSubnet.(string) != "" { 170 | obj.PodSubnet = podSubnet.(string) 171 | } 172 | 173 | serviceSubnet := mapKeyIfExists(d, "service_subnet") 174 | if serviceSubnet != nil && serviceSubnet.(string) != "" { 175 | obj.ServiceSubnet = serviceSubnet.(string) 176 | } 177 | 178 | dnsSearch := mapKeyIfExists(d, "dns_search") 179 | if dnsSearch != nil { 180 | vals := []string{} 181 | for _, k := range dnsSearch.([]interface{}) { 182 | data := k.(string) 183 | vals = append(vals, data) 184 | } 185 | obj.DNSSearch = &vals 186 | } 187 | 188 | return obj 189 | } 190 | 191 | func flattenKindConfigExtraMounts(d map[string]interface{}) v1alpha4.Mount { 192 | obj := v1alpha4.Mount{} 193 | 194 | containerPath := mapKeyIfExists(d, "container_path") 195 | if containerPath != nil && containerPath.(string) != "" { 196 | obj.ContainerPath = containerPath.(string) 197 | } 198 | hostPath := mapKeyIfExists(d, "host_path") 199 | if hostPath != nil && hostPath.(string) != "" { 200 | obj.HostPath = hostPath.(string) 201 | } 202 | propagation := mapKeyIfExists(d, "propagation") 203 | if propagation != nil && propagation.(string) != "" { 204 | switch propagation.(string) { 205 | case string(v1alpha4.MountPropagationBidirectional): 206 | obj.Propagation = v1alpha4.MountPropagationBidirectional 207 | case string(v1alpha4.MountPropagationHostToContainer): 208 | obj.Propagation = v1alpha4.MountPropagationHostToContainer 209 | case string(v1alpha4.MountPropagationNone): 210 | obj.Propagation = v1alpha4.MountPropagationNone 211 | } 212 | } 213 | 214 | readOnly := mapKeyIfExists(d, "read_only") 215 | if readOnly != nil { 216 | obj.Readonly = readOnly.(bool) 217 | } 218 | selinuxRelabel := mapKeyIfExists(d, "selinux_relabel") 219 | if selinuxRelabel != nil { 220 | obj.SelinuxRelabel = selinuxRelabel.(bool) 221 | } 222 | 223 | return obj 224 | } 225 | 226 | func flattenKindConfigExtraPortMappings(d map[string]interface{}) v1alpha4.PortMapping { 227 | obj := v1alpha4.PortMapping{} 228 | 229 | containerPort := mapKeyIfExists(d, "container_port") 230 | if containerPort != nil { 231 | obj.ContainerPort = int32(containerPort.(int)) 232 | } 233 | hostPort := mapKeyIfExists(d, "host_port") 234 | if hostPort != nil { 235 | obj.HostPort = int32(hostPort.(int)) 236 | } 237 | listenAddress := mapKeyIfExists(d, "listen_address") 238 | if listenAddress != nil && listenAddress.(string) != "" { 239 | obj.ListenAddress = listenAddress.(string) 240 | } 241 | protocol := mapKeyIfExists(d, "protocol") 242 | if protocol != nil && protocol.(string) != "" { 243 | switch protocol.(string) { 244 | case string(v1alpha4.PortMappingProtocolSCTP): 245 | obj.Protocol = v1alpha4.PortMappingProtocolSCTP 246 | case string(v1alpha4.PortMappingProtocolTCP): 247 | obj.Protocol = v1alpha4.PortMappingProtocolTCP 248 | case string(v1alpha4.PortMappingProtocolUDP): 249 | obj.Protocol = v1alpha4.PortMappingProtocolUDP 250 | } 251 | } 252 | 253 | return obj 254 | } 255 | 256 | func mapKeyIfExists(m map[string]interface{}, key string) interface{} { 257 | if val, ok := m[key]; ok { 258 | return val 259 | } 260 | return nil 261 | } 262 | -------------------------------------------------------------------------------- /kind/structure_test.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestNormalizeTomlString(t *testing.T) { 8 | cases := []struct { 9 | Name string 10 | Input string 11 | ExpectedOutput string 12 | ExpectUnchanged bool 13 | ExpectError bool 14 | }{ 15 | { 16 | Name: "WellFormattedIsReturnedAsIs", 17 | Input: `name = "Test" 18 | 19 | [section] 20 | key = "value" 21 | `, 22 | ExpectUnchanged: true, 23 | }, 24 | { 25 | Name: "MalformedInputResultsInErrorAndReturnsInput", 26 | Input: `fruit = [] 27 | [[fruit]] 28 | `, 29 | ExpectUnchanged: true, 30 | ExpectError: true, 31 | }, 32 | { 33 | Name: "UnformattedInputIsFormatted", 34 | Input: `name = "test" 35 | [fruit.apple] 36 | [animal] 37 | [fruit] 38 | `, 39 | ExpectedOutput: `name = "test" 40 | 41 | [animal] 42 | 43 | [fruit] 44 | 45 | [fruit.apple] 46 | `, 47 | }, 48 | } 49 | 50 | for _, tc := range cases { 51 | t.Run(tc.Name, func(t *testing.T) { 52 | output, err := normalizeToml(tc.Input) 53 | if err != nil { 54 | if !tc.ExpectError { 55 | t.Error("received error but expected no errors for case", err) 56 | } 57 | } 58 | if tc.ExpectUnchanged && output != tc.Input { 59 | t.Errorf("received:\n---\n%s\n---\n but expected input \n---\n%s\n---\n to be unchanged", output, tc.Input) 60 | } 61 | if !tc.ExpectUnchanged && output != tc.ExpectedOutput { 62 | t.Errorf("received \n---\n%s\n---\n but expected \n---\n%s\n---\n", output, tc.ExpectedOutput) 63 | } 64 | }) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /kind/validation.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func stringIsValidToml(i interface{}, k string) (warnings []string, errors []error) { 8 | v, ok := i.(string) 9 | if !ok { 10 | errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) 11 | return warnings, errors 12 | } 13 | _, err := normalizeToml(v) 14 | if err != nil { 15 | errors = append(errors, fmt.Errorf("%s is not valid toml: %s", k, err)) 16 | } 17 | return warnings, errors 18 | } 19 | -------------------------------------------------------------------------------- /kind/validation_test.go: -------------------------------------------------------------------------------- 1 | package kind 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | ) 7 | 8 | func TestStringIsValidToml(t *testing.T) { 9 | cases := []struct { 10 | Name string 11 | Value interface{} 12 | Key string 13 | ExpectedErrors int 14 | ExpectedWarnings int 15 | }{ 16 | { 17 | Name: "PassingNonStringIsAnError", 18 | Value: struct{}{}, 19 | ExpectedErrors: 1, 20 | }, 21 | { 22 | Name: "ValidTomlIsValid", 23 | Value: "the_answer_to_everything = 42", 24 | }, 25 | { 26 | Name: "NilIsInvalid", 27 | Value: nil, 28 | ExpectedErrors: 1, 29 | }, 30 | { 31 | Name: "EmptyStringIsValid", 32 | Value: "", 33 | }, 34 | { 35 | Name: "InvalidTomlIsInvalid", 36 | Value: strings.Join([]string{"fruits = []", "[[fruits]]"}, "\n"), 37 | ExpectedErrors: 1, 38 | }, 39 | } 40 | 41 | for _, tc := range cases { 42 | t.Run(tc.Name, func(t *testing.T) { 43 | warnings, errors := stringIsValidToml(tc.Value, tc.Key) 44 | if len(warnings) != tc.ExpectedWarnings { 45 | t.Errorf("expected %d warnings but got len(%v) = %d", tc.ExpectedWarnings, warnings, len(warnings)) 46 | } 47 | if len(errors) != tc.ExpectedErrors { 48 | t.Errorf("expected %d warnings but got len(%v) = %d", tc.ExpectedErrors, errors, len(errors)) 49 | } 50 | }) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" 5 | "github.com/tehcyx/terraform-provider-kind/kind" 6 | ) 7 | 8 | func main() { 9 | plugin.Serve(&plugin.ServeOpts{ 10 | ProviderFunc: kind.Provider}) 11 | } 12 | --------------------------------------------------------------------------------