From 86a0fd49b6709ef22dffdd5715206e4f3bf027b8 Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Thu, 15 Oct 2020 19:51:02 -0400 Subject: [PATCH 01/42] Add Github Action for Terraform Registry --- .github/workflows/release.yaml | 47 +++++++++++++++++++++++++++++ .goreleaser.yml | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..9776db75 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,47 @@ +# This GitHub action can publish assets for release when a tag is created. +# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). +# +# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your +# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` +# secret. If you would rather own your own GPG handling, please fork this action +# or use an alternative one for key handling. +# +# You will need to pass the `--batch` flag to `gpg` in your signing step +# in `goreleaser` to indicate this is being used in a non-interactive mode. +# +name: release +on: + push: + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Import GPG key + id: import_gpg + uses: paultyng/ghaction-import-gpg@v2.1.0 + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..37845af0 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,54 @@ +# Visit https://goreleaser.com for documentation on how to customize this +# behavior. +before: + hooks: + # this is just an example and not a requirement for provider building/publishing + - go mod tidy +builds: +- env: + # goreleaser does not work with CGO, it could also complicate + # usage by users in CI/CD systems like Terraform Cloud where + # they are unable to install libraries. + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +signs: + - artifacts: checksum + args: + # if you are using this is a GitHub action or some other automated pipeline, you + # need to pass the batch flag to indicate its not interactive. + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" +release: + # If you want to manually examine the release before its live, uncomment this line: + # draft: true +changelog: + skip: true \ No newline at end of file From dae62778ffe2e8259286c7b261baa1fbfd390c7c Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Thu, 22 Oct 2020 19:10:40 -0400 Subject: [PATCH 02/42] Update docs to support Terraform Registry --- .../datastores.md} | 5 ++--- .../dns.md} | 5 ++--- .../group.md} | 5 ++--- .../groups.md} | 5 ++--- .../hosts.md} | 5 ++--- .../index.md => data-sources/index.html} | 2 +- .../nodes.md} | 5 ++--- .../pool.md} | 5 ++--- .../pools.md} | 5 ++--- .../role.md} | 5 ++--- .../roles.md} | 5 ++--- .../time.md} | 5 ++--- .../user.md} | 5 ++--- .../users.md} | 5 ++--- .../version.md} | 5 ++--- docs/data_sources/virtual_environment/index.md | 10 ---------- docs/index.md | 16 ---------------- ...environment_certificate.md => certificate.md} | 5 ++--- ...ual_environment_container.md => container.md} | 5 ++--- ...proxmox_virtual_environment_dns.md => dns.md} | 5 ++--- ...oxmox_virtual_environment_file.md => file.md} | 5 ++--- ...mox_virtual_environment_group.md => group.md} | 5 ++--- ...mox_virtual_environment_hosts.md => hosts.md} | 5 ++--- docs/resources/{index.md => index.html} | 2 +- ...oxmox_virtual_environment_pool.md => pool.md} | 5 ++--- ...oxmox_virtual_environment_role.md => role.md} | 5 ++--- ...oxmox_virtual_environment_time.md => time.md} | 5 ++--- ...oxmox_virtual_environment_user.md => user.md} | 5 ++--- docs/resources/virtual_environment/index.md | 10 ---------- .../proxmox_virtual_environment_vm.md => vm.md} | 5 ++--- 30 files changed, 52 insertions(+), 113 deletions(-) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_datastores.md => data-sources/datastores.md} (86%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_dns.md => data-sources/dns.md} (76%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_group.md => data-sources/group.md} (83%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_groups.md => data-sources/groups.md} (77%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_hosts.md => data-sources/hosts.md} (82%) rename docs/{data_sources/index.md => data-sources/index.html} (88%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_nodes.md => data-sources/nodes.md} (86%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_pool.md => data-sources/pool.md} (83%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_pools.md => data-sources/pools.md} (75%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_role.md => data-sources/role.md} (75%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_roles.md => data-sources/roles.md} (79%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_time.md => data-sources/time.md} (79%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_user.md => data-sources/user.md} (87%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_users.md => data-sources/users.md} (85%) rename docs/{data_sources/virtual_environment/data_source_virtual_environment_version.md => data-sources/version.md} (80%) delete mode 100644 docs/data_sources/virtual_environment/index.md rename docs/resources/{virtual_environment/proxmox_virtual_environment_certificate.md => certificate.md} (93%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_container.md => container.md} (98%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_dns.md => dns.md} (89%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_file.md => file.md} (94%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_group.md => group.md} (85%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_hosts.md => hosts.md} (88%) rename docs/resources/{index.md => index.html} (87%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_pool.md => pool.md} (84%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_role.md => role.md} (80%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_time.md => time.md} (81%) rename docs/resources/{virtual_environment/proxmox_virtual_environment_user.md => user.md} (92%) delete mode 100644 docs/resources/virtual_environment/index.md rename docs/resources/{virtual_environment/proxmox_virtual_environment_vm.md => vm.md} (99%) diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md b/docs/data-sources/datastores.md similarity index 86% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md rename to docs/data-sources/datastores.md index 9a6f9cde..ab13f8eb 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md +++ b/docs/data-sources/datastores.md @@ -1,10 +1,9 @@ --- layout: page title: Datastores -permalink: /data-sources/virtual-environment/datastores +permalink: /data-sources/datastores nav_order: 1 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Datastores diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md b/docs/data-sources/dns.md similarity index 76% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md rename to docs/data-sources/dns.md index d849502f..454110f6 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md +++ b/docs/data-sources/dns.md @@ -1,10 +1,9 @@ --- layout: page title: DNS -permalink: /data-sources/virtual-environment/dns +permalink: /data-sources/dns nav_order: 2 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: DNS diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_group.md b/docs/data-sources/group.md similarity index 83% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_group.md rename to docs/data-sources/group.md index d82bb62c..d62b75e6 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_group.md +++ b/docs/data-sources/group.md @@ -1,10 +1,9 @@ --- layout: page title: Group -permalink: /data-sources/virtual-environment/group +permalink: /data-sources/group nav_order: 3 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Group diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md b/docs/data-sources/groups.md similarity index 77% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md rename to docs/data-sources/groups.md index cf4e09e1..7df96779 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md +++ b/docs/data-sources/groups.md @@ -1,10 +1,9 @@ --- layout: page title: Groups -permalink: /data-sources/virtual-environment/groups +permalink: /data-sources/groups nav_order: 4 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Groups diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md b/docs/data-sources/hosts.md similarity index 82% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md rename to docs/data-sources/hosts.md index 044fe2f8..84e1c6fc 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md +++ b/docs/data-sources/hosts.md @@ -1,10 +1,9 @@ --- layout: page title: Hosts -permalink: /data-sources/virtual-environment/hosts +permalink: /data-sources/hosts nav_order: 5 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Hosts diff --git a/docs/data_sources/index.md b/docs/data-sources/index.html similarity index 88% rename from docs/data_sources/index.md rename to docs/data-sources/index.html index d2695eb9..27061e02 100644 --- a/docs/data_sources/index.md +++ b/docs/data-sources/index.html @@ -2,7 +2,7 @@ layout: page title: Data Sources permalink: /data-sources -nav_order: 2 +nav_order: 3 has_children: true --- diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md b/docs/data-sources/nodes.md similarity index 86% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md rename to docs/data-sources/nodes.md index 4631056c..17cb75c2 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md +++ b/docs/data-sources/nodes.md @@ -1,10 +1,9 @@ --- layout: page title: Nodes -permalink: /data-sources/virtual-environment/nodes +permalink: /data-sources/nodes nav_order: 6 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Nodes diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md b/docs/data-sources/pool.md similarity index 83% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md rename to docs/data-sources/pool.md index d919b3d7..59a768ee 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md +++ b/docs/data-sources/pool.md @@ -1,10 +1,9 @@ --- layout: page title: Pool -permalink: /data-sources/virtual-environment/pool +permalink: /data-sources/pool nav_order: 7 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Pool diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md b/docs/data-sources/pools.md similarity index 75% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md rename to docs/data-sources/pools.md index 28074d94..ba6aa53e 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md +++ b/docs/data-sources/pools.md @@ -1,10 +1,9 @@ --- layout: page title: Pools -permalink: /data-sources/virtual-environment/pools +permalink: /data-sources/pools nav_order: 8 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Pools diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_role.md b/docs/data-sources/role.md similarity index 75% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_role.md rename to docs/data-sources/role.md index 26d15f4d..c412383c 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_role.md +++ b/docs/data-sources/role.md @@ -1,10 +1,9 @@ --- layout: page title: Role -permalink: /data-sources/virtual-environment/role +permalink: /data-sources/role nav_order: 9 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Role diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md b/docs/data-sources/roles.md similarity index 79% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md rename to docs/data-sources/roles.md index af7c9b28..e9187eb3 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md +++ b/docs/data-sources/roles.md @@ -1,10 +1,9 @@ --- layout: page title: Roles -permalink: /data-sources/virtual-environment/roles +permalink: /data-sources/roles nav_order: 10 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Roles diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_time.md b/docs/data-sources/time.md similarity index 79% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_time.md rename to docs/data-sources/time.md index 54fc08a3..93f39aa6 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_time.md +++ b/docs/data-sources/time.md @@ -1,10 +1,9 @@ --- layout: page title: Time -permalink: /data-sources/virtual-environment/time +permalink: /data-sources/time nav_order: 11 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Time diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_user.md b/docs/data-sources/user.md similarity index 87% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_user.md rename to docs/data-sources/user.md index a6338b07..1e37871d 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_user.md +++ b/docs/data-sources/user.md @@ -1,10 +1,9 @@ --- layout: page title: User -permalink: /data-sources/virtual-environment/user +permalink: /data-sources/user nav_order: 12 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: User diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_users.md b/docs/data-sources/users.md similarity index 85% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_users.md rename to docs/data-sources/users.md index 6259ed42..7b1a2f49 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_users.md +++ b/docs/data-sources/users.md @@ -1,10 +1,9 @@ --- layout: page title: Users -permalink: /data-sources/virtual-environment/users +permalink: /data-sources/users nav_order: 13 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Users diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_version.md b/docs/data-sources/version.md similarity index 80% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_version.md rename to docs/data-sources/version.md index 700dc88f..d3217ddb 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_version.md +++ b/docs/data-sources/version.md @@ -1,10 +1,9 @@ --- layout: page title: Version -permalink: /data-sources/virtual-environment/version +permalink: /data-sources/version nav_order: 14 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +parent: Data Sources --- # Data Source: Version diff --git a/docs/data_sources/virtual_environment/index.md b/docs/data_sources/virtual_environment/index.md deleted file mode 100644 index 9e0eea09..00000000 --- a/docs/data_sources/virtual_environment/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page -title: Virtual Environment Data Sources -permalink: /data-sources/virtual-environment -nav_order: 1 -parent: Data Sources -has_children: true ---- - -# Virtual Environment Data Sources diff --git a/docs/index.md b/docs/index.md index 48f99181..d819239a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,22 +23,6 @@ provider "proxmox" { } ``` -## Installation - -You can install the latest release of the provider using either Git Bash or regular Bash: - -```sh -$ export PROVIDER_PLATFORM="$([[ "$OSTYPE" =~ ^msys|cygwin$ ]] && echo "windows" || ([[ "$OSTYPE" == "darwin"* ]] && echo "darwin" || ([[ "$OSTYPE" == "linux"* ]] && echo "linux" || echo "unsupported")))" -$ export PROVIDER_VERSION="$(curl -L -s -H 'Accept: application/json' https://github.com/danitso/terraform-provider-proxmox/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')" -$ export PLUGINS_PATH="$([[ "$PROVIDER_PLATFORM" == "windows" ]] && cygpath -u "$APPDATA" || echo "$HOME")/terraform.d/plugins" -$ mkdir -p "$PLUGINS_PATH" -$ curl -o "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -sL "https://github.com/danitso/terraform-provider-proxmox/releases/download/${PROVIDER_VERSION}/terraform-provider-proxmox_v${PROVIDER_VERSION}-custom_${PROVIDER_PLATFORM}_amd64.zip" -$ unzip -o -d "$PLUGINS_PATH" "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -$ rm "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -``` - -You can also install it manually by following the instructions to [install it as a plugin](https://www.terraform.io/docs/plugins/basics.html#installing-plugins). You can download the latest release from the [releases](https://github.com/danitso/terraform-provider-proxmox/releases) page. - ## Authentication The Proxmox provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md b/docs/resources/certificate.md similarity index 93% rename from docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md rename to docs/resources/certificate.md index f8c0bc7e..15fe9d7f 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md +++ b/docs/resources/certificate.md @@ -1,10 +1,9 @@ --- layout: page title: Certificate -permalink: /ressources/virtual-environment/certificate +permalink: /resources/certificate nav_order: 1 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Certificate diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_container.md b/docs/resources/container.md similarity index 98% rename from docs/resources/virtual_environment/proxmox_virtual_environment_container.md rename to docs/resources/container.md index d6272fcb..1dc03433 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_container.md +++ b/docs/resources/container.md @@ -1,10 +1,9 @@ --- layout: page title: Container -permalink: /ressources/virtual-environment/container +permalink: /resources/container nav_order: 2 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Container diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_dns.md b/docs/resources/dns.md similarity index 89% rename from docs/resources/virtual_environment/proxmox_virtual_environment_dns.md rename to docs/resources/dns.md index ec66adc7..5f4babf0 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_dns.md +++ b/docs/resources/dns.md @@ -1,10 +1,9 @@ --- layout: page title: DNS -permalink: /ressources/virtual-environment/dns +permalink: /resources/dns nav_order: 3 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: DNS diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_file.md b/docs/resources/file.md similarity index 94% rename from docs/resources/virtual_environment/proxmox_virtual_environment_file.md rename to docs/resources/file.md index df11f129..17c285a6 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_file.md +++ b/docs/resources/file.md @@ -1,10 +1,9 @@ --- layout: page title: File -permalink: /ressources/virtual-environment/file +permalink: /resources/file nav_order: 4 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: File diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_group.md b/docs/resources/group.md similarity index 85% rename from docs/resources/virtual_environment/proxmox_virtual_environment_group.md rename to docs/resources/group.md index e5ddfa7e..8a8cdc3d 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_group.md +++ b/docs/resources/group.md @@ -1,10 +1,9 @@ --- layout: page title: Group -permalink: /ressources/virtual-environment/group +permalink: /resources/group nav_order: 5 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Group diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md b/docs/resources/hosts.md similarity index 88% rename from docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md rename to docs/resources/hosts.md index 81b0c1b3..5e02a634 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md +++ b/docs/resources/hosts.md @@ -1,10 +1,9 @@ --- layout: page title: Hosts -permalink: /ressources/virtual-environment/hosts +permalink: /resources/hosts nav_order: 6 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Hosts diff --git a/docs/resources/index.md b/docs/resources/index.html similarity index 87% rename from docs/resources/index.md rename to docs/resources/index.html index bc999921..12716077 100644 --- a/docs/resources/index.md +++ b/docs/resources/index.html @@ -2,7 +2,7 @@ layout: page title: Resources permalink: /resources -nav_order: 3 +nav_order: 2 has_children: true --- diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_pool.md b/docs/resources/pool.md similarity index 84% rename from docs/resources/virtual_environment/proxmox_virtual_environment_pool.md rename to docs/resources/pool.md index 5af936f4..be48ab0c 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_pool.md +++ b/docs/resources/pool.md @@ -1,10 +1,9 @@ --- layout: page title: Pool -permalink: /ressources/virtual-environment/pool +permalink: /resources/pool nav_order: 7 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Pool diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_role.md b/docs/resources/role.md similarity index 80% rename from docs/resources/virtual_environment/proxmox_virtual_environment_role.md rename to docs/resources/role.md index 108f9565..17f12068 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_role.md +++ b/docs/resources/role.md @@ -1,10 +1,9 @@ --- layout: page title: Role -permalink: /ressources/virtual-environment/role +permalink: /resources/role nav_order: 8 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Role diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_time.md b/docs/resources/time.md similarity index 81% rename from docs/resources/virtual_environment/proxmox_virtual_environment_time.md rename to docs/resources/time.md index c124386c..8642a65e 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_time.md +++ b/docs/resources/time.md @@ -1,10 +1,9 @@ --- layout: page title: Time -permalink: /ressources/virtual-environment/time +permalink: /resources/time nav_order: 9 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: Time diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_user.md b/docs/resources/user.md similarity index 92% rename from docs/resources/virtual_environment/proxmox_virtual_environment_user.md rename to docs/resources/user.md index e40dd67a..c4ed020c 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_user.md +++ b/docs/resources/user.md @@ -1,10 +1,9 @@ --- layout: page title: User -permalink: /ressources/virtual-environment/user +permalink: /resources/user nav_order: 10 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: User diff --git a/docs/resources/virtual_environment/index.md b/docs/resources/virtual_environment/index.md deleted file mode 100644 index e1e34954..00000000 --- a/docs/resources/virtual_environment/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page -title: Virtual Environment Resources -permalink: /resources/virtual-environment -nav_order: 1 -parent: Resources -has_children: true ---- - -# Virtual Environment Resources diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md b/docs/resources/vm.md similarity index 99% rename from docs/resources/virtual_environment/proxmox_virtual_environment_vm.md rename to docs/resources/vm.md index 4445cdde..ec779d10 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md +++ b/docs/resources/vm.md @@ -1,10 +1,9 @@ --- layout: page title: VM -permalink: /ressources/virtual-environment/vm +permalink: /resources/vm nav_order: 11 -parent: Virtual Environment Resources -grand_parent: Resources +parent: Resources --- # Resource: VM From b08e4cc55fa1a1cb3f08b34be4c13bed89f2d440 Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Mon, 9 Nov 2020 18:58:58 -0500 Subject: [PATCH 03/42] Update vm.md Due to merge [#46](https://github.com/danitso/terraform-provider-proxmox/pull/46/files) --- docs/resources/vm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/vm.md b/docs/resources/vm.md index ec779d10..b904faba 100644 --- a/docs/resources/vm.md +++ b/docs/resources/vm.md @@ -184,7 +184,7 @@ output "ubuntu_vm_public_key" { * `read_burstable` - (Optional) The maximum burstable read speed in megabytes per second. * `write` - (Optional) The maximum write speed in megabytes per second. * `write_burstable` - (Optional) The maximum burstable write speed in megabytes per second. -* `initialization` - (Optional) The cloud-init configuration (conflicts with `cdrom`). +* `initialization` - (Optional) The cloud-init configuration. * `datastore_id` - (Optional) The identifier for the datastore to create the cloud-init disk in (defaults to `local-lvm`). * `dns` - (Optional) The DNS configuration. * `domain` - (Optional) The DNS search domain. From 920bf24200d14461d56f487a6d186b06eb585cd5 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Sat, 5 Dec 2020 20:14:17 -0800 Subject: [PATCH 04/42] fix index out of range error --- proxmoxtf/resource_virtual_environment_vm.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..74ab35ed 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -2205,14 +2205,16 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = vmConfig.IDEDevice3.Enabled cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = vmConfig.IDEDevice3.FileVolume - isCurrentCDROMFileId := currentCDROM[0].(map[string]interface{}) + if len(currentCDROM) > 0 { + isCurrentCDROMFileId := currentCDROM[0].(map[string]interface{}) - if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMFileID] == "" { - cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = "" - } + if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMFileID] == "" { + cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = "" + } - if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMEnabled] == false { - cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = false + if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMEnabled] == false { + cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = false + } } cdrom[0] = cdromBlock From 0a71fe6b1f3bdca2245b271e127ffb8771590486 Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Thu, 10 Dec 2020 09:45:27 -0500 Subject: [PATCH 05/42] add `alias` cluster resource --- .../data_source_virtual_environment_alias.md | 28 +++ ...data_source_virtual_environment_aliases.md | 26 +++ .../proxmox_virtual_environment_alias.md | 39 ++++ ...ource_virtual_environment_cluster_alias.tf | 7 + ...rce_virtual_environment_cluster_aliases.tf | 9 + ...ource_virtual_environemnt_cluster_alias.tf | 13 ++ proxmox/virtual_environment_cluster_alias.go | 63 ++++++ ...virtual_environment_cluster_alias_types.go | 39 ++++ .../data_source_virtual_environment_alias.go | 70 +++++++ ...a_source_virtual_environment_alias_test.go | 40 ++++ ...data_source_virtual_environment_aliases.go | 54 +++++ ...source_virtual_environment_aliases_test.go | 33 ++++ proxmoxtf/provider.go | 3 + ...ource_virtual_environment_cluster_alias.go | 184 ++++++++++++++++++ ..._virtual_environment_cluster_alias_test.go | 40 ++++ 15 files changed, 648 insertions(+) create mode 100644 docs/data_sources/virtual_environment/data_source_virtual_environment_alias.md create mode 100644 docs/data_sources/virtual_environment/data_source_virtual_environment_aliases.md create mode 100644 docs/resources/virtual_environment/proxmox_virtual_environment_alias.md create mode 100644 example/data_source_virtual_environment_cluster_alias.tf create mode 100644 example/data_source_virtual_environment_cluster_aliases.tf create mode 100644 example/resource_virtual_environemnt_cluster_alias.tf create mode 100644 proxmox/virtual_environment_cluster_alias.go create mode 100644 proxmox/virtual_environment_cluster_alias_types.go create mode 100644 proxmoxtf/data_source_virtual_environment_alias.go create mode 100644 proxmoxtf/data_source_virtual_environment_alias_test.go create mode 100644 proxmoxtf/data_source_virtual_environment_aliases.go create mode 100644 proxmoxtf/data_source_virtual_environment_aliases_test.go create mode 100644 proxmoxtf/resource_virtual_environment_cluster_alias.go create mode 100644 proxmoxtf/resource_virtual_environment_cluster_alias_test.go diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_alias.md b/docs/data_sources/virtual_environment/data_source_virtual_environment_alias.md new file mode 100644 index 00000000..17df5433 --- /dev/null +++ b/docs/data_sources/virtual_environment/data_source_virtual_environment_alias.md @@ -0,0 +1,28 @@ +--- +layout: page +title: Alias +permalink: /data-sources/virtual-environment/alias +nav_order: 1 +parent: Virtual Environment Data Sources +--- + +# Data Source: Alias + +Retrieves information about a specific alias. + +## Example Usage + +``` +data "proxmox_virtual_environment_cluster_alias" "local_network" { + name = "local_network" +} +``` + +## Arguments Reference + +* `name` - (Required) Alias name. + +## Attributes Reference + +* `cidr` - (Required) Network/IP specification in CIDR format. +* `comment` - (Optional) Alias comment. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_aliases.md b/docs/data_sources/virtual_environment/data_source_virtual_environment_aliases.md new file mode 100644 index 00000000..106e5a24 --- /dev/null +++ b/docs/data_sources/virtual_environment/data_source_virtual_environment_aliases.md @@ -0,0 +1,26 @@ +--- +layout: page +title: Aliases +permalink: /data-sources/virtual-environment/aliases +nav_order: 1 +parent: Virtual Environment Data Sources +parent: Data Sources +--- + +# Data Source: Aliases + +Retrieves the identifiers for all the available aliases. + +## Example Usage + +``` +data "proxmox_virtual_environment_cluster_aliases" "available_aliases" {} +``` + +## Arguments Reference + +There are no arguments available for this data source. + +## Attributes Reference + +* `alias_ids` - The pool identifiers. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_alias.md b/docs/resources/virtual_environment/proxmox_virtual_environment_alias.md new file mode 100644 index 00000000..584f4770 --- /dev/null +++ b/docs/resources/virtual_environment/proxmox_virtual_environment_alias.md @@ -0,0 +1,39 @@ +--- +layout: page +title: Alias +permalink: /ressources/virtual-environment/alias +nav_order: 1 +parent: Virtual Environment Resources +grand_parent: Resources +--- + +# Resource: Alias + +Aliases are used to see what devices or group of devices are affected by a rule. +We can create aliases to identify an IP address or a network. + +## Example Usage + +``` +resource "proxmox_virtual_environment_cluster_alias" "local_network" { + name = "local_network" + cidr = "192.168.0.0/23" + comment = "Managed by Terraform" +} + +resource "proxmox_virtual_environment_cluster_alias" "ubuntu_vm" { + name = "ubuntu" + cidr = "192.168.0.1" + comment = "Managed by Terraform" +} +``` + +## Arguments Reference + +* `name` - (Required) Alias name. +* `cidr` - (Required) Network/IP specification in CIDR format. +* `comment` - (Optional) Alias comment. + +## Attributes Reference + +There are no attribute references available for this resource. diff --git a/example/data_source_virtual_environment_cluster_alias.tf b/example/data_source_virtual_environment_cluster_alias.tf new file mode 100644 index 00000000..01b17e8f --- /dev/null +++ b/example/data_source_virtual_environment_cluster_alias.tf @@ -0,0 +1,7 @@ +data "proxmox_virtual_environment_cluster_alias" "example" { + name = "example" +} + +output "proxmox_virtual_environment_cluster_alias_example_cidr" { + value = proxmox_virtual_environment_cluster_alias.example.cidr +} diff --git a/example/data_source_virtual_environment_cluster_aliases.tf b/example/data_source_virtual_environment_cluster_aliases.tf new file mode 100644 index 00000000..c59250dc --- /dev/null +++ b/example/data_source_virtual_environment_cluster_aliases.tf @@ -0,0 +1,9 @@ +data "proxmox_virtual_environment_cluster_aliases" "example" { + depends_on = ["proxmox_virtual_environment_cluster_alias.example"] +} + +output "proxmox_virtual_environment_cluster_aliases" { + value = "${map( + "alias_ids", data.proxmox_virtual_environment_cluster_aliases.example.alias_ids, + )}" +} diff --git a/example/resource_virtual_environemnt_cluster_alias.tf b/example/resource_virtual_environemnt_cluster_alias.tf new file mode 100644 index 00000000..34170be4 --- /dev/null +++ b/example/resource_virtual_environemnt_cluster_alias.tf @@ -0,0 +1,13 @@ +resource "proxmox_virtual_environment_cluster_alias" "example" { + name = "local_network" + cidr = "192.168.0.0/23" + comment = "Managed by Terraform" +} + +output "proxmox_virtual_environment_cluster_alias_example_name" { + value = "${proxmox_virtual_environment_cluster_alias.example.name}" +} + +output "proxmox_virtual_environment_cluster_alias_example_cidr" { + value = "${proxmox_virtual_environment_cluster_alias.example.cidr}" +} diff --git a/proxmox/virtual_environment_cluster_alias.go b/proxmox/virtual_environment_cluster_alias.go new file mode 100644 index 00000000..6fc57aac --- /dev/null +++ b/proxmox/virtual_environment_cluster_alias.go @@ -0,0 +1,63 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +import ( + "errors" + "fmt" + "net/url" + "sort" +) + +// CreateAlias create an alias +func (c *VirtualEnvironmentClient) CreateAlias(d *VirtualEnvironmentClusterAliasCreateRequestBody) error { + return c.DoRequest(hmPOST, "cluster/firewall/aliases", d, nil) +} + +// DeleteAlias delete an alias +func (c *VirtualEnvironmentClient) DeleteAlias(id string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), nil, nil) +} + +// GetAlias retrieves an alias +func (c *VirtualEnvironmentClient) GetAlias(id string) (*VirtualEnvironmentClusterAliasGetResponseData, error) { + resBody := &VirtualEnvironmentClusterAliasGetResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// ListAlias retrieves a list of aliases. +func (c *VirtualEnvironmentClient) ListAliases() ([]*VirtualEnvironmentClusterAliasGetResponseData, error) { + resBody := &VirtualEnvironmentClusterAliasListResponseBody{} + err := c.DoRequest(hmGET, "cluster/firewall/aliases", nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + sort.Slice(resBody.Data, func(i, j int) bool { + return resBody.Data[i].Name < resBody.Data[j].Name + }) + + return resBody.Data, nil +} + +// UpdateAlias updates an alias. +func (c *VirtualEnvironmentClient) UpdateAlias(id string, d *VirtualEnvironmentClusterAliasUpdateRequestBody) error { + return c.DoRequest(hmPUT, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), d, nil) +} \ No newline at end of file diff --git a/proxmox/virtual_environment_cluster_alias_types.go b/proxmox/virtual_environment_cluster_alias_types.go new file mode 100644 index 00000000..d6813206 --- /dev/null +++ b/proxmox/virtual_environment_cluster_alias_types.go @@ -0,0 +1,39 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +// VirtualEnvironmentClusterAliasCreateRequestBody contains the data for an alias create request. +type VirtualEnvironmentClusterAliasCreateRequestBody struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` + CIDR string `json:"cidr" url:"cidr"` +} + +// VirtualEnvironmentClusterAliasGetResponseBody contains the body from an alias get response. +type VirtualEnvironmentClusterAliasGetResponseBody struct { + Data *VirtualEnvironmentClusterAliasGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterAliasGetResponseData contains the data from an alias get response. +type VirtualEnvironmentClusterAliasGetResponseData struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` + CIDR string `json:"cidr" url:"cidr"` + Digest *string `json:"digest" url:"digest"` + IPVersion int `json:"ipversion" url:"ipversion"` +} + +// VirtualEnvironmentClusterAliasListResponseBody contains the data from an alias get response. +type VirtualEnvironmentClusterAliasListResponseBody struct { + Data []*VirtualEnvironmentClusterAliasGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterAliasUpdateRequestBody contains the data for an alias update request. +type VirtualEnvironmentClusterAliasUpdateRequestBody struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + ReName string `json:"rename" url:"rename"` + CIDR string `json:"cidr" url:"cidr"` +} + diff --git a/proxmoxtf/data_source_virtual_environment_alias.go b/proxmoxtf/data_source_virtual_environment_alias.go new file mode 100644 index 00000000..f04bfed5 --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_alias.go @@ -0,0 +1,70 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +const ( + dvDataVirtualEnvironmentClusterAliasComment = "" + + mkDataSourceVirtualEnvironmentClusterAliasName = "name" + mkDataSourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkDataSourceVirtualEnvironmentClusterAliasComment = "comment" + +) + +func dataSourceVirtualEnvironmentClusterAlias() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkDataSourceVirtualEnvironmentClusterAliasName: { + Type: schema.TypeString, + Description: "Alias name", + Required: true, + }, + mkDataSourceVirtualEnvironmentClusterAliasCIDR: { + Type: schema.TypeString, + Description: "IP/CIDR block", + Computed: true, + }, + mkDataSourceVirtualEnvironmentClusterAliasComment: { + Type: schema.TypeString, + Description: "Alias comment", + Computed: true, + }, + + }, + Read: dataSourceVirtualEnvironmentAliasRead, + } +} + +func dataSourceVirtualEnvironmentAliasRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + AliasID := d.Get(mkDataSourceVirtualEnvironmentClusterAliasName).(string) + Alias, err := veClient.GetAlias(AliasID) + + if err != nil { + return err + } + + d.SetId(AliasID) + + d.Set(mkDataSourceVirtualEnvironmentClusterAliasCIDR, Alias.CIDR) + + if Alias.Comment != nil { + d.Set(mkDataSourceVirtualEnvironmentClusterAliasComment, Alias.Comment) + } else { + d.Set(mkDataSourceVirtualEnvironmentClusterAliasComment, dvDataVirtualEnvironmentClusterAliasComment) + } + + return nil +} diff --git a/proxmoxtf/data_source_virtual_environment_alias_test.go b/proxmoxtf/data_source_virtual_environment_alias_test.go new file mode 100644 index 00000000..56526388 --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_alias_test.go @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/schema" +) + +// TestDataSourceVirtualEnvironmentAliasInstantiation tests whether the DataSourceVirtualEnvironmentAlias instance can be instantiated. +func TestDataSourceVirtualEnvironmentAliasInstantiation(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAlias() + + if s == nil { + t.Fatalf("Cannot instantiate dataSourceVirtualEnvironmentAlias") + } +} + +// TestDataSourceVirtualEnvironmentAliasSchema tests the dataSourceVirtualEnvironmentAlias schema. +func TestDataSourceVirtualEnvironmentAliasSchema(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAlias() + + testRequiredArguments(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasName, + }) + + testComputedAttributes(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasCIDR, + mkDataSourceVirtualEnvironmentClusterAliasComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkDataSourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasComment: schema.TypeString, + }) +} diff --git a/proxmoxtf/data_source_virtual_environment_aliases.go b/proxmoxtf/data_source_virtual_environment_aliases.go new file mode 100644 index 00000000..34b37320 --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_aliases.go @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +const ( + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs = "alias_ids" +) + +func dataSourceVirtualEnvironmentClusterAliases() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs: { + Type: schema.TypeList, + Description: "Alias IDs", + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + Read: dataSourceVirtualEnvironmentClusterAliasesRead, + } +} + +func dataSourceVirtualEnvironmentClusterAliasesRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + list, err := veClient.ListPools() + + if err != nil { + return err + } + + aliasIDs := make([]interface{}, len(list)) + + for i, v := range list { + aliasIDs[i] = v.ID + } + + d.SetId("aliases") + + d.Set(mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs, aliasIDs) + + return nil +} diff --git a/proxmoxtf/data_source_virtual_environment_aliases_test.go b/proxmoxtf/data_source_virtual_environment_aliases_test.go new file mode 100644 index 00000000..da5a640a --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_aliases_test.go @@ -0,0 +1,33 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/schema" +) + +// TestDataSourceVirtualEnvironmentAliasesInstantiation tests whether the DataSourceVirtualEnvironmentAliases instance can be instantiated. +func TestDataSourceVirtualEnvironmentAliasesInstantiation(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAliases() + + if s == nil { + t.Fatalf("Cannot instantiate dataSourceVirtualEnvironmentAliases") + } +} + +// TestDataSourceVirtualEnvironmentAliasesSchema tests the dataSourceVirtualEnvironmentAliases schema. +func TestDataSourceVirtualEnvironmentAliasesSchema(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAliases() + + testComputedAttributes(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs: schema.TypeList, + }) +} diff --git a/proxmoxtf/provider.go b/proxmoxtf/provider.go index 7d2b514f..51702aad 100644 --- a/proxmoxtf/provider.go +++ b/proxmoxtf/provider.go @@ -50,6 +50,8 @@ func Provider() *schema.Provider { "proxmox_virtual_environment_user": dataSourceVirtualEnvironmentUser(), "proxmox_virtual_environment_users": dataSourceVirtualEnvironmentUsers(), "proxmox_virtual_environment_version": dataSourceVirtualEnvironmentVersion(), + "proxmox_virtual_environment_cluster_alias": dataSourceVirtualEnvironmentClusterAlias(), + "proxmox_virtual_environment_cluster_aliases": dataSourceVirtualEnvironmentClusterAliases(), }, ResourcesMap: map[string]*schema.Resource{ "proxmox_virtual_environment_certificate": resourceVirtualEnvironmentCertificate(), @@ -63,6 +65,7 @@ func Provider() *schema.Provider { "proxmox_virtual_environment_time": resourceVirtualEnvironmentTime(), "proxmox_virtual_environment_user": resourceVirtualEnvironmentUser(), "proxmox_virtual_environment_vm": resourceVirtualEnvironmentVM(), + "proxmox_virtual_environment_cluster_alias": resourceVirtualEnvironmentClusterAlias(), }, Schema: map[string]*schema.Schema{ mkProviderVirtualEnvironment: { diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias.go b/proxmoxtf/resource_virtual_environment_cluster_alias.go new file mode 100644 index 00000000..0e7a305f --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_alias.go @@ -0,0 +1,184 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform/helper/schema" + "strings" +) + +const ( + dvResourceVirtualEnvironmentClusterAliasComment = "" + + mkResourceVirtualEnvironmentClusterAliasName = "name" + mkResourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkResourceVirtualEnvironmentClusterAliasComment = "comment" +) + +func resourceVirtualEnvironmentClusterAlias() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterAliasName: { + Type: schema.TypeString, + Description: "Alias name", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterAliasCIDR: { + Type: schema.TypeString, + Description: "IP/CIDR block", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterAliasComment: { + Type: schema.TypeString, + Description: "Alias comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterAliasComment, + }, + }, + Create: resourceVirtualEnvironmentClusterAliasCreate, + Read: resourceVirtualEnvironmentClusterAliasRead, + Update: resourceVirtualEnvironmentClusterAliasUpdate, + Delete: resourceVirtualEnvironmentClusterAliasDelete, + } +} + +func resourceVirtualEnvironmentClusterAliasCreate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterAliasComment).(string) + name := d.Get(mkResourceVirtualEnvironmentClusterAliasName).(string) + cidr := d.Get(mkResourceVirtualEnvironmentClusterAliasCIDR).(string) + + body := &proxmox.VirtualEnvironmentClusterAliasCreateRequestBody{ + Comment: &comment, + Name: name, + CIDR: cidr, + } + + err = veClient.CreateAlias(body) + + if err != nil { + return err + } + + d.SetId(name) + + return resourceVirtualEnvironmentClusterAliasRead(d, m) +} + +func resourceVirtualEnvironmentClusterAliasRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + name := d.Id() + alias, err := veClient.GetAlias(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + aliasMap := map[string]interface{}{ + mkResourceVirtualEnvironmentClusterAliasComment: alias.Comment, + mkResourceVirtualEnvironmentClusterAliasName: alias.Name, + mkResourceVirtualEnvironmentClusterAliasCIDR: alias.CIDR, + } + + for key, val := range aliasMap { + err = d.Set(key, val) + + if err != nil { + return err + } + } + + return nil +} + +func resourceVirtualEnvironmentClusterAliasUpdate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterAliasComment).(string) + cidr := d.Get(mkResourceVirtualEnvironmentClusterAliasCIDR).(string) + newName := d.Get(mkResourceVirtualEnvironmentClusterAliasName).(string) + previousName := d.Id() + + body := &proxmox.VirtualEnvironmentClusterAliasUpdateRequestBody{ + ReName: newName, + CIDR: cidr, + Comment: &comment, + } + + err = veClient.UpdateAlias(previousName, body) + + if err != nil { + return err + } + + d.SetId(newName) + + return resourceVirtualEnvironmentClusterAliasRead(d, m) +} + + +func resourceVirtualEnvironmentClusterAliasDelete(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return nil + } + + name := d.Id() + err = veClient.DeleteAlias(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + d.SetId("") + + return nil +} + + + + + + + + + + + + + + diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias_test.go b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go new file mode 100644 index 00000000..c5739675 --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/schema" +) + +// TestResourceVirtualEnvironmentAliasInstantiation tests whether the ResourceVirtualEnvironmentAlias instance can be instantiated. +func TestResourceVirtualEnvironmentAliasInstantiation(t *testing.T) { + s := resourceVirtualEnvironmentClusterAlias() + + if s == nil { + t.Fatalf("Cannot instantiate resourceVirtualEnvironmentAlias") + } +} + +// TestResourceVirtualEnvironmentAliasSchema tests the resourceVirtualEnvironmentAlias schema. +func TestResourceVirtualEnvironmentAliasSchema(t *testing.T) { + s := resourceVirtualEnvironmentClusterAlias() + + testRequiredArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterAliasName, + mkResourceVirtualEnvironmentClusterAliasCIDR, + }) + + testOptionalArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterAliasComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasComment: schema.TypeString, + }) +} From 3d14018ff77049fb2072ece45b4ed2e0b1cdb557 Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Thu, 10 Dec 2020 09:52:38 -0500 Subject: [PATCH 06/42] add `ipset` cluster resource --- .../proxmox_virtual_environment_ipset.md | 50 ++++ ...ource_virtual_environment_cluster_ipset.tf | 25 ++ proxmox/virtual_environment_cluster_ipset.go | 73 +++++ ...virtual_environment_cluster_ipset_types.go | 48 +++ proxmoxtf/provider.go | 1 + ...ource_virtual_environment_cluster_ipset.go | 273 ++++++++++++++++++ ..._virtual_environment_cluster_ipset_test.go | 58 ++++ 7 files changed, 528 insertions(+) create mode 100644 docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md create mode 100644 example/resource_virtual_environment_cluster_ipset.tf create mode 100644 proxmox/virtual_environment_cluster_ipset.go create mode 100644 proxmox/virtual_environment_cluster_ipset_types.go create mode 100644 proxmoxtf/resource_virtual_environment_cluster_ipset.go create mode 100644 proxmoxtf/resource_virtual_environment_cluster_ipset_test.go diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md b/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md new file mode 100644 index 00000000..9a1a8daf --- /dev/null +++ b/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md @@ -0,0 +1,50 @@ +--- +layout: page +title: IPSet +permalink: /ressources/virtual-environment/ipset +nav_order: 12 +parent: Virtual Environment Resources +grand_parent: Resources +--- + +# Resource: IPSet + +An IPSet allows us to group multiple IP addresses, IP subnets and aliases. + +## Example Usage + +``` +resource "proxmox_virtual_environment_cluster_ipset" "ipset" { + name = "local_network" + comment = "Managed by Terraform" + + ipset { + cidr = "192.168.0.0/23" + comment = "Local network 1" + } + + ipset { + cidr = "192.168.0.1" + comment = "Server 1" + nomatch = true + } + + ipset { + cidr = "192.168.2.1" + comment = "Server 1" + } +} +``` + +## Arguments Reference + +* `name` - (Required) Alias name. +* `comment` - (Optional) Alias comment. +* `ipset` - (Optional) IP/CIDR block (multiple blocks supported). + * `cidr` - Network/IP specification in CIDR format. + * `comment` - (Optional) Arbitrary string annotation. + * `nomatch` - (Optional) Entries marked as `nomatch` are skipped as if those were not added to the set. + +## Attributes Reference + +There are no attribute references available for this resource. diff --git a/example/resource_virtual_environment_cluster_ipset.tf b/example/resource_virtual_environment_cluster_ipset.tf new file mode 100644 index 00000000..63bbcc96 --- /dev/null +++ b/example/resource_virtual_environment_cluster_ipset.tf @@ -0,0 +1,25 @@ +resource "proxmox_virtual_environment_cluster_ipset" "example" { + name = "local_network" + comment = "Managed by Terraform" + + ipset { + cidr = "192.168.0.0/23" + comment = "Local network 1" + } + + ipset { + cidr = "192.168.0.1" + comment = "Server 1" + nomatch = true + } + + ipset { + cidr = "192.168.2.1" + comment = "Server 1" + } +} + +output "resource_proxmox_virtual_environment_cluster_ipset" { + value = "${proxmox_virtual_environment_cluster_ipset.example.name}" +} + diff --git a/proxmox/virtual_environment_cluster_ipset.go b/proxmox/virtual_environment_cluster_ipset.go new file mode 100644 index 00000000..3513bede --- /dev/null +++ b/proxmox/virtual_environment_cluster_ipset.go @@ -0,0 +1,73 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +import ( + "errors" + "fmt" + "net/url" + "sort" +) + +// CreateIPSet create an IPSet +func (c *VirtualEnvironmentClient) CreateIPSet(d *VirtualEnvironmentClusterIPSetCreateRequestBody) error { + return c.DoRequest(hmPOST, "cluster/firewall/ipset", d, nil) +} + +// Add IP or Network to IPSet +func (c *VirtualEnvironmentClient) AddCIDRToIPSet(id string, d *VirtualEnvironmentClusterIPSetGetResponseData) error { + return c.DoRequest(hmPOST, fmt.Sprintf("cluster/firewall/ipset/%s/", url.PathEscape(id)), d, nil) +} + +// UpdateIPSet updates an IPSet. +func (c *VirtualEnvironmentClient) UpdateIPSet(d *VirtualEnvironmentClusterIPSetUpdateRequestBody) error { + return c.DoRequest(hmPOST, fmt.Sprint("cluster/firewall/ipset/"), d, nil) +} + +// DeleteIPSet delete an IPSet +func (c *VirtualEnvironmentClient) DeleteIPSet(id string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/ipset/%s", url.PathEscape(id)), nil, nil) +} + +// DeleteIPSetContent remove IP or Network from IPSet. +func (c *VirtualEnvironmentClient) DeleteIPSetContent(id string, cidr string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/ipset/%s/%s", url.PathEscape(id), url.PathEscape(cidr)), nil, nil) +} + +// GetListIPSetContent retrieve a list of IPSet content +func (c *VirtualEnvironmentClient) GetListIPSetContent(id string) ([]*VirtualEnvironmentClusterIPSetGetResponseData, error) { + resBody := &VirtualEnvironmentClusterIPSetGetResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("cluster/firewall/ipset/%s", url.PathEscape(id)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// GetListIPSets retrieves list of IPSets. +func (c *VirtualEnvironmentClient) GetListIPSets() (*VirtualEnvironmentClusterIPSetListResponseBody, error) { + resBody := &VirtualEnvironmentClusterIPSetListResponseBody{} + err := c.DoRequest(hmGET, "cluster/firewall/ipset", nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + sort.Slice(resBody.Data, func(i, j int) bool { + return resBody.Data[i].Name < resBody.Data[j].Name + }) + + return resBody, nil +} \ No newline at end of file diff --git a/proxmox/virtual_environment_cluster_ipset_types.go b/proxmox/virtual_environment_cluster_ipset_types.go new file mode 100644 index 00000000..36edafff --- /dev/null +++ b/proxmox/virtual_environment_cluster_ipset_types.go @@ -0,0 +1,48 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +/** +* Reference: https://pve.proxmox.com/pve-docs/api-viewer/#/cluster/firewall/ipset + */ + +package proxmox + +// VirtualEnvironmentClusterIPSetListResponseBody contains the data from an IPSet get response. +type VirtualEnvironmentClusterIPSetListResponseBody struct { + Data []*VirtualEnvironmentClusterIPSetCreateRequestBody `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterIPSetCreateRequestBody contains the data for an IPSet create request +type VirtualEnvironmentClusterIPSetCreateRequestBody struct { + Comment string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetGetResponseBody contains the body from an IPSet get response. +type VirtualEnvironmentClusterIPSetGetResponseBody struct { + Data []*VirtualEnvironmentClusterIPSetGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterIPSetGetResponseData contains the data from an IPSet get response. +type VirtualEnvironmentClusterIPSetGetResponseData struct { + CIDR string `json:"cidr" url:"cidr"` + NoMatch *CustomBool `json:"nomatch,omitempty" url:"nomatch,omitempty,int"` + Comment string `json:"comment,omitempty" url:"comment,omitempty"` +} + +// VirtualEnvironmentClusterIPSetUpdateRequestBody contains the data for an IPSet update request. +type VirtualEnvironmentClusterIPSetUpdateRequestBody struct { + ReName string `json:"rename,omitempty" url:"rename,omitempty"` + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetGetResponseData contains list of IPSets from +type VirtualEnvironmentClusterIPSetListResponseData struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetContent is an array of VirtualEnvironmentClusterIPSetGetResponseData. +type VirtualEnvironmentClusterIPSetContent []VirtualEnvironmentClusterIPSetGetResponseData diff --git a/proxmoxtf/provider.go b/proxmoxtf/provider.go index 7d2b514f..eb9f3052 100644 --- a/proxmoxtf/provider.go +++ b/proxmoxtf/provider.go @@ -63,6 +63,7 @@ func Provider() *schema.Provider { "proxmox_virtual_environment_time": resourceVirtualEnvironmentTime(), "proxmox_virtual_environment_user": resourceVirtualEnvironmentUser(), "proxmox_virtual_environment_vm": resourceVirtualEnvironmentVM(), + "proxmox_virtual_environment_cluster_ipset": resourceVirtualEnvironmentClusterIPSet(), }, Schema: map[string]*schema.Schema{ mkProviderVirtualEnvironment: { diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset.go b/proxmoxtf/resource_virtual_environment_cluster_ipset.go new file mode 100644 index 00000000..52e036fd --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset.go @@ -0,0 +1,273 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform/helper/schema" + "strings" +) + +const ( + dvResourceVirtualEnvironmentClusterIPSetComment = "" + dvResourceVirtualEnvironmentClusterIPSetNoMatch = false + + mkResourceVirtualEnvironmentClusterIPSet = "ipset" + mkResourceVirtualEnvironmentClusterIPSetCIDR = "cidr" + mkResourceVirtualEnvironmentClusterIPSetName = "name" + mkResourceVirtualEnvironmentClusterIPSetComment = "comment" + mkResourceVirtualEnvironmentClusterIPSetNoMatch = "nomatch" +) + +func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterIPSetName: { + Type: schema.TypeString, + Description: "IPSet name", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterIPSet: { + Type: schema.TypeList, + Description: "List of IP or Networks", + Optional: true, + ForceNew: true, + DefaultFunc: func() (interface{}, error) { + return []interface{}{}, nil + }, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterIPSetCIDR: { + Type: schema.TypeString, + Description: "Network/IP specification in CIDR format", + Required: true, + ForceNew: true, + }, + mkResourceVirtualEnvironmentClusterIPSetNoMatch: { + Type: schema.TypeBool, + Description: "No match this IP/CIDR", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetNoMatch, + ForceNew: true, + }, + mkResourceVirtualEnvironmentClusterIPSetComment: { + Type: schema.TypeString, + Description: "IP/CIDR comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetComment, + ForceNew: true, + }, + }, + }, + }, + mkResourceVirtualEnvironmentClusterIPSetComment: { + Type: schema.TypeString, + Description: "IPSet comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetComment, + }, + }, + Create: resourceVirtualEnvironmentClusterIPSetCreate, + Read: resourceVirtualEnvironmentClusterIPSetRead, + Update: resourceVirtualEnvironmentClusterIPSetUpdate, + Delete: resourceVirtualEnvironmentClusterIPSetDelete, + } +} + +func resourceVirtualEnvironmentClusterIPSetCreate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetComment).(string) + name := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) + + IPSets := d.Get(mkResourceVirtualEnvironmentClusterIPSet).([]interface{}) + IPSetsArray := make(proxmox.VirtualEnvironmentClusterIPSetContent, len(IPSets)) + + for i, v := range IPSets { + IPSetMap := v.(map[string]interface{}) + IPSetObject := proxmox.VirtualEnvironmentClusterIPSetGetResponseData{} + + cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDR].(string) + noMatch := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetNoMatch].(bool) + comment := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetComment].(string) + + + IPSetObject.Comment = comment + IPSetObject.CIDR = cidr + + if noMatch { + noMatchBool := proxmox.CustomBool(true) + IPSetObject.NoMatch = &noMatchBool + } + + + IPSetsArray[i] = IPSetObject + } + + body := &proxmox.VirtualEnvironmentClusterIPSetCreateRequestBody{ + Comment: comment, + Name: name, + } + + err = veClient.CreateIPSet(body) + + if err != nil { + return err + } + + for _, v := range IPSetsArray { + err = veClient.AddCIDRToIPSet(name, &v) + + if err != nil { + return err + } + } + + d.SetId(name) + return resourceVirtualEnvironmentClusterIPSetRead(d, m) +} + +func resourceVirtualEnvironmentClusterIPSetRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + name := d.Id() + + allIPSets, err := veClient.GetListIPSets() + + if err != nil { + return err + } + + for _, v := range allIPSets.Data { + if v.Name == name { + err = d.Set(mkResourceVirtualEnvironmentClusterIPSetName, v.Name) + + if err != nil { + return err + } + + err = d.Set(mkResourceVirtualEnvironmentClusterIPSetComment, v.Comment) + + if err != nil { + return err + } + } + } + + + IPSet, err := veClient.GetListIPSetContent(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + for key, _ := range IPSet { + d.Set(mkResourceVirtualEnvironmentClusterIPSet, IPSet[key]) + } + + return nil +} + +func resourceVirtualEnvironmentClusterIPSetUpdate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetComment).(string) + newName := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) + previousName := d.Id() + + body := &proxmox.VirtualEnvironmentClusterIPSetUpdateRequestBody{ + ReName: previousName, + Name: newName, + Comment: &comment, + } + + err = veClient.UpdateIPSet(body) + + if err != nil { + return err + } + + d.SetId(newName) + + return resourceVirtualEnvironmentClusterIPSetRead(d, m) +} + + +func resourceVirtualEnvironmentClusterIPSetDelete(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return nil + } + + name := d.Id() + + IPSetContent, err := veClient.GetListIPSetContent(name) + + if err != nil { + return err + } + + // PVE requires content of IPSet be cleared before removal + if len(IPSetContent) > 0 { + for _, IPSet := range IPSetContent { + err = veClient.DeleteIPSetContent(name, IPSet.CIDR) + if err != nil { + return err + } + } + } + + err = veClient.DeleteIPSet(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + d.SetId("") + + return nil +} + + + + + + + + + + + + + + diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go new file mode 100644 index 00000000..75c9022a --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/hashicorp/terraform/helper/schema" + "testing" +) + +// TestResourceVirtualEnvironmentIPSetInstantiation tests whether the resourceVirtualEnvironmentClusterIPSet +// instance can be instantiated. +func TestResourceVirtualEnvironmentIPSetInstantiation(t *testing.T) { + s := resourceVirtualEnvironmentClusterIPSet() + + if s == nil { + t.Fatalf("Cannot instantiate resourceVirtualEnvironmentAlias") + } +} + +// TestResourceVirtualEnvironmentIPSetSchema tests the resourceVirtualEnvironmentClusterIPSet schema. +func TestResourceVirtualEnvironmentIPSetSchema(t *testing.T) { + s := resourceVirtualEnvironmentClusterIPSet() + + testRequiredArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterIPSetName, + }) + + testOptionalArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterIPSet, + mkResourceVirtualEnvironmentClusterIPSetComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterIPSetName: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSet: schema.TypeList, + mkResourceVirtualEnvironmentClusterIPSetComment: schema.TypeString, + }) + + IPSetSchema := testNestedSchemaExistence(t, s, mkResourceVirtualEnvironmentClusterIPSet) + + testRequiredArguments(t, IPSetSchema, []string{ + mkResourceVirtualEnvironmentClusterIPSetCIDR, + }) + + testOptionalArguments(t, IPSetSchema, []string{ + mkResourceVirtualEnvironmentClusterIPSetComment, + mkResourceVirtualEnvironmentClusterIPSetNoMatch, + }) + + testValueTypes(t, IPSetSchema, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterIPSetCIDR: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetComment: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetNoMatch: schema.TypeBool, + }) + +} From 4597175e5cbc7583e693ee157c97d35f73c12f12 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 13 Dec 2020 12:25:02 +0800 Subject: [PATCH 07/42] provider: Migrate to standalone terraform plugin SDK 1.9.1 --- go.mod | 4 +- go.sum | 41 +++++++++++++++++++ main.go | 4 +- ...a_source_virtual_environment_datastores.go | 2 +- ...rce_virtual_environment_datastores_test.go | 2 +- .../data_source_virtual_environment_dns.go | 2 +- ...ata_source_virtual_environment_dns_test.go | 2 +- .../data_source_virtual_environment_group.go | 2 +- ...a_source_virtual_environment_group_test.go | 2 +- .../data_source_virtual_environment_groups.go | 2 +- ..._source_virtual_environment_groups_test.go | 2 +- .../data_source_virtual_environment_hosts.go | 2 +- ...a_source_virtual_environment_hosts_test.go | 2 +- .../data_source_virtual_environment_nodes.go | 2 +- ...a_source_virtual_environment_nodes_test.go | 2 +- .../data_source_virtual_environment_pool.go | 2 +- ...ta_source_virtual_environment_pool_test.go | 2 +- .../data_source_virtual_environment_pools.go | 2 +- ...a_source_virtual_environment_pools_test.go | 2 +- .../data_source_virtual_environment_role.go | 2 +- ...ta_source_virtual_environment_role_test.go | 2 +- .../data_source_virtual_environment_roles.go | 2 +- ...a_source_virtual_environment_roles_test.go | 2 +- .../data_source_virtual_environment_time.go | 2 +- ...ta_source_virtual_environment_time_test.go | 2 +- .../data_source_virtual_environment_user.go | 2 +- ...ta_source_virtual_environment_user_test.go | 2 +- .../data_source_virtual_environment_users.go | 2 +- ...a_source_virtual_environment_users_test.go | 2 +- ...data_source_virtual_environment_version.go | 2 +- ...source_virtual_environment_version_test.go | 2 +- proxmoxtf/provider.go | 2 +- proxmoxtf/provider_test.go | 2 +- ...esource_virtual_environment_certificate.go | 2 +- ...ce_virtual_environment_certificate_test.go | 2 +- .../resource_virtual_environment_container.go | 4 +- ...urce_virtual_environment_container_test.go | 2 +- proxmoxtf/resource_virtual_environment_dns.go | 2 +- .../resource_virtual_environment_dns_test.go | 2 +- .../resource_virtual_environment_file.go | 2 +- .../resource_virtual_environment_file_test.go | 2 +- .../resource_virtual_environment_group.go | 2 +- ...resource_virtual_environment_group_test.go | 2 +- .../resource_virtual_environment_hosts.go | 2 +- ...resource_virtual_environment_hosts_test.go | 2 +- .../resource_virtual_environment_pool.go | 2 +- .../resource_virtual_environment_pool_test.go | 2 +- .../resource_virtual_environment_role.go | 2 +- .../resource_virtual_environment_role_test.go | 2 +- .../resource_virtual_environment_time.go | 2 +- .../resource_virtual_environment_time_test.go | 2 +- .../resource_virtual_environment_user.go | 4 +- .../resource_virtual_environment_user_test.go | 2 +- proxmoxtf/resource_virtual_environment_vm.go | 4 +- .../resource_virtual_environment_vm_test.go | 2 +- proxmoxtf/utils.go | 4 +- 56 files changed, 102 insertions(+), 61 deletions(-) diff --git a/go.mod b/go.mod index 40ff9fcf..75bf38dc 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.13 require ( github.com/google/go-querystring v1.0.0 - github.com/hashicorp/terraform v0.12.23 + github.com/hashicorp/terraform-plugin-sdk v1.9.1 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/pkg/sftp v1.11.0 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 - google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 + google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a ) diff --git a/go.sum b/go.sum index e94fd28d..8c2dc249 100644 --- a/go.sum +++ b/go.sum @@ -34,6 +34,7 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= @@ -67,6 +68,7 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -85,6 +87,8 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -105,7 +109,11 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -138,17 +146,23 @@ github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuD github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= +github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f h1:Yv9YzBlAETjy6AOX9eLBZ3nshNVRREgerT/3nvxlGho= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26 h1:hRho44SAoNu1CBtn5r8Q9J3rCs4ZverWZ4R+UeeNuWM= github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.2 h1:AoISa4P4IsW0/m4T6St8Yw38gTl5GtBAgfkhYh1xAz4= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= @@ -168,21 +182,30 @@ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= github.com/hashicorp/terraform v0.12.23 h1:3fTWHq6JkHk4VJ8Z6A+8MvvAVtlSXbXViPJSWLuSNAk= github.com/hashicorp/terraform v0.12.23/go.mod h1:eJcloDEx5ywM4a1tetIuVrlqklM0bUVRYJBYAh4CYzA= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-plugin-sdk v1.9.1 h1:AgHnd6yPCg7o57XWrv4L7tIMdF0KQpcZro1pDHF1Xbw= +github.com/hashicorp/terraform-plugin-sdk v1.9.1/go.mod h1:C/AXwmDHqbc3h6URiHpIsVKrwV4PS0Sh0+VTaeEkShw= +github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -249,6 +272,8 @@ github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4a github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= @@ -258,6 +283,7 @@ github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -272,6 +298,7 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -285,6 +312,8 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M= github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -353,6 +382,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= @@ -380,6 +411,8 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -394,6 +427,7 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -413,11 +447,17 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a h1:lRlI5zu6AFy3iU/F8YWyNrAmn/tPCnhiTxfwhWb76eU= +google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -430,4 +470,5 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/main.go b/main.go index d6fa5732..68efbdab 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ package main import ( "github.com/danitso/terraform-provider-proxmox/proxmoxtf" - "github.com/hashicorp/terraform/plugin" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-sdk/plugin" + "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func main() { diff --git a/proxmoxtf/data_source_virtual_environment_datastores.go b/proxmoxtf/data_source_virtual_environment_datastores.go index 890440b5..d1f3a519 100644 --- a/proxmoxtf/data_source_virtual_environment_datastores.go +++ b/proxmoxtf/data_source_virtual_environment_datastores.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "fmt" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_datastores_test.go b/proxmoxtf/data_source_virtual_environment_datastores_test.go index 8f20951e..401a5c20 100644 --- a/proxmoxtf/data_source_virtual_environment_datastores_test.go +++ b/proxmoxtf/data_source_virtual_environment_datastores_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_dns.go b/proxmoxtf/data_source_virtual_environment_dns.go index 9d4df2d5..945a2756 100644 --- a/proxmoxtf/data_source_virtual_environment_dns.go +++ b/proxmoxtf/data_source_virtual_environment_dns.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "fmt" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_dns_test.go b/proxmoxtf/data_source_virtual_environment_dns_test.go index 47dfe3b8..a2793225 100644 --- a/proxmoxtf/data_source_virtual_environment_dns_test.go +++ b/proxmoxtf/data_source_virtual_environment_dns_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_group.go b/proxmoxtf/data_source_virtual_environment_group.go index 3e034111..592d70a5 100644 --- a/proxmoxtf/data_source_virtual_environment_group.go +++ b/proxmoxtf/data_source_virtual_environment_group.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_group_test.go b/proxmoxtf/data_source_virtual_environment_group_test.go index d7639443..8b978480 100644 --- a/proxmoxtf/data_source_virtual_environment_group_test.go +++ b/proxmoxtf/data_source_virtual_environment_group_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentGroupInstantiation tests whether the DataSourceVirtualEnvironmentGroup instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_groups.go b/proxmoxtf/data_source_virtual_environment_groups.go index 4d4a6b5a..2239345a 100644 --- a/proxmoxtf/data_source_virtual_environment_groups.go +++ b/proxmoxtf/data_source_virtual_environment_groups.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_groups_test.go b/proxmoxtf/data_source_virtual_environment_groups_test.go index 32bf5eba..d98fccc1 100644 --- a/proxmoxtf/data_source_virtual_environment_groups_test.go +++ b/proxmoxtf/data_source_virtual_environment_groups_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_hosts.go b/proxmoxtf/data_source_virtual_environment_hosts.go index af13d17f..5f6927e4 100644 --- a/proxmoxtf/data_source_virtual_environment_hosts.go +++ b/proxmoxtf/data_source_virtual_environment_hosts.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_hosts_test.go b/proxmoxtf/data_source_virtual_environment_hosts_test.go index 35be566e..669a7d59 100644 --- a/proxmoxtf/data_source_virtual_environment_hosts_test.go +++ b/proxmoxtf/data_source_virtual_environment_hosts_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_nodes.go b/proxmoxtf/data_source_virtual_environment_nodes.go index 56000aba..fc9a5aee 100644 --- a/proxmoxtf/data_source_virtual_environment_nodes.go +++ b/proxmoxtf/data_source_virtual_environment_nodes.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "math" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_nodes_test.go b/proxmoxtf/data_source_virtual_environment_nodes_test.go index ff9c2bf2..eb8141e3 100644 --- a/proxmoxtf/data_source_virtual_environment_nodes_test.go +++ b/proxmoxtf/data_source_virtual_environment_nodes_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentNodesInstantiation tests whether the DataSourceVirtualEnvironmentNodes instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_pool.go b/proxmoxtf/data_source_virtual_environment_pool.go index 828a5400..4059f87a 100644 --- a/proxmoxtf/data_source_virtual_environment_pool.go +++ b/proxmoxtf/data_source_virtual_environment_pool.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_pool_test.go b/proxmoxtf/data_source_virtual_environment_pool_test.go index d9cca8ef..6a9106de 100644 --- a/proxmoxtf/data_source_virtual_environment_pool_test.go +++ b/proxmoxtf/data_source_virtual_environment_pool_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentPoolInstantiation tests whether the DataSourceVirtualEnvironmentPool instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_pools.go b/proxmoxtf/data_source_virtual_environment_pools.go index 8c8fb660..77f7b60e 100644 --- a/proxmoxtf/data_source_virtual_environment_pools.go +++ b/proxmoxtf/data_source_virtual_environment_pools.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_pools_test.go b/proxmoxtf/data_source_virtual_environment_pools_test.go index c3f1e8d8..d2af8194 100644 --- a/proxmoxtf/data_source_virtual_environment_pools_test.go +++ b/proxmoxtf/data_source_virtual_environment_pools_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentPoolsInstantiation tests whether the DataSourceVirtualEnvironmentPools instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_role.go b/proxmoxtf/data_source_virtual_environment_role.go index 844bffc9..288d81ea 100644 --- a/proxmoxtf/data_source_virtual_environment_role.go +++ b/proxmoxtf/data_source_virtual_environment_role.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_role_test.go b/proxmoxtf/data_source_virtual_environment_role_test.go index 90a983c6..ddbac565 100644 --- a/proxmoxtf/data_source_virtual_environment_role_test.go +++ b/proxmoxtf/data_source_virtual_environment_role_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentRoleInstantiation tests whether the DataSourceVirtualEnvironmentRole instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_roles.go b/proxmoxtf/data_source_virtual_environment_roles.go index 79d5899f..297f8a94 100644 --- a/proxmoxtf/data_source_virtual_environment_roles.go +++ b/proxmoxtf/data_source_virtual_environment_roles.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_roles_test.go b/proxmoxtf/data_source_virtual_environment_roles_test.go index a3059179..fa375e96 100644 --- a/proxmoxtf/data_source_virtual_environment_roles_test.go +++ b/proxmoxtf/data_source_virtual_environment_roles_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_time.go b/proxmoxtf/data_source_virtual_environment_time.go index 3b562565..b05a3e9c 100644 --- a/proxmoxtf/data_source_virtual_environment_time.go +++ b/proxmoxtf/data_source_virtual_environment_time.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_time_test.go b/proxmoxtf/data_source_virtual_environment_time_test.go index 73337086..a45ba030 100644 --- a/proxmoxtf/data_source_virtual_environment_time_test.go +++ b/proxmoxtf/data_source_virtual_environment_time_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentTimeInstantiation tests whether the DataSourceVirtualEnvironmentRoles instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_user.go b/proxmoxtf/data_source_virtual_environment_user.go index 13e4028a..7755dd82 100644 --- a/proxmoxtf/data_source_virtual_environment_user.go +++ b/proxmoxtf/data_source_virtual_environment_user.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_user_test.go b/proxmoxtf/data_source_virtual_environment_user_test.go index ff2846b1..9353cfac 100644 --- a/proxmoxtf/data_source_virtual_environment_user_test.go +++ b/proxmoxtf/data_source_virtual_environment_user_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentUserInstantiation tests whether the DataSourceVirtualEnvironmentUser instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_users.go b/proxmoxtf/data_source_virtual_environment_users.go index cdabdfef..d7b85105 100644 --- a/proxmoxtf/data_source_virtual_environment_users.go +++ b/proxmoxtf/data_source_virtual_environment_users.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_users_test.go b/proxmoxtf/data_source_virtual_environment_users_test.go index d14d257d..376c36b2 100644 --- a/proxmoxtf/data_source_virtual_environment_users_test.go +++ b/proxmoxtf/data_source_virtual_environment_users_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentUsersInstantiation tests whether the DataSourceVirtualEnvironmentUsers instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_version.go b/proxmoxtf/data_source_virtual_environment_version.go index 0d079228..be12638b 100644 --- a/proxmoxtf/data_source_virtual_environment_version.go +++ b/proxmoxtf/data_source_virtual_environment_version.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_version_test.go b/proxmoxtf/data_source_virtual_environment_version_test.go index 6d935a13..30e1fe03 100644 --- a/proxmoxtf/data_source_virtual_environment_version_test.go +++ b/proxmoxtf/data_source_virtual_environment_version_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentVersionInstantiation tests whether the DataSourceVirtualEnvironmentVersion instance can be instantiated. diff --git a/proxmoxtf/provider.go b/proxmoxtf/provider.go index 7d2b514f..0a02f02a 100644 --- a/proxmoxtf/provider.go +++ b/proxmoxtf/provider.go @@ -10,7 +10,7 @@ import ( "os" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/provider_test.go b/proxmoxtf/provider_test.go index ce5f2432..fd994a35 100644 --- a/proxmoxtf/provider_test.go +++ b/proxmoxtf/provider_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestProviderInstantiation() tests whether the Provider instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_certificate.go b/proxmoxtf/resource_virtual_environment_certificate.go index 42dfc0cc..79a81ff0 100644 --- a/proxmoxtf/resource_virtual_environment_certificate.go +++ b/proxmoxtf/resource_virtual_environment_certificate.go @@ -10,7 +10,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_certificate_test.go b/proxmoxtf/resource_virtual_environment_certificate_test.go index 3692b128..9a5e2140 100644 --- a/proxmoxtf/resource_virtual_environment_certificate_test.go +++ b/proxmoxtf/resource_virtual_environment_certificate_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentCertificateInstantiation tests whether the ResourceVirtualEnvironmentCertificate instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_container.go b/proxmoxtf/resource_virtual_environment_container.go index 6ff8be89..c9f5b8d5 100644 --- a/proxmoxtf/resource_virtual_environment_container.go +++ b/proxmoxtf/resource_virtual_environment_container.go @@ -10,8 +10,8 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_container_test.go b/proxmoxtf/resource_virtual_environment_container_test.go index 409b358a..e29bc367 100644 --- a/proxmoxtf/resource_virtual_environment_container_test.go +++ b/proxmoxtf/resource_virtual_environment_container_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentContainerInstantiation tests whether the ResourceVirtualEnvironmentContainer instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_dns.go b/proxmoxtf/resource_virtual_environment_dns.go index 63ee205e..b4e294cf 100644 --- a/proxmoxtf/resource_virtual_environment_dns.go +++ b/proxmoxtf/resource_virtual_environment_dns.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_dns_test.go b/proxmoxtf/resource_virtual_environment_dns_test.go index dbf17270..b7ea37a1 100644 --- a/proxmoxtf/resource_virtual_environment_dns_test.go +++ b/proxmoxtf/resource_virtual_environment_dns_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentDNSInstantiation tests whether the ResourceVirtualEnvironmentDNS instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_file.go b/proxmoxtf/resource_virtual_environment_file.go index badde67e..c00f918f 100644 --- a/proxmoxtf/resource_virtual_environment_file.go +++ b/proxmoxtf/resource_virtual_environment_file.go @@ -20,7 +20,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_file_test.go b/proxmoxtf/resource_virtual_environment_file_test.go index 562aff69..23e7534b 100644 --- a/proxmoxtf/resource_virtual_environment_file_test.go +++ b/proxmoxtf/resource_virtual_environment_file_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentFileInstantiation tests whether the ResourceVirtualEnvironmentFile instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_group.go b/proxmoxtf/resource_virtual_environment_group.go index a3a3e105..0c619b8f 100644 --- a/proxmoxtf/resource_virtual_environment_group.go +++ b/proxmoxtf/resource_virtual_environment_group.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_group_test.go b/proxmoxtf/resource_virtual_environment_group_test.go index 8efd2ab4..028710e9 100644 --- a/proxmoxtf/resource_virtual_environment_group_test.go +++ b/proxmoxtf/resource_virtual_environment_group_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentGroupInstantiation tests whether the ResourceVirtualEnvironmentGroup instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_hosts.go b/proxmoxtf/resource_virtual_environment_hosts.go index 914ed9e1..7da84462 100644 --- a/proxmoxtf/resource_virtual_environment_hosts.go +++ b/proxmoxtf/resource_virtual_environment_hosts.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_hosts_test.go b/proxmoxtf/resource_virtual_environment_hosts_test.go index 5bb9ba61..9cc2b9a7 100644 --- a/proxmoxtf/resource_virtual_environment_hosts_test.go +++ b/proxmoxtf/resource_virtual_environment_hosts_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentHostsInstantiation tests whether the ResourceVirtualEnvironmentHosts instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_pool.go b/proxmoxtf/resource_virtual_environment_pool.go index a40b4fd3..f5b76f82 100644 --- a/proxmoxtf/resource_virtual_environment_pool.go +++ b/proxmoxtf/resource_virtual_environment_pool.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_pool_test.go b/proxmoxtf/resource_virtual_environment_pool_test.go index 044c0e8c..138c4122 100644 --- a/proxmoxtf/resource_virtual_environment_pool_test.go +++ b/proxmoxtf/resource_virtual_environment_pool_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentPoolInstantiation tests whether the ResourceVirtualEnvironmentPool instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_role.go b/proxmoxtf/resource_virtual_environment_role.go index 50b2f755..b87731b2 100644 --- a/proxmoxtf/resource_virtual_environment_role.go +++ b/proxmoxtf/resource_virtual_environment_role.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_role_test.go b/proxmoxtf/resource_virtual_environment_role_test.go index 149dd7e5..9331cdb6 100644 --- a/proxmoxtf/resource_virtual_environment_role_test.go +++ b/proxmoxtf/resource_virtual_environment_role_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentRoleInstantiation tests whether the ResourceVirtualEnvironmentRole instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_time.go b/proxmoxtf/resource_virtual_environment_time.go index bdd11379..7a644408 100644 --- a/proxmoxtf/resource_virtual_environment_time.go +++ b/proxmoxtf/resource_virtual_environment_time.go @@ -9,7 +9,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_time_test.go b/proxmoxtf/resource_virtual_environment_time_test.go index fe4d9121..0e0fda82 100644 --- a/proxmoxtf/resource_virtual_environment_time_test.go +++ b/proxmoxtf/resource_virtual_environment_time_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentTimeInstantiation tests whether the ResourceVirtualEnvironmentTime instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_user.go b/proxmoxtf/resource_virtual_environment_user.go index b1c6d7f6..f2c50ef7 100644 --- a/proxmoxtf/resource_virtual_environment_user.go +++ b/proxmoxtf/resource_virtual_environment_user.go @@ -9,8 +9,8 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_user_test.go b/proxmoxtf/resource_virtual_environment_user_test.go index 34e00d7e..68b3bdf0 100644 --- a/proxmoxtf/resource_virtual_environment_user_test.go +++ b/proxmoxtf/resource_virtual_environment_user_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentUserInstantiation tests whether the ResourceVirtualEnvironmentUser instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..e8c7de08 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -12,8 +12,8 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_vm_test.go b/proxmoxtf/resource_virtual_environment_vm_test.go index db0fa213..ddb5a5a5 100644 --- a/proxmoxtf/resource_virtual_environment_vm_test.go +++ b/proxmoxtf/resource_virtual_environment_vm_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentVMInstantiation tests whether the ResourceVirtualEnvironmentVM instance can be instantiated. diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index c755b9b9..8c7e9dae 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) func getBIOSValidator() schema.SchemaValidateFunc { From 7eac54086a2ad19f399ac5b74448cd61c9702933 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Sat, 12 Dec 2020 22:06:48 -0800 Subject: [PATCH 08/42] fixing started diff --- proxmoxtf/resource_virtual_environment_vm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..9eefb0ad 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -2915,7 +2915,9 @@ func resourceVirtualEnvironmentVMReadPrimitiveValues(d *schema.ResourceData, m i } } - d.Set(mkResourceVirtualEnvironmentVMStarted, vmStatus.Status == "running") + if d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) != true { + d.Set(mkResourceVirtualEnvironmentVMStarted, vmStatus.Status == "running") + } currentTabletDevice := d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool) From b5ff37af74fd8d8f37dd8d53355189b0f199a426 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Sat, 12 Dec 2020 23:09:37 -0800 Subject: [PATCH 09/42] fix initialization diff --- proxmoxtf/resource_virtual_environment_vm.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..ff301b6e 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -2519,7 +2519,9 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ ipConfigList[ipConfigIndex] = ipConfigItem } - initialization[mkResourceVirtualEnvironmentVMInitializationIPConfig] = ipConfigList[:ipConfigLast+1] + if ipConfigLast >= 0 { + initialization[mkResourceVirtualEnvironmentVMInitializationIPConfig] = ipConfigList[:ipConfigLast+1] + } if vmConfig.CloudInitPassword != nil || vmConfig.CloudInitSSHKeys != nil || vmConfig.CloudInitUsername != nil { initializationUserAccount := map[string]interface{}{} @@ -2551,7 +2553,7 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ } else { initialization[mkResourceVirtualEnvironmentVMInitializationUserDataFileID] = "" } - } else { + } else if len(initialization) > 0 { initialization[mkResourceVirtualEnvironmentVMInitializationUserDataFileID] = "" } From fd85eb85cb7e26ae3cefc10fe65831f6aa2a5b24 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Sun, 6 Dec 2020 18:13:26 -0800 Subject: [PATCH 10/42] adding citype support --- proxmoxtf/resource_virtual_environment_vm.go | 22 ++++++++++++++++++++ proxmoxtf/utils.go | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..12bcdc4d 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -55,6 +55,7 @@ const ( dvResourceVirtualEnvironmentVMInitializationIPConfigIPv6Gateway = "" dvResourceVirtualEnvironmentVMInitializationUserAccountPassword = "" dvResourceVirtualEnvironmentVMInitializationUserDataFileID = "" + dvResourceVirtualEnvironmentVMInitializationType = "" dvResourceVirtualEnvironmentVMKeyboardLayout = "en-us" dvResourceVirtualEnvironmentVMMemoryDedicated = 512 dvResourceVirtualEnvironmentVMMemoryFloating = 0 @@ -131,6 +132,7 @@ const ( mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6 = "ipv6" mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6Address = "address" mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6Gateway = "gateway" + mkResourceVirtualEnvironmentVMInitializationType = "type" mkResourceVirtualEnvironmentVMInitializationUserAccount = "user_account" mkResourceVirtualEnvironmentVMInitializationUserAccountKeys = "keys" mkResourceVirtualEnvironmentVMInitializationUserAccountPassword = "password" @@ -674,6 +676,14 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Default: dvResourceVirtualEnvironmentVMInitializationUserDataFileID, ValidateFunc: getFileIDValidator(), }, + mkResourceVirtualEnvironmentVMInitializationType: { + Type: schema.TypeString, + Description: "The cloud-init configuration format", + Optional: true, + ForceNew: true, + Default: dvResourceVirtualEnvironmentVMInitializationType, + ValidateFunc: getCloudInitTypeValidator(), + }, }, }, MaxItems: 1, @@ -1854,6 +1864,12 @@ func resourceVirtualEnvironmentVMGetCloudInitConfig(d *schema.ResourceData, m in UserVolume: &initializationUserDataFileID, } } + + initializationType := initializationBlock[mkResourceVirtualEnvironmentVMInitializationType].(string) + + if initializationType != "" { + initializationConfig.Type = &initializationType + } } return initializationConfig, nil @@ -2555,6 +2571,12 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ initialization[mkResourceVirtualEnvironmentVMInitializationUserDataFileID] = "" } + if vmConfig.CloudInitType != nil { + initialization[mkResourceVirtualEnvironmentVMInitializationType] = *vmConfig.CloudInitType + } else if len(initialization) > 0 { + initialization[mkResourceVirtualEnvironmentVMInitializationType] = "" + } + currentInitialization := d.Get(mkResourceVirtualEnvironmentVMInitialization).([]interface{}) if len(clone) > 0 { diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index c755b9b9..e4a847c4 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -370,6 +370,13 @@ func getVMIDValidator() schema.SchemaValidateFunc { } } +func getCloudInitTypeValidator() schema.SchemaValidateFunc { + return validation.StringInSlice([]string{ + "configdrive2", + "nocloud", + }, false) +} + func testComputedAttributes(t *testing.T, s *schema.Resource, keys []string) { for _, v := range keys { if s.Schema[v] == nil { From 30560ac133f5dc1cc2da3fbda6c684eb3cca1dcc Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Mon, 14 Dec 2020 21:07:07 -0500 Subject: [PATCH 11/42] fix: rename `ipset` block to `cidr` --- .../proxmox_virtual_environment_ipset.md | 16 ++--- ...ource_virtual_environment_cluster_ipset.tf | 12 ++-- ...ource_virtual_environment_cluster_ipset.go | 62 +++++++++---------- ..._virtual_environment_cluster_ipset_test.go | 24 +++---- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md b/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md index 9a1a8daf..998a569a 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md +++ b/docs/resources/virtual_environment/proxmox_virtual_environment_ipset.md @@ -18,19 +18,19 @@ resource "proxmox_virtual_environment_cluster_ipset" "ipset" { name = "local_network" comment = "Managed by Terraform" - ipset { - cidr = "192.168.0.0/23" + cidr { + name = "192.168.0.0/23" comment = "Local network 1" } - ipset { - cidr = "192.168.0.1" + cidr { + name = "192.168.0.1" comment = "Server 1" nomatch = true } - ipset { - cidr = "192.168.2.1" + cidr { + name = "192.168.2.1" comment = "Server 1" } } @@ -40,8 +40,8 @@ resource "proxmox_virtual_environment_cluster_ipset" "ipset" { * `name` - (Required) Alias name. * `comment` - (Optional) Alias comment. -* `ipset` - (Optional) IP/CIDR block (multiple blocks supported). - * `cidr` - Network/IP specification in CIDR format. +* `cidr` - (Optional) IP/CIDR block (multiple blocks supported). + * `name` - Network/IP specification in CIDR format. * `comment` - (Optional) Arbitrary string annotation. * `nomatch` - (Optional) Entries marked as `nomatch` are skipped as if those were not added to the set. diff --git a/example/resource_virtual_environment_cluster_ipset.tf b/example/resource_virtual_environment_cluster_ipset.tf index 63bbcc96..5d81f53c 100644 --- a/example/resource_virtual_environment_cluster_ipset.tf +++ b/example/resource_virtual_environment_cluster_ipset.tf @@ -2,19 +2,19 @@ resource "proxmox_virtual_environment_cluster_ipset" "example" { name = "local_network" comment = "Managed by Terraform" - ipset { - cidr = "192.168.0.0/23" + cidr { + name = "192.168.0.0/23" comment = "Local network 1" } - ipset { - cidr = "192.168.0.1" + cidr { + name = "192.168.0.1" comment = "Server 1" nomatch = true } - ipset { - cidr = "192.168.2.1" + cidr { + name = "192.168.2.1" comment = "Server 1" } } diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset.go b/proxmoxtf/resource_virtual_environment_cluster_ipset.go index 52e036fd..78a4ff97 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_ipset.go +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset.go @@ -11,14 +11,14 @@ import ( ) const ( - dvResourceVirtualEnvironmentClusterIPSetComment = "" - dvResourceVirtualEnvironmentClusterIPSetNoMatch = false + dvResourceVirtualEnvironmentClusterIPSetCIDRComment = "" + dvResourceVirtualEnvironmentClusterIPSetCIDRNoMatch = false - mkResourceVirtualEnvironmentClusterIPSet = "ipset" - mkResourceVirtualEnvironmentClusterIPSetCIDR = "cidr" - mkResourceVirtualEnvironmentClusterIPSetName = "name" - mkResourceVirtualEnvironmentClusterIPSetComment = "comment" - mkResourceVirtualEnvironmentClusterIPSetNoMatch = "nomatch" + mkResourceVirtualEnvironmentClusterIPSetName = "name" + mkResourceVirtualEnvironmentClusterIPSetCIDR = "cidr" + mkResourceVirtualEnvironmentClusterIPSetCIDRName = "name" + mkResourceVirtualEnvironmentClusterIPSetCIDRComment = "comment" + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch = "nomatch" ) func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { @@ -30,7 +30,7 @@ func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { Required: true, ForceNew: false, }, - mkResourceVirtualEnvironmentClusterIPSet: { + mkResourceVirtualEnvironmentClusterIPSetCIDR: { Type: schema.TypeList, Description: "List of IP or Networks", Optional: true, @@ -40,34 +40,34 @@ func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - mkResourceVirtualEnvironmentClusterIPSetCIDR: { + mkResourceVirtualEnvironmentClusterIPSetCIDRName: { Type: schema.TypeString, Description: "Network/IP specification in CIDR format", Required: true, ForceNew: true, }, - mkResourceVirtualEnvironmentClusterIPSetNoMatch: { - Type: schema.TypeBool, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch: { + Type: schema.TypeBool, Description: "No match this IP/CIDR", - Optional: true, - Default: dvResourceVirtualEnvironmentClusterIPSetNoMatch, - ForceNew: true, + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRNoMatch, + ForceNew: true, }, - mkResourceVirtualEnvironmentClusterIPSetComment: { - Type: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: { + Type: schema.TypeString, Description: "IP/CIDR comment", - Optional: true, - Default: dvResourceVirtualEnvironmentClusterIPSetComment, - ForceNew: true, + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRComment, + ForceNew: true, }, }, }, }, - mkResourceVirtualEnvironmentClusterIPSetComment: { - Type: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: { + Type: schema.TypeString, Description: "IPSet comment", - Optional: true, - Default: dvResourceVirtualEnvironmentClusterIPSetComment, + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRComment, }, }, Create: resourceVirtualEnvironmentClusterIPSetCreate, @@ -85,19 +85,19 @@ func resourceVirtualEnvironmentClusterIPSetCreate(d *schema.ResourceData, m inte return err } - comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetComment).(string) + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDRComment).(string) name := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) - IPSets := d.Get(mkResourceVirtualEnvironmentClusterIPSet).([]interface{}) + IPSets := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDR).([]interface{}) IPSetsArray := make(proxmox.VirtualEnvironmentClusterIPSetContent, len(IPSets)) for i, v := range IPSets { IPSetMap := v.(map[string]interface{}) IPSetObject := proxmox.VirtualEnvironmentClusterIPSetGetResponseData{} - cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDR].(string) - noMatch := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetNoMatch].(bool) - comment := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetComment].(string) + cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRName].(string) + noMatch := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch].(bool) + comment := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRComment].(string) IPSetObject.Comment = comment @@ -159,7 +159,7 @@ func resourceVirtualEnvironmentClusterIPSetRead(d *schema.ResourceData, m interf return err } - err = d.Set(mkResourceVirtualEnvironmentClusterIPSetComment, v.Comment) + err = d.Set(mkResourceVirtualEnvironmentClusterIPSetCIDRComment, v.Comment) if err != nil { return err @@ -180,7 +180,7 @@ func resourceVirtualEnvironmentClusterIPSetRead(d *schema.ResourceData, m interf } for key, _ := range IPSet { - d.Set(mkResourceVirtualEnvironmentClusterIPSet, IPSet[key]) + d.Set(mkResourceVirtualEnvironmentClusterIPSetCIDR, IPSet[key]) } return nil @@ -194,7 +194,7 @@ func resourceVirtualEnvironmentClusterIPSetUpdate(d *schema.ResourceData, m inte return err } - comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetComment).(string) + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDRComment).(string) newName := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) previousName := d.Id() diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go index 75c9022a..024376da 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go @@ -28,31 +28,31 @@ func TestResourceVirtualEnvironmentIPSetSchema(t *testing.T) { }) testOptionalArguments(t, s, []string{ - mkResourceVirtualEnvironmentClusterIPSet, - mkResourceVirtualEnvironmentClusterIPSetComment, + mkResourceVirtualEnvironmentClusterIPSetCIDR, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment, }) testValueTypes(t, s, map[string]schema.ValueType{ - mkResourceVirtualEnvironmentClusterIPSetName: schema.TypeString, - mkResourceVirtualEnvironmentClusterIPSet: schema.TypeList, - mkResourceVirtualEnvironmentClusterIPSetComment: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetName: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDR: schema.TypeList, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: schema.TypeString, }) - IPSetSchema := testNestedSchemaExistence(t, s, mkResourceVirtualEnvironmentClusterIPSet) + IPSetSchema := testNestedSchemaExistence(t, s, mkResourceVirtualEnvironmentClusterIPSetCIDR) testRequiredArguments(t, IPSetSchema, []string{ - mkResourceVirtualEnvironmentClusterIPSetCIDR, + mkResourceVirtualEnvironmentClusterIPSetCIDRName, }) testOptionalArguments(t, IPSetSchema, []string{ - mkResourceVirtualEnvironmentClusterIPSetComment, - mkResourceVirtualEnvironmentClusterIPSetNoMatch, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch, }) testValueTypes(t, IPSetSchema, map[string]schema.ValueType{ - mkResourceVirtualEnvironmentClusterIPSetCIDR: schema.TypeString, - mkResourceVirtualEnvironmentClusterIPSetComment: schema.TypeString, - mkResourceVirtualEnvironmentClusterIPSetNoMatch: schema.TypeBool, + mkResourceVirtualEnvironmentClusterIPSetCIDRName: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch: schema.TypeBool, }) } From 51e8f9b62119bc60931b5b9a52c67b601ea73c9c Mon Sep 17 00:00:00 2001 From: Alex Kulikovskikh Date: Thu, 17 Dec 2020 09:50:42 -0500 Subject: [PATCH 12/42] Fix `vm` resource --- proxmoxtf/resource_virtual_environment_vm.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..5ef4633e 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -1503,7 +1503,6 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac KeyboardLayout: &keyboardLayout, NetworkDevices: networkDeviceObjects, OSType: &operatingSystemType, - PoolID: &poolID, SCSIDevices: diskDeviceObjects, SCSIHardware: &scsiHardware, SerialDevices: serialDevices, @@ -1532,6 +1531,10 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac createBody.Name = &name } + if poolID != "" { + createBody.PoolID = &poolID + } + err = veClient.CreateVM(nodeName, createBody) if err != nil { @@ -3011,7 +3014,12 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e } name := d.Get(mkResourceVirtualEnvironmentVMName).(string) - updateBody.Name = &name + + if name == "" { + delete = append(delete, "name") + } else { + updateBody.Name = &name + } if d.HasChange(mkResourceVirtualEnvironmentVMTabletDevice) { tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) From 7642a319ce0bd098bad70c9b588dac2a34296b0a Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sun, 22 Mar 2020 00:56:55 +0100 Subject: [PATCH 13/42] Support for moving and resizing disks - Utilize asynchronous Functions for proxmox --- proxmox/virtual_environment_nodes.go | 43 +++ proxmox/virtual_environment_nodes_types.go | 11 + proxmox/virtual_environment_vm.go | 175 ++++++++- proxmox/virtual_environment_vm_types.go | 70 +++- proxmoxtf/resource_virtual_environment_vm.go | 353 +++++++++++++++---- proxmoxtf/utils.go | 75 ++++ 6 files changed, 649 insertions(+), 78 deletions(-) diff --git a/proxmox/virtual_environment_nodes.go b/proxmox/virtual_environment_nodes.go index da114aed..dd8468af 100644 --- a/proxmox/virtual_environment_nodes.go +++ b/proxmox/virtual_environment_nodes.go @@ -10,6 +10,7 @@ import ( "net/url" "sort" "strings" + "time" "golang.org/x/crypto/ssh" ) @@ -88,6 +89,22 @@ func (c *VirtualEnvironmentClient) GetNodeTime(nodeName string) (*VirtualEnviron return resBody.Data, nil } +// GetNodeTaskStatus retrieves the status of a node task. +func (c *VirtualEnvironmentClient) GetNodeTaskStatus(nodeName string, upid string) (*VirtualEnvironmentNodeGetTaskStatusResponseData, error) { + resBody := &VirtualEnvironmentNodeGetTaskStatusResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("nodes/%s/tasks/%s/status", url.PathEscape(nodeName), url.PathEscape(upid)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + // ListNodeNetworkDevices retrieves a list of network devices for a specific nodes. func (c *VirtualEnvironmentClient) ListNodeNetworkDevices(nodeName string) ([]*VirtualEnvironmentNodeNetworkDeviceListResponseData, error) { resBody := &VirtualEnvironmentNodeNetworkDeviceListResponseBody{} @@ -157,3 +174,29 @@ func (c *VirtualEnvironmentClient) OpenNodeShell(nodeName string) (*ssh.Client, func (c *VirtualEnvironmentClient) UpdateNodeTime(nodeName string, d *VirtualEnvironmentNodeUpdateTimeRequestBody) error { return c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/time", url.PathEscape(nodeName)), d, nil) } + +// WaitForNodeTask waits for a specific node task to complete. +func (c *VirtualEnvironmentClient) WaitForNodeTask(nodeName string, upid string, timeout int, delay int) error { + timeDelay := int64(delay) + timeMax := float64(timeout) + timeStart := time.Now() + timeElapsed := timeStart.Sub(timeStart) + + for timeElapsed.Seconds() < timeMax { + if int64(timeElapsed.Seconds())%timeDelay == 0 { + status, err := c.GetNodeTaskStatus(nodeName, upid) + + if err == nil && status.Status != "running" { + return nil + } + + time.Sleep(1 * time.Second) + } + + time.Sleep(200 * time.Millisecond) + + timeElapsed = time.Now().Sub(timeStart) + } + + return fmt.Errorf("Timeout while waiting for task \"%s\" on node \"%s\" to complete", upid, nodeName) +} diff --git a/proxmox/virtual_environment_nodes_types.go b/proxmox/virtual_environment_nodes_types.go index 66e6cdd0..262398d2 100644 --- a/proxmox/virtual_environment_nodes_types.go +++ b/proxmox/virtual_environment_nodes_types.go @@ -29,6 +29,17 @@ type VirtualEnvironmentNodeGetTimeResponseData struct { UTCTime CustomTimestamp `json:"time"` } +// VirtualEnvironmentNodeGetTaskStatusResponseBody contains the body from a node get task status response. +type VirtualEnvironmentNodeGetTaskStatusResponseBody struct { + Data *VirtualEnvironmentNodeGetTaskStatusResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentNodeGetTaskStatusResponseData contains the data from a node get task status response. +type VirtualEnvironmentNodeGetTaskStatusResponseData struct { + PID int `json:"pid,omitempty"` + Status string `json:"status,omitempty"` +} + // VirtualEnvironmentNodeListResponseBody contains the body from a node list response. type VirtualEnvironmentNodeListResponseBody struct { Data []*VirtualEnvironmentNodeListResponseData `json:"data,omitempty"` diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 8993977b..c35bf5ff 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -130,6 +130,39 @@ func (c *VirtualEnvironmentClient) GetVMStatus(nodeName string, vmID int) (*Virt return resBody.Data, nil } +// MoveVMDisk moves a virtual machine disk. +func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody) error { + taskID, err := c.MoveVMDiskAsync(nodeName, vmID, d) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, 86400, 5) + + if err != nil { + return err + } + + return nil +} + +// MoveVMDiskAsync moves a virtual machine disk asynchronously. +func (c *VirtualEnvironmentClient) MoveVMDiskAsync(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/move_disk", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + // ListVMs retrieves a list of virtual machines. func (c *VirtualEnvironmentClient) ListVMs() ([]*VirtualEnvironmentVMListResponseData, error) { return nil, errors.New("Not implemented") @@ -137,22 +170,139 @@ func (c *VirtualEnvironmentClient) ListVMs() ([]*VirtualEnvironmentVMListRespons // RebootVM reboots a virtual machine. func (c *VirtualEnvironmentClient) RebootVM(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/reboot", url.PathEscape(nodeName), vmID), d, nil) + taskID, err := c.RebootVMAsync(nodeName, vmID, d) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + + if err != nil { + return err + } + + return nil +} + +// RebootVMAsync reboots a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) RebootVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMRebootResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/reboot", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// ResizeVMDisk resizes a virtual machine disk. +func (c *VirtualEnvironmentClient) ResizeVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMResizeDiskRequestBody) error { + return c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/qemu/%d/resize", url.PathEscape(nodeName), vmID), d, nil) } // ShutdownVM shuts down a virtual machine. func (c *VirtualEnvironmentClient) ShutdownVM(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/shutdown", url.PathEscape(nodeName), vmID), d, nil) + taskID, err := c.ShutdownVMAsync(nodeName, vmID, d) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + + if err != nil { + return err + } + + return nil +} + +// ShutdownVMAsync shuts down a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) ShutdownVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMShutdownResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/shutdown", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // StartVM starts a virtual machine. func (c *VirtualEnvironmentClient) StartVM(nodeName string, vmID int) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/start", url.PathEscape(nodeName), vmID), nil, nil) + taskID, err := c.StartVMAsync(nodeName, vmID) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + + if err != nil { + return err + } + + return nil } -// StopVM stops a virtual machine immediately. +// StartVMAsync starts a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) StartVMAsync(nodeName string, vmID int) (*string, error) { + resBody := &VirtualEnvironmentVMStartResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/start", url.PathEscape(nodeName), vmID), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// StopVM stops a virtual machine. func (c *VirtualEnvironmentClient) StopVM(nodeName string, vmID int) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/stop", url.PathEscape(nodeName), vmID), nil, nil) + taskID, err := c.StopVMAsync(nodeName, vmID) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, 300, 5) + + if err != nil { + return err + } + + return nil +} + +// StopVMAsync stops a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) StopVMAsync(nodeName string, vmID int) (*string, error) { + resBody := &VirtualEnvironmentVMStopResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/stop", url.PathEscape(nodeName), vmID), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // UpdateVM updates a virtual machine. @@ -161,8 +311,19 @@ func (c *VirtualEnvironmentClient) UpdateVM(nodeName string, vmID int, d *Virtua } // UpdateVMAsync updates a virtual machine asynchronously. -func (c *VirtualEnvironmentClient) UpdateVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMUpdateRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/config", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) UpdateVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMUpdateRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMUpdateAsyncResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/config", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // WaitForNetworkInterfacesFromVMAgent waits for a virtual machine's QEMU agent to publish the network interfaces. diff --git a/proxmox/virtual_environment_vm_types.go b/proxmox/virtual_environment_vm_types.go index 89f28297..ae2be692 100644 --- a/proxmox/virtual_environment_vm_types.go +++ b/proxmox/virtual_environment_vm_types.go @@ -162,6 +162,7 @@ type CustomStorageDevice struct { MaxWriteSpeedMbps *int `json:"mbps_wr,omitempty" url:"mbps_wr,omitempty"` Media *string `json:"media,omitempty" url:"media,omitempty"` Size *string `json:"size,omitempty" url:"size,omitempty"` + Format *string `json:"format,omitempty" url:"format,omitempty"` } // CustomStorageDevices handles QEMU SATA device parameters. @@ -280,7 +281,7 @@ type VirtualEnvironmentVMCreateRequestBody struct { USBDevices CustomUSBDevices `json:"usb,omitempty" url:"usb,omitempty"` VGADevice *CustomVGADevice `json:"vga,omitempty" url:"vga,omitempty"` VirtualCPUCount *int `json:"vcpus,omitempty" url:"vcpus,omitempty"` - VirtualIODevices CustomVirtualIODevices `json:"virtio,omitempty" url:"virtio,omitempty"` + VirtualIODevices CustomStorageDevices `json:"virtio,omitempty" url:"virtio,omitempty"` VMGenerationID *string `json:"vmgenid,omitempty" url:"vmgenid,omitempty"` VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"` VMStateDatastoreID *string `json:"vmstatestorage,omitempty" url:"vmstatestorage,omitempty"` @@ -440,7 +441,22 @@ type VirtualEnvironmentVMGetResponseData struct { USBDevices *CustomUSBDevices `json:"usb,omitempty"` VGADevice *CustomVGADevice `json:"vga,omitempty"` VirtualCPUCount *int `json:"vcpus,omitempty"` - VirtualIODevices *CustomVirtualIODevices `json:"virtio,omitempty"` + VirtualIODevice0 *CustomStorageDevice `json:"virtio0,omitempty"` + VirtualIODevice1 *CustomStorageDevice `json:"virtio1,omitempty"` + VirtualIODevice2 *CustomStorageDevice `json:"virtio2,omitempty"` + VirtualIODevice3 *CustomStorageDevice `json:"virtio3,omitempty"` + VirtualIODevice4 *CustomStorageDevice `json:"virtio4,omitempty"` + VirtualIODevice5 *CustomStorageDevice `json:"virtio5,omitempty"` + VirtualIODevice6 *CustomStorageDevice `json:"virtio6,omitempty"` + VirtualIODevice7 *CustomStorageDevice `json:"virtio7,omitempty"` + VirtualIODevice8 *CustomStorageDevice `json:"virtio8,omitempty"` + VirtualIODevice9 *CustomStorageDevice `json:"virtio9,omitempty"` + VirtualIODevice10 *CustomStorageDevice `json:"virtio10,omitempty"` + VirtualIODevice11 *CustomStorageDevice `json:"virtio11,omitempty"` + VirtualIODevice12 *CustomStorageDevice `json:"virtio12,omitempty"` + VirtualIODevice13 *CustomStorageDevice `json:"virtio13,omitempty"` + VirtualIODevice14 *CustomStorageDevice `json:"virtio14,omitempty"` + VirtualIODevice15 *CustomStorageDevice `json:"virtio15,omitempty"` VMGenerationID *string `json:"vmgenid,omitempty"` VMStateDatastoreID *string `json:"vmstatestorage,omitempty"` WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty"` @@ -478,11 +494,39 @@ type VirtualEnvironmentVMListResponseData struct { ACPI *CustomBool `json:"acpi,omitempty" url:"acpi,omitempty,int"` } +// VirtualEnvironmentVMMoveDiskRequestBody contains the body for a VM move disk request. +type VirtualEnvironmentVMMoveDiskRequestBody struct { + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + DeleteOriginalDisk *CustomBool `json:"delete,omitempty,int" url:"delete,omitempty,int"` + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + TargetStorage string `json:"storage" url:"storage"` + TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` +} + +// VirtualEnvironmentVMMoveDiskResponseBody contains the body from a VM move disk response. +type VirtualEnvironmentVMMoveDiskResponseBody struct { + Data *string `json:"data,omitempty"` +} + // VirtualEnvironmentVMRebootRequestBody contains the body for a VM reboot request. type VirtualEnvironmentVMRebootRequestBody struct { Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } +// VirtualEnvironmentVMRebootResponseBody contains the body from a VM reboot response. +type VirtualEnvironmentVMRebootResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMResizeDiskRequestBody contains the body for a VM resize disk request. +type VirtualEnvironmentVMResizeDiskRequestBody struct { + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + Size string `json:"size" url:"size"` + SkipLock *CustomBool `json:"skiplock,omitempty,int" url:"skiplock,omitempty,int"` +} + // VirtualEnvironmentVMShutdownRequestBody contains the body for a VM shutdown request. type VirtualEnvironmentVMShutdownRequestBody struct { ForceStop *CustomBool `json:"forceStop,omitempty,int" url:"forceStop,omitempty,int"` @@ -491,6 +535,26 @@ type VirtualEnvironmentVMShutdownRequestBody struct { Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } +// VirtualEnvironmentVMShutdownResponseBody contains the body from a VM shutdown response. +type VirtualEnvironmentVMShutdownResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMStartResponseBody contains the body from a VM start response. +type VirtualEnvironmentVMStartResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMStopResponseBody contains the body from a VM stop response. +type VirtualEnvironmentVMStopResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMUpdateAsyncResponseBody contains the body from a VM async update response. +type VirtualEnvironmentVMUpdateAsyncResponseBody struct { + Data *string `json:"data,omitempty"` +} + // VirtualEnvironmentVMUpdateRequestBody contains the data for an virtual machine update request. type VirtualEnvironmentVMUpdateRequestBody VirtualEnvironmentVMCreateRequestBody @@ -1497,6 +1561,8 @@ func (r *CustomStorageDevice) UnmarshalJSON(b []byte) error { r.Media = &v[1] case "size": r.Size = &v[1] + case "format": + r.Format = &v[1] } } } diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac09..37e58b8d 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -5,6 +5,7 @@ package proxmoxtf import ( + "errors" "fmt" "math" "strconv" @@ -38,6 +39,7 @@ const ( dvResourceVirtualEnvironmentVMCPUType = "qemu64" dvResourceVirtualEnvironmentVMCPUUnits = 1024 dvResourceVirtualEnvironmentVMDescription = "" + dvResourcevirtualEnvironmentVMDiskInterface = "" dvResourceVirtualEnvironmentVMDiskDatastoreID = "local-lvm" dvResourceVirtualEnvironmentVMDiskFileFormat = "qcow2" dvResourceVirtualEnvironmentVMDiskFileID = "" @@ -110,6 +112,7 @@ const ( mkResourceVirtualEnvironmentVMCPUUnits = "units" mkResourceVirtualEnvironmentVMDescription = "description" mkResourceVirtualEnvironmentVMDisk = "disk" + mkResourcevirtualEnvironmentVMDiskInterface = "interface" mkResourceVirtualEnvironmentVMDiskDatastoreID = "datastore_id" mkResourceVirtualEnvironmentVMDiskFileFormat = "file_format" mkResourceVirtualEnvironmentVMDiskFileID = "file_id" @@ -432,17 +435,23 @@ func resourceVirtualEnvironmentVM() *schema.Resource { mkResourceVirtualEnvironmentVMDiskDatastoreID: dvResourceVirtualEnvironmentVMDiskDatastoreID, mkResourceVirtualEnvironmentVMDiskFileFormat: dvResourceVirtualEnvironmentVMDiskFileFormat, mkResourceVirtualEnvironmentVMDiskFileID: dvResourceVirtualEnvironmentVMDiskFileID, + mkResourcevirtualEnvironmentVMDiskInterface: dvResourcevirtualEnvironmentVMDiskInterface, mkResourceVirtualEnvironmentVMDiskSize: dvResourceVirtualEnvironmentVMDiskSize, }, }, nil }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourcevirtualEnvironmentVMDiskInterface: { + Type: schema.TypeString, + Description: "The datastore name", + Optional: true, + Default: dvResourcevirtualEnvironmentVMDiskInterface, + }, mkResourceVirtualEnvironmentVMDiskDatastoreID: { Type: schema.TypeString, Description: "The datastore id", Optional: true, - ForceNew: true, Default: dvResourceVirtualEnvironmentVMDiskDatastoreID, }, mkResourceVirtualEnvironmentVMDiskFileFormat: { @@ -465,7 +474,6 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Type: schema.TypeInt, Description: "The disk size in gigabytes", Optional: true, - ForceNew: true, Default: dvResourceVirtualEnvironmentVMDiskSize, ValidateFunc: validation.IntBetween(1, 8192), }, @@ -1284,11 +1292,77 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface updateBody.Delete = delete err = veClient.UpdateVM(nodeName, vmID, updateBody) - if err != nil { return err } + disk := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) + + vmConfig, err := veClient.GetVM(nodeName, vmID) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") || + (strings.Contains(err.Error(), "HTTP 500") && strings.Contains(err.Error(), "does not exist")) { + d.SetId("") + + return nil + } + + return err + } + + allDiskInfo := getDiskInfo(vmConfig) + + for i := range disk { + + diskBlock := disk[i].(map[string]interface{}) + diskInterface := diskBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + dataStoreID := diskBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) + diskSize := diskBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) + + currentDiskInfo := allDiskInfo[diskInterface] + + if currentDiskInfo == nil { + return errors.New(fmt.Sprintf("Disk move failed, no disk named %s", diskInterface)) + } + + compareString := *currentDiskInfo.Size + compareSize := len(compareString) + compareNumber, err := strconv.Atoi(compareString[:compareSize-1]) + + if err != nil { + return errors.New(fmt.Sprintf("Disk resize failed, vm disk size could not be converted to int disk size = %s", *currentDiskInfo.Size)) + } + + if diskSize < compareNumber { + return errors.New(fmt.Sprintf("Disk resize fails requests size (%dG) is lower than current size (%s)", diskSize, *currentDiskInfo.Size)) + } + + deleteOriginalDisk := proxmox.CustomBool(true) + diskMoveBody := &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ + DeleteOriginalDisk: &deleteOriginalDisk, + Disk: diskInterface, + TargetStorage: dataStoreID, + } + + diskResizeBody := &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ + Disk: diskInterface, + Size: fmt.Sprintf("%dG", diskSize), + } + + err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody) + + if err != nil { + return err + } + + err = veClient.ResizeVMDisk(nodeName, vmID, diskResizeBody) + + if err != nil { + return err + } + } + return resourceVirtualEnvironmentVMCreateStart(d, m) } @@ -1359,6 +1433,11 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac return err } + virtioDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "virtio") + scsiDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "scsi") + //ideDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "ide") + sataDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "sata") + initializationConfig, err := resourceVirtualEnvironmentVMGetCloudInitConfig(d, m) if err != nil { @@ -1504,7 +1583,6 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac NetworkDevices: networkDeviceObjects, OSType: &operatingSystemType, PoolID: &poolID, - SCSIDevices: diskDeviceObjects, SCSIHardware: &scsiHardware, SerialDevices: serialDevices, SharedMemory: memorySharedObject, @@ -1515,6 +1593,25 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac VMID: &vmID, } + if sataDeviceObjects != nil { + createBody.SATADevices = sataDeviceObjects + } + + if scsiDeviceObjects != nil { + createBody.SCSIDevices = scsiDeviceObjects + } + + if virtioDeviceObjects != nil { + createBody.VirtualIODevices = virtioDeviceObjects + } + + //this will most likely break the cdrom part + /* + if ideDevices != nil { + createBody.IDEDevices = ideDeviceObjects + } + */ + // Only the root account is allowed to change the CPU architecture, which makes this check necessary. if veClient.Username == proxmox.DefaultRootAccount || cpuArchitecture != dvResourceVirtualEnvironmentVMCPUArchitecture { createBody.CPUArchitecture = &cpuArchitecture @@ -1713,12 +1810,6 @@ func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface return err } - err = veClient.WaitForVMState(nodeName, vmID, "running", 120, 5) - - if err != nil { - return err - } - return resourceVirtualEnvironmentVMRead(d, m) } @@ -1866,12 +1957,13 @@ func resourceVirtualEnvironmentVMGetCPUArchitectureValidator() schema.SchemaVali }, false) } -func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}) (proxmox.CustomStorageDevices, error) { +func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}) (map[string]map[string]proxmox.CustomStorageDevice, error) { diskDevice := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) - diskDeviceObjects := make(proxmox.CustomStorageDevices, len(diskDevice)) + diskDeviceObjects := make(map[string]map[string]proxmox.CustomStorageDevice) resource := resourceVirtualEnvironmentVM() + scsiDefaultCount := 0 - for i, diskEntry := range diskDevice { + for _, diskEntry := range diskDevice { diskDevice := proxmox.CustomStorageDevice{ Enabled: true, } @@ -1880,6 +1972,7 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m datastoreID, _ := block[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) fileID, _ := block[mkResourceVirtualEnvironmentVMDiskFileID].(string) size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) + diskInterface, _ := block[mkResourcevirtualEnvironmentVMDiskInterface].(string) speedBlock, err := getSchemaBlock(resource, d, m, []string{mkResourceVirtualEnvironmentVMDisk, mkResourceVirtualEnvironmentVMDiskSpeed}, 0, false) @@ -1916,7 +2009,24 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m } } - diskDeviceObjects[i] = diskDevice + // only for backwards compatibility + if diskInterface == "" { + diskInterface = fmt.Sprintf("scsi%d", scsiDefaultCount) + scsiDefaultCount = scsiDefaultCount + 1 + } + + baseDiskInterface := diskDigitPrefix(diskInterface) + + if baseDiskInterface != "virtio" && baseDiskInterface != "scsi" && baseDiskInterface != "sata" && baseDiskInterface != "ide" { + errorMsg := fmt.Sprintf("Defined disk interface not supported. Interface was %s, but only virtio, sata, scsi, and ide are supported", diskInterface) + return diskDeviceObjects, errors.New(errorMsg) + } + + if _, present := diskDeviceObjects[baseDiskInterface]; !present { + diskDeviceObjects[baseDiskInterface] = make(map[string]proxmox.CustomStorageDevice) + } + + diskDeviceObjects[baseDiskInterface][diskInterface] = diskDevice } return diskDeviceObjects, nil @@ -3149,35 +3259,63 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e return err } - scsiDevices := []*proxmox.CustomStorageDevice{ - vmConfig.SCSIDevice0, - vmConfig.SCSIDevice1, - vmConfig.SCSIDevice2, - vmConfig.SCSIDevice3, - vmConfig.SCSIDevice4, - vmConfig.SCSIDevice5, - vmConfig.SCSIDevice6, - vmConfig.SCSIDevice7, - vmConfig.SCSIDevice8, - vmConfig.SCSIDevice9, - vmConfig.SCSIDevice10, - vmConfig.SCSIDevice11, - vmConfig.SCSIDevice12, - vmConfig.SCSIDevice13, - } + diskDeviceInfo := getDiskInfo(vmConfig) - updateBody.SCSIDevices = make(proxmox.CustomStorageDevices, len(diskDeviceObjects)) + for prefix, diskMap := range diskDeviceObjects { + index := 0 - for di, do := range diskDeviceObjects { - if scsiDevices[di] == nil { - return fmt.Errorf("Missing SCSI device %d (scsi%d)", di, di) + if diskMap == nil { + continue } - updateBody.SCSIDevices[di] = *scsiDevices[di] - updateBody.SCSIDevices[di].BurstableReadSpeedMbps = do.BurstableReadSpeedMbps - updateBody.SCSIDevices[di].BurstableWriteSpeedMbps = do.BurstableWriteSpeedMbps - updateBody.SCSIDevices[di].MaxReadSpeedMbps = do.MaxReadSpeedMbps - updateBody.SCSIDevices[di].MaxWriteSpeedMbps = do.MaxWriteSpeedMbps + for key, value := range diskMap { + if diskDeviceInfo[key] == nil { + return fmt.Errorf("Missing %s device %s", prefix, key) + } + + switch prefix { + case "virtio": + { + if updateBody.VirtualIODevices == nil { + updateBody.VirtualIODevices = make(proxmox.CustomStorageDevices, len(diskMap)) + } + updateBody.VirtualIODevices[index] = *diskDeviceInfo[key] + updateBody.VirtualIODevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps + updateBody.VirtualIODevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps + updateBody.VirtualIODevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps + updateBody.VirtualIODevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + } + case "sata": + { + if updateBody.SATADevices == nil { + updateBody.SATADevices = make(proxmox.CustomStorageDevices, len(diskMap)) + } + updateBody.SATADevices[index] = *diskDeviceInfo[key] + updateBody.SATADevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps + updateBody.SATADevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps + updateBody.SATADevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps + updateBody.SATADevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + } + case "scsi": + { + if updateBody.SCSIDevices == nil { + updateBody.SCSIDevices = make(proxmox.CustomStorageDevices, len(diskMap)) + } + updateBody.SCSIDevices[index] = *diskDeviceInfo[key] + updateBody.SCSIDevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps + updateBody.SCSIDevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps + updateBody.SCSIDevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps + updateBody.SCSIDevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + } + case "ide": + { + //not sure right now + } + default: + return fmt.Errorf("Device prefix %s not supported", prefix) + } + index = index + 1 + } } rebootRequired = true @@ -3324,12 +3462,6 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e if err != nil { return err } - - err = veClient.WaitForVMState(nodeName, vmID, "running", 120, 5) - - if err != nil { - return err - } } else { forceStop := proxmox.CustomBool(true) shutdownTimeout := 300 @@ -3343,36 +3475,125 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e return err } - err = veClient.WaitForVMState(nodeName, vmID, "stopped", 30, 5) - - if err != nil { - return err - } - rebootRequired = false } } - // Reboot the virtual machine, if required. - if !bool(template) && rebootRequired { + // Change the disk locations and/or sizes, if necessary. + return resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d, m, vmConfig, !bool(template) && rebootRequired) +} + +func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceData, m interface{}, vmConfig *proxmox.VirtualEnvironmentVMGetResponseData, reboot bool) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + nodeName := d.Get(mkResourceVirtualEnvironmentVMNodeName).(string) + started := d.Get(mkResourceVirtualEnvironmentVMStarted).(bool) + template := d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) + vmID, err := strconv.Atoi(d.Id()) + + if err != nil { + return err + } + + // Determine if any of the disks are changing location and/or size, and initiate the necessary actions. + if d.HasChange(mkResourceVirtualEnvironmentVMDisk) { + diskOld, diskNew := d.GetChange(mkResourceVirtualEnvironmentVMDisk) + + diskOldEntries := diskOld.([]interface{}) + diskNewEntries := diskNew.([]interface{}) + + diskMoveBodies := []*proxmox.VirtualEnvironmentVMMoveDiskRequestBody{} + diskResizeBodies := []*proxmox.VirtualEnvironmentVMResizeDiskRequestBody{} + + for i := range diskOldEntries { + diskOldBlock := diskOldEntries[i].(map[string]interface{}) + diskNewBlock := diskNewEntries[i].(map[string]interface{}) + + diskOldDatastoreID := diskOldBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) + diskOldName := diskOldBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + + diskNewDatastoreID := diskNewBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) + + if diskOldDatastoreID != diskNewDatastoreID { + deleteOriginalDisk := proxmox.CustomBool(true) + + diskMoveBodies = append(diskMoveBodies, &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ + DeleteOriginalDisk: &deleteOriginalDisk, + Disk: diskOldName, + TargetStorage: diskNewDatastoreID, + }) + } + + diskOldSize := diskOldBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) + diskNewSize := diskNewBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) + + if diskOldSize != diskNewSize { + diskResizeBodies = append(diskResizeBodies, &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ + Disk: diskOldName, + Size: fmt.Sprintf("%dG", diskNewSize), + }) + } + } + + if len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0 { + if !template { + forceStop := proxmox.CustomBool(true) + shutdownTimeout := 300 + + err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ + ForceStop: &forceStop, + Timeout: &shutdownTimeout, + }) + + if err != nil { + return err + } + } + + reboot = false + } + + for _, reqBody := range diskMoveBodies { + err = veClient.MoveVMDisk(nodeName, vmID, reqBody) + + if err != nil { + return err + } + } + + for _, reqBody := range diskResizeBodies { + err = veClient.ResizeVMDisk(nodeName, vmID, reqBody) + + if err != nil { + return err + } + } + + if (len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0) && started && !template { + err = veClient.StartVM(nodeName, vmID) + + if err != nil { + return err + } + } + } + + // Perform a regular reboot in case it's necessary and haven't already been done. + if reboot { rebootTimeout := 300 - err = veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ + err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ Timeout: &rebootTimeout, }) if err != nil { return err } - - // Wait for the agent to unpublish the network interfaces, if it's enabled. - if vmConfig.Agent != nil && vmConfig.Agent.Enabled != nil && *vmConfig.Agent.Enabled { - err = veClient.WaitForNoNetworkInterfacesFromVMAgent(nodeName, vmID, 300, 5) - - if err != nil { - return err - } - } } return resourceVirtualEnvironmentVMRead(d, m) @@ -3412,12 +3633,6 @@ func resourceVirtualEnvironmentVMDelete(d *schema.ResourceData, m interface{}) e if err != nil { return err } - - err = veClient.WaitForVMState(nodeName, vmID, "stopped", 30, 5) - - if err != nil { - return err - } } err = veClient.DeleteVM(nodeName, vmID) diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index c755b9b9..0f963ca5 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -9,7 +9,9 @@ import ( "regexp" "testing" "time" + "unicode" + "github.com/danitso/terraform-provider-proxmox/proxmox" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" ) @@ -199,6 +201,15 @@ func getKeyboardLayoutValidator() schema.SchemaValidateFunc { }, false) } +func diskDigitPrefix(s string) string { + for i, r := range s { + if unicode.IsDigit(r) { + return s[:i] + } + } + return s +} + func getMACAddressValidator() schema.SchemaValidateFunc { return func(i interface{}, k string) (ws []string, es []error) { v, ok := i.(string) @@ -370,6 +381,70 @@ func getVMIDValidator() schema.SchemaValidateFunc { } } +func getOrderedDiskDeviceList(diskDeviceMap map[string]map[string]proxmox.CustomStorageDevice, diskInterface string) proxmox.CustomStorageDevices { + diskDevices := diskDeviceMap[diskInterface] + + if diskDevices == nil { + return nil + } + + orderedDiskList := make(proxmox.CustomStorageDevices, len(diskDevices)) + + for _, value := range diskDevices { + orderedDiskList = append(orderedDiskList, value) + } + + return orderedDiskList +} + +func getDiskInfo(data *proxmox.VirtualEnvironmentVMGetResponseData) map[string]*proxmox.CustomStorageDevice { + storageDevices := make(map[string]*proxmox.CustomStorageDevice) + storageDevices["ide0"] = data.IDEDevice0 + storageDevices["ide1"] = data.IDEDevice1 + storageDevices["ide2"] = data.IDEDevice2 + + storageDevices["sata0"] = data.SATADevice0 + storageDevices["sata1"] = data.SATADevice1 + storageDevices["sata2"] = data.SATADevice2 + storageDevices["sata3"] = data.SATADevice3 + storageDevices["sata4"] = data.SATADevice4 + storageDevices["sata5"] = data.SATADevice5 + + storageDevices["scsi0"] = data.SCSIDevice0 + storageDevices["scsi1"] = data.SCSIDevice1 + storageDevices["scsi2"] = data.SCSIDevice2 + storageDevices["scsi3"] = data.SCSIDevice3 + storageDevices["scsi4"] = data.SCSIDevice4 + storageDevices["scsi5"] = data.SCSIDevice5 + storageDevices["scsi6"] = data.SCSIDevice6 + storageDevices["scsi7"] = data.SCSIDevice7 + storageDevices["scsi8"] = data.SCSIDevice8 + storageDevices["scsi9"] = data.SCSIDevice9 + storageDevices["scsi10"] = data.SCSIDevice10 + storageDevices["scsi11"] = data.SCSIDevice11 + storageDevices["scsi12"] = data.SCSIDevice12 + storageDevices["scsi13"] = data.SCSIDevice13 + + storageDevices["virtio0"] = data.VirtualIODevice0 + storageDevices["virtio1"] = data.VirtualIODevice1 + storageDevices["virtio2"] = data.VirtualIODevice2 + storageDevices["virtio3"] = data.VirtualIODevice3 + storageDevices["virtio4"] = data.VirtualIODevice4 + storageDevices["virtio5"] = data.VirtualIODevice5 + storageDevices["virtio6"] = data.VirtualIODevice6 + storageDevices["virtio7"] = data.VirtualIODevice7 + storageDevices["virtio8"] = data.VirtualIODevice8 + storageDevices["virtio9"] = data.VirtualIODevice9 + storageDevices["virtio10"] = data.VirtualIODevice10 + storageDevices["virtio11"] = data.VirtualIODevice11 + storageDevices["virtio12"] = data.VirtualIODevice12 + storageDevices["virtio13"] = data.VirtualIODevice13 + storageDevices["virtio14"] = data.VirtualIODevice14 + storageDevices["virtio15"] = data.VirtualIODevice15 + + return storageDevices +} + func testComputedAttributes(t *testing.T, s *schema.Resource, keys []string) { for _, v := range keys { if s.Schema[v] == nil { From 51a71b44e38f5924665cab86681c763690003741 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Fri, 17 Apr 2020 11:50:14 +0200 Subject: [PATCH 14/42] added check for update disks --- proxmoxtf/resource_virtual_environment_vm.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index 37e58b8d..378a1feb 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -3515,7 +3515,12 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat diskNewBlock := diskNewEntries[i].(map[string]interface{}) diskOldDatastoreID := diskOldBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) - diskOldName := diskOldBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + diskOldInterface := diskOldBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + diskNewInterface := diskNewBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + + if diskNewInterface != diskOldInterface { + return fmt.Errorf("Alteration of disk interface is not supported. Old Interface was %s", diskOldInterface) + } diskNewDatastoreID := diskNewBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) @@ -3524,7 +3529,7 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat diskMoveBodies = append(diskMoveBodies, &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ DeleteOriginalDisk: &deleteOriginalDisk, - Disk: diskOldName, + Disk: diskOldInterface, TargetStorage: diskNewDatastoreID, }) } @@ -3532,9 +3537,9 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat diskOldSize := diskOldBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) diskNewSize := diskNewBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) - if diskOldSize != diskNewSize { + if diskOldSize <= diskNewSize { diskResizeBodies = append(diskResizeBodies, &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ - Disk: diskOldName, + Disk: diskOldInterface, Size: fmt.Sprintf("%dG", diskNewSize), }) } From 1798bade566af756d6675f5dcb1257a0ace18578 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Fri, 17 Apr 2020 16:18:37 +0200 Subject: [PATCH 15/42] added support to reboot vm after creation or clone --- proxmox/virtual_environment_nodes.go | 9 +- proxmox/virtual_environment_nodes_types.go | 5 +- proxmox/virtual_environment_vm.go | 37 +++++++- proxmox/virtual_environment_vm_types.go | 3 + proxmoxtf/resource_virtual_environment_vm.go | 89 ++++++++++++++------ 5 files changed, 112 insertions(+), 31 deletions(-) diff --git a/proxmox/virtual_environment_nodes.go b/proxmox/virtual_environment_nodes.go index dd8468af..b3dd78d6 100644 --- a/proxmox/virtual_environment_nodes.go +++ b/proxmox/virtual_environment_nodes.go @@ -186,7 +186,14 @@ func (c *VirtualEnvironmentClient) WaitForNodeTask(nodeName string, upid string, if int64(timeElapsed.Seconds())%timeDelay == 0 { status, err := c.GetNodeTaskStatus(nodeName, upid) - if err == nil && status.Status != "running" { + if err != nil { + return err + } + + if status.Status != "running" { + if status.ExitCode != "OK" { + return fmt.Errorf("Task \"%s\" on node \"%s\" failed to complete with error: %s", upid, nodeName, status.ExitCode) + } return nil } diff --git a/proxmox/virtual_environment_nodes_types.go b/proxmox/virtual_environment_nodes_types.go index 262398d2..f8b7d08e 100644 --- a/proxmox/virtual_environment_nodes_types.go +++ b/proxmox/virtual_environment_nodes_types.go @@ -36,8 +36,9 @@ type VirtualEnvironmentNodeGetTaskStatusResponseBody struct { // VirtualEnvironmentNodeGetTaskStatusResponseData contains the data from a node get task status response. type VirtualEnvironmentNodeGetTaskStatusResponseData struct { - PID int `json:"pid,omitempty"` - Status string `json:"status,omitempty"` + PID int `json:"pid,omitempty"` + Status string `json:"status,omitempty"` + ExitCode string `json:"exitstatus,omitempty"` } // VirtualEnvironmentNodeListResponseBody contains the body from a node list response. diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index c35bf5ff..7f45a1df 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -24,8 +24,30 @@ var ( ) // CloneVM clones a virtual machine. -func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, d *VirtualEnvironmentVMCloneRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/clone", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries int, d *VirtualEnvironmentVMCloneRequestBody) error { + resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} + var err error + + for i := 0; i < retries; i++ { + err = c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/clone", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return err + } + + if resBody.Data == nil { + return errors.New("The server did not include a data object in the response") + } + + err = c.WaitForNodeTask(nodeName, *resBody.Data, 1800, 5) + + if err == nil { + return nil + } + time.Sleep(10 * time.Second) + } + + return err } // CreateVM creates a virtual machine. @@ -203,7 +225,16 @@ func (c *VirtualEnvironmentClient) RebootVMAsync(nodeName string, vmID int, d *V // ResizeVMDisk resizes a virtual machine disk. func (c *VirtualEnvironmentClient) ResizeVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMResizeDiskRequestBody) error { - return c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/qemu/%d/resize", url.PathEscape(nodeName), vmID), d, nil) + var err error + for i := 0; i < 5; i++ { + err = c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/qemu/%d/resize", url.PathEscape(nodeName), vmID), d, nil) + if err == nil { + return nil + } + log.Printf("[DEBUG] resize disk failed, retry nr: %d", i) + time.Sleep(5 * time.Second) + } + return err } // ShutdownVM shuts down a virtual machine. diff --git a/proxmox/virtual_environment_vm_types.go b/proxmox/virtual_environment_vm_types.go index ae2be692..aea3f84c 100644 --- a/proxmox/virtual_environment_vm_types.go +++ b/proxmox/virtual_environment_vm_types.go @@ -163,6 +163,9 @@ type CustomStorageDevice struct { Media *string `json:"media,omitempty" url:"media,omitempty"` Size *string `json:"size,omitempty" url:"size,omitempty"` Format *string `json:"format,omitempty" url:"format,omitempty"` + Interface *string + ID *string + FileId *string } // CustomStorageDevices handles QEMU SATA device parameters. diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index 378a1feb..bc87a825 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -7,6 +7,7 @@ package proxmoxtf import ( "errors" "fmt" + "log" "math" "strconv" "strings" @@ -18,6 +19,7 @@ import ( ) const ( + dvResourceVirtualEnvironmentVMRebootAfterCreation = false dvResourceVirtualEnvironmentVMACPI = true dvResourceVirtualEnvironmentVMAgentEnabled = false dvResourceVirtualEnvironmentVMAgentTimeout = "15m" @@ -32,6 +34,7 @@ const ( dvResourceVirtualEnvironmentVMCloneDatastoreID = "" dvResourceVirtualEnvironmentVMCloneNodeName = "" dvResourceVirtualEnvironmentVMCloneFull = true + dvResourceVirtualEnvironmentVMCloneRetries = 0 dvResourceVirtualEnvironmentVMCPUArchitecture = "x86_64" dvResourceVirtualEnvironmentVMCPUCores = 1 dvResourceVirtualEnvironmentVMCPUHotplugged = 0 @@ -83,6 +86,7 @@ const ( maxResourceVirtualEnvironmentVMNetworkDevices = 8 maxResourceVirtualEnvironmentVMSerialDevices = 4 + mkResourceVirtualEnvironmentVMRebootAfterCreation = "reboot" mkResourceVirtualEnvironmentVMACPI = "acpi" mkResourceVirtualEnvironmentVMAgent = "agent" mkResourceVirtualEnvironmentVMAgentEnabled = "enabled" @@ -98,6 +102,7 @@ const ( mkResourceVirtualEnvironmentVMCDROMEnabled = "enabled" mkResourceVirtualEnvironmentVMCDROMFileID = "file_id" mkResourceVirtualEnvironmentVMClone = "clone" + mkResourceVirtualEnvironmentVMCloneRetries = "retries" mkResourceVirtualEnvironmentVMCloneDatastoreID = "datastore_id" mkResourceVirtualEnvironmentVMCloneNodeName = "node_name" mkResourceVirtualEnvironmentVMCloneVMID = "vm_id" @@ -175,6 +180,12 @@ const ( func resourceVirtualEnvironmentVM() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentVMRebootAfterCreation: { + Type: schema.TypeBool, + Description: "Wether to reboot vm after creation", + Optional: true, + Default: dvResourceVirtualEnvironmentVMRebootAfterCreation, + }, mkResourceVirtualEnvironmentVMACPI: { Type: schema.TypeBool, Description: "Whether to enable ACPI", @@ -310,6 +321,13 @@ func resourceVirtualEnvironmentVM() *schema.Resource { }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentVMCloneRetries: { + Type: schema.TypeInt, + Description: "The number of Retries to create a clone", + Optional: true, + ForceNew: true, + Default: dvResourceVirtualEnvironmentVMCloneRetries, + }, mkResourceVirtualEnvironmentVMCloneDatastoreID: { Type: schema.TypeString, Description: "The ID of the target datastore", @@ -987,6 +1005,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface clone := d.Get(mkResourceVirtualEnvironmentVMClone).([]interface{}) cloneBlock := clone[0].(map[string]interface{}) + cloneRetries := cloneBlock[mkResourceVirtualEnvironmentVMCloneRetries].(int) cloneDatastoreID := cloneBlock[mkResourceVirtualEnvironmentVMCloneDatastoreID].(string) cloneNodeName := cloneBlock[mkResourceVirtualEnvironmentVMCloneNodeName].(string) cloneVMID := cloneBlock[mkResourceVirtualEnvironmentVMCloneVMID].(int) @@ -1034,9 +1053,9 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface if cloneNodeName != "" && cloneNodeName != nodeName { cloneBody.TargetNodeName = &nodeName - err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneBody) + err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneRetries, cloneBody) } else { - err = veClient.CloneVM(nodeName, cloneVMID, cloneBody) + err = veClient.CloneVM(nodeName, cloneVMID, cloneRetries, cloneBody) } if err != nil { @@ -1784,6 +1803,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface{}) error { started := d.Get(mkResourceVirtualEnvironmentVMStarted).(bool) template := d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) + reboot := d.Get(mkResourceVirtualEnvironmentVMRebootAfterCreation).(bool) if !started || template { return resourceVirtualEnvironmentVMRead(d, m) @@ -1810,6 +1830,18 @@ func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface return err } + if reboot { + rebootTimeout := 300 + + err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ + Timeout: &rebootTimeout, + }) + + if err != nil { + return err + } + } + return resourceVirtualEnvironmentVMRead(d, m) } @@ -2415,30 +2447,34 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ } // Compare the disks to those stored in the state. - currentDisk := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) + currentDisks := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) diskList := []interface{}{} - diskObjects := []*proxmox.CustomStorageDevice{ - vmConfig.SCSIDevice0, - vmConfig.SCSIDevice1, - vmConfig.SCSIDevice2, - vmConfig.SCSIDevice3, - vmConfig.SCSIDevice4, - vmConfig.SCSIDevice5, - vmConfig.SCSIDevice6, - vmConfig.SCSIDevice7, - vmConfig.SCSIDevice8, - vmConfig.SCSIDevice9, - vmConfig.SCSIDevice10, - vmConfig.SCSIDevice11, - vmConfig.SCSIDevice12, - vmConfig.SCSIDevice13, + diskObjects := getDiskInfo(vmConfig) + + currentDiskMap := make(map[string]*proxmox.CustomStorageDevice) + + for _, dd := range currentDisks { + var disk proxmox.CustomStorageDevice + currentDiskEntry := dd.(map[string]interface{}) + + id := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) + diskInterface := currentDiskEntry[mkResourcevirtualEnvironmentVMDiskInterface].(string) + format := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileFormat].(string) + fileId := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileID].(string) + + disk.Interface = &diskInterface + disk.ID = &id + disk.Format = &format + disk.FileId = &fileId + + currentDiskMap[diskInterface] = &disk } for di, dd := range diskObjects { disk := map[string]interface{}{} - if dd == nil { + if dd == nil || strings.HasPrefix(di, "ide") { continue } @@ -2446,11 +2482,13 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ disk[mkResourceVirtualEnvironmentVMDiskDatastoreID] = fileIDParts[0] - if len(currentDisk) > di { - currentDiskEntry := currentDisk[di].(map[string]interface{}) + if val, ok := currentDiskMap[di]; ok { + if *val.FileId != "" { + disk[mkResourceVirtualEnvironmentVMDiskFileID] = val.FileId + } - disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileFormat] - disk[mkResourceVirtualEnvironmentVMDiskFileID] = currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileID] + disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = val.Format + disk[mkResourcevirtualEnvironmentVMDiskInterface] = val.Interface } diskSize := 0 @@ -2525,11 +2563,12 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ diskList = append(diskList, disk) } + log.Printf("[DEBUG] NUMBER CURRENT DISKS %d NUMBER READ DISKS %d", len(currentDisks), len(diskList)) if len(clone) > 0 { - if len(currentDisk) > 0 { + if len(currentDisks) > 0 || len(diskList) > 0 { d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) } - } else if len(currentDisk) > 0 || len(diskList) > 0 { + } else if len(currentDisks) > 0 || len(diskList) > 0 { d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) } From 328acd80df81a644fd939f931d5135b193ee1e9e Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Fri, 8 May 2020 09:02:11 +0200 Subject: [PATCH 16/42] set retries to default 1 and add guard --- proxmox/virtual_environment_vm.go | 5 +++++ proxmoxtf/resource_virtual_environment_vm.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 7f45a1df..9864827f 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -28,6 +28,11 @@ func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries in resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} var err error + // just a guard in case someone sets retries to 0 unknowingly + if retries <= 0 { + retries = 1 + } + for i := 0; i < retries; i++ { err = c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/clone", url.PathEscape(nodeName), vmID), d, resBody) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index bc87a825..fe7ac8de 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -34,7 +34,7 @@ const ( dvResourceVirtualEnvironmentVMCloneDatastoreID = "" dvResourceVirtualEnvironmentVMCloneNodeName = "" dvResourceVirtualEnvironmentVMCloneFull = true - dvResourceVirtualEnvironmentVMCloneRetries = 0 + dvResourceVirtualEnvironmentVMCloneRetries = 1 dvResourceVirtualEnvironmentVMCPUArchitecture = "x86_64" dvResourceVirtualEnvironmentVMCPUCores = 1 dvResourceVirtualEnvironmentVMCPUHotplugged = 0 From 6a08bb7329936ceff3b673d1f64993b0609a01e6 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 8 Jun 2020 10:38:07 +0200 Subject: [PATCH 17/42] Make disk interface a required attribute --- proxmoxtf/resource_virtual_environment_vm.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index fe7ac8de..ce415a3a 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -463,7 +463,7 @@ func resourceVirtualEnvironmentVM() *schema.Resource { mkResourcevirtualEnvironmentVMDiskInterface: { Type: schema.TypeString, Description: "The datastore name", - Optional: true, + Optional: false, Default: dvResourcevirtualEnvironmentVMDiskInterface, }, mkResourceVirtualEnvironmentVMDiskDatastoreID: { @@ -1624,7 +1624,7 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac createBody.VirtualIODevices = virtioDeviceObjects } - //this will most likely break the cdrom part + //this will most likely break the cdrom part thats why ide is disabled in line 2017 /* if ideDevices != nil { createBody.IDEDevices = ideDeviceObjects @@ -1993,7 +1993,6 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m diskDevice := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) diskDeviceObjects := make(map[string]map[string]proxmox.CustomStorageDevice) resource := resourceVirtualEnvironmentVM() - scsiDefaultCount := 0 for _, diskEntry := range diskDevice { diskDevice := proxmox.CustomStorageDevice{ @@ -2041,16 +2040,10 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m } } - // only for backwards compatibility - if diskInterface == "" { - diskInterface = fmt.Sprintf("scsi%d", scsiDefaultCount) - scsiDefaultCount = scsiDefaultCount + 1 - } - baseDiskInterface := diskDigitPrefix(diskInterface) - if baseDiskInterface != "virtio" && baseDiskInterface != "scsi" && baseDiskInterface != "sata" && baseDiskInterface != "ide" { - errorMsg := fmt.Sprintf("Defined disk interface not supported. Interface was %s, but only virtio, sata, scsi, and ide are supported", diskInterface) + if baseDiskInterface != "virtio" && baseDiskInterface != "scsi" && baseDiskInterface != "sata" { + errorMsg := fmt.Sprintf("Defined disk interface not supported. Interface was %s, but only virtio, sata and scsi are supported", diskInterface) return diskDeviceObjects, errors.New(errorMsg) } From 5e96f8d6d1d2e764ef96314abbc81a8d854edbd0 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 8 Jun 2020 10:38:22 +0200 Subject: [PATCH 18/42] Update Changelog.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38871fac..199ce9a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ FEATURES: ENHANCEMENTS: * provider/configuration: Add `virtual_environment.otp` argument for TOTP support +* resource/virtual_environment_vm: Clone supports resize and datastore_id for moving disks +* resource/virtual_environment_vm: Bulk clones can now use retries as argument to try multiple times to create a clone. BUG FIXES: @@ -16,6 +18,8 @@ BUG FIXES: * resource/virtual_environment_vm: Fix VM ID collision when `vm_id` is not specified * resource/virtual_environment_vm: Fix disk import issue when importing from directory-based datastores * resource/virtual/environment/vm: Fix handling of storage name - correct handling of `-` +* library/virtual_environment_nodes: Fix WaitForNodeTask now detects errors correctly +* library/virtual_environment_vm: Fix CloneVM now waits for the task to be finished and detect errors. WORKAROUNDS: From 2e4bb2210db377ff5d0b4a7821d08dfcc213d466 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 8 Jun 2020 10:38:38 +0200 Subject: [PATCH 19/42] Update documentation for new clone options and disk interface --- .../virtual_environment/proxmox_virtual_environment_vm.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md b/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md index 63ba31e0..6fd7e716 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md +++ b/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md @@ -28,6 +28,7 @@ resource "proxmox_virtual_environment_vm" "ubuntu_vm" { disk { datastore_id = "local-lvm" file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" } initialization { @@ -118,6 +119,7 @@ output "ubuntu_vm_public_key" { * `clone` - (Optional) The cloning configuration. * `datastore_id` - (Optional) The identifier for the target datastore. * `node_name` - (Optional) The name of the source node (leave blank, if equal to the `node_name` argument). + * `retries` - (Optional) Number of retries in Proxmox for clone vm. Sometimes Proxmox errors with timeout when creating multiple clones at once. * `vm_id` - (Required) The identifier for the source VM. * `cpu` - (Optional) The CPU configuration. * `architecture` - (Optional) The CPU architecture (defaults to `x86_64`). @@ -179,6 +181,7 @@ output "ubuntu_vm_public_key" { * `raw` - Raw Disk Image. * `vmdk` - VMware Disk Image. * `file_id` - (Optional) The file ID for a disk image (experimental - might cause high CPU utilization during import, especially with large disk images). + * `interface` - (Required) The disk interface for Proxmox, currently scsi, sata and virtio are supported. * `size` - (Optional) The disk size in gigabytes (defaults to `8`). * `speed` - (Optional) The speed limits. * `read` - (Optional) The maximum read speed in megabytes per second. From 68b67e556da5b1715dd7833e8ec86ab8ada3bd0e Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 8 Jun 2020 10:58:16 +0200 Subject: [PATCH 20/42] Update example with disk interface --- example/resource_virtual_environment_vm.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/example/resource_virtual_environment_vm.tf b/example/resource_virtual_environment_vm.tf index 0816d6eb..1c99bd2c 100644 --- a/example/resource_virtual_environment_vm.tf +++ b/example/resource_virtual_environment_vm.tf @@ -8,6 +8,7 @@ resource "proxmox_virtual_environment_vm" "example_template" { disk { datastore_id = "${element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm"))}" file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" } initialization { From 8acafc0bb7ec0c72619e344d0b6ebc86c805c494 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 6 Jul 2020 15:48:57 +0200 Subject: [PATCH 21/42] Fix Errors - Fix required disk interface parameter - Fix datastore move to same datastore error - Fix compare sizes for resize disk --- proxmox/virtual_environment_vm.go | 5 ++ proxmoxtf/resource_virtual_environment_vm.go | 49 +++++--------------- proxmoxtf/utils.go | 36 ++++++++++++++ 3 files changed, 53 insertions(+), 37 deletions(-) diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 9864827f..9a0e7842 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -161,6 +161,11 @@ func (c *VirtualEnvironmentClient) GetVMStatus(nodeName string, vmID int) (*Virt func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody) error { taskID, err := c.MoveVMDiskAsync(nodeName, vmID, d) + if strings.Contains(err.Error(), "you can't move to the same storage with same format") { + // if someone tries to move to the same storage, the move is considered to be successful + return nil + } + if err != nil { return err } diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index ce415a3a..e389d78b 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "log" - "math" "strconv" "strings" "time" @@ -42,7 +41,7 @@ const ( dvResourceVirtualEnvironmentVMCPUType = "qemu64" dvResourceVirtualEnvironmentVMCPUUnits = 1024 dvResourceVirtualEnvironmentVMDescription = "" - dvResourcevirtualEnvironmentVMDiskInterface = "" + dvResourcevirtualEnvironmentVMDiskInterface = "scsi0" dvResourceVirtualEnvironmentVMDiskDatastoreID = "local-lvm" dvResourceVirtualEnvironmentVMDiskFileFormat = "qcow2" dvResourceVirtualEnvironmentVMDiskFileID = "" @@ -463,8 +462,7 @@ func resourceVirtualEnvironmentVM() *schema.Resource { mkResourcevirtualEnvironmentVMDiskInterface: { Type: schema.TypeString, Description: "The datastore name", - Optional: false, - Default: dvResourcevirtualEnvironmentVMDiskInterface, + Required: true, }, mkResourceVirtualEnvironmentVMDiskDatastoreID: { Type: schema.TypeString, @@ -1345,12 +1343,10 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface return errors.New(fmt.Sprintf("Disk move failed, no disk named %s", diskInterface)) } - compareString := *currentDiskInfo.Size - compareSize := len(compareString) - compareNumber, err := strconv.Atoi(compareString[:compareSize-1]) + compareNumber, err := parseDiskSize(currentDiskInfo.Size) if err != nil { - return errors.New(fmt.Sprintf("Disk resize failed, vm disk size could not be converted to int disk size = %s", *currentDiskInfo.Size)) + return err } if diskSize < compareNumber { @@ -1369,10 +1365,12 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface Size: fmt.Sprintf("%dG", diskSize), } - err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody) + if dataStoreID != "" { + err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody) - if err != nil { - return err + if err != nil { + return err + } } err = veClient.ResizeVMDisk(nodeName, vmID, diskResizeBody) @@ -2487,33 +2485,10 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ diskSize := 0 var err error + diskSize, err = parseDiskSize(dd.Size) - if dd.Size != nil { - if strings.HasSuffix(*dd.Size, "T") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "T")) - - if err != nil { - return err - } - - diskSize = int(math.Ceil(float64(diskSize) * 1024)) - } else if strings.HasSuffix(*dd.Size, "G") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "G")) - - if err != nil { - return err - } - } else if strings.HasSuffix(*dd.Size, "M") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "M")) - - if err != nil { - return err - } - - diskSize = int(math.Ceil(float64(diskSize) / 1024)) - } else { - return fmt.Errorf("Cannot parse storage size \"%s\"", *dd.Size) - } + if err != nil { + return err } disk[mkResourceVirtualEnvironmentVMDiskSize] = diskSize diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index 0f963ca5..c34f3225 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -6,7 +6,10 @@ package proxmoxtf import ( "fmt" + "math" "regexp" + "strconv" + "strings" "testing" "time" "unicode" @@ -445,6 +448,39 @@ func getDiskInfo(data *proxmox.VirtualEnvironmentVMGetResponseData) map[string]* return storageDevices } +func parseDiskSize(size *string) (int, error) { + var diskSize int + var err error + if size != nil { + if strings.HasSuffix(*size, "T") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "T")) + + if err != nil { + return -1, err + } + + diskSize = int(math.Ceil(float64(diskSize) * 1024)) + } else if strings.HasSuffix(*size, "G") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "G")) + + if err != nil { + return -1, err + } + } else if strings.HasSuffix(*size, "M") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "M")) + + if err != nil { + return -1, err + } + + diskSize = int(math.Ceil(float64(diskSize) / 1024)) + } else { + return -1, fmt.Errorf("Cannot parse storage size \"%s\"", *size) + } + } + return diskSize, err +} + func testComputedAttributes(t *testing.T, s *schema.Resource, keys []string) { for _, v := range keys { if s.Schema[v] == nil { From 7883dfdb7e0e91a0a52dafa9996a42b499ad070f Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 6 Jul 2020 15:54:00 +0200 Subject: [PATCH 22/42] introduce onBoot parameter --- proxmoxtf/resource_virtual_environment_vm.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index e389d78b..59201db4 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -19,6 +19,7 @@ import ( const ( dvResourceVirtualEnvironmentVMRebootAfterCreation = false + dvResourceVirtualEnvironmentVMOnBoot = false dvResourceVirtualEnvironmentVMACPI = true dvResourceVirtualEnvironmentVMAgentEnabled = false dvResourceVirtualEnvironmentVMAgentTimeout = "15m" @@ -86,6 +87,7 @@ const ( maxResourceVirtualEnvironmentVMSerialDevices = 4 mkResourceVirtualEnvironmentVMRebootAfterCreation = "reboot" + mkResourceVirtualEnvironmentVMOnBoot = "on_boot" mkResourceVirtualEnvironmentVMACPI = "acpi" mkResourceVirtualEnvironmentVMAgent = "agent" mkResourceVirtualEnvironmentVMAgentEnabled = "enabled" @@ -185,6 +187,12 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Optional: true, Default: dvResourceVirtualEnvironmentVMRebootAfterCreation, }, + mkResourceVirtualEnvironmentVMOnBoot: { + Type: schema.TypeBool, + Description: "Start VM on Node boot", + Optional: true, + Default: dvResourceVirtualEnvironmentVMOnBoot, + }, mkResourceVirtualEnvironmentVMACPI: { Type: schema.TypeBool, Description: "Whether to enable ACPI", @@ -1087,7 +1095,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface networkDevice := d.Get(mkResourceVirtualEnvironmentVMNetworkDevice).([]interface{}) operatingSystem := d.Get(mkResourceVirtualEnvironmentVMOperatingSystem).([]interface{}) serialDevice := d.Get(mkResourceVirtualEnvironmentVMSerialDevice).([]interface{}) - started := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMStarted).(bool)) + onBoot := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) template := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) vga := d.Get(mkResourceVirtualEnvironmentVMVGA).([]interface{}) @@ -1284,9 +1292,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface } } - if started != dvResourceVirtualEnvironmentVMStarted { - updateBody.StartOnBoot = &started - } + updateBody.StartOnBoot = &onBoot if tabletDevice != dvResourceVirtualEnvironmentVMTabletDevice { updateBody.TabletDeviceEnabled = &tabletDevice @@ -1507,7 +1513,7 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac return err } - started := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMStarted).(bool)) + onBoot := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) template := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) @@ -1603,7 +1609,7 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac SCSIHardware: &scsiHardware, SerialDevices: serialDevices, SharedMemory: memorySharedObject, - StartOnBoot: &started, + StartOnBoot: &onBoot, TabletDeviceEnabled: &tabletDevice, Template: &template, VGADevice: vgaDevice, From 3956a314948666b17f97a740c83dfda213820454 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Wed, 2 Sep 2020 14:44:20 +0200 Subject: [PATCH 23/42] Add multidisk support --- proxmox/virtual_environment_vm.go | 1 + proxmox/virtual_environment_vm_types.go | 9 +- proxmoxtf/resource_virtual_environment_vm.go | 271 ++++++++++--------- proxmoxtf/utils.go | 23 +- 4 files changed, 155 insertions(+), 149 deletions(-) diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 9a0e7842..3a6d2b17 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -236,6 +236,7 @@ func (c *VirtualEnvironmentClient) RebootVMAsync(nodeName string, vmID int, d *V // ResizeVMDisk resizes a virtual machine disk. func (c *VirtualEnvironmentClient) ResizeVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMResizeDiskRequestBody) error { var err error + log.Printf("[DEBUG] RESIZE size: %s, disk: %s", d.Size, d.Disk) for i := 0; i < 5; i++ { err = c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/qemu/%d/resize", url.PathEscape(nodeName), vmID), d, nil) if err == nil { diff --git a/proxmox/virtual_environment_vm_types.go b/proxmox/virtual_environment_vm_types.go index aea3f84c..7b10b9e5 100644 --- a/proxmox/virtual_environment_vm_types.go +++ b/proxmox/virtual_environment_vm_types.go @@ -165,11 +165,12 @@ type CustomStorageDevice struct { Format *string `json:"format,omitempty" url:"format,omitempty"` Interface *string ID *string - FileId *string + FileID *string + SizeInt *int } // CustomStorageDevices handles QEMU SATA device parameters. -type CustomStorageDevices []CustomStorageDevice +type CustomStorageDevices map[string]CustomStorageDevice // CustomUSBDevice handles QEMU USB device parameters. type CustomUSBDevice struct { @@ -248,7 +249,7 @@ type VirtualEnvironmentVMCreateRequestBody struct { HookScript *string `json:"hookscript,omitempty" url:"hookscript,omitempty"` Hotplug CustomCommaSeparatedList `json:"hotplug,omitempty" url:"hotplug,omitempty,comma"` Hugepages *string `json:"hugepages,omitempty" url:"hugepages,omitempty"` - IDEDevices CustomStorageDevices `json:"ide,omitempty" url:"ide,omitempty"` + IDEDevices CustomStorageDevices `json:"ide,omitempty" url:",omitempty"` KeyboardLayout *string `json:"keyboard,omitempty" url:"keyboard,omitempty"` KVMArguments CustomLineBreakSeparatedList `json:"args,omitempty" url:"args,omitempty,space"` KVMEnabled *CustomBool `json:"kvm,omitempty" url:"kvm,omitempty,int"` @@ -1055,7 +1056,7 @@ func (r CustomStorageDevice) EncodeValues(key string, v *url.Values) error { func (r CustomStorageDevices) EncodeValues(key string, v *url.Values) error { for i, d := range r { if d.Enabled { - d.EncodeValues(fmt.Sprintf("%s%d", key, i), v) + d.EncodeValues(i, v) } } diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index 59201db4..482e5092 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "errors" "fmt" - "log" + "sort" "strconv" "strings" "time" @@ -499,7 +499,7 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Description: "The disk size in gigabytes", Optional: true, Default: dvResourceVirtualEnvironmentVMDiskSize, - ValidateFunc: validation.IntBetween(1, 8192), + ValidateFunc: validation.IntAtLeast(1), }, mkResourceVirtualEnvironmentVMDiskSpeed: { Type: schema.TypeList, @@ -1132,16 +1132,16 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface if len(cdrom) > 0 || len(initialization) > 0 { ideDevices = proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ + "ide0": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide1": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: false, }, } @@ -1159,13 +1159,13 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromMedia := "cdrom" - cdromDevice := proxmox.CustomStorageDevice{ - Enabled: cdromEnabled, - FileVolume: cdromFileID, - Media: &cdromMedia, + updateBody.IDEDevices = proxmox.CustomStorageDevices{ + "ide3": proxmox.CustomStorageDevice{ + Enabled: cdromEnabled, + FileVolume: cdromFileID, + Media: &cdromMedia, + }, } - - ideDevices[3] = cdromDevice } if len(cpu) > 0 { @@ -1211,13 +1211,14 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromCloudInitFileID := fmt.Sprintf("%s:cloudinit", initializationDatastoreID) cdromCloudInitMedia := "cdrom" - cdromCloudInitDevice := proxmox.CustomStorageDevice{ - Enabled: cdromCloudInitEnabled, - FileVolume: cdromCloudInitFileID, - Media: &cdromCloudInitMedia, + updateBody.IDEDevices = proxmox.CustomStorageDevices{ + "ide2": proxmox.CustomStorageDevice{ + Enabled: cdromCloudInitEnabled, + FileVolume: cdromCloudInitFileID, + Media: &cdromCloudInitMedia, + }, } - ideDevices[2] = cdromCloudInitDevice initializationConfig, err := resourceVirtualEnvironmentVMGetCloudInitConfig(d, m) if err != nil { @@ -1336,6 +1337,12 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface allDiskInfo := getDiskInfo(vmConfig) + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) + + if err != nil { + return err + } + for i := range disk { diskBlock := disk[i].(map[string]interface{}) @@ -1346,7 +1353,32 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface currentDiskInfo := allDiskInfo[diskInterface] if currentDiskInfo == nil { - return errors.New(fmt.Sprintf("Disk move failed, no disk named %s", diskInterface)) + diskUpdateBody := &proxmox.VirtualEnvironmentVMUpdateRequestBody{} + prefix := diskDigitPrefix(diskInterface) + switch prefix { + case "virtio": + if diskUpdateBody.VirtualIODevices == nil { + diskUpdateBody.VirtualIODevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.VirtualIODevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + case "sata": + if diskUpdateBody.SATADevices == nil { + diskUpdateBody.SATADevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.SATADevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + case "scsi": + if diskUpdateBody.SCSIDevices == nil { + diskUpdateBody.SCSIDevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.SCSIDevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + } + + err = veClient.UpdateVM(nodeName, vmID, diskUpdateBody) + if err != nil { + return err + } + + continue } compareNumber, err := parseDiskSize(currentDiskInfo.Size) @@ -1356,7 +1388,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface } if diskSize < compareNumber { - return errors.New(fmt.Sprintf("Disk resize fails requests size (%dG) is lower than current size (%s)", diskSize, *currentDiskInfo.Size)) + return fmt.Errorf("Disk resize fails requests size (%dG) is lower than current size (%s)", diskSize, *currentDiskInfo.Size) } deleteOriginalDisk := proxmox.CustomBool(true) @@ -1450,16 +1482,16 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac cpuUnits := cpuBlock[mkResourceVirtualEnvironmentVMCPUUnits].(int) description := d.Get(mkResourceVirtualEnvironmentVMDescription).(string) - diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m) + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) if err != nil { return err } - virtioDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "virtio") - scsiDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "scsi") + virtioDeviceObjects := diskDeviceObjects["vitio"] + scsiDeviceObjects := diskDeviceObjects["scsi"] //ideDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "ide") - sataDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "sata") + sataDeviceObjects := diskDeviceObjects["sata"] initializationConfig, err := resourceVirtualEnvironmentVMGetCloudInitConfig(d, m) @@ -1552,18 +1584,12 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac ideDevice2Media := "cdrom" ideDevices := proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ - Enabled: false, - }, - proxmox.CustomStorageDevice{ - Enabled: false, - }, - proxmox.CustomStorageDevice{ + "ide1": proxmox.CustomStorageDevice{ Enabled: cdromCloudInitEnabled, FileVolume: cdromCloudInitFileID, Media: &ideDevice2Media, }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, Media: &ideDevice2Media, @@ -1993,8 +2019,13 @@ func resourceVirtualEnvironmentVMGetCPUArchitectureValidator() schema.SchemaVali }, false) } -func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}) (map[string]map[string]proxmox.CustomStorageDevice, error) { - diskDevice := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) +func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}, disks []interface{}) (map[string]map[string]proxmox.CustomStorageDevice, error) { + var diskDevice []interface{} + if disks != nil { + diskDevice = disks + } else { + diskDevice = d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) + } diskDeviceObjects := make(map[string]map[string]proxmox.CustomStorageDevice) resource := resourceVirtualEnvironmentVM() @@ -2021,6 +2052,13 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m diskDevice.FileVolume = fmt.Sprintf("%s:%d", datastoreID, size) } + diskDevice.ID = &datastoreID + diskDevice.Interface = &diskInterface + diskDevice.FileID = &fileID + sizeString := fmt.Sprintf("%dG", size) + diskDevice.Size = &sizeString + diskDevice.SizeInt = &size + if len(speedBlock) > 0 { speedLimitRead := speedBlock[mkResourceVirtualEnvironmentVMDiskSpeedRead].(int) speedLimitReadBurstable := speedBlock[mkResourceVirtualEnvironmentVMDiskSpeedReadBurstable].(int) @@ -2443,31 +2481,10 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ d.Set(mkResourceVirtualEnvironmentVMCPU, []interface{}{cpu}) } - // Compare the disks to those stored in the state. - currentDisks := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) - - diskList := []interface{}{} + diskMap := map[string]interface{}{} + orderedDiskList := []interface{}{} diskObjects := getDiskInfo(vmConfig) - currentDiskMap := make(map[string]*proxmox.CustomStorageDevice) - - for _, dd := range currentDisks { - var disk proxmox.CustomStorageDevice - currentDiskEntry := dd.(map[string]interface{}) - - id := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) - diskInterface := currentDiskEntry[mkResourcevirtualEnvironmentVMDiskInterface].(string) - format := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileFormat].(string) - fileId := currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileID].(string) - - disk.Interface = &diskInterface - disk.ID = &id - disk.Format = &format - disk.FileId = &fileId - - currentDiskMap[diskInterface] = &disk - } - for di, dd := range diskObjects { disk := map[string]interface{}{} @@ -2479,14 +2496,13 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ disk[mkResourceVirtualEnvironmentVMDiskDatastoreID] = fileIDParts[0] - if val, ok := currentDiskMap[di]; ok { - if *val.FileId != "" { - disk[mkResourceVirtualEnvironmentVMDiskFileID] = val.FileId - } - - disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = val.Format - disk[mkResourcevirtualEnvironmentVMDiskInterface] = val.Interface + disk[mkResourceVirtualEnvironmentVMDiskFileID] = dd.FileID + if dd.Format == nil { + disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = "qcow2" + } else { + disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = dd.Format } + disk[mkResourcevirtualEnvironmentVMDiskInterface] = di diskSize := 0 @@ -2534,16 +2550,23 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ disk[mkResourceVirtualEnvironmentVMDiskSpeed] = []interface{}{} } - diskList = append(diskList, disk) + diskMap[di] = disk } - log.Printf("[DEBUG] NUMBER CURRENT DISKS %d NUMBER READ DISKS %d", len(currentDisks), len(diskList)) + keyList := []string{} + for key := range diskMap { + keyList = append(keyList, key) + } + sort.Strings(keyList) + for _, k := range keyList { + orderedDiskList = append(orderedDiskList, diskMap[k]) + } if len(clone) > 0 { - if len(currentDisks) > 0 || len(diskList) > 0 { - d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) + if len(orderedDiskList) > 0 { + d.Set(mkResourceVirtualEnvironmentVMDisk, orderedDiskList) } - } else if len(currentDisks) > 0 || len(diskList) > 0 { - d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) + } else if len(orderedDiskList) > 0 { + d.Set(mkResourceVirtualEnvironmentVMDisk, orderedDiskList) } // Compare the initialization configuration to the one stored in the state. @@ -3084,16 +3107,16 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e updateBody := &proxmox.VirtualEnvironmentVMUpdateRequestBody{ IDEDevices: proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ + "ide0": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide1": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: false, }, }, @@ -3212,7 +3235,7 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e cdromMedia := "cdrom" - updateBody.IDEDevices[3] = proxmox.CustomStorageDevice{ + updateBody.IDEDevices["ide3"] = proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, Media: &cdromMedia, @@ -3266,7 +3289,7 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e // Prepare the new disk device configuration. if d.HasChange(mkResourceVirtualEnvironmentVMDisk) { - diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m) + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) if err != nil { return err @@ -3275,8 +3298,6 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e diskDeviceInfo := getDiskInfo(vmConfig) for prefix, diskMap := range diskDeviceObjects { - index := 0 - if diskMap == nil { continue } @@ -3286,39 +3307,33 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e return fmt.Errorf("Missing %s device %s", prefix, key) } + tmp := *diskDeviceInfo[key] + tmp.BurstableReadSpeedMbps = value.BurstableReadSpeedMbps + tmp.BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps + tmp.MaxReadSpeedMbps = value.MaxReadSpeedMbps + tmp.MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + switch prefix { case "virtio": { if updateBody.VirtualIODevices == nil { - updateBody.VirtualIODevices = make(proxmox.CustomStorageDevices, len(diskMap)) + updateBody.VirtualIODevices = make(proxmox.CustomStorageDevices) } - updateBody.VirtualIODevices[index] = *diskDeviceInfo[key] - updateBody.VirtualIODevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps - updateBody.VirtualIODevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps - updateBody.VirtualIODevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps - updateBody.VirtualIODevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + updateBody.VirtualIODevices[key] = tmp } case "sata": { if updateBody.SATADevices == nil { - updateBody.SATADevices = make(proxmox.CustomStorageDevices, len(diskMap)) + updateBody.SATADevices = make(proxmox.CustomStorageDevices) } - updateBody.SATADevices[index] = *diskDeviceInfo[key] - updateBody.SATADevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps - updateBody.SATADevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps - updateBody.SATADevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps - updateBody.SATADevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + updateBody.SATADevices[key] = tmp } case "scsi": { if updateBody.SCSIDevices == nil { - updateBody.SCSIDevices = make(proxmox.CustomStorageDevices, len(diskMap)) + updateBody.SCSIDevices = make(proxmox.CustomStorageDevices) } - updateBody.SCSIDevices[index] = *diskDeviceInfo[key] - updateBody.SCSIDevices[index].BurstableReadSpeedMbps = value.BurstableReadSpeedMbps - updateBody.SCSIDevices[index].BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps - updateBody.SCSIDevices[index].MaxReadSpeedMbps = value.MaxReadSpeedMbps - updateBody.SCSIDevices[index].MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + updateBody.SCSIDevices[key] = tmp } case "ide": { @@ -3327,7 +3342,6 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e default: return fmt.Errorf("Device prefix %s not supported", prefix) } - index = index + 1 } } @@ -3351,7 +3365,7 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e cdromMedia := "cdrom" - updateBody.IDEDevices[2] = proxmox.CustomStorageDevice{ + updateBody.IDEDevices["ide2"] = proxmox.CustomStorageDevice{ Enabled: true, FileVolume: fmt.Sprintf("%s:cloudinit", initializationDatastoreID), Media: &cdromMedia, @@ -3359,7 +3373,9 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e if vmConfig.IDEDevice2 != nil { if strings.Contains(vmConfig.IDEDevice2.FileVolume, fmt.Sprintf("vm-%d-cloudinit", vmID)) { - updateBody.IDEDevices[2].Enabled = false + var tmp = updateBody.IDEDevices["ide2"] + tmp.Enabled = true + updateBody.IDEDevices["ide2"] = tmp } } } @@ -3517,44 +3533,41 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat if d.HasChange(mkResourceVirtualEnvironmentVMDisk) { diskOld, diskNew := d.GetChange(mkResourceVirtualEnvironmentVMDisk) - diskOldEntries := diskOld.([]interface{}) - diskNewEntries := diskNew.([]interface{}) + diskOldEntries, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, diskOld.([]interface{})) + if err != nil { + return err + } + + diskNewEntries, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, diskNew.([]interface{})) + if err != nil { + return err + } diskMoveBodies := []*proxmox.VirtualEnvironmentVMMoveDiskRequestBody{} diskResizeBodies := []*proxmox.VirtualEnvironmentVMResizeDiskRequestBody{} - for i := range diskOldEntries { - diskOldBlock := diskOldEntries[i].(map[string]interface{}) - diskNewBlock := diskNewEntries[i].(map[string]interface{}) + for prefix, diskMap := range diskOldEntries { + for oldKey, oldDisk := range diskMap { + if _, present := diskNewEntries[prefix][oldKey]; !present { + return fmt.Errorf("Deletion of disks not supported. Please delete disk by hand. Old Interface was %s", *oldDisk.Interface) + } - diskOldDatastoreID := diskOldBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) - diskOldInterface := diskOldBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) - diskNewInterface := diskNewBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + if oldDisk.ID != diskNewEntries[prefix][oldKey].ID { + deleteOriginalDisk := proxmox.CustomBool(true) - if diskNewInterface != diskOldInterface { - return fmt.Errorf("Alteration of disk interface is not supported. Old Interface was %s", diskOldInterface) - } + diskMoveBodies = append(diskMoveBodies, &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ + DeleteOriginalDisk: &deleteOriginalDisk, + Disk: *oldDisk.Interface, + TargetStorage: *diskNewEntries[prefix][oldKey].ID, + }) + } - diskNewDatastoreID := diskNewBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) - - if diskOldDatastoreID != diskNewDatastoreID { - deleteOriginalDisk := proxmox.CustomBool(true) - - diskMoveBodies = append(diskMoveBodies, &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ - DeleteOriginalDisk: &deleteOriginalDisk, - Disk: diskOldInterface, - TargetStorage: diskNewDatastoreID, - }) - } - - diskOldSize := diskOldBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) - diskNewSize := diskNewBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) - - if diskOldSize <= diskNewSize { - diskResizeBodies = append(diskResizeBodies, &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ - Disk: diskOldInterface, - Size: fmt.Sprintf("%dG", diskNewSize), - }) + if *oldDisk.SizeInt <= *diskNewEntries[prefix][oldKey].SizeInt { + diskResizeBodies = append(diskResizeBodies, &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ + Disk: *oldDisk.Interface, + Size: *diskNewEntries[prefix][oldKey].Size, + }) + } } } diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index c34f3225..cd467392 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -384,22 +384,6 @@ func getVMIDValidator() schema.SchemaValidateFunc { } } -func getOrderedDiskDeviceList(diskDeviceMap map[string]map[string]proxmox.CustomStorageDevice, diskInterface string) proxmox.CustomStorageDevices { - diskDevices := diskDeviceMap[diskInterface] - - if diskDevices == nil { - return nil - } - - orderedDiskList := make(proxmox.CustomStorageDevices, len(diskDevices)) - - for _, value := range diskDevices { - orderedDiskList = append(orderedDiskList, value) - } - - return orderedDiskList -} - func getDiskInfo(data *proxmox.VirtualEnvironmentVMGetResponseData) map[string]*proxmox.CustomStorageDevice { storageDevices := make(map[string]*proxmox.CustomStorageDevice) storageDevices["ide0"] = data.IDEDevice0 @@ -445,6 +429,13 @@ func getDiskInfo(data *proxmox.VirtualEnvironmentVMGetResponseData) map[string]* storageDevices["virtio14"] = data.VirtualIODevice14 storageDevices["virtio15"] = data.VirtualIODevice15 + for key, value := range storageDevices { + if value != nil { + tmpKey := key + value.Interface = &tmpKey + } + } + return storageDevices } From 0fd8d3dae7713dd7aafd0ae2c8e764fa94f5e5ab Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sat, 2 Jan 2021 22:48:42 +0100 Subject: [PATCH 24/42] fix: missing reference to standalone terraform plugin and duplicate output names in example --- ...ource_virtual_environment_cluster_alias.tf | 2 +- ...rce_virtual_environment_cluster_aliases.tf | 2 +- .../data_source_virtual_environment_alias.go | 12 ++-- ...a_source_virtual_environment_alias_test.go | 6 +- ...data_source_virtual_environment_aliases.go | 4 +- ...source_virtual_environment_aliases_test.go | 2 +- ...ource_virtual_environment_cluster_alias.go | 60 +++++++------------ ..._virtual_environment_cluster_alias_test.go | 8 +-- ...ource_virtual_environment_cluster_ipset.go | 51 ++++++---------- ..._virtual_environment_cluster_ipset_test.go | 3 +- 10 files changed, 59 insertions(+), 91 deletions(-) diff --git a/example/data_source_virtual_environment_cluster_alias.tf b/example/data_source_virtual_environment_cluster_alias.tf index 01b17e8f..946225e0 100644 --- a/example/data_source_virtual_environment_cluster_alias.tf +++ b/example/data_source_virtual_environment_cluster_alias.tf @@ -2,6 +2,6 @@ data "proxmox_virtual_environment_cluster_alias" "example" { name = "example" } -output "proxmox_virtual_environment_cluster_alias_example_cidr" { +output "data_proxmox_virtual_environment_cluster_alias_example_cidr" { value = proxmox_virtual_environment_cluster_alias.example.cidr } diff --git a/example/data_source_virtual_environment_cluster_aliases.tf b/example/data_source_virtual_environment_cluster_aliases.tf index c59250dc..f7a0308a 100644 --- a/example/data_source_virtual_environment_cluster_aliases.tf +++ b/example/data_source_virtual_environment_cluster_aliases.tf @@ -2,7 +2,7 @@ data "proxmox_virtual_environment_cluster_aliases" "example" { depends_on = ["proxmox_virtual_environment_cluster_alias.example"] } -output "proxmox_virtual_environment_cluster_aliases" { +output "data_proxmox_virtual_environment_cluster_aliases" { value = "${map( "alias_ids", data.proxmox_virtual_environment_cluster_aliases.example.alias_ids, )}" diff --git a/proxmoxtf/data_source_virtual_environment_alias.go b/proxmoxtf/data_source_virtual_environment_alias.go index f04bfed5..ee7045be 100644 --- a/proxmoxtf/data_source_virtual_environment_alias.go +++ b/proxmoxtf/data_source_virtual_environment_alias.go @@ -5,16 +5,15 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( - dvDataVirtualEnvironmentClusterAliasComment = "" - - mkDataSourceVirtualEnvironmentClusterAliasName = "name" - mkDataSourceVirtualEnvironmentClusterAliasCIDR = "cidr" - mkDataSourceVirtualEnvironmentClusterAliasComment = "comment" + dvDataVirtualEnvironmentClusterAliasComment = "" + mkDataSourceVirtualEnvironmentClusterAliasName = "name" + mkDataSourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkDataSourceVirtualEnvironmentClusterAliasComment = "comment" ) func dataSourceVirtualEnvironmentClusterAlias() *schema.Resource { @@ -35,7 +34,6 @@ func dataSourceVirtualEnvironmentClusterAlias() *schema.Resource { Description: "Alias comment", Computed: true, }, - }, Read: dataSourceVirtualEnvironmentAliasRead, } diff --git a/proxmoxtf/data_source_virtual_environment_alias_test.go b/proxmoxtf/data_source_virtual_environment_alias_test.go index 56526388..9ed3bbfc 100644 --- a/proxmoxtf/data_source_virtual_environment_alias_test.go +++ b/proxmoxtf/data_source_virtual_environment_alias_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentAliasInstantiation tests whether the DataSourceVirtualEnvironmentAlias instance can be instantiated. @@ -33,8 +33,8 @@ func TestDataSourceVirtualEnvironmentAliasSchema(t *testing.T) { }) testValueTypes(t, s, map[string]schema.ValueType{ - mkDataSourceVirtualEnvironmentClusterAliasName: schema.TypeString, - mkDataSourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, mkDataSourceVirtualEnvironmentClusterAliasComment: schema.TypeString, }) } diff --git a/proxmoxtf/data_source_virtual_environment_aliases.go b/proxmoxtf/data_source_virtual_environment_aliases.go index 34b37320..5945e87f 100644 --- a/proxmoxtf/data_source_virtual_environment_aliases.go +++ b/proxmoxtf/data_source_virtual_environment_aliases.go @@ -5,11 +5,11 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( - mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs = "alias_ids" + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs = "alias_ids" ) func dataSourceVirtualEnvironmentClusterAliases() *schema.Resource { diff --git a/proxmoxtf/data_source_virtual_environment_aliases_test.go b/proxmoxtf/data_source_virtual_environment_aliases_test.go index da5a640a..2f2331f7 100644 --- a/proxmoxtf/data_source_virtual_environment_aliases_test.go +++ b/proxmoxtf/data_source_virtual_environment_aliases_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentAliasesInstantiation tests whether the DataSourceVirtualEnvironmentAliases instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias.go b/proxmoxtf/resource_virtual_environment_cluster_alias.go index 0e7a305f..2a8a99ce 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_alias.go +++ b/proxmoxtf/resource_virtual_environment_cluster_alias.go @@ -5,43 +5,44 @@ package proxmoxtf import ( - "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" "strings" + + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( - dvResourceVirtualEnvironmentClusterAliasComment = "" + dvResourceVirtualEnvironmentClusterAliasComment = "" - mkResourceVirtualEnvironmentClusterAliasName = "name" - mkResourceVirtualEnvironmentClusterAliasCIDR = "cidr" - mkResourceVirtualEnvironmentClusterAliasComment = "comment" + mkResourceVirtualEnvironmentClusterAliasName = "name" + mkResourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkResourceVirtualEnvironmentClusterAliasComment = "comment" ) func resourceVirtualEnvironmentClusterAlias() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ mkResourceVirtualEnvironmentClusterAliasName: { - Type: schema.TypeString, + Type: schema.TypeString, Description: "Alias name", - Required: true, - ForceNew: false, + Required: true, + ForceNew: false, }, mkResourceVirtualEnvironmentClusterAliasCIDR: { - Type: schema.TypeString, + Type: schema.TypeString, Description: "IP/CIDR block", - Required: true, - ForceNew: false, + Required: true, + ForceNew: false, }, mkResourceVirtualEnvironmentClusterAliasComment: { - Type: schema.TypeString, + Type: schema.TypeString, Description: "Alias comment", - Optional: true, - Default: dvResourceVirtualEnvironmentClusterAliasComment, + Optional: true, + Default: dvResourceVirtualEnvironmentClusterAliasComment, }, }, Create: resourceVirtualEnvironmentClusterAliasCreate, - Read: resourceVirtualEnvironmentClusterAliasRead, + Read: resourceVirtualEnvironmentClusterAliasRead, Update: resourceVirtualEnvironmentClusterAliasUpdate, Delete: resourceVirtualEnvironmentClusterAliasDelete, } @@ -61,8 +62,8 @@ func resourceVirtualEnvironmentClusterAliasCreate(d *schema.ResourceData, m inte body := &proxmox.VirtualEnvironmentClusterAliasCreateRequestBody{ Comment: &comment, - Name: name, - CIDR: cidr, + Name: name, + CIDR: cidr, } err = veClient.CreateAlias(body) @@ -98,8 +99,8 @@ func resourceVirtualEnvironmentClusterAliasRead(d *schema.ResourceData, m interf aliasMap := map[string]interface{}{ mkResourceVirtualEnvironmentClusterAliasComment: alias.Comment, - mkResourceVirtualEnvironmentClusterAliasName: alias.Name, - mkResourceVirtualEnvironmentClusterAliasCIDR: alias.CIDR, + mkResourceVirtualEnvironmentClusterAliasName: alias.Name, + mkResourceVirtualEnvironmentClusterAliasCIDR: alias.CIDR, } for key, val := range aliasMap { @@ -127,8 +128,8 @@ func resourceVirtualEnvironmentClusterAliasUpdate(d *schema.ResourceData, m inte previousName := d.Id() body := &proxmox.VirtualEnvironmentClusterAliasUpdateRequestBody{ - ReName: newName, - CIDR: cidr, + ReName: newName, + CIDR: cidr, Comment: &comment, } @@ -143,7 +144,6 @@ func resourceVirtualEnvironmentClusterAliasUpdate(d *schema.ResourceData, m inte return resourceVirtualEnvironmentClusterAliasRead(d, m) } - func resourceVirtualEnvironmentClusterAliasDelete(d *schema.ResourceData, m interface{}) error { config := m.(providerConfiguration) veClient, err := config.GetVEClient() @@ -168,17 +168,3 @@ func resourceVirtualEnvironmentClusterAliasDelete(d *schema.ResourceData, m inte return nil } - - - - - - - - - - - - - - diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias_test.go b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go index c5739675..bb30ae40 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_alias_test.go +++ b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentAliasInstantiation tests whether the ResourceVirtualEnvironmentAlias instance can be instantiated. @@ -33,8 +33,8 @@ func TestResourceVirtualEnvironmentAliasSchema(t *testing.T) { }) testValueTypes(t, s, map[string]schema.ValueType{ - mkResourceVirtualEnvironmentClusterAliasName: schema.TypeString, - mkResourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, - mkResourceVirtualEnvironmentClusterAliasComment: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasComment: schema.TypeString, }) } diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset.go b/proxmoxtf/resource_virtual_environment_cluster_ipset.go index 78a4ff97..a0e8602f 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_ipset.go +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset.go @@ -5,9 +5,10 @@ package proxmoxtf import ( - "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" "strings" + + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( @@ -25,26 +26,26 @@ func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ mkResourceVirtualEnvironmentClusterIPSetName: { - Type: schema.TypeString, + Type: schema.TypeString, Description: "IPSet name", - Required: true, - ForceNew: false, + Required: true, + ForceNew: false, }, mkResourceVirtualEnvironmentClusterIPSetCIDR: { - Type: schema.TypeList, + Type: schema.TypeList, Description: "List of IP or Networks", - Optional: true, - ForceNew: true, + Optional: true, + ForceNew: true, DefaultFunc: func() (interface{}, error) { return []interface{}{}, nil }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ mkResourceVirtualEnvironmentClusterIPSetCIDRName: { - Type: schema.TypeString, + Type: schema.TypeString, Description: "Network/IP specification in CIDR format", - Required: true, - ForceNew: true, + Required: true, + ForceNew: true, }, mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch: { Type: schema.TypeBool, @@ -71,7 +72,7 @@ func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { }, }, Create: resourceVirtualEnvironmentClusterIPSetCreate, - Read: resourceVirtualEnvironmentClusterIPSetRead, + Read: resourceVirtualEnvironmentClusterIPSetRead, Update: resourceVirtualEnvironmentClusterIPSetUpdate, Delete: resourceVirtualEnvironmentClusterIPSetDelete, } @@ -95,11 +96,10 @@ func resourceVirtualEnvironmentClusterIPSetCreate(d *schema.ResourceData, m inte IPSetMap := v.(map[string]interface{}) IPSetObject := proxmox.VirtualEnvironmentClusterIPSetGetResponseData{} - cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRName].(string) + cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRName].(string) noMatch := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch].(bool) comment := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRComment].(string) - IPSetObject.Comment = comment IPSetObject.CIDR = cidr @@ -108,13 +108,12 @@ func resourceVirtualEnvironmentClusterIPSetCreate(d *schema.ResourceData, m inte IPSetObject.NoMatch = &noMatchBool } - IPSetsArray[i] = IPSetObject } body := &proxmox.VirtualEnvironmentClusterIPSetCreateRequestBody{ Comment: comment, - Name: name, + Name: name, } err = veClient.CreateIPSet(body) @@ -167,7 +166,6 @@ func resourceVirtualEnvironmentClusterIPSetRead(d *schema.ResourceData, m interf } } - IPSet, err := veClient.GetListIPSetContent(name) if err != nil { @@ -199,8 +197,8 @@ func resourceVirtualEnvironmentClusterIPSetUpdate(d *schema.ResourceData, m inte previousName := d.Id() body := &proxmox.VirtualEnvironmentClusterIPSetUpdateRequestBody{ - ReName: previousName, - Name: newName, + ReName: previousName, + Name: newName, Comment: &comment, } @@ -215,7 +213,6 @@ func resourceVirtualEnvironmentClusterIPSetUpdate(d *schema.ResourceData, m inte return resourceVirtualEnvironmentClusterIPSetRead(d, m) } - func resourceVirtualEnvironmentClusterIPSetDelete(d *schema.ResourceData, m interface{}) error { config := m.(providerConfiguration) veClient, err := config.GetVEClient() @@ -257,17 +254,3 @@ func resourceVirtualEnvironmentClusterIPSetDelete(d *schema.ResourceData, m inte return nil } - - - - - - - - - - - - - - diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go index 024376da..56edb678 100644 --- a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go @@ -5,8 +5,9 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentIPSetInstantiation tests whether the resourceVirtualEnvironmentClusterIPSet From ceacbbeb2045b5e9770f42529b486c58ca015498 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sat, 2 Jan 2021 23:28:18 +0100 Subject: [PATCH 25/42] fix: tidy up modules and bump go reference to v1.15 --- go.mod | 4 +- go.sum | 198 +++++---------------------------------------------------- 2 files changed, 17 insertions(+), 185 deletions(-) diff --git a/go.mod b/go.mod index 75bf38dc..c9d69c57 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,10 @@ module github.com/danitso/terraform-provider-proxmox -go 1.13 +go 1.15 require ( github.com/google/go-querystring v1.0.0 github.com/hashicorp/terraform-plugin-sdk v1.9.1 - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/pkg/sftp v1.11.0 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 - google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a ) diff --git a/go.sum b/go.sum index 8c2dc249..e765d235 100644 --- a/go.sum +++ b/go.sum @@ -7,102 +7,46 @@ cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/azure/cli v0.2.0/go.mod h1:WWTbGPvkAg3I4ms2j2s+Zr5xCGwGqTQh+6M2ZqOczkE= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= -github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= -github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= -github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -112,7 +56,6 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -122,6 +65,7 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -130,48 +74,22 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHBJPd5jL+cXr5BGVzSKhE= -github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8= -github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f h1:Yv9YzBlAETjy6AOX9eLBZ3nshNVRREgerT/3nvxlGho= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= -github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26 h1:hRho44SAoNu1CBtn5r8Q9J3rCs4ZverWZ4R+UeeNuWM= -github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.2 h1:AoISa4P4IsW0/m4T6St8Yw38gTl5GtBAgfkhYh1xAz4= -github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= -github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-tfe v0.3.27/go.mod h1:DVPSW2ogH+M9W1/i50ASgMht8cHP7NxxK0nrY9aFikQ= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -184,24 +102,16 @@ github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+Db github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= -github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hashicorp/terraform v0.12.23 h1:3fTWHq6JkHk4VJ8Z6A+8MvvAVtlSXbXViPJSWLuSNAk= -github.com/hashicorp/terraform v0.12.23/go.mod h1:eJcloDEx5ywM4a1tetIuVrlqklM0bUVRYJBYAh4CYzA= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-plugin-sdk v1.9.1 h1:AgHnd6yPCg7o57XWrv4L7tIMdF0KQpcZro1pDHF1Xbw= github.com/hashicorp/terraform-plugin-sdk v1.9.1/go.mod h1:C/AXwmDHqbc3h6URiHpIsVKrwV4PS0Sh0+VTaeEkShw= github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -209,35 +119,18 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= -github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= -github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= -github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= -github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= -github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= -github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -246,9 +139,6 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= @@ -257,87 +147,49 @@ github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFW github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= -github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.11.0 h1:4Zv0OGbpkg4yNuUtH0s8rvoYxRCNyT29NVUo6pgPmxI= github.com/pkg/sftp v1.11.0/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M= -github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= -github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= -github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= -github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= @@ -345,16 +197,9 @@ github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgK go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -369,10 +214,7 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -395,12 +237,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -409,8 +247,6 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -438,6 +274,7 @@ google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -458,14 +295,11 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 94cd3a9303b883295e064bc07e80fafd85effec3 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sat, 2 Jan 2021 23:32:44 +0100 Subject: [PATCH 26/42] feat: upgrade dependencies --- go.mod | 37 ++++- go.sum | 478 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 498 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index c9d69c57..84ab365b 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,39 @@ module github.com/danitso/terraform-provider-proxmox go 1.15 require ( + cloud.google.com/go v0.74.0 // indirect + cloud.google.com/go/storage v1.12.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect + github.com/aws/aws-sdk-go v1.36.19 // indirect + github.com/fatih/color v1.10.0 // indirect github.com/google/go-querystring v1.0.0 - github.com/hashicorp/terraform-plugin-sdk v1.9.1 - github.com/pkg/sftp v1.11.0 - golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 + github.com/google/uuid v1.1.3 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-getter v1.5.1 // indirect + github.com/hashicorp/go-hclog v0.15.0 // indirect + github.com/hashicorp/go-multierror v1.1.0 // indirect + github.com/hashicorp/go-plugin v1.4.0 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/hashicorp/hcl/v2 v2.8.1 // indirect + github.com/hashicorp/terraform-plugin-sdk v1.16.0 + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect + github.com/mitchellh/cli v1.1.2 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.4.0 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pkg/sftp v1.12.0 + github.com/posener/complete v1.2.3 // indirect + github.com/spf13/afero v1.5.1 // indirect + github.com/ulikunitz/xz v0.5.9 // indirect + github.com/vmihailenco/tagparser v0.1.2 // indirect + github.com/zclconf/go-cty v1.7.1 // indirect + github.com/zclconf/go-cty-yaml v1.0.2 // indirect + golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect + golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 // indirect + golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 // indirect + google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d // indirect ) diff --git a/go.sum b/go.sum index e765d235..aa3a6581 100644 --- a/go.sum +++ b/go.sum @@ -5,49 +5,129 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= +cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= +github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -56,6 +136,16 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -63,38 +153,77 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.3 h1:twObb+9XcuH5B9V1TBCvvvZoO6iEdILi2a76PYn5rJI= +github.com/google/uuid v1.1.3/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.1 h1:lM9sM02nvEApQGFgkXxWbhfqtyN+AyhQmi+MaMdBDOI= +github.com/hashicorp/go-getter v1.5.1/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= +github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -102,25 +231,52 @@ github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+Db github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= +github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +github.com/hashicorp/hcl/v2 v2.8.1 h1:FJ60CIYaMyJOKzPndhMyjiz353Fd+2jr6PodF5Xzb08= +github.com/hashicorp/hcl/v2 v2.8.1/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= -github.com/hashicorp/terraform-plugin-sdk v1.9.1 h1:AgHnd6yPCg7o57XWrv4L7tIMdF0KQpcZro1pDHF1Xbw= -github.com/hashicorp/terraform-plugin-sdk v1.9.1/go.mod h1:C/AXwmDHqbc3h6URiHpIsVKrwV4PS0Sh0+VTaeEkShw= -github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= +github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-plugin-sdk v1.16.0 h1:NrkXMRjHErUPPTHQkZ6JIn6bByiJzGnlJzH1rVdNEuE= +github.com/hashicorp/terraform-plugin-sdk v1.16.0/go.mod h1:5sVxrwW6/xzFhZyql+Q9zXCUEJaGWcBIxBbZFLpVXOI= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce h1:7UnVY3T/ZnHUrfviiAgIUjg2PXxsQfs5bphsG8F7Keo= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -128,19 +284,29 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -150,32 +316,53 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= +github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.11.0 h1:4Zv0OGbpkg4yNuUtH0s8rvoYxRCNyT29NVUo6pgPmxI= -github.com/pkg/sftp v1.11.0/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.12.0 h1:/f3b24xrDhkhddlaobPe2JgBqfdt+gC/NYl0QY9IOuI= +github.com/pkg/sftp v1.12.0/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= +github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -183,34 +370,96 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.9 h1:RsKRIA2MO8x56wkkcd3LbtcE/uMszhb6DpRf+3uwa3I= +github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= +github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -222,23 +471,55 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -247,14 +528,48 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 h1:joucsQqXmyBVxViHCPFjG3hx8JzIFSaym3l3MM/Jsdg= +golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -265,17 +580,84 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= +google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -284,25 +666,93 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a h1:lRlI5zu6AFy3iU/F8YWyNrAmn/tPCnhiTxfwhWb76eU= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d h1:HV9Z9qMhQEsdlvxNFELgQ11RkMzO3CMkjEySjCtuLes= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From b978955641b0eac0c407e8473de1667fa7f31e76 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 26 Oct 2020 13:40:09 +0100 Subject: [PATCH 27/42] Use correct ide devices for cloud init --- proxmoxtf/resource_virtual_environment_vm.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index cfa58955..de12d089 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -1169,7 +1169,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromMedia := "cdrom" - updateBody.IDEDevices = proxmox.CustomStorageDevices{ + ideDevices = proxmox.CustomStorageDevices{ "ide3": proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, @@ -1221,7 +1221,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromCloudInitFileID := fmt.Sprintf("%s:cloudinit", initializationDatastoreID) cdromCloudInitMedia := "cdrom" - updateBody.IDEDevices = proxmox.CustomStorageDevices{ + ideDevices = proxmox.CustomStorageDevices{ "ide2": proxmox.CustomStorageDevice{ Enabled: cdromCloudInitEnabled, FileVolume: cdromCloudInitFileID, @@ -1594,12 +1594,12 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac ideDevice2Media := "cdrom" ideDevices := proxmox.CustomStorageDevices{ - "ide1": proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: cdromCloudInitEnabled, FileVolume: cdromCloudInitFileID, Media: &ideDevice2Media, }, - "ide2": proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, Media: &ideDevice2Media, @@ -1663,13 +1663,6 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac createBody.VirtualIODevices = virtioDeviceObjects } - //this will most likely break the cdrom part thats why ide is disabled in line 2017 - /* - if ideDevices != nil { - createBody.IDEDevices = ideDeviceObjects - } - */ - // Only the root account is allowed to change the CPU architecture, which makes this check necessary. if veClient.Username == proxmox.DefaultRootAccount || cpuArchitecture != dvResourceVirtualEnvironmentVMCPUArchitecture { createBody.CPUArchitecture = &cpuArchitecture From 586d3877b54e3dd644b639108233e33d6a7b6fa5 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 4 Jan 2021 14:42:40 +0100 Subject: [PATCH 28/42] Extend documentation with on_boot and reboot parameter --- docs/resources/vm.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/resources/vm.md b/docs/resources/vm.md index 94babae4..7bea83cb 100644 --- a/docs/resources/vm.md +++ b/docs/resources/vm.md @@ -247,6 +247,7 @@ output "ubuntu_vm_public_key" { * `rate_limit` - (Optional) The rate limit in megabytes per second. * `vlan_id` - (Optional) The VLAN identifier. * `node_name` - (Required) The name of the node to assign the virtual machine to. +* `on_boot` - (Optional) Specifies whether a VM will be started during system boot. (defaults to `false`) * `operating_system` - (Optional) The Operating System configuration. * `type` - (Optional) The type (defaults to `other`). * `l24` - Linux Kernel 2.4. @@ -262,6 +263,7 @@ output "ubuntu_vm_public_key" { * `wvista` - Windows Vista. * `wxp` - Windows XP. * `pool_id` - (Optional) The identifier for a pool to assign the virtual machine to. +* `reboot` - (Optional) Reboot the VM after initial creation. (defaults to `false`) * `serial_device` - (Optional) A serial device (multiple blocks supported). * `device` - (Optional) The device (defaults to `socket`). * `/dev/*` - A host serial device. From 48ad150b80bfa790e97a07dba022e8772fcf975a Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Mon, 4 Jan 2021 15:00:58 +0100 Subject: [PATCH 29/42] Update CHANGELOG.md --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 199ce9a5..e4ff501d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,25 @@ FEATURES: * **New Data Source:** `proxmox_virtual_environment_time` * **New Resource:** `proxmox_virtual_environment_time` +BREAKING CHANGES: + +* `interface` is now required to create disks + +``` + disk { + datastore_id = "local-lvm" + file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" + } +``` + ENHANCEMENTS: * provider/configuration: Add `virtual_environment.otp` argument for TOTP support * resource/virtual_environment_vm: Clone supports resize and datastore_id for moving disks * resource/virtual_environment_vm: Bulk clones can now use retries as argument to try multiple times to create a clone. +* resource/virtual_environment_vm: `on_boot` parameter can be used to start a VM after the Node has been rebooted. +* resource/virtual_environment_vm: `reboot` parameter can be used to reboot a VM after creation BUG FIXES: From 8ae3b2c0e33b9930b8044010aacc67287a5d4fe0 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Fri, 8 Jan 2021 13:42:16 +0100 Subject: [PATCH 30/42] Parameterize all timeouts --- proxmox/virtual_environment_vm.go | 24 +++--- proxmoxtf/resource_virtual_environment_vm.go | 89 ++++++++++++++++---- 2 files changed, 84 insertions(+), 29 deletions(-) diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 3a6d2b17..d5bf7398 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -24,7 +24,7 @@ var ( ) // CloneVM clones a virtual machine. -func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries int, d *VirtualEnvironmentVMCloneRequestBody) error { +func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries int, d *VirtualEnvironmentVMCloneRequestBody, timeout int) error { resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} var err error @@ -44,7 +44,7 @@ func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries in return errors.New("The server did not include a data object in the response") } - err = c.WaitForNodeTask(nodeName, *resBody.Data, 1800, 5) + err = c.WaitForNodeTask(nodeName, *resBody.Data, timeout, 5) if err == nil { return nil @@ -158,7 +158,7 @@ func (c *VirtualEnvironmentClient) GetVMStatus(nodeName string, vmID int) (*Virt } // MoveVMDisk moves a virtual machine disk. -func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody) error { +func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody, timeout int) error { taskID, err := c.MoveVMDiskAsync(nodeName, vmID, d) if strings.Contains(err.Error(), "you can't move to the same storage with same format") { @@ -170,7 +170,7 @@ func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *Virt return err } - err = c.WaitForNodeTask(nodeName, *taskID, 86400, 5) + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) if err != nil { return err @@ -201,14 +201,14 @@ func (c *VirtualEnvironmentClient) ListVMs() ([]*VirtualEnvironmentVMListRespons } // RebootVM reboots a virtual machine. -func (c *VirtualEnvironmentClient) RebootVM(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody) error { +func (c *VirtualEnvironmentClient) RebootVM(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody, timeout int) error { taskID, err := c.RebootVMAsync(nodeName, vmID, d) if err != nil { return err } - err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) if err != nil { return err @@ -249,14 +249,14 @@ func (c *VirtualEnvironmentClient) ResizeVMDisk(nodeName string, vmID int, d *Vi } // ShutdownVM shuts down a virtual machine. -func (c *VirtualEnvironmentClient) ShutdownVM(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody) error { +func (c *VirtualEnvironmentClient) ShutdownVM(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody, timeout int) error { taskID, err := c.ShutdownVMAsync(nodeName, vmID, d) if err != nil { return err } - err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) if err != nil { return err @@ -282,14 +282,14 @@ func (c *VirtualEnvironmentClient) ShutdownVMAsync(nodeName string, vmID int, d } // StartVM starts a virtual machine. -func (c *VirtualEnvironmentClient) StartVM(nodeName string, vmID int) error { +func (c *VirtualEnvironmentClient) StartVM(nodeName string, vmID int, timeout int) error { taskID, err := c.StartVMAsync(nodeName, vmID) if err != nil { return err } - err = c.WaitForNodeTask(nodeName, *taskID, 1800, 5) + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) if err != nil { return err @@ -315,14 +315,14 @@ func (c *VirtualEnvironmentClient) StartVMAsync(nodeName string, vmID int) (*str } // StopVM stops a virtual machine. -func (c *VirtualEnvironmentClient) StopVM(nodeName string, vmID int) error { +func (c *VirtualEnvironmentClient) StopVM(nodeName string, vmID int, timeout int) error { taskID, err := c.StopVMAsync(nodeName, vmID) if err != nil { return err } - err = c.WaitForNodeTask(nodeName, *taskID, 300, 5) + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) if err != nil { return err diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index de12d089..453db43a 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -78,6 +78,12 @@ const ( dvResourceVirtualEnvironmentVMStarted = true dvResourceVirtualEnvironmentVMTabletDevice = true dvResourceVirtualEnvironmentVMTemplate = false + dvResourceVirtualEnvironmentVMTimeoutClone = 1800 + dvResourceVirtualEnvironmentVMTimeoutMoveDisk = 1800 + dvResourceVirtualEnvironmentVMTimeoutReboot = 1800 + dvResourceVirtualEnvironmentVMTimeoutShutdownVM = 1800 + dvResourceVirtualEnvironmentVMTimeoutStartVM = 1800 + dvResourceVirtualEnvironmentVMTimeoutStopVM = 300 dvResourceVirtualEnvironmentVMVGAEnabled = true dvResourceVirtualEnvironmentVMVGAMemory = 16 dvResourceVirtualEnvironmentVMVGAType = "std" @@ -173,6 +179,12 @@ const ( mkResourceVirtualEnvironmentVMStarted = "started" mkResourceVirtualEnvironmentVMTabletDevice = "tablet_device" mkResourceVirtualEnvironmentVMTemplate = "template" + mkResourceVirtualEnvironmentVMTimeoutClone = "timeout_clone" + mkResourceVirtualEnvironmentVMTimeoutMoveDisk = "timeout_move_disk" + mkResourceVirtualEnvironmentVMTimeoutReboot = "timeout_reboot" + mkResourceVirtualEnvironmentVMTimeoutShutdownVM = "timeout_shutdown_vm" + mkResourceVirtualEnvironmentVMTimeoutStartVM = "timeout_start_vm" + mkResourceVirtualEnvironmentVMTimeoutStopVM = "timeout_stop_vm" mkResourceVirtualEnvironmentVMVGA = "vga" mkResourceVirtualEnvironmentVMVGAEnabled = "enabled" mkResourceVirtualEnvironmentVMVGAMemory = "memory" @@ -945,6 +957,42 @@ func resourceVirtualEnvironmentVM() *schema.Resource { ForceNew: true, Default: dvResourceVirtualEnvironmentVMTemplate, }, + mkResourceVirtualEnvironmentVMTimeoutClone: { + Type: schema.TypeInt, + Description: "Clone VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutClone, + }, + mkResourceVirtualEnvironmentVMTimeoutMoveDisk: { + Type: schema.TypeInt, + Description: "MoveDisk timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutMoveDisk, + }, + mkResourceVirtualEnvironmentVMTimeoutReboot: { + Type: schema.TypeInt, + Description: "Reboot timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutReboot, + }, + mkResourceVirtualEnvironmentVMTimeoutShutdownVM: { + Type: schema.TypeInt, + Description: "Shutdown timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutShutdownVM, + }, + mkResourceVirtualEnvironmentVMTimeoutStartVM: { + Type: schema.TypeInt, + Description: "Start VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutStartVM, + }, + mkResourceVirtualEnvironmentVMTimeoutStopVM: { + Type: schema.TypeInt, + Description: "Stop VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutStopVM, + }, mkResourceVirtualEnvironmentVMVGA: { Type: schema.TypeList, Description: "The VGA configuration", @@ -1066,12 +1114,14 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cloneBody.PoolID = &poolID } + cloneTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutClone).(int) + if cloneNodeName != "" && cloneNodeName != nodeName { cloneBody.TargetNodeName = &nodeName - err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneRetries, cloneBody) + err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneRetries, cloneBody, cloneTimeout) } else { - err = veClient.CloneVM(nodeName, cloneVMID, cloneRetries, cloneBody) + err = veClient.CloneVM(nodeName, cloneVMID, cloneRetries, cloneBody, cloneTimeout) } if err != nil { @@ -1414,7 +1464,8 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface } if dataStoreID != "" { - err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody) + moveDiskTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutMoveDisk).(int) + err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody, moveDiskTimeout) if err != nil { return err @@ -1860,18 +1911,19 @@ func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface } // Start the virtual machine and wait for it to reach a running state before continuing. - err = veClient.StartVM(nodeName, vmID) + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err } if reboot { - rebootTimeout := 300 + rebootTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutReboot).(int) err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ Timeout: &rebootTimeout, - }) + }, (rebootTimeout + 30)) if err != nil { return err @@ -3515,19 +3567,20 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e if d.HasChange(mkResourceVirtualEnvironmentVMStarted) && !bool(template) { if started { - err = veClient.StartVM(nodeName, vmID) + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err } } else { forceStop := proxmox.CustomBool(true) - shutdownTimeout := 300 + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ ForceStop: &forceStop, Timeout: &shutdownTimeout, - }) + }, (shutdownTimeout + 30)) if err != nil { return err @@ -3603,12 +3656,12 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat if len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0 { if !template { forceStop := proxmox.CustomBool(true) - shutdownTimeout := 300 + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ ForceStop: &forceStop, Timeout: &shutdownTimeout, - }) + }, (shutdownTimeout + 30)) if err != nil { return err @@ -3619,7 +3672,8 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat } for _, reqBody := range diskMoveBodies { - err = veClient.MoveVMDisk(nodeName, vmID, reqBody) + moveDiskTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutMoveDisk).(int) + err = veClient.MoveVMDisk(nodeName, vmID, reqBody, moveDiskTimeout) if err != nil { return err @@ -3635,7 +3689,8 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat } if (len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0) && started && !template { - err = veClient.StartVM(nodeName, vmID) + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err @@ -3645,11 +3700,11 @@ func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceDat // Perform a regular reboot in case it's necessary and haven't already been done. if reboot { - rebootTimeout := 300 + rebootTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutReboot).(int) err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ Timeout: &rebootTimeout, - }) + }, (rebootTimeout + 30)) if err != nil { return err @@ -3683,12 +3738,12 @@ func resourceVirtualEnvironmentVMDelete(d *schema.ResourceData, m interface{}) e if status.Status != "stopped" { forceStop := proxmox.CustomBool(true) - shutdownTimeout := 300 + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ ForceStop: &forceStop, Timeout: &shutdownTimeout, - }) + }, (shutdownTimeout + 30)) if err != nil { return err From 87e0fe92fbcf5f6aeefa6391cd486851581abdd0 Mon Sep 17 00:00:00 2001 From: Lucas Hahn Date: Fri, 8 Jan 2021 14:29:18 +0100 Subject: [PATCH 31/42] Upadte doc and changelog --- CHANGELOG.md | 1 + docs/resources/vm.md | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ff501d..207fd821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ ENHANCEMENTS: * resource/virtual_environment_vm: Bulk clones can now use retries as argument to try multiple times to create a clone. * resource/virtual_environment_vm: `on_boot` parameter can be used to start a VM after the Node has been rebooted. * resource/virtual_environment_vm: `reboot` parameter can be used to reboot a VM after creation +* resource/virtual_environment_vm: Has now multiple new parameters to set timeouts for the vm creation/cloning `timeout_clone`, `timeout_move_disk`, `timeout_reboot`, `timeout_shutdown_vm`, `timeout_start_vm`, `timeout_stop_vm` BUG FIXES: diff --git a/docs/resources/vm.md b/docs/resources/vm.md index 7bea83cb..60dee6a2 100644 --- a/docs/resources/vm.md +++ b/docs/resources/vm.md @@ -271,6 +271,12 @@ output "ubuntu_vm_public_key" { * `started` - (Optional) Whether to start the virtual machine (defaults to `true`). * `tablet_device` - (Optional) Whether to enable the USB tablet device (defaults to `true`). * `template` - (Optional) Whether to create a template (defaults to `false`). +* `timeout_clone` - (Optional) Timeout for cloning a VM in seconds (defaults to 1800). +* `timeout_move_disk` - (Optional) Timeout for moving the disk of a VM in seconds (defaults to 1800). +* `timeout_reboot` - (Optional) Timeout for rebooting a VM in seconds (defaults to 1800). +* `timeout_shutdown_vm` - (Optional) Timeout for shutting down a VM in seconds (defaults to 1800). +* `timeout_start_vm` - (Optional) Timeout for starting a VM in seconds (defaults to 1800). +* `timeout_stop_vm` - (Optional) Timeout for stopping a VM in seconds (defaults to 300). * `vga` - (Optional) The VGA configuration. * `enabled` - (Optional) Whether to enable the VGA device (defaults to `true`). * `memory` - (Optional) The VGA memory in megabytes (defaults to `16`). From 0b68e058cf975dd75c22a055aff8e52e5b9a667b Mon Sep 17 00:00:00 2001 From: mleone87 Date: Wed, 20 Jan 2021 17:11:35 +0100 Subject: [PATCH 32/42] Fix a typo and make disk import coherent with disk interface Fix a small typo in resourceVirtualEnvironmentVMCreateCustom function and make the provider capable to import disk with the correct interface --- proxmoxtf/resource_virtual_environment_vm.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index 453db43a..48fba726 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -1549,7 +1549,7 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac return err } - virtioDeviceObjects := diskDeviceObjects["vitio"] + virtioDeviceObjects := diskDeviceObjects["virtio"] scsiDeviceObjects := diskDeviceObjects["scsi"] //ideDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "ide") sataDeviceObjects := diskDeviceObjects["sata"] @@ -1798,6 +1798,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int fileFormat, _ := block[mkResourceVirtualEnvironmentVMDiskFileFormat].(string) size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) speed := block[mkResourceVirtualEnvironmentVMDiskSpeed].([]interface{}) + diskInterface,_ := block[mkResourcevirtualEnvironmentVMDiskInterface].(string) if len(speed) == 0 { diskSpeedDefault, err := diskSpeedResource.DefaultValue() @@ -1853,6 +1854,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int fmt.Sprintf(`disk_index="%d"`, i), fmt.Sprintf(`disk_options="%s"`, diskOptions), fmt.Sprintf(`disk_size="%d"`, size), + fmt.Sprintf(`disk_interface="%s"`, diskInterface), fmt.Sprintf(`file_path="%s"`, filePath), fmt.Sprintf(`file_path_tmp="%s"`, filePathTmp), fmt.Sprintf(`vm_id="%d"`, vmID), @@ -1867,7 +1869,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int `qemu-img resize "$file_path_tmp" "${disk_size}G"`, `qm importdisk "$vm_id" "$file_path_tmp" "$datastore_id_target" -format qcow2`, `disk_id="${datastore_id_target}:$([[ -n "$dsp_target" ]] && echo "${vm_id}/" || echo "")vm-${vm_id}-disk-${disk_count}$([[ -n "$dsp_target" ]] && echo ".qcow2" || echo "")${disk_options}"`, - `qm set "$vm_id" "-scsi${disk_index}" "$disk_id"`, + `qm set "$vm_id" "-${disk_interface}" "$disk_id"`, `rm -f "$file_path_tmp"`, ) From 259b4465832d275748fd00719fe04b50581fe9f1 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 00:00:56 +0100 Subject: [PATCH 33/42] Update changelog, documentation and release workflow --- .github/workflows/release.yaml | 40 ++++++++++++--------------------- .goreleaser.yml | 15 +++---------- .travis.yml | 2 +- CHANGELOG.md | 8 +++---- docs/data-sources/alias.md | 5 +++-- docs/data-sources/aliases.md | 5 +++-- docs/data-sources/datastores.md | 5 +++-- docs/data-sources/dns.md | 5 +++-- docs/data-sources/group.md | 5 +++-- docs/data-sources/groups.md | 5 +++-- docs/data-sources/hosts.md | 5 +++-- docs/data-sources/nodes.md | 5 +++-- docs/data-sources/pool.md | 5 +++-- docs/data-sources/pools.md | 5 +++-- docs/data-sources/role.md | 5 +++-- docs/data-sources/roles.md | 5 +++-- docs/data-sources/time.md | 5 +++-- docs/data-sources/user.md | 5 +++-- docs/data-sources/users.md | 5 +++-- docs/data-sources/version.md | 5 +++-- docs/index.md | 2 +- docs/resources/alias.md | 5 +++-- docs/resources/certificate.md | 5 +++-- docs/resources/container.md | 5 +++-- docs/resources/dns.md | 5 +++-- docs/resources/file.md | 5 +++-- docs/resources/group.md | 5 +++-- docs/resources/hosts.md | 5 +++-- docs/resources/ipset.md | 5 +++-- docs/resources/pool.md | 5 +++-- docs/resources/role.md | 5 +++-- docs/resources/time.md | 5 +++-- docs/resources/user.md | 5 +++-- docs/resources/vm.md | 5 +++-- 34 files changed, 110 insertions(+), 102 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9776db75..1b13167a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,47 +1,35 @@ -# This GitHub action can publish assets for release when a tag is created. -# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). -# -# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your -# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` -# secret. If you would rather own your own GPG handling, please fork this action -# or use an alternative one for key handling. -# -# You will need to pass the `--batch` flag to `gpg` in your signing step -# in `goreleaser` to indicate this is being used in a non-interactive mode. -# -name: release +name: Create release on: push: tags: - 'v*' jobs: goreleaser: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - name: Checkout + name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go + name: Set up the required version of Go uses: actions/setup-go@v2 with: - go-version: 1.14 + go-version: 1.15 - - name: Import GPG key - id: import_gpg - uses: paultyng/ghaction-import-gpg@v2.1.0 + name: Import the GPG signing key env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.PASSPHRASE }} + GPG_KEY: ${{ secrets.GPG_KEY }} + run: | + echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import + gpg --keyid-format LONG --list-secret-keys - - name: Run GoReleaser + name: Create release uses: goreleaser/goreleaser-action@v2 with: version: latest args: release --rm-dist env: - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 37845af0..e3448085 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,14 +1,8 @@ -# Visit https://goreleaser.com for documentation on how to customize this -# behavior. before: hooks: - # this is just an example and not a requirement for provider building/publishing - go mod tidy builds: - env: - # goreleaser does not work with CGO, it could also complicate - # usage by users in CI/CD systems like Terraform Cloud where - # they are unable to install libraries. - CGO_ENABLED=0 mod_timestamp: '{{ .CommitTimestamp }}' flags: @@ -38,17 +32,14 @@ checksum: signs: - artifacts: checksum args: - # if you are using this is a GitHub action or some other automated pipeline, you - # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" - - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key + - "{{ .Env.GPG_FINGERPRINT }}" - "--output" - "${signature}" - "--detach-sign" - "${artifact}" release: - # If you want to manually examine the release before its live, uncomment this line: - # draft: true + draft: false changelog: - skip: true \ No newline at end of file + skip: true diff --git a/.travis.yml b/.travis.yml index 695ca621..5ca0fb08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: - $HOME/gopath/pkg/mod go: - - 1.13.x + - 1.15.x git: depth: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 207fd821..c4c78c16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.4.0 (UNRELEASED) +## v0.4.0 FEATURES: @@ -7,7 +7,7 @@ FEATURES: BREAKING CHANGES: -* `interface` is now required to create disks +* resource/virtual_environment_vm: `interface` is now required to create disks ``` disk { @@ -29,12 +29,12 @@ ENHANCEMENTS: BUG FIXES: * library/virtual_environment_nodes: Fix node IP address format +* library/virtual_environment_nodes: Fix WaitForNodeTask now detects errors correctly +* library/virtual_environment_vm: Fix CloneVM now waits for the task to be finished and detect errors. * resource/virtual_environment_container: Fix VM ID collision when `vm_id` is not specified * resource/virtual_environment_vm: Fix VM ID collision when `vm_id` is not specified * resource/virtual_environment_vm: Fix disk import issue when importing from directory-based datastores * resource/virtual/environment/vm: Fix handling of storage name - correct handling of `-` -* library/virtual_environment_nodes: Fix WaitForNodeTask now detects errors correctly -* library/virtual_environment_vm: Fix CloneVM now waits for the task to be finished and detect errors. WORKAROUNDS: diff --git a/docs/data-sources/alias.md b/docs/data-sources/alias.md index 4efb0cb0..bbf5a602 100644 --- a/docs/data-sources/alias.md +++ b/docs/data-sources/alias.md @@ -4,6 +4,7 @@ title: Alias permalink: /data-sources/alias nav_order: 1 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Alias @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_cluster_alias" "local_network" { } ``` -## Arguments Reference +## Argument Reference * `name` - (Required) Alias name. -## Attributes Reference +## Attribute Reference * `cidr` - (Required) Network/IP specification in CIDR format. * `comment` - (Optional) Alias comment. diff --git a/docs/data-sources/aliases.md b/docs/data-sources/aliases.md index adc63492..68fb7ece 100644 --- a/docs/data-sources/aliases.md +++ b/docs/data-sources/aliases.md @@ -4,6 +4,7 @@ title: Aliases permalink: /data-sources/aliases nav_order: 2 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Aliases @@ -16,10 +17,10 @@ Retrieves the identifiers for all the available aliases. data "proxmox_virtual_environment_cluster_aliases" "available_aliases" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `alias_ids` - The pool identifiers. diff --git a/docs/data-sources/datastores.md b/docs/data-sources/datastores.md index ba79a389..2b9cc74f 100644 --- a/docs/data-sources/datastores.md +++ b/docs/data-sources/datastores.md @@ -4,6 +4,7 @@ title: Datastores permalink: /data-sources/datastores nav_order: 3 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Datastores @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_datastores" "first_node" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `active` - Whether the datastore is active. * `content_types` - The allowed content types. diff --git a/docs/data-sources/dns.md b/docs/data-sources/dns.md index de80ac05..bc65150d 100644 --- a/docs/data-sources/dns.md +++ b/docs/data-sources/dns.md @@ -4,6 +4,7 @@ title: DNS permalink: /data-sources/dns nav_order: 4 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: DNS @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_dns" "first_node" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `domain` - The DNS search domain. * `servers` - The DNS servers. diff --git a/docs/data-sources/group.md b/docs/data-sources/group.md index a55b95b5..27b517b7 100644 --- a/docs/data-sources/group.md +++ b/docs/data-sources/group.md @@ -4,6 +4,7 @@ title: Group permalink: /data-sources/group nav_order: 5 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Group @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_group" "operations_team" { } ``` -## Arguments Reference +## Argument Reference * `group_id` - (Required) The group identifier. -## Attributes Reference +## Attribute Reference * `acl` - The access control list. * `path` - The path. diff --git a/docs/data-sources/groups.md b/docs/data-sources/groups.md index c85a27f2..524a25a4 100644 --- a/docs/data-sources/groups.md +++ b/docs/data-sources/groups.md @@ -4,6 +4,7 @@ title: Groups permalink: /data-sources/groups nav_order: 6 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Groups @@ -16,11 +17,11 @@ Retrieves basic information about all available user groups. data "proxmox_virtual_environment_groups" "available_groups" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `comments` - The group comments. * `group_ids` - The group identifiers. diff --git a/docs/data-sources/hosts.md b/docs/data-sources/hosts.md index 3d7707a4..ccc73767 100644 --- a/docs/data-sources/hosts.md +++ b/docs/data-sources/hosts.md @@ -4,6 +4,7 @@ title: Hosts permalink: /data-sources/hosts nav_order: 7 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Hosts @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_hosts" "first_node_host_entries" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `addresses` - The IP addresses. * `digest` - The SHA1 digest. diff --git a/docs/data-sources/nodes.md b/docs/data-sources/nodes.md index d091a7dd..d9648795 100644 --- a/docs/data-sources/nodes.md +++ b/docs/data-sources/nodes.md @@ -4,6 +4,7 @@ title: Nodes permalink: /data-sources/nodes nav_order: 8 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Nodes @@ -16,11 +17,11 @@ Retrieves information about all available nodes. data "proxmox_virtual_environment_nodes" "available_nodes" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `cpu_count` - The CPU count for each node. * `cpu_utilization` - The CPU utilization on each node. diff --git a/docs/data-sources/pool.md b/docs/data-sources/pool.md index f57871b3..394e1bb1 100644 --- a/docs/data-sources/pool.md +++ b/docs/data-sources/pool.md @@ -4,6 +4,7 @@ title: Pool permalink: /data-sources/pool nav_order: 9 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Pool @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_pool" "operations_pool" { } ``` -## Arguments Reference +## Argument Reference * `pool_id` - (Required) The pool identifier. -## Attributes Reference +## Attribute Reference * `comment` - The pool comment. * `members` - The pool members. diff --git a/docs/data-sources/pools.md b/docs/data-sources/pools.md index 3a502c0b..5b712a55 100644 --- a/docs/data-sources/pools.md +++ b/docs/data-sources/pools.md @@ -4,6 +4,7 @@ title: Pools permalink: /data-sources/pools nav_order: 10 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Pools @@ -16,10 +17,10 @@ Retrieves the identifiers for all the available resource pools. data "proxmox_virtual_environment_pools" "available_pools" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `pool_ids` - The pool identifiers. diff --git a/docs/data-sources/role.md b/docs/data-sources/role.md index 0676ca8b..24cbbfff 100644 --- a/docs/data-sources/role.md +++ b/docs/data-sources/role.md @@ -4,6 +4,7 @@ title: Role permalink: /data-sources/role nav_order: 11 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Role @@ -18,10 +19,10 @@ data "proxmox_virtual_environment_role" "operations_role" { } ``` -## Arguments Reference +## Argument Reference * `role_id` - (Required) The role identifier. -## Attributes Reference +## Attribute Reference * `privileges` - The role privileges diff --git a/docs/data-sources/roles.md b/docs/data-sources/roles.md index 8ee1b58e..fb0fc4b3 100644 --- a/docs/data-sources/roles.md +++ b/docs/data-sources/roles.md @@ -4,6 +4,7 @@ title: Roles permalink: /data-sources/roles nav_order: 12 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Roles @@ -16,11 +17,11 @@ Retrieves information about all the available roles. data "proxmox_virtual_environment_roles" "available_roles" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `privileges` - The role privileges. * `role_ids` - The role identifiers. diff --git a/docs/data-sources/time.md b/docs/data-sources/time.md index 455e50e2..b5800348 100644 --- a/docs/data-sources/time.md +++ b/docs/data-sources/time.md @@ -4,6 +4,7 @@ title: Time permalink: /data-sources/time nav_order: 13 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Time @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_time" "first_node_time" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `local_time` - The node's local time. * `time_zone` - The node's time zone. diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index 64120a71..5c159958 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -4,6 +4,7 @@ title: User permalink: /data-sources/user nav_order: 14 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: User @@ -18,11 +19,11 @@ data "proxmox_virtual_environment_user" "operations_user" { } ``` -## Arguments Reference +## Argument Reference * `user_id` - (Required) The user identifier. -## Attributes Reference +## Attribute Reference * `acl` - The access control list. * `path` - The path. diff --git a/docs/data-sources/users.md b/docs/data-sources/users.md index 0375474a..2768738b 100644 --- a/docs/data-sources/users.md +++ b/docs/data-sources/users.md @@ -4,6 +4,7 @@ title: Users permalink: /data-sources/users nav_order: 15 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Users @@ -16,11 +17,11 @@ Retrieves information about all the available users. data "proxmox_virtual_environment_users" "available_users" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `comments` - The user comments. * `emails` - The users' email addresses. diff --git a/docs/data-sources/version.md b/docs/data-sources/version.md index 3eacaca1..45c43da9 100644 --- a/docs/data-sources/version.md +++ b/docs/data-sources/version.md @@ -4,6 +4,7 @@ title: Version permalink: /data-sources/version nav_order: 16 parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Version @@ -16,11 +17,11 @@ Retrieves the version information from the API endpoint. data "proxmox_virtual_environment_version" "current_version" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `keyboard_layout` - The keyboard layout. * `release` - The release number. diff --git a/docs/index.md b/docs/index.md index d819239a..e56366bd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -64,7 +64,7 @@ $ export PROXMOX_VE_PASSWORD="a-strong-password" $ terraform plan ``` -## Arguments Reference +## Argument Reference In addition to [generic provider arguments](https://www.terraform.io/docs/configuration/providers.html) (e.g. `alias` and `version`), the following arguments are supported in the Proxmox `provider` block: diff --git a/docs/resources/alias.md b/docs/resources/alias.md index 2f9cfcad..319914e1 100644 --- a/docs/resources/alias.md +++ b/docs/resources/alias.md @@ -4,6 +4,7 @@ title: Alias permalink: /ressources/alias nav_order: 1 parent: Resources +subcategory: Virtual Environment --- # Resource: Alias @@ -27,12 +28,12 @@ resource "proxmox_virtual_environment_cluster_alias" "ubuntu_vm" { } ``` -## Arguments Reference +## Argument Reference * `name` - (Required) Alias name. * `cidr` - (Required) Network/IP specification in CIDR format. * `comment` - (Optional) Alias comment. -## Attributes Reference +## Attribute Reference There are no attribute references available for this resource. diff --git a/docs/resources/certificate.md b/docs/resources/certificate.md index 840c8f38..148801dc 100644 --- a/docs/resources/certificate.md +++ b/docs/resources/certificate.md @@ -4,6 +4,7 @@ title: Certificate permalink: /resources/certificate nav_order: 2 parent: Resources +subcategory: Virtual Environment --- # Resource: Certificate @@ -43,14 +44,14 @@ resource "tls_self_signed_cert" "proxmox_virtual_environment_certificate" { } ``` -## Arguments Reference +## Argument Reference * `certificate` - (Required) The PEM encoded certificate. * `certificate_chain` - (Optional) The PEM encoded certificate chain. * `node_name` - (Required) A node name. * `private_key` - (Required) The PEM encoded private key. -## Attributes Reference +## Attribute Reference * `expiration_date` - The expiration date (RFC 3339). * `file_name` - The file name. diff --git a/docs/resources/container.md b/docs/resources/container.md index 8ab1ae58..ee1b5306 100644 --- a/docs/resources/container.md +++ b/docs/resources/container.md @@ -4,6 +4,7 @@ title: Container permalink: /resources/container nav_order: 3 parent: Resources +subcategory: Virtual Environment --- # Resource: Container @@ -80,7 +81,7 @@ output "ubuntu_container_public_key" { } ``` -## Arguments Reference +## Argument Reference * `clone` - (Optional) The cloning configuration. * `datastore_id` - (Optional) The identifier for the target datastore. @@ -147,6 +148,6 @@ output "ubuntu_container_public_key" { * `template` - (Optional) Whether to create a template (defaults to `false`). * `vm_id` - (Optional) The virtual machine identifier -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/dns.md b/docs/resources/dns.md index 360ddcd5..49bdf123 100644 --- a/docs/resources/dns.md +++ b/docs/resources/dns.md @@ -4,6 +4,7 @@ title: DNS permalink: /resources/dns nav_order: 4 parent: Resources +subcategory: Virtual Environment --- # Resource: DNS @@ -28,13 +29,13 @@ data "proxmox_virtual_environment_dns" "first_node_dns_configuration" { } ``` -## Arguments Reference +## Argument Reference * `domain` - (Required) The DNS search domain. * `node_name` - (Required) A node name. * `servers` - (Optional) The DNS servers. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/file.md b/docs/resources/file.md index 3b73db4d..34ea9462 100644 --- a/docs/resources/file.md +++ b/docs/resources/file.md @@ -4,6 +4,7 @@ title: File permalink: /resources/file nav_order: 5 parent: Resources +subcategory: Virtual Environment --- # Resource: File @@ -24,7 +25,7 @@ resource "proxmox_virtual_environment_file" "ubuntu_container_template" { } ``` -## Arguments Reference +## Argument Reference * `content_type` - (Optional) The content type. * `backup` @@ -43,7 +44,7 @@ resource "proxmox_virtual_environment_file" "ubuntu_container_template" { * `file_name` - (Required) The file name. * `resize` - (Optional) The number of bytes to resize the file to. -## Attributes Reference +## Attribute Reference * `file_modification_date` - The file modification date (RFC 3339). * `file_name` - The file name. diff --git a/docs/resources/group.md b/docs/resources/group.md index d6c80212..1e13cf6f 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -4,6 +4,7 @@ title: Group permalink: /resources/group nav_order: 6 parent: Resources +subcategory: Virtual Environment --- # Resource: Group @@ -19,7 +20,7 @@ resource "proxmox_virtual_environment_group" "operations_team" { } ``` -## Arguments Reference +## Argument Reference * `acl` - (Optional) The access control list (multiple blocks supported). * `path` - The path. @@ -28,6 +29,6 @@ resource "proxmox_virtual_environment_group" "operations_team" { * `comment` - (Optional) The group comment. * `group_id` - (Required) The group identifier. -## Attributes Reference +## Attribute Reference * `members` - The group members as a list of `username@realm` entries diff --git a/docs/resources/hosts.md b/docs/resources/hosts.md index 6bcd52a5..e9805ef1 100644 --- a/docs/resources/hosts.md +++ b/docs/resources/hosts.md @@ -4,6 +4,7 @@ title: Hosts permalink: /resources/hosts nav_order: 7 parent: Resources +subcategory: Virtual Environment --- # Resource: Hosts @@ -27,14 +28,14 @@ resource "proxmox_virtual_environment_hosts" "first_node_host_entries" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. * `entry` - (Required) A host entry (multiple blocks supported). * `address` - (Required) The IP address. * `hostnames` - (Required) The hostnames. -## Attributes Reference +## Attribute Reference * `addresses` - The IP addresses. * `digest` - The SHA1 digest. diff --git a/docs/resources/ipset.md b/docs/resources/ipset.md index 0ac85187..935539f4 100644 --- a/docs/resources/ipset.md +++ b/docs/resources/ipset.md @@ -4,6 +4,7 @@ title: IPSet permalink: /ressources/ipset nav_order: 8 parent: Resources +subcategory: Virtual Environment --- # Resource: IPSet @@ -35,7 +36,7 @@ resource "proxmox_virtual_environment_cluster_ipset" "ipset" { } ``` -## Arguments Reference +## Argument Reference * `name` - (Required) Alias name. * `comment` - (Optional) Alias comment. @@ -44,6 +45,6 @@ resource "proxmox_virtual_environment_cluster_ipset" "ipset" { * `comment` - (Optional) Arbitrary string annotation. * `nomatch` - (Optional) Entries marked as `nomatch` are skipped as if those were not added to the set. -## Attributes Reference +## Attribute Reference There are no attribute references available for this resource. diff --git a/docs/resources/pool.md b/docs/resources/pool.md index 7cbc0d1d..31bbb69c 100644 --- a/docs/resources/pool.md +++ b/docs/resources/pool.md @@ -4,6 +4,7 @@ title: Pool permalink: /resources/pool nav_order: 9 parent: Resources +subcategory: Virtual Environment --- # Resource: Pool @@ -19,12 +20,12 @@ resource "proxmox_virtual_environment_pool" "operations_pool" { } ``` -## Arguments Reference +## Argument Reference * `comment` - (Optional) The pool comment. * `pool_id` - (Required) The pool identifier. -## Attributes Reference +## Attribute Reference * `members` - The pool members. * `datastore_id` - The datastore identifier. diff --git a/docs/resources/role.md b/docs/resources/role.md index df59c6ed..38bf541d 100644 --- a/docs/resources/role.md +++ b/docs/resources/role.md @@ -4,6 +4,7 @@ title: Role permalink: /resources/role nav_order: 10 parent: Resources +subcategory: Virtual Environment --- # Resource: Role @@ -22,11 +23,11 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { } ``` -## Arguments Reference +## Argument Reference * `privileges` - (Required) The role privileges. * `role_id` - (Required) The role identifier. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/time.md b/docs/resources/time.md index 3dbc0f34..18720635 100644 --- a/docs/resources/time.md +++ b/docs/resources/time.md @@ -4,6 +4,7 @@ title: Time permalink: /resources/time nav_order: 11 parent: Resources +subcategory: Virtual Environment --- # Resource: Time @@ -19,12 +20,12 @@ resource "proxmox_virtual_environment_time" "first_node_time" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. * `time_zone` - (Required) The node's time zone. -## Attributes Reference +## Attribute Reference * `local_time` - The node's local time. * `utc_time` - The node's local time formatted as UTC. diff --git a/docs/resources/user.md b/docs/resources/user.md index 9fec586f..e9184548 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -4,6 +4,7 @@ title: User permalink: /resources/user nav_order: 12 parent: Resources +subcategory: Virtual Environment --- # Resource: User @@ -34,7 +35,7 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { } ``` -## Arguments Reference +## Argument Reference * `acl` - (Optional) The access control list (multiple blocks supported). * `path` - The path. @@ -51,6 +52,6 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { * `password` - (Required) The user's password. * `user_id` - (Required) The user identifier. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/vm.md b/docs/resources/vm.md index 60dee6a2..5b940dd2 100644 --- a/docs/resources/vm.md +++ b/docs/resources/vm.md @@ -4,6 +4,7 @@ title: VM permalink: /resources/vm nav_order: 13 parent: Resources +subcategory: Virtual Environment --- # Resource: VM @@ -91,7 +92,7 @@ output "ubuntu_vm_public_key" { } ``` -## Arguments Reference +## Argument Reference * `acpi` - (Optional) Whether to enable ACPI (defaults to `true`). * `agent` - (Optional) The QEMU agent configuration. @@ -295,7 +296,7 @@ output "ubuntu_vm_public_key" { * `vmware` - VMware Compatible. * `vm_id` - (Optional) The VM identifier. -## Attributes Reference +## Attribute Reference * `ipv4_addresses` - The IPv4 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`) * `ipv6_addresses` - The IPv6 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`) From 53f1e93f21d74051d18d68302c64660a07a0ce34 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 00:13:53 +0100 Subject: [PATCH 34/42] Minor update to changelog and versions.tf. Added initial test workflow as a replacement for Travis --- .../workflows/{release.yaml => release.yml} | 0 .github/workflows/test.yml | 37 +++++++++++++++++++ CHANGELOG.md | 14 +++---- example/versions.tf | 2 +- 4 files changed, 45 insertions(+), 8 deletions(-) rename .github/workflows/{release.yaml => release.yml} (100%) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release.yaml rename to .github/workflows/release.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..37c07770 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Test changes +on: + pull_request: + branches: + - main + - master + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up the required version of Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - + name: Import the GPG signing key + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + run: | + echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import + gpg --keyid-format LONG --list-secret-keys + - + name: Create release + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist --snapshot + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} diff --git a/CHANGELOG.md b/CHANGELOG.md index c4c78c16..256a6124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,13 @@ BREAKING CHANGES: * resource/virtual_environment_vm: `interface` is now required to create disks -``` - disk { - datastore_id = "local-lvm" - file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" - interface = "scsi0" - } -``` + ``` + disk { + datastore_id = "local-lvm" + file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" + } + ``` ENHANCEMENTS: diff --git a/example/versions.tf b/example/versions.tf index 45c50008..6066ec0e 100644 --- a/example/versions.tf +++ b/example/versions.tf @@ -4,7 +4,7 @@ terraform { source = "hashicorp/local" } proxmox = { - source = "terraform.danitso.com/provider/proxmox" + source = "danitso/proxmox" } tls = { source = "hashicorp/tls" From b0bc399fca0b04da9b183a697328183294081503 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 00:26:31 +0100 Subject: [PATCH 35/42] Initial fix for GPG signing issue --- .github/workflows/release.yml | 3 ++- .github/workflows/test.yml | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b13167a..c0ccb000 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,8 @@ on: tags: - 'v*' jobs: - goreleaser: + release: + name: Tag runs-on: ubuntu-20.04 steps: - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37c07770..23c851bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,8 @@ on: - master - 'v*' jobs: - goreleaser: + test: + name: Pull Request runs-on: ubuntu-20.04 steps: - @@ -24,6 +25,9 @@ jobs: env: GPG_KEY: ${{ secrets.GPG_KEY }} run: | + GPG_TTY="$(tty)" + export GPG_TTY + echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import gpg --keyid-format LONG --list-secret-keys - From 55187e173fb4a2ac9b7fc319b5d5678eb071d696 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 01:53:00 +0100 Subject: [PATCH 36/42] Changes to workflows --- .github/workflows/release.yml | 14 +++++++------- .github/workflows/test.yml | 17 +++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0ccb000..8666d381 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,17 +20,17 @@ jobs: go-version: 1.15 - name: Import the GPG signing key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - run: | - echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import - gpg --keyid-format LONG --list-secret-keys + id: import_gpg + uses: danitso/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_KEY } + passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release - uses: goreleaser/goreleaser-action@v2 + uses: danitso/goreleaser-action@v2 with: version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23c851bf..adba6611 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,20 +22,17 @@ jobs: go-version: 1.15 - name: Import the GPG signing key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - run: | - GPG_TTY="$(tty)" - export GPG_TTY - - echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import - gpg --keyid-format LONG --list-secret-keys + id: import_gpg + uses: danitso/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_KEY } + passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release - uses: goreleaser/goreleaser-action@v2 + uses: danitso/goreleaser-action@v2 with: version: latest args: release --rm-dist --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} From 206ed8c0ef6895f6b2c6ac7cb7eec830c754efab Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 01:54:06 +0100 Subject: [PATCH 37/42] Fix typo in workflow files --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8666d381..5f427912 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: id: import_gpg uses: danitso/ghaction-import-gpg@v3 with: - gpg-private-key: ${{ secrets.GPG_KEY } + gpg-private-key: ${{ secrets.GPG_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index adba6611..fc2542ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: id: import_gpg uses: danitso/ghaction-import-gpg@v3 with: - gpg-private-key: ${{ secrets.GPG_KEY } + gpg-private-key: ${{ secrets.GPG_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release From b2858a6bfc84846b22c044c75882dc7047172f70 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 02:07:32 +0100 Subject: [PATCH 38/42] Use changes from forked branches --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f427912..92053226 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Import the GPG signing key id: import_gpg - uses: danitso/ghaction-import-gpg@v3 + uses: danitso/ghaction-import-gpg@master with: gpg-private-key: ${{ secrets.GPG_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc2542ab..eac20654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Import the GPG signing key id: import_gpg - uses: danitso/ghaction-import-gpg@v3 + uses: danitso/ghaction-import-gpg@master with: gpg-private-key: ${{ secrets.GPG_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} From 22750fd5a4c9f514e5ae7bdaea24555e897a5d90 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 03:14:00 +0100 Subject: [PATCH 39/42] Attempt to fix GPG issues --- .github/workflows/release.yml | 46 ++++++++++++++++++++++++-------- .github/workflows/test.yml | 46 ++++++++++++++++++++++++-------- .goreleaser.test.yml | 37 ++++++++++++++++++++++++++ .goreleaser.yml | 49 +++++++++++++++++++---------------- 4 files changed, 133 insertions(+), 45 deletions(-) create mode 100644 .goreleaser.test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92053226..c5fd86aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,19 +18,43 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.15 + - + name: Install the required version of GoReleaser + env: + GORELEASER_VERSION: '0.155.1' + run: | + curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb" + sudo dpkg -i goreleaser_amd64.deb + rm -f goreleaser_amd64.deb - name: Import the GPG signing key - id: import_gpg - uses: danitso/ghaction-import-gpg@master - with: - gpg-private-key: ${{ secrets.GPG_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + mkdir -p ~/.gnupg + + cat << EOF > ~/.gnupg/gpg.conf + use-agent + pinentry-mode loopback + EOF + + echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import + gpg --keyid-format LONG --list-secret-keys + + cat << EOF > ~/.gnupg/gpg-agent.conf + default-cache-ttl 7200 + max-cache-ttl 31536000 + allow-loopback-pinentry + allow-preset-passphrase + EOF + + echo RELOADAGENT | gpg-connect-agent + + printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase - name: Create release - uses: danitso/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + run: | + goreleaser build --parallelism 2 --rm-dist --timeout 1h diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eac20654..e8be4a0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,19 +20,43 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.15 + - + name: Install the required version of GoReleaser + env: + GORELEASER_VERSION: '0.155.1' + run: | + curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb" + sudo dpkg -i goreleaser_amd64.deb + rm -f goreleaser_amd64.deb - name: Import the GPG signing key - id: import_gpg - uses: danitso/ghaction-import-gpg@master - with: - gpg-private-key: ${{ secrets.GPG_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + mkdir -p ~/.gnupg + + cat << EOF > ~/.gnupg/gpg.conf + use-agent + pinentry-mode loopback + EOF + + echo "$GPG_KEY" | base64 -d -i | gpg --batch --allow-secret-key-import --import + gpg --keyid-format LONG --list-secret-keys + + cat << EOF > ~/.gnupg/gpg-agent.conf + default-cache-ttl 7200 + max-cache-ttl 31536000 + allow-loopback-pinentry + allow-preset-passphrase + EOF + + echo RELOADAGENT | gpg-connect-agent + + printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase - name: Create release - uses: danitso/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist --snapshot env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + run: | + goreleaser build --parallelism 2 --rm-dist --snapshot --timeout 1h diff --git a/.goreleaser.test.yml b/.goreleaser.test.yml new file mode 100644 index 00000000..467767b7 --- /dev/null +++ b/.goreleaser.test.yml @@ -0,0 +1,37 @@ +before: + hooks: + - go mod tidy +builds: +- env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +signs: + - artifacts: none +release: + draft: false +changelog: + skip: true diff --git a/.goreleaser.yml b/.goreleaser.yml index e3448085..dca0b00b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,30 +2,30 @@ before: hooks: - go mod tidy builds: -- env: - - CGO_ENABLED=0 - mod_timestamp: '{{ .CommitTimestamp }}' - flags: - - -trimpath - ldflags: - - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' - goos: - - freebsd - - windows - - linux - - darwin - goarch: - - amd64 - - '386' - - arm - - arm64 - ignore: - - goos: darwin - goarch: '386' - binary: '{{ .ProjectName }}_v{{ .Version }}' + - env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' archives: -- format: zip - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' + - format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 @@ -37,8 +37,11 @@ signs: - "{{ .Env.GPG_FINGERPRINT }}" - "--output" - "${signature}" + - "--passphrase-fd" + - "0" - "--detach-sign" - "${artifact}" + stdin_file: ./.gpg_passphrase release: draft: false changelog: From 64bbc97df17d4c17aec7a490dd3814617d9e1a9c Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 03:25:04 +0100 Subject: [PATCH 40/42] Remove GPG signing from test workflow --- .github/workflows/release.yml | 1 + .github/workflows/test.yml | 30 ++---------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5fd86aa..a8a96ffa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,7 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | mkdir -p ~/.gnupg + chmod 0700 ~/.gnupg cat << EOF > ~/.gnupg/gpg.conf use-agent diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8be4a0a..00fb8ee1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,34 +29,8 @@ jobs: sudo dpkg -i goreleaser_amd64.deb rm -f goreleaser_amd64.deb - - name: Import the GPG signing key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: | - mkdir -p ~/.gnupg - - cat << EOF > ~/.gnupg/gpg.conf - use-agent - pinentry-mode loopback - EOF - - echo "$GPG_KEY" | base64 -d -i | gpg --batch --allow-secret-key-import --import - gpg --keyid-format LONG --list-secret-keys - - cat << EOF > ~/.gnupg/gpg-agent.conf - default-cache-ttl 7200 - max-cache-ttl 31536000 - allow-loopback-pinentry - allow-preset-passphrase - EOF - - echo RELOADAGENT | gpg-connect-agent - - printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase - - - name: Create release + name: Create snapshot env: GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} run: | - goreleaser build --parallelism 2 --rm-dist --snapshot --timeout 1h + goreleaser build --config .goreleaser.test.yml --parallelism 2 --rm-dist --snapshot --timeout 1h From 24c20fd38ff8af3b1e737a103b31feb698c043e1 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 03:29:20 +0100 Subject: [PATCH 41/42] Remove reference to unused secret in test workflow --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00fb8ee1..6b2396ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,5 @@ jobs: rm -f goreleaser_amd64.deb - name: Create snapshot - env: - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} run: | goreleaser build --config .goreleaser.test.yml --parallelism 2 --rm-dist --snapshot --timeout 1h From f8aaed1f15d59f837e24dcd19d7edd911a68560e Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 03:32:57 +0100 Subject: [PATCH 42/42] Minor workflow changes --- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8a96ffa..1f2771c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,17 +9,17 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Checkout the repository + name: Checkout the code uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Set up the required version of Go + name: Install and configure Go uses: actions/setup-go@v2 with: go-version: 1.15 - - name: Install the required version of GoReleaser + name: Install and configure GoReleaser env: GORELEASER_VERSION: '0.155.1' run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b2396ab..c9c6fa1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,17 +11,17 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Checkout the repository + name: Checkout the code uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Set up the required version of Go + name: Install and configure Go uses: actions/setup-go@v2 with: go-version: 1.15 - - name: Install the required version of GoReleaser + name: Install and configure GoReleaser env: GORELEASER_VERSION: '0.155.1' run: |