diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 55842de2..00000000 --- a/.drone.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -kind: pipeline -name: default - -steps: -- name: build - image: docker:20.10.17-dind - environment: - GOPATH: /go - PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/go/bin - commands: - - /usr/local/bin/dockerd-entrypoint.sh & - - apk add -U bash make gcc musl-dev git wget go curl - - mkdir -p /go/src/github.com/rancher - - ln -s /drone/src /go/src/github.com/rancher/terraform-provider-rancher2 - - cd /go/src/github.com/rancher/terraform-provider-rancher2 - - make docker-build - - make docker-testacc - - kill %1 - privileged: true - -- name: build-all-binaries - image: golang:1.19.4 - environment: - CROSS: 1 - VERSION: ${DRONE_TAG} - commands: - - apt-get update - - apt-get install -y xz-utils zip rsync jq curl ca-certificates - - mkdir -p /go/src/github.com/rancher - - ln -s /drone/src /go/src/github.com/rancher/terraform-provider-rancher2 - - cd /go/src/github.com/rancher/terraform-provider-rancher2 - - make build-rancher - - make package-rancher - when: - event: tag - -- name: gpg_sign_release - image: plugins/gpgsign - settings: - key: - from_secret: gpg_key - passphrase: - from_secret: gpg_passphrase - files: - - dist/artifacts/${DRONE_TAG}/terraform-provider-rancher2_*_SHA256SUMS - detach_sign: true - armor: false - when: - event: tag - -- name: github_binary_prerelease - image: plugins/github-release - settings: - prerelease: true - files: - - dist/artifacts/${DRONE_TAG}/terraform-provider-rancher2_* - api_key: - from_secret: github_token - when: - event: tag - ref: - include: [ refs/tags/*rc* ] - -- name: github_binary_release - image: plugins/github-release - settings: - files: - - dist/artifacts/${DRONE_TAG}/terraform-provider-rancher2_* - api_key: - from_secret: github_token - when: - event: tag - ref: - exclude: [ refs/tags/*rc* ] \ No newline at end of file diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml new file mode 100644 index 00000000..83616f23 --- /dev/null +++ b/.github/workflows/pre-release.yaml @@ -0,0 +1,50 @@ +name: Prerelease + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v4 + - name: build binaries + env: + CROSS: 1 + VERSION: ${{ github.ref_name }} + run: | + make build-rancher + + - name: package + run: | + make package-rancher + + - name: retrieve GPG Credentials + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/key/app-credentials passphrase | GPG_PASSPHRASE ; + secret/data/github/repo/${{ github.repository }}/key/app-credentials privateKey | GPG_KEY + + - name: sign shasum + env: + GPG_KEY: ${{ env.GPG_KEY }} + GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }} + run: | + echo "Importing gpg key" + echo -n '${{ env.GPG_KEY }}' | gpg --import --batch > /dev/null + echo "signing SHASUM file" + VERSION_NO_V="$(echo ${{ github.ref_name }} | tr -d 'v')" + SHASUM_FILE="dist/artifacts/${{ github.ref_name }}/terraform-provider-rancher2_${VERSION_NO_V}_SHA256SUMS" + echo '${{ env.GPG_PASSPHRASE }}' | gpg --detach-sig --pinentry-mode loopback --passphrase-fd 0 --output "${SHASUM_FILE}.sig" --sign "${SHASUM_FILE}" + + - name: GH release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create ${{ github.ref_name }} --prerelease --verify-tag --generate-notes ./dist/artifacts/${{ github.ref_name }}/* diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 00000000..ca5a9d2d --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,16 @@ +name: Pull Request + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: build binaries + env: + CROSS: 1 + VERSION: ${{ github.ref_name }} + run: | + make build-rancher diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..9e83d265 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v4 + - name: build binaries + env: + CROSS: 1 + VERSION: ${{ github.ref_name }} + run: | + make build-rancher + + - name: package + run: | + make package-rancher + + - name: retrieve GPG Credentials + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/key/app-credentials passphrase | GPG_PASSPHRASE ; + secret/data/github/repo/${{ github.repository }}/key/app-credentials privateKey | GPG_KEY + + - name: sign shasum + env: + GPG_KEY: ${{ env.GPG_KEY }} + GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }} + run: | + echo "Importing gpg key" + echo -n '${{ env.GPG_KEY }}' | gpg --import --batch > /dev/null + echo "signing SHASUM file" + VERSION_NO_V="$(echo ${{ github.ref_name }} | tr -d 'v')" + SHASUM_FILE="dist/artifacts/${{ github.ref_name }}/terraform-provider-rancher2_${VERSION_NO_V}_SHA256SUMS" + echo '${{ env.GPG_PASSPHRASE }}' | gpg --detach-sig --pinentry-mode loopback --passphrase-fd 0 --output "${SHASUM_FILE}.sig" --sign "${SHASUM_FILE}" + + - name: GH release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create ${{ github.ref_name }} --verify-tag --generate-notes ./dist/artifacts/${{ github.ref_name }}/* diff --git a/GNUmakefile b/GNUmakefile index ce30c814..a479f088 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,16 +16,16 @@ build-rancher: validate-rancher validate-rancher: validate test -validate: fmtcheck lint vet +validate: fmtcheck vet package-rancher: @sh -c "'$(CURDIR)/scripts/gopackage.sh'" test: fmtcheck @echo "==> Running testing..." - go test $(TEST) || exit 1 + go test -v $(TEST) || exit 1 echo $(TEST) | \ - xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 + xargs -t -n4 go test -v $(TESTARGS) -timeout=30s -parallel=4 testacc: @sh -c "'$(CURDIR)/scripts/gotestacc.sh'" @@ -47,16 +47,6 @@ vet: echo "fix them if necessary, before submitting the code for review."; \ fi -lint: - @echo "==> Checking that code complies with golint requirements..." - @GO111MODULE=off go get -u golang.org/x/lint/golint - @if [ -n "$$(golint $$(go list ./...) | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then \ - echo ""; \ - echo "golint found style issues. Please check the reported issues"; \ - echo "and fix them if necessary before submitting the code for review."; \ - exit 1; \ - fi - bin: go build -o $(PROVIDER_NAME) @@ -79,6 +69,6 @@ test-compile: echo " make test-compile TEST=./$(PKG_NAME)"; \ exit 1; \ fi - go test -c $(TEST) $(TESTARGS) + go test -v -c $(TEST) $(TESTARGS) .PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile bin vendor diff --git a/README.md b/README.md index e74be8c2..873f3a98 100644 --- a/README.md +++ b/README.md @@ -97,41 +97,38 @@ See [test process](docs/test-process.md) for details on release testing (_Terraf Branching the Provider --------------------------- -The provider is branched into three release lines with major version alignment with Rancher 2.6, 2.7, and 2.8. The `release/v2` branch with 2.0.0+ is aligned with Rancher 2.6, the `release/v3` branch with 3.0.0+ is aligned with Rancher 2.7, and the `master` branch with 4.0.0+ is aligned with Rancher 2.8. The lifecycle of each major provider version is aligned with the lifecycle of each Rancher minor version. For example, provider versions 4.0.x which are aligned with Rancher 2.8.x will only be actively maintained until the EOM for Rancher 2.8.x and supported until EOL for Rancher 2.8.x. +This provider is branched in correlation with minor versions of Rancher: 2.8, 2.9, etc. +The `release/v3` branch with 3.0.0+ is aligned with Rancher 2.7, + the `release/v4` branch with 4.0.0+ is aligned with Rancher 2.8, + and the `master` branch with 5.0.0+ is aligned with Rancher 2.9. +The lifecycle of each major provider version is aligned with the lifecycle of each Rancher minor version. +For example, provider versions 4.x are aligned with Rancher 2.8.x will only be actively maintained until the EOM for Rancher 2.8.x and supported until EOL for Rancher 2.8.x. See the [Rancher support matrix](https://www.suse.com/lifecycle/#rancher) for details. -Aligning major provider releases with minor Rancher releases means, +Aligning major provider releases with minor Rancher releases means: * We can follow semver -* We can cut patch/minor versions on an as-needed basis to fix bugs or add new resources +* We can cut patch/minor versions on an as-needed basis to fix bugs or add new resources * We have 'out of band' flexibility and are only tied to releasing a new version of the provider when we get a new 2.x Rancher minor version. See the [compatibility matrix](docs/compatibility-matrix.md) for details. -If you are using Terraform to provision clusters on instances of Rancher 2.7 and 2.8, you must have a separate configuration in a separate dir for each provider. Otherwise, Terraform will overwrite the `.tfstate` file every time you switch versions. +If you are using Terraform to provision clusters on instances of Rancher 2.7 and 2.8, + you must have a separate configuration in a separate dir for each provider. +Otherwise, Terraform will overwrite the `.tfstate` file every time you switch versions. Releasing the Provider --------------------------- -As of Terraform 2.0.0 and 3.0.0, the provider is tied to Rancher minor releases but can be released 'out of band' within that minor version. For example, 4.0.0 will be released 1-2 weeks after Rancher 2.8.x and fixes and features in the 4.0.0 release will be supported for clusters provisioned via Terraform on Rancher 2.8.x. A critical bug fix can be released 'out of band' as 4.0.1 and backported to `release/v3` as 3.0.1. A new feature can also be released 'out of band' as 4.1.0 but not backported. - -The [RKE provider](https://github.com/rancher/terraform-provider-rke) should be released after every RKE or KDM release. For example, if upstream RKE 1.3.15 was released, bump the RKE version to 1.3.15 and release the provider. +As of Terraform 2.0.0 and 3.0.0, the provider is tied to Rancher minor releases but can be released 'out of band' within that minor version. +For example, 4.0.0 will be released 1-2 weeks after Rancher 2.8.x and fixes and features in the 4.0.0 release will be supported for clusters provisioned via Terraform on Rancher 2.8.x. +A critical bug fix can be released 'out of band' as 4.0.1 and backported to `release/v3` as 3.0.1. To release the provider -* Create a draft of the [release](https://github.com/rancher/terraform-provider-rancher2/releases) and select create new tag for the version you are releasing -* Create release notes by clicking `Generate release notes` -* Copy the release notes to the CHANGELOG and update to the following format - -``` -# (Month Day, Year) -FEATURES: -ENHANCEMENTS: -BUG FIXES: -``` - -* Create a PR to update CHANGELOG -* Copy the updated notes back to the draft release and save (DO NOT release with just the generated notes. Those are just a template to help you) -* Undraft the release, which creates the tag and builds the release -* If necessary - create a followup PR to edit [`./docs/compatibility-matrix.md`](https://github.com/rancher/terraform-provider-rancher2/blob/master/docs/compatibility-matrix.md) with the new version information +* Make sure that the various QA teams have approved the rc versions, see [test process](./docs/test-process.md) for more information. +* Update the `CHANGELOG.md` with the release notes +* Push a tag to the release branch (`release/v2`, `release/v3`, or `master`) which does not have a `-rc` suffix +* The CI will build the provider and generate a release on GitHub +* Make sure to validate that the release is picked up by the Terraform registry, you may need to find the "resync" button to accomplish this. diff --git a/docs/compatibility-matrix.md b/docs/compatibility-matrix.md index 374ed828..413a0496 100644 --- a/docs/compatibility-matrix.md +++ b/docs/compatibility-matrix.md @@ -1,35 +1,22 @@ # Rancher2 Provider -### Version compatibility matrix +## Version compatibility matrix -The version matrix specifies the Terraform provider version _recommended_ to use with the associated minor Rancher version that it was released for. When updating the version matrix, add a row for each Terraform version released with a minor Rancher release. +The version matrix specifies the Terraform provider version _recommended_ to use with the associated minor Rancher version that it was released for. +When updating the version matrix, add a row for each Terraform version released with a minor Rancher release. +This shouldn't be a changelog for every branch, each branch has its own CHANGELOG.md file which should be updated with changes. -#### Rancher 2.6 +| Terraform provider version | Rancher version | Terraform provider branch | +|----------------------------|:---------------:|---------------------------| +| 2.x | 2.6.x | release/v2 | +| 3.x | 2.7.x | release/v3 | +| 4.x | 2.8.x | release/v4 | +| 5.x | 2.9.x | master | -| Terraform provider version | Rancher | Notes | -|----------------------------------------|:-------:|:-----------:| -| 2.0.0 | 2.6.11 | Bug fixes | +## FAQ -#### Rancher 2.7 +**Can I use an earlier Terraform version?** +Yes, but Terraform may not support all features and fields supported in your Rancher version so provisioning may be limited. -| Terraform provider version | Rancher | Notes | -|----------------------------|:-------:|-----------------------------------------------------------------------------------------------------| -| 3.0.0 | 2.7.2 | Kubernetes 1.25 support, Azure / EKS / Harvester features
and bug fixes | -| 3.0.1 | 2.7.4 | Fix to support old Harvester config | -| 3.0.2 | 2.7.4 | Fix Harvester disk_size default value | -| 3.1.0 | 2.7.5 | Cluster Agent customization, PSACT support for 1.25+ clusters,
custom user tokens and bug fixes | -| 3.1.1 | 2.7.5 | Docs patch | -| 3.2.0 | 2.7.x | | - -#### Rancher 2.8 - -| Terraform provider version | Rancher | Notes | -|----------------------------|:-------:|-------| -| 4.0.0 | 2.8.x | | -| 4.1.0 | 2.8.x | | - -#### FAQ - -**Can I use an earlier Terraform version?** Yes, but Terraform may not support all features and fields supported in your Rancher version so provisioning may be limited. - -**Can I use a later Terraform version?** Yes, but you must NOT use any new features and fields that your Rancher version does not support. +**Can I use a later Terraform version?** +Yes, but you must NOT use any new features and fields that your Rancher version does not support. diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 1f339df0..ebb1dfc5 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -44,13 +44,10 @@ The following attributes are exported: * `oke_config` - (Computed) The Oracle OKE configuration for `oke` Clusters. Conflicts with `aks_config`, `aks_config_v2`, `eks_config`, `eks_config_v2`, `gke_config`, `gke_config_v2`, `k3s_config` and `rke_config` (list maxitems:1) * `description` - (Computed) The description for Cluster (string) * `cluster_auth_endpoint` - (Computed) Enabling the [local cluster authorized endpoint](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#local-cluster-auth-endpoint) allows direct communication with the cluster, bypassing the Rancher API proxy. (list maxitems:1) -* `cluster_monitoring_input` - (Computed) Cluster monitoring config (list maxitems:1) * `cluster_template_answers` - (Computed) Cluster template answers (list maxitems:1) * `cluster_template_id` - (Computed) Cluster template ID (string) * `cluster_template_questions` - (Computed) Cluster template questions (list) * `cluster_template_revision_id` - (Computed) Cluster template revision ID (string) -* `default_pod_security_policy_template_id` - (Optional/Computed) [Default pod security policy template id](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#pod-security-policy-support) (string) -* `enable_cluster_monitoring` - (Computed) Enable built-in cluster monitoring. Default `false` (bool) * `enable_network_policy` - (Computed) Enable project network isolation. Default `false` (bool) * `enable_cluster_istio` - (Computed) Enable built-in cluster istio. Default `false` (bool) * `fleet_workspace_name` - (Computed) Fleet workspace name (string) diff --git a/docs/data-sources/cluster_alert_group.md b/docs/data-sources/cluster_alert_group.md deleted file mode 100644 index 26c589ca..00000000 --- a/docs/data-sources/cluster_alert_group.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -page_title: "rancher2_cluster_alert_group Data Source" ---- - -# rancher2\_cluster\_alert\_group Data Source - -Use this data source to retrieve information about a Rancher v2 cluster alert group. - -## Example Usage - -``` -data "rancher2_cluster_alert_group" "foo" { - cluster_id = "" - name = "" -} -``` - -## Argument Reference - -* `cluster_id` - (Required) The cluster id where create cluster alert group (string) -* `name` - (Required) The cluster alert group name (string) - -## Attributes Reference - -* `description` - (Computed) The cluster alert group description (string) -* `group_interval_seconds` - (Computed) The cluster alert group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Computed) The cluster alert group wait seconds. Default: `180` (int) -* `recipients` - (Computed) The cluster alert group recipients (list) -* `repeat_interval_seconds` - (Computed) The cluster alert group wait seconds. Default: `3600` (int) -* `annotations` - (Computed) The cluster alert group annotations (map) -* `labels` - (Computed) The cluster alert group labels (map) - diff --git a/docs/data-sources/cluster_alert_rule.md b/docs/data-sources/cluster_alert_rule.md deleted file mode 100644 index 0f2f64a6..00000000 --- a/docs/data-sources/cluster_alert_rule.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -page_title: "rancher2_cluster_alert_rule Data Source" ---- - -# rancher2\_cluster\_alert\_rule Data Source - -Use this data source to retrieve information about a Rancher v2 cluster alert rule. - -## Example Usage - -``` -data "rancher2_cluster_alert_rule" "foo" { - cluster_id = "" - name = "" -} -``` - -## Argument Reference - -* `cluster_id` - (Required) The cluster id where create cluster alert rule (string) -* `name` - (Required) The cluster alert rule name (string) - -## Attributes Reference - -* `group_id` - (Computed) The cluster alert rule alert group ID (string) -* `event_rule` - (Computed) The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"` (list Maxitems:1) -* `group_interval_seconds` - (Computed) The cluster alert rule group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Computed) The cluster alert rule group wait seconds. Default: `180` (int) -* `inherited` - (Computed) The cluster alert rule inherited. Default: `true` (bool) -* `metric_rule` - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1) -* `node_rule` - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1) -* `repeat_interval_seconds` - (Optional) The cluster alert rule wait seconds. Default: `3600` (int) -* `severity` - (Computed) The cluster alert rule severity. Supported values : `"critical" | "info" | "warning"`. Default: `critical` (string) -* `system_service_rule` - (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1) -* `annotations` - (Computed) The cluster alert rule annotations (map) -* `labels` - (Computed) The cluster alert rule labels (map) - diff --git a/docs/data-sources/cluster_v2.md b/docs/data-sources/cluster_v2.md index e32133fc..a24f9143 100644 --- a/docs/data-sources/cluster_v2.md +++ b/docs/data-sources/cluster_v2.md @@ -35,7 +35,6 @@ The following attributes are exported: * `agent_env_vars` - (Computed) Optional Agent Env Vars for Rancher agent (list) * `rke_config` - (Computed) The RKE configuration for `k3s` and `rke2` Clusters v2. (list maxitems:1) * `cloud_credential_secret_name` - (Computed) Cluster V2 cloud credential secret name (string) -* `default_pod_security_policy_template_name` - (Computed) Cluster V2 default pod security policy template name (string) * `default_pod_security_admission_configuration_template_name` - (Computed) Cluster V2 default pod security admission configuration template name (string) * `default_cluster_role_for_project_members` - (Computed) Cluster V2 default cluster role for project members (string) * `enable_network_policy` - (Computed) Enable k8s network policy at Cluster V2 (bool) diff --git a/docs/data-sources/notifier.md b/docs/data-sources/notifier.md deleted file mode 100644 index 8f0451c1..00000000 --- a/docs/data-sources/notifier.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -page_title: "rancher2_notifier Data Source" ---- - -# rancher2\_notifier Data Source - -Use this data source to retrieve information about a Rancher v2 notifier. - -## Example Usage - -``` -data "rancher2_notifier" "foo" { - name = "foo" - cluster_id = "" -} -``` - -## Argument Reference - -* `name` - (Required) The name of the notifier (string) -* `cluster_id` - (Required) The cluster id where create notifier (string) - -## Attributes Reference - -* `id` - (Computed) The ID of the resource (string) -* `description` - (Computed) The notifier description (string) -* `send_resolved` - (Computed) If the notifier sends resolved notifications (bool) -* `dingtalk_config` - (Computed) Dingtalk config for notifier (list maxitems:1) -* `msteams_config` - (Computed) MSTeams config for notifier (list maxitems:1) -* `pagerduty_config` - (Computed) Pagerduty config for notifier (list maxitems:1) -* `slack_config` - (Computed) Slack config for notifier (list maxitems:1) -* `smtp_config` - (Computed) SMTP config for notifier (list maxitems:1) -* `webhook_config` - (Computed) Webhook config for notifier (list maxitems:1) -* `wechat_config` - (Computed) Wechat config for notifier (list maxitems:1) -* `annotations` - (Computed) Annotations for notifier object (map) -* `labels` - (Computed) Labels for notifier object (map) diff --git a/docs/data-sources/pod_security_policy_template.md b/docs/data-sources/pod_security_policy_template.md deleted file mode 100644 index bd86603f..00000000 --- a/docs/data-sources/pod_security_policy_template.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -page_title: "rancher2_pod_security_policy_template Data Source" ---- - -# rancher2\_pod\_security\_policy\_template Data Source - -Use this data source to retrieve information about a Rancher v2 PodSecurityPolicyTemplate. - -## Example Usage - -```hcl-terraform -data "rancher2_pod_security_policy_template" "foo" { - name = "foo" -} -``` - -## Argument Reference - -* `name` - (Required) The name of the PodSecurityPolicyTemplate (string) - -## Argument Reference - -The following arguments are supported: - -Any field without a description is taken from the PodSecurityPolicy object definition in Kubernetes: [https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions) - -* `name` - (Required) The name of the PodSecurityPolicyTemplate (string) -* `description` - (Optional) The PodSecurityPolicyTemplate description (string) -* `annotations` - (Optional/Computed) Annotations for PodSecurityPolicyTemplate object (map) -* `labels` - (Optional/Computed) Labels for PodSecurityPolicyTemplate object (map) -* `allow_privilege_escalation` = (Optional) -* `allowed_capabilities` - (Optional) (list) -* `allowed_csi_driver` - (Optional) (list) -* `allowed_flex_volume` - (Optional) (list) -* `allowed_host_path` - (Optional) (list) -* `allowed_proc_mount_types` - (Optional) (list) -* `allowed_unsafe_sysctls` - (Optional) (list) -* `default_add_capabilities` - (Optional) (list) -* `default_allow_privilege_escalation` - (Optional) (list) -* `forbidden_sysctls` - (Optional) (list) -* `fs_group` - (Optional) (list maxitems:1) -* `host_ipc` - (Optional) (bool) -* `host_pid` - (Optional) (bool) -* `host_port` - (Optional) (list) -* `privileged` - (Optional) (bool) -* `read_only_root_filesystem` - (Optional) (bool) -* `required_drop_capabilities` - (Optional) (list) -* `run_as_user` - (Optional) (list maxitems:1) -* `run_as_group` - (Optional) (list maxitems:1) -* `runtime_class` - (Optional) (list maxitems:1) -* `se_linux` - (Optional) (list maxitems:1) -* `supplemental_group` - (Optional) (list maxitems:1) -* `volumes` - (Optional) (list) diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md index 7fadab4c..3ca97674 100644 --- a/docs/data-sources/project.md +++ b/docs/data-sources/project.md @@ -36,8 +36,6 @@ resource "kubernetes_namespace" "my_namespace" { * `id` - (Computed) Cluster-wide unique ID of the Rancher 2 project (string) * `container_resource_limit` - (Computed) Default containers resource limits on project (List maxitem:1) - * `enable_project_monitoring` - (Computed) Enable built-in project monitoring. Default `false` (bool) - * `pod_security_policy_template_id` - (Computed) Default Pod Security Policy ID for the project (string) * `resource_quota` - (Computed) Resource quota for project. Rancher v2.1.x or higher (list maxitems:1) * `uuid` - (Computed) UUID of the project as stored by Rancher 2 (string) * `description` - (Computed) The project's description (string) diff --git a/docs/data-sources/project_alert_group.md b/docs/data-sources/project_alert_group.md deleted file mode 100644 index 307bf4b8..00000000 --- a/docs/data-sources/project_alert_group.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -page_title: "rancher2_project_alert_group Data Source" ---- - -# rancher2\_project\_alert\_group Data Source - -Use this data source to retrieve information about a Rancher v2 project alert group. - -## Example Usage - -``` -data "rancher2_project_alert_group" "foo" { - project_id = "" - name = "" -} -``` - -## Argument Reference - -* `project_id` - (Required) The project id where create project alert group (string) -* `name` - (Required) The project alert group name (string) - -## Attributes Reference - -* `description` - (Computed) The project alert group description (string) -* `group_interval_seconds` - (Computed) The project alert group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Computed) The project alert group wait seconds. Default: `180` (int) -* `recipients` - (Computed) The project alert group recipients (list) -* `repeat_interval_seconds` - (Computed) The project alert group wait seconds. Default: `3600` (int) -* `annotations` - (Computed) The project alert group annotations (map) -* `labels` - (Computed) The project alert group labels (map) - diff --git a/docs/data-sources/project_alert_rule.md b/docs/data-sources/project_alert_rule.md deleted file mode 100644 index 34ab4fbc..00000000 --- a/docs/data-sources/project_alert_rule.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -page_title: "rancher2_project_alert_rule Data Source" ---- - -# rancher2\_project\_alert\_rule Data Source - -Use this data source to retrieve information about a Rancher v2 project alert rule. - -## Example Usage - -``` -data "rancher2_project_alert_rule" "foo" { - project_id = "" - name = "" -} -``` - -## Argument Reference - -* `project_id` - (Required) The project id where create project alert rule (string) -* `name` - (Required) The project alert rule name (string) - -## Attributes Reference - -* `group_id` - (Computed) The project alert rule alert group ID (string) -* `group_interval_seconds` - (Computed) The project alert rule group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Computed) The project alert rule group wait seconds. Default: `180` (int) -* `inherited` - (Computed) The project alert rule inherited. Default: `true` (bool) -* `metric_rule` - (Computed) The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1) -* `pod_rule` - (Computed) The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1) -* `repeat_interval_seconds` - (Computed) The project alert rule wait seconds. Default: `3600` (int) -* `severity` - (Computed) The project alert rule severity. Supported values : `"critical" | "info" | "warning"`. Default: `critical` (string) -* `workload_rule` - (Computed) The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1) -* `annotations` - (Computed) The project alert rule annotations (map) -* `labels` - (Computed) The project alert rule labels (map) - diff --git a/docs/data-sources/role_template.md b/docs/data-sources/role_template.md index 04440aa8..86e0a478 100644 --- a/docs/data-sources/role_template.md +++ b/docs/data-sources/role_template.md @@ -31,6 +31,7 @@ The following attributes are exported: * `default_role` - (Computed) Default role template for new created cluster or project (bool) * `description` - (Computed) Role template description (string) * `external` - (Computed) External role template (bool) +* `external_rules` - (Computed) External rules used for authorization. (list) * `hidden` - (Computed) Hidden role template (bool) * `locked` - (Computed) Locked role template (bool) * `role_template_ids` - (Computed) Inherit role template IDs (list) diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index dc2cce2c..e08409e6 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -26,5 +26,6 @@ data "rancher2_user" "foo" { * `name` - (Computed) The user common name (string) * `annotations` - (Computed) Annotations of the resource (map) * `enabled` - (Computed) The user is enabled (bool) +* `must_change_password` - (Computed) The user must change password at first login (bool) * `principal_ids` - (Computed) The user principal IDs (list) * `labels` - (Computed) Labels of the resource (map) diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 17a56d2c..8260c239 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -8,7 +8,7 @@ Provides a Rancher v2 Cluster resource. This can be used to create Clusters for ## Example Usage -**Note optional/computed arguments** If any `optional/computed` argument of this resource is defined by the user, removing it from tf file will NOT reset its value. To reset it, let its definition at tf file as empty/false object. Ex: `enable_cluster_monitoring = false`, `cloud_provider {}`, `name = ""` +**Note optional/computed arguments** If any `optional/computed` argument of this resource is defined by the user, removing it from tf file will NOT reset its value. To reset it, let its definition at tf file as empty/false object. Ex: `cloud_provider {}`, `name = ""` ### Creating Rancher v2 imported cluster @@ -60,9 +60,7 @@ resource "rancher2_cluster" "foo-custom" { } ``` -### Creating Rancher v2 RKE cluster enabling and customizing monitoring - -**Note** Cluster monitoring version `0.2.0` and above, can't be enabled until cluster is fully deployed as [`kubeVersion`](https://github.com/rancher/system-charts/blob/52be656700468904b9bf15c3f39cd7112e1f8c9b/charts/rancher-monitoring/v0.2.0/Chart.yaml#L12) requirement has been introduced to helm chart +### Creating Rancher v2 RKE cluster enabling ```hcl # Create a new rancher2 RKE Cluster @@ -74,34 +72,10 @@ resource "rancher2_cluster" "foo-custom" { plugin = "canal" } } - enable_cluster_monitoring = true - cluster_monitoring_input { - answers = { - "exporter-kubelets.https" = true - "exporter-node.enabled" = true - "exporter-node.ports.metrics.port" = 9796 - "exporter-node.resources.limits.cpu" = "200m" - "exporter-node.resources.limits.memory" = "200Mi" - "grafana.persistence.enabled" = false - "grafana.persistence.size" = "10Gi" - "grafana.persistence.storageClass" = "default" - "operator.resources.limits.memory" = "500Mi" - "prometheus.persistence.enabled" = "false" - "prometheus.persistence.size" = "50Gi" - "prometheus.persistence.storageClass" = "default" - "prometheus.persistent.useReleaseName" = "true" - "prometheus.resources.core.limits.cpu" = "1000m", - "prometheus.resources.core.limits.memory" = "1500Mi" - "prometheus.resources.core.requests.cpu" = "750m" - "prometheus.resources.core.requests.memory" = "750Mi" - "prometheus.retention" = "12h" - } - version = "0.1.0" - } } ``` -### Creating Rancher v2 RKE cluster enabling/customizing monitoring and istio +### Creating Rancher v2 RKE cluster enabling/customizing istio ```hcl # Create a new rancher2 RKE Cluster @@ -113,35 +87,10 @@ resource "rancher2_cluster" "foo-custom" { plugin = "canal" } } - enable_cluster_monitoring = true - cluster_monitoring_input { - answers = { - "exporter-kubelets.https" = true - "exporter-node.enabled" = true - "exporter-node.ports.metrics.port" = 9796 - "exporter-node.resources.limits.cpu" = "200m" - "exporter-node.resources.limits.memory" = "200Mi" - "grafana.persistence.enabled" = false - "grafana.persistence.size" = "10Gi" - "grafana.persistence.storageClass" = "default" - "operator.resources.limits.memory" = "500Mi" - "prometheus.persistence.enabled" = "false" - "prometheus.persistence.size" = "50Gi" - "prometheus.persistence.storageClass" = "default" - "prometheus.persistent.useReleaseName" = "true" - "prometheus.resources.core.limits.cpu" = "1000m", - "prometheus.resources.core.limits.memory" = "1500Mi" - "prometheus.resources.core.requests.cpu" = "750m" - "prometheus.resources.core.requests.memory" = "750Mi" - "prometheus.retention" = "12h" - } - version = "0.1.0" - } } # Create a new rancher2 Cluster Sync for foo-custom cluster resource "rancher2_cluster_sync" "foo-custom" { cluster_id = rancher2_cluster.foo-custom.id - wait_monitoring = rancher2_cluster.foo-custom.enable_cluster_monitoring } # Create a new rancher2 Namespace resource "rancher2_namespace" "foo-istio" { @@ -149,7 +98,7 @@ resource "rancher2_namespace" "foo-istio" { project_id = rancher2_cluster_sync.foo-custom.system_project_id description = "istio namespace" } -# Create a new rancher2 App deploying istio (should wait until monitoring is up and running) +# Create a new rancher2 App deploying istio resource "rancher2_app" "istio" { catalog_name = "system-library" name = "cluster-istio" @@ -168,7 +117,6 @@ resource "rancher2_app" "istio" { "gateways.istio-ingressgateway.resources.requests.cpu" = "100m" "gateways.istio-ingressgateway.resources.requests.memory" = "128Mi" "gateways.istio-ingressgateway.type" = "NodePort" - "global.monitoring.type" = "cluster-monitoring" "global.rancher.clusterId" = rancher2_cluster_sync.foo-custom.cluster_id "istio_cni.enabled" = "false" "istiocoredns.enabled" = "false" @@ -653,18 +601,14 @@ The following arguments are supported: * `oke_config` - (Optional) The Oracle OKE configuration for `oke` Clusters. Conflicts with `aks_config`, `aks_config_v2`, `eks_config`, `eks_config_v2`, `gke_config`, `gke_config_v2`, `k3s_config` and `rke_config` (list maxitems:1) * `description` - (Optional) The description for Cluster (string) * `cluster_auth_endpoint` - (Optional/Computed) Enabling the [local cluster authorized endpoint](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#local-cluster-auth-endpoint) allows direct communication with the cluster, bypassing the Rancher API proxy. (list maxitems:1) -* `cluster_monitoring_input` - (Optional) Cluster monitoring config. Any parameter defined in [rancher-monitoring charts](https://github.com/rancher/system-charts/tree/dev/charts/rancher-monitoring) could be configured (list maxitems:1) * `cluster_template_answers` - (Optional/Computed) Cluster template answers. For Rancher v2.3.x and above (list maxitems:1) * `cluster_template_id` - (Optional) Cluster template ID. For Rancher v2.3.x and above (string) * `cluster_template_questions` - (Optional/Computed) Cluster template questions. For Rancher v2.3.x and above (list) * `cluster_template_revision_id` - (Optional) Cluster template revision ID. For Rancher v2.3.x and above (string) -* `default_pod_security_policy_template_id` - (Optional/Computed) [Default pod security policy template id](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#pod-security-policy-support) (string) * `default_pod_security_admission_configuration_template_name` - (Optional/Computed) The name of the pre-defined pod security admission configuration template to be applied to the cluster. Rancher admins (or those with the right permissions) can create, manage, and edit those templates. For more information, please refer to [Rancher Documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/psa-config-templates). The argument is available in Rancher v2.7.2 and above (string) * `desired_agent_image` - (Optional/Computed) Desired agent image. For Rancher v2.3.x and above (string) * `desired_auth_image` - (Optional/Computed) Desired auth image. For Rancher v2.3.x and above (string) * `docker_root_dir` - (Optional/Computed) Desired auth image. For Rancher v2.3.x and above (string) -* `enable_cluster_alerting` - (Optional/Computed) Enable built-in cluster alerting (bool) -* `enable_cluster_monitoring` - (Optional/Computed) Enable built-in cluster monitoring (bool) * `enable_cluster_istio` - (Deprecated) Deploy istio on `system` project and `istio-system` namespace, using rancher2_app resource instead. See above example. * `enable_network_policy` - (Optional/Computed) Enable project network isolation (bool) * `fleet_workspace_name` - (Optional/Computed) Fleet workspace name (string) @@ -1316,7 +1260,6 @@ The following attributes are exported: * `extra_binds` - (Optional) Extra binds for kube API service (list) * `extra_env` - (Optional) Extra environment for kube API service (list) * `image` - (Optional/Computed) Docker image for kube API service (string) -* `pod_security_policy` - (Optional) Pod Security Policy option for kube API service. Default `false` (bool) * `secrets_encryption_config` - (Optional) [Encrypt k8s secret data configration](https://rancher.com/docs/rke/latest/en/config-options/secrets-encryption/). (list maxitem: 1) * `service_cluster_ip_range` - (Optional/Computed) Service Cluster IP Range option for kube API service (string) * `service_node_port_range` - (Optional/Computed) Service Node Port Range option for kube API service (string) @@ -1582,7 +1525,7 @@ The following arguments are supported: * `cloud_credential_id` - (Required) The AKS Cloud Credential ID to use (string) * `resource_group` - (Required) The AKS resource group (string) * `resource_location` - (Required) The AKS resource location (string) -* `imported` - (Optional) Is AKS cluster imported? Defaul: `false` (bool) +* `imported` - (Optional) Is AKS cluster imported? Default: `false` (bool) The following arguments are supported just for creating new AKS clusters (`imported=false`): @@ -1945,13 +1888,6 @@ The following arguments are supported: * `enabled` - (Optional) Enable the authorized cluster endpoint. Default `true` (bool) * `fqdn` - (Optional) FQDN for the authorized cluster endpoint (string) -### `cluster_monitoring_input` - -#### Arguments - -* `answers` - (Optional/Computed) Key/value answers for monitor input (map) -* `version` - (Optional) rancher-monitoring chart version (string) - ### `cluster_template_answers` #### Arguments diff --git a/docs/resources/cluster_alert_group.md b/docs/resources/cluster_alert_group.md deleted file mode 100644 index f6e439d8..00000000 --- a/docs/resources/cluster_alert_group.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -page_title: "rancher2_cluster_alert_group Resource" ---- - -# rancher2\_cluster\_alert\_group Resource - -Provides a Rancher v2 Cluster Alert Group resource. This can be used to create Cluster Alert Group for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl -# Create a new Rancher2 Cluster Alert Group -resource "rancher2_cluster_alert_group" "foo" { - cluster_id = "" - name = "foo" - description = "Terraform cluster alert group" - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `cluster_id` - (Required) The cluster id where create cluster alert group (string) -* `name` - (Required) The cluster alert group name (string) -* `description` - (Optional) The cluster alert group description (string) -* `group_interval_seconds` - (Optional) The cluster alert group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Optional) The cluster alert group wait seconds. Default: `180` (int) -* `recipients` - (Optional) The cluster alert group recipients (list) -* `repeat_interval_seconds` - (Optional) The cluster alert group wait seconds. Default: `3600` (int) -* `annotations` - (Optional/Computed) The cluster alert group annotations (map) -* `labels` - (Optional/Computed) The cluster alert group labels (map) - - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -### `recipients` - -#### Arguments - -* `notifier_id` - (Required) Recipient notifier ID (string) -* `recipient` - (Optional/Computed) Recipient (string) -* `default_recipient` - (Optional) Use notifier default recipient, overriding `recipient` argument if set. Default: `false` (bool) - -#### Attributes - -* `notifier_type` - (Computed) Recipient notifier ID. Supported values : `"dingtalk" | "msteams" | "pagerduty" | "slack" | "email" | "webhook" | "wechat"` (string) - -## Timeouts - -`rancher2_cluster_alert_group` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: - -- `create` - (Default `10 minutes`) Used for creating cluster alert groups. -- `update` - (Default `10 minutes`) Used for cluster alert group modifications. -- `delete` - (Default `10 minutes`) Used for deleting cluster alert groups. - -## Import - -Cluster Alert Group can be imported using the Rancher cluster alert group ID - -``` -$ terraform import rancher2_cluster_alert_group.foo <CLUSTER_ALERT_GROUP_ID> -``` diff --git a/docs/resources/cluster_alert_rule.md b/docs/resources/cluster_alert_rule.md deleted file mode 100644 index daf91a7b..00000000 --- a/docs/resources/cluster_alert_rule.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -page_title: "rancher2_cluster_alert_rule Resource" ---- - -# rancher2\_cluster\_alert\_rule Resource - -Provides a Rancher v2 Cluster Alert Rule resource. This can be used to create Cluster Alert Rule for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl -# Create a new Rancher2 Cluster Alert Group -resource "rancher2_cluster_alert_group" "foo" { - cluster_id = "" - name = "foo" - description = "Terraform cluster alert group" - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -# Create a new Rancher2 Cluster Alert Rule -resource "rancher2_cluster_alert_rule" "foo" { - cluster_id = rancher2_cluster_alert_group.foo.cluster_id - group_id = rancher2_cluster_alert_group.foo.id - name = "foo" - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `cluster_id` - (Required) The cluster id where create cluster alert rule (string) -* `group_id` - (Required) The cluster alert rule alert group ID (string) -* `name` - (Required) The cluster alert rule name (string) -* `event_rule` - (Optional) The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1) -* `group_interval_seconds` - (Optional) The cluster alert rule group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Optional) The cluster alert rule group wait seconds. Default: `180` (int) -* `inherited` - (Optional) The cluster alert rule inherited. Default: `true` (bool) -* `metric_rule` - (Optional) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1) -* `node_rule` - (Optional) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1) -* `repeat_interval_seconds` - (Optional) The cluster alert rule wait seconds. Default: `3600` (int) -* `severity` - (Optional) The cluster alert rule severity. Supported values : `"critical" | "info" | "warning"`. Default: `critical` (string) -* `system_service_rule` - (Optional) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"` (list Maxitems:1) -* `annotations` - (Optional/Computed) The cluster alert rule annotations (map) -* `labels` - (Optional/Computed) The cluster alert rule labels (map) - - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -### `event_rule` - -#### Arguments - -* `resource_kind` - (Required) Resource kind. Supported values : `"DaemonSet" | "Deployment" | "Node" | "Pod" | "StatefulSet"` (string) -* `event_type` - (Optional) Event type. Supported values : `"Warning" | "Normal"`. Default: `Warning` (string) - -### `metric_rule` - -#### Arguments - -* `duration` - (Required) Metric rule duration (string) -* `expression` - (Required) Metric rule expression (string) -* `threshold_value` - (Required) Metric rule threshold value (float64) -* `comparison` - (Optional) Metric rule comparison. Supported values : `"equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value"`. Default: `equal` (string) -* `description` - (Optional) Metric rule description (string) - -### `node_rule` - -#### Arguments - -* `cpu_threshold` - (Optional) Node rule cpu threshold. Default: `70` (int) -* `condition` - (Optional) Node rule condition. Supported values : `"cpu" | "mem" | "notready"`. Default: `notready` (string) -* `mem_threshold` - (Optional) Node rule mem threshold. Default: `70` (int) -* `node_id` - (Optional) Node ID (string) -* `selector` - (Optional) Node rule selector (map) - -### `system_service_rule` - -#### Arguments - -* `condition` - (Optional) System service rule condition. Supported values : `"controller-manager" | "etcd" | "scheduler"`. Default: `scheduler` (string) - -## Timeouts - -`rancher2_cluster_alert_rule` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: - -- `create` - (Default `10 minutes`) Used for creating cluster alert rules. -- `update` - (Default `10 minutes`) Used for cluster alert rule modifications. -- `delete` - (Default `10 minutes`) Used for deleting cluster alert rules. - -## Import - -Cluster Alert Rule can be imported using the Rancher cluster alert rule ID - -``` -$ terraform import rancher2_cluster_alert_rule.foo <CLUSTER_ALERT_RULE_ID> -``` diff --git a/docs/resources/cluster_sync.md b/docs/resources/cluster_sync.md index 46421e6c..1c9ec678 100644 --- a/docs/resources/cluster_sync.md +++ b/docs/resources/cluster_sync.md @@ -86,9 +86,7 @@ The following arguments are supported: * `cluster_id` - (Required/ForceNew) The cluster ID that is syncing (string) * `node_pool_ids` - (Optional) The node pool IDs used by the cluster id (list) -* `wait_alerting` - (Optional) Wait until alerting is up and running. Default: `false` (bool) * `wait_catalogs` - (Optional) Wait until all catalogs are downloaded and active. Default: `false` (bool) -* `wait_monitoring` - (Optional) Wait until monitoring is up and running. Default: `false` (bool) * `state_confirm` - (Optional) Wait until active status is confirmed a number of times (wait interval of 5s). Default: `1` means no confirmation (int) **Note:** `state_confirm` would be useful, if you have troubles for creating/updating custom clusters that eventually are reaching `active` state before they are fully installed. For example: setting `state_confirm = 2` will assure that the cluster has been in `active` state for at least 5 seconds, `state_confirm = 3` assure at least 10 seconds, etc diff --git a/docs/resources/cluster_template.md b/docs/resources/cluster_template.md index afd84a54..3a8a7fc3 100644 --- a/docs/resources/cluster_template.md +++ b/docs/resources/cluster_template.md @@ -122,12 +122,9 @@ resource "rancher2_cluster_template" "foo" { * `cluster_auth_endpoint` - (Optional/Computed) Local cluster auth endpoint (list maxitems: 1) * `default_cluster_role_for_project_members` - (Optional/Computed) Default cluster role for project members (string) -* `default_pod_security_policy_template_id` - (Optional/Computed) Default pod security policy template ID (string) * `desired_agent_image` - (Optional/Computed) Desired agent image (string) * `desired_auth_image` - (Optional/Computed) Desired auth image (string) * `docker_root_dir` - (Optional/Computed) Desired auth image (string) -* `enable_cluster_alerting` - (Optional) Enable built-in cluster alerting. Default: `false` (bool) -* `enable_cluster_monitoring` - (Optional) Enable built-in cluster monitoring. Default: `false` (bool) * `enable_network_policy` - (Optional) Enable project network isolation. Default: `false` (bool) * `rke_config` - (Required) Rancher Kubernetes Engine Config (list maxitems: 1) * `windows_prefered_cluster` - (Optional) Windows prefered cluster. Default: `false` (bool) diff --git a/docs/resources/cluster_v2.md b/docs/resources/cluster_v2.md index 0fa99499..c4b7f567 100644 --- a/docs/resources/cluster_v2.md +++ b/docs/resources/cluster_v2.md @@ -849,7 +849,6 @@ The following arguments are supported: * `rke_config` - (Optional/computed, list, max length: 1) The RKE configuration for the cluster. * `local_auth_endpoint` - (Optional, list, max length: 1) Local auth endpoint configures the Authorized Cluster Endpoint (ACE) which can be used to directly access the Kubernetes API server, without requiring communication through Rancher. For more information, please refer to [Rancher Documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/register-existing-clusters#authorized-cluster-endpoint-support-for-rke2-and-k3s-clusters). * `cloud_credential_secret_name` - (Optional, string) Cloud credential secret name is the secret to be used when a cloud credential secret name is not specified at the machine pool level. -* `default_pod_security_policy_template_name` - (Optional, string) Default pod security policy template name specifies the default PSP for the cluster. For more information, please refer to [Rancher Documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/create-pod-security-policies). * `default_pod_security_admission_configuration_template_name` - (Optional, string) The name of the pre-defined pod security admission configuration template to be applied to the cluster. Rancher admins (or those with the right permissions) can create, manage, and edit those templates. For more information, please refer to [Rancher Documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/psa-config-templates). The argument is available in Rancher v2.7.2 and above. * `default_cluster_role_for_project_members` - (Optional, string) Default cluster role for project members. * `enable_network_policy` - (Optional, bool, default: false) Enable k8s network policy on the cluster. diff --git a/docs/resources/global_role.md b/docs/resources/global_role.md index 652dcb15..45dba484 100644 --- a/docs/resources/global_role.md +++ b/docs/resources/global_role.md @@ -53,7 +53,7 @@ The following attributes are exported: * `non_resource_urls` - (Optional) Policy rule non resource urls (list) * `resource_names` - (Optional) Policy rule resource names (list) * `resources` - (Optional) Policy rule resources (list) -* `verbs` - (Optional) Policy rule verbs. `bind`, `create`, `delete`, `deletecollection`, `escalate`, `get`, `impersonate`, `list`, `patch`, `update`, `use`, `view`, `watch`, `own` and `*` values are supported (list) +* `verbs` - (Optional) Policy rule verbs. `bind`, `create`, `delete`, `deletecollection`, `escalate`, `get`, `impersonate`, `list`, `manage-namespaces`, `patch`, `update`, `updatepsa`, `use`, `view`, `watch`, `own` and `*` values are supported (list) ## Timeouts diff --git a/docs/resources/node_template.md b/docs/resources/node_template.md index 8e029e5a..aba30102 100644 --- a/docs/resources/node_template.md +++ b/docs/resources/node_template.md @@ -487,4 +487,3 @@ $ terraform import rancher2_node_template.foo <node_template_id> **Important** This process could update `rancher2_node_template` data on tfstate file. Be sure to save a copy of tfstate file before proceed Due to [this feature](https://github.com/rancher/rancher/pull/23718) included on Rancher v2.3.3, `rancher2_node_template` are now global scoped objects with RBAC around them, instead of user scoped objects as they were. This means that existing node templates `id` field is changing on upgrade. Provider implements `fixNodeTemplateID()` that will update tfstate with proper id. -``` diff --git a/docs/resources/notifier.md b/docs/resources/notifier.md deleted file mode 100644 index 5cb29ea4..00000000 --- a/docs/resources/notifier.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -page_title: "rancher2_notifier Resource" ---- - -# rancher2\_notifier Resource - -Provides a Rancher v2 Notifier resource. This can be used to create notifiers for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl -# Create a new rancher2 Notifier -resource "rancher2_notifier" "foo" { - name = "foo" - cluster_id = "" - description = "Terraform notifier acceptance test" - send_resolved = "true" - pagerduty_config { - service_key = "XXXXXXXX" - proxy_url = "http://proxy.test.io" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) The name of the notifier (string) -* `cluster_id` - (Required/ForceNew) The cluster id where create notifier (string) -* `description` - (Optional) The notifier description (string) -* `send_resolved` = (Optional) Enable the notifier to send resolved notifications. Default `false` (bool) -* `dingtalk_config` - (Optional) Dingtalk config for notifier (list maxitems:1) -* `msteams_config` - (Optional) MSTeams config for notifier (list maxitems:1) -* `pagerduty_config` - (Optional) Pagerduty config for notifier (list maxitems:1) -* `slack_config` - (Optional) Slack config for notifier (list maxitems:1) -* `smtp_config` - (Optional) SMTP config for notifier (list maxitems:1) -* `webhook_config` - (Optional) Webhook config for notifier (list maxitems:1) -* `wechat_config` - (Optional) Wechat config for notifier (list maxitems:1) -* `annotations` - (Optional/Computed) Annotations for notifier object (map) -* `labels` - (Optional/Computed) Labels for notifier object (map) - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -### `dingtalk_config` - -#### Arguments - -* `url` - (Required) Dingtalk url (string) -* `proxy_url` - (Optional) Dingtalk proxy url (string) -* `secret` - (Optional) Secret for url sign enable (string) - -### `msteams_config` - -#### Arguments - -* `url` - (Required) MSTeams url (string) -* `proxy_url` - (Optional) MSTeams proxy url (string) - -### `pagerduty_config` - -#### Arguments - -* `service_key` - (Required) Pagerduty service key (string) -* `proxy_url` - (Optional) Pagerduty proxy url (string) - -### `slack_config` - -#### Arguments - -* `default_recipient` - (Required) Slack default recipient (string) -* `url` - (Required) Slack url (string) -* `proxy_url` - (Optional) Slack proxy url (string) - -### `smtp_config` - -* `default_recipient` - (Required) SMTP default recipient (string) -* `host` - (Required) SMTP host (string) -* `port` - (Required) SMTP port (int) -* `sender` - (Required) SMTP sender (string) -* `password` - (Optional/Sensitive) SMTP password (string) -* `tls` - (Optional/Sensitive) SMTP tls. Default `true` (bool) -* `username` - (Optional/Sensitive) SMTP username (string) - -#### Arguments - -### `webhook_config` - -* `url` - (Required) Webhook url (string) -* `proxy_url` - (Optional) Webhook proxy url (string) - -#### Arguments - -### `wechat_config` - -#### Arguments - -* `agent` - (Required) Wechat agent ID (string) -* `corp` - (Required) Wechat corporation ID (string) -* `default_recipient` - (Required) Wechat default recipient (string) -* `secret` - (Required/Sensitive) Wechat agent ID (string) -* `proxy_url` - (Optional) Wechat proxy url (string) -* `recipient_type` - (Optional) Wechat recipient type. Allowed values: `party` | `tag` | `user` (string) - -## Timeouts - -`rancher2_notifier` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: - -- `create` - (Default `10 minutes`) Used for creating notifiers. -- `update` - (Default `10 minutes`) Used for notifier modifications. -- `delete` - (Default `10 minutes`) Used for deleting notifiers. - -## Import - -Notifiers can be imported using the Rancher nNtifier ID - -``` -$ terraform import rancher2_notifier.foo <notifier_id> -``` - diff --git a/docs/resources/pod_security_policy_template.md b/docs/resources/pod_security_policy_template.md deleted file mode 100644 index b02f6312..00000000 --- a/docs/resources/pod_security_policy_template.md +++ /dev/null @@ -1,235 +0,0 @@ ---- -layout: "rancher2" -page_title: "Rancher2: rancher2_pod_security_policy_template" -sidebar_current: "docs-rancher2-resource-pod-security-policy-template" -description: |- - Provides a Rancher v2 PodSecurityPolicyTemplate resource. This can be used to create PodSecurityPolicyTemplates for Rancher v2 environments and retrieve their information. ---- - -# rancher2\_pod\_security\_policy\_template - -Provides a Rancher v2 PodSecurityPolicyTemplate resource. This can be used to create PodSecurityPolicyTemplates for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl-terraform -# Create a new rancher2 PodSecurityPolicyTemplate -resource "rancher2_pod_security_policy_template" "foo" { - name = "foo" - description = "Terraform PodSecurityPolicyTemplate acceptance test - update" - allow_privilege_escalation = false - allowed_csi_driver { - name = "something" - } - allowed_csi_driver { - name = "something-else" - } - allowed_flex_volume { - driver = "something" - } - allowed_flex_volume { - driver = "something-else" - } - allowed_host_path { - path_prefix = "/" - read_only = true - } - allowed_host_path { - path_prefix = "//" - read_only = false - } - allowed_proc_mount_types = ["Default"] - default_allow_privilege_escalation = false - fs_group { - rule = "MustRunAs" - range { - min = 0 - max = 100 - } - range { - min = 0 - max = 100 - } - } - host_ipc = false - host_network = false - host_pid = false - host_port { - min = 0 - max = 65535 - } - host_port { - min = 1024 - max = 8080 - } - privileged = false - read_only_root_filesystem = false - required_drop_capabilities = ["something"] - - run_as_user { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - run_as_group { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - runtime_class { - default_runtime_class_name = "something" - allowed_runtime_class_names = ["something"] - } - se_linux { - rule = "RunAsAny" - } - supplemental_group { - rule = "RunAsAny" - } - volumes = ["azureFile"] -} -``` - -## Argument Reference - -The following arguments are supported: - -Any field without a description is taken from the PodSecurityPolicy object definition in Kubernetes: [https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions) - -* `name` - (Required) The name of the PodSecurityPolicyTemplate (string) -* `description` - (Optional) The PodSecurityPolicyTemplate description (string) -* `annotations` - (Optional/Computed) Annotations for PodSecurityPolicyTemplate object (map) -* `labels` - (Optional/Computed) Labels for PodSecurityPolicyTemplate object (map) -* `allow_privilege_escalation` = (Optional) -* `allowed_capabilities` - (Optional) (list) -* `allowed_csi_driver` - (Optional) (list) -* `allowed_flex_volume` - (Optional) (list) -* `allowed_host_path` - (Optional) (list) -* `allowed_proc_mount_types` - (Optional) (list) -* `allowed_unsafe_sysctls` - (Optional) (list) -* `default_add_capabilities` - (Optional) (list) -* `default_allow_privilege_escalation` - (Optional) (list) -* `forbidden_sysctls` - (Optional) (list) -* `fs_group` - (Optional) (list maxitems:1) -* `host_ipc` - (Optional) (bool) -* `host_pid` - (Optional) (bool) -* `host_port` - (Optional) (list) -* `privileged` - (Optional) (bool) -* `read_only_root_filesystem` - (Optional) (bool) -* `required_drop_capabilities` - (Optional) (list) -* `run_as_user` - (Optional) (list maxitems:1) -* `run_as_group` - (Optional) (list maxitems:1) -* `runtime_class` - (Optional) (list maxitems:1) -* `se_linux` - (Optional) (list maxitems:1) -* `supplemental_group` - (Optional) (list maxitems:1) -* `volumes` - (Optional) (list) - - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -Any field without a description is taken from the PodSecurityPolicy object definition in Kubernetes: [https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podsecuritypolicy-v1beta1-extensions) - -### `allowed_host_path` - -#### Arguments - -* `path_prefix` - (Required) (string) -* `read_only` - (Optional) (string) - -### `fs_group` - -#### Arguments - -* `range` - (Optional) (list) -* `rule` - (Optional) (string) - -### `range` - -#### Arguments - -* `min` - (Required) (int) -* `max` - (Required) (int) - -### `host_port` - -#### Arguments - -* `min` - (Required) (int) -* `max` - (Required) (int) - -### `run_as_user` - -#### Arguments - -* `rule` - (Required) (string) -* `range` - (Optional) (list) - -### `run_as_group` - -#### Arguments - -* `rule` - (Required) (string) -* `range` - (Optional) (list) - -### `runtime_class` - -#### Arguments - -* `allowed_runtime_class_names` - (Required) (list) -* `default_runtime_class_name` - (Optional) (string) - -### `se_linux` - -#### Arguments - -* `rule` - (Required) (string) -* `se_linux_option` - (Optional) (list maxitems:1) - -### `se_linux_option` - -#### Arguments - -* `level` - (Optional) (string) -* `role` - (Optional) (string) -* `type` - (Optional) (string) -* `user` - (Optional) (string) - -### `supplemental_group` - -#### Arguments - -* `rule` - (Required) (string) -* `range` - (Optional) (list) - - -## Timeouts - -Because the `rancher2_pod_security_policy_template` API endpoint does not have a `state` field defined, this provider does -not implement timeouts, only direct API calls (without retry on failure). - -## Import - -PodSecurityPolicyTemplate can be imported using the Rancher PodSecurityPolicyTemplate Name - -``` -$ terraform import rancher2_pod_security_policy_template.foo <pod_security_policy_name> -``` - diff --git a/docs/resources/project.md b/docs/resources/project.md index 9250b76f..a5a572e1 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -35,7 +35,7 @@ resource "rancher2_project" "foo" { ``` ```hcl -# Create a new rancher2 Project enabling and customizing monitoring +# Create a new rancher2 Project resource "rancher2_project" "foo" { name = "foo" cluster_id = "" @@ -57,29 +57,6 @@ resource "rancher2_project" "foo" { requests_cpu = "1m" requests_memory = "1Mi" } - enable_project_monitoring = true - project_monitoring_input { - answers = { - "exporter-kubelets.https" = true - "exporter-node.enabled" = true - "exporter-node.ports.metrics.port" = 9796 - "exporter-node.resources.limits.cpu" = "200m" - "exporter-node.resources.limits.memory" = "200Mi" - "grafana.persistence.enabled" = false - "grafana.persistence.size" = "10Gi" - "grafana.persistence.storageClass" = "default" - "operator.resources.limits.memory" = "500Mi" - "prometheus.persistence.enabled" = "false" - "prometheus.persistence.size" = "50Gi" - "prometheus.persistence.storageClass" = "default" - "prometheus.persistent.useReleaseName" = "true" - "prometheus.resources.core.limits.cpu" = "1000m", - "prometheus.resources.core.limits.memory" = "1500Mi" - "prometheus.resources.core.requests.cpu" = "750m" - "prometheus.resources.core.requests.memory" = "750Mi" - "prometheus.retention" = "12h" - } - } } ``` @@ -91,9 +68,6 @@ The following arguments are supported: * `cluster_id` - (Required) The cluster id where create project (string) * `container_resource_limit` - (Optional) Default containers resource limits on project (List maxitem:1) * `description` - (Optional) A project description (string) -* `enable_project_monitoring` - (Optional) Enable built-in project monitoring. Default `false` (bool) -* `pod_security_policy_template_id` - (Optional) Default Pod Security Policy ID for the project (string) -* `project_monitoring_input` - (Optional) Project monitoring config. Any parameter defined in [rancher-monitoring charts](https://github.com/rancher/system-charts/tree/dev/charts/rancher-monitoring) could be configured (list maxitems:1) * `resource_quota` - (Optional) Resource quota for project. Rancher v2.1.x or higher (list maxitems:1) * `wait_for_cluster` - (Optional) Wait for cluster becomes active. Default `false` (bool) * `annotations` - (Optional/Computed) Annotations for Node Pool object (map) @@ -116,13 +90,6 @@ The following attributes are exported: * `requests_cpu` - (Optional) CPU reservation for containers (string) * `requests_memory` - (Optional) Memory reservation for containers (string) -### `project_monitoring_input` - -#### Arguments - -* `answers` - (Optional/Computed) Key/value answers for monitor input (map) -* `version` - (Optional) rancher-monitoring chart version (string) - ### `resource_quota` #### Arguments diff --git a/docs/resources/project_alert_group.md b/docs/resources/project_alert_group.md deleted file mode 100644 index f510b594..00000000 --- a/docs/resources/project_alert_group.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -page_title: "rancher2_project_alert_group Resource" ---- - -# rancher2\_project\_alert\_group Resource - -Provides a Rancher v2 Project Alert Group resource. This can be used to create Project Alert Group for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl -# Create a new Rancher2 Project Alert Group -resource "rancher2_project_alert_group" "foo" { - name = "foo" - description = "Terraform project alert group" - project_id = "" - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) The project alert group name (string) -* `project_id` - (Required) The project id where create project alert group (string) -* `description` - (Optional) The project alert group description (string) -* `group_interval_seconds` - (Optional) The project alert group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Optional) The project alert group wait seconds. Default: `180` (int) -* `recipients` - (Optional) The project alert group recipients (list) -* `repeat_interval_seconds` - (Optional) The project alert group wait seconds. Default: `3600` (int) -* `annotations` - (Optional/Computed) The project alert group annotations (map) -* `labels` - (Optional/Computed) The project alert group labels (map) - - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -### `recipients` - -#### Arguments - -* `notifier_id` - (Required) Recipient notifier ID (string) -* `recipient` - (Optional/Computed) Recipient (string) - -#### Attributes - -* `notifier_type` - (Computed) Recipient notifier ID. Supported values : `"pagerduty" | "slack" | "email" | "webhook" | "wechat"` (string) - -## Timeouts - -`rancher2_project_alert_group` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: - -- `create` - (Default `10 minutes`) Used for creating project alert groups. -- `update` - (Default `10 minutes`) Used for project alert group modifications. -- `delete` - (Default `10 minutes`) Used for deleting project alert groups. - -## Import - -Project Alert Group can be imported using the Rancher project alert group ID - -``` -$ terraform import rancher2_project_alert_group.foo <project_alert_group_id> -``` diff --git a/docs/resources/project_alert_rule.md b/docs/resources/project_alert_rule.md deleted file mode 100644 index 9289d7ba..00000000 --- a/docs/resources/project_alert_rule.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -page_title: "rancher2_project_alert_rule Resource" ---- - -# rancher2\_project\_alert\_rule Resource - -Provides a Rancher v2 Project Alert Rule resource. This can be used to create Project Alert Rule for Rancher v2 environments and retrieve their information. - -## Example Usage - -```hcl -# Create a new Rancher2 Project -resource "rancher2_project" "foo" { - name = "foo" - cluster_id = "" - description = "Terraform project " - resource_quota { - project_limit { - limits_cpu = "2000m" - limits_memory = "2000Mi" - requests_storage = "2Gi" - } - namespace_default_limit { - limits_cpu = "500m" - limits_memory = "500Mi" - requests_storage = "1Gi" - } - } - container_resource_limit { - limits_cpu = "20m" - limits_memory = "20Mi" - requests_cpu = "1m" - requests_memory = "1Mi" - } -} -# Create a new Rancher2 Project Alert Group -resource "rancher2_project_alert_group" "foo" { - name = "foo" - description = "Terraform project alert group" - project_id = rancher2_project.foo.id - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -# Create a new Rancher2 Project Alert Rule -resource "rancher2_project_alert_rule" "foo" { - project_id = rancher2_project_alert_group.foo.project_id - group_id = rancher2_project_alert_group.foo.id - name = "foo" - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `project_id` - (Required) The project id where create project alert rule (string) -* `group_id` - (Required) The project alert rule alert group ID (string) -* `name` - (Required) The project alert rule name (string) -* `group_interval_seconds` - (Optional) The project alert rule group interval seconds. Default: `180` (int) -* `group_wait_seconds` - (Optional) The project alert rule group wait seconds. Default: `180` (int) -* `inherited` - (Optional) The project alert rule inherited. Default: `true` (bool) -* `metric_rule` - (Optional) The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1) -* `pod_rule` - (Optional) The project alert rule pod rule. ConflictsWith: `"metric_rule", "workload_rule"`` (list Maxitems:1) -* `repeat_interval_seconds` - (Optional) The project alert rule wait seconds. Default: `3600` (int) -* `severity` - (Optional) The project alert rule severity. Supported values : `"critical" | "info" | "warning"`. Default: `critical` (string) -* `workload_rule` - (Optional) The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1) -* `annotations` - (Optional/Computed) The project alert rule annotations (map) -* `labels` - (Optional/Computed) The project alert rule labels (map) - - -## Attributes Reference - -The following attributes are exported: - -* `id` - (Computed) The ID of the resource (string) - -## Nested blocks - -### `metric_rule` - -#### Arguments - -* `duration` - (Required) Metric rule duration (string) -* `expression` - (Required) Metric rule expression (string) -* `threshold_value` - (Required) Metric rule threshold value (float64) -* `comparison` - (Optional) Metric rule comparison. Supported values : `"equal" | "greater-or-equal" | "greater-than" | "less-or-equal" | "less-than" | "not-equal" | "has-value"`. Default: `equal` (string) -* `description` - (Optional) Metric rule description (string) - -### `pod_rule` - -#### Arguments - -* `pod_id` - (Required) Pod ID (string) -* `condition` - (Optional) Pod rule condition. Supported values : `"notrunning" | "notscheduled" | "restarts"`. Default: `notrunning` (string) -* `restart_interval_seconds` - (Optional) Pod rule restart interval seconds. Default: `300` (int) -* `restart_times` - (Optional) Pod rule restart times. Default: `3` (int) - -### `workload_rule` - -#### Arguments - -* `available_percentage` - (Optional) Workload rule available percentage. Default: `70` (int) -* `selector` - (Optional) Workload rule selector (map) -* `workload_id` - (Optional) Workload ID (string) - -## Timeouts - -`rancher2_project_alert_rule` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/resources.html#operation-timeouts) configuration options: - -- `create` - (Default `10 minutes`) Used for creating project alert rules. -- `update` - (Default `10 minutes`) Used for project alert rule modifications. -- `delete` - (Default `10 minutes`) Used for deleting project alert rules. - -## Import - -Project Alert Rule can be imported using the Rancher project alert rule ID - -``` -$ terraform import rancher2_project_alert_rule.foo <project_alert_rule_id> -``` diff --git a/docs/resources/role_template.md b/docs/resources/role_template.md index 130b78c6..f62ac83c 100644 --- a/docs/resources/role_template.md +++ b/docs/resources/role_template.md @@ -50,13 +50,13 @@ The following arguments are supported: * `default_role` - (Optional) Default role template for new created cluster or project. Default `false` (bool) * `description` - (Optional/Computed) Role template description (string) * `external` - (Optional) External role template. Default `false` (bool) +* `external_rules` - (Optional/Computed) External rules used for authorization. This field is required when `external=true` and no underlying ClusterRole exists. (list) * `hidden` - (Optional) Hidden role template. Default `false` (bool) * `locked` - (Optional) Locked role template. Default `false` (bool) * `role_template_ids` - (Optional/Computed) Inherit role template IDs (list) * `rules` - (Optional/Computed) Role template policy rules (list) * `annotations` - (Optional/Computed) Annotations for role template object (map) * `labels` - (Optional/Computed) Labels for role template object (map) -* `inherited_cluster_roles` - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list) ## Attributes Reference @@ -75,7 +75,7 @@ The following attributes are exported: * `non_resource_urls` - (Optional) Policy rule non resource urls (list) * `resource_names` - (Optional) Policy rule resource names (list) * `resources` - (Optional) Policy rule resources (list) -* `verbs` - (Optional) Policy rule verbs. `bind`, `create`, `delete`, `deletecollection`, `escalate`, `get`, `impersonate`, `list`, `patch`, `update`, `use`, `view`, `watch`, `own` and `*` values are supported (list) +* `verbs` - (Optional) Policy rule verbs. `bind`, `create`, `delete`, `deletecollection`, `escalate`, `get`, `impersonate`, `list`, `manage-namespaces`, `patch`, `update`, `updatepsa`, `use`, `view`, `watch`, `own` and `*` values are supported (list) ## Timeouts diff --git a/docs/resources/user.md b/docs/resources/user.md index ee1508b9..777f8cd5 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -17,6 +17,7 @@ resource "rancher2_user" "foo" { username = "foo" password = "changeme" enabled = true + must_change_password = true } # Create a new rancher2 global_role_binding for User resource "rancher2_global_role_binding" "foo" { @@ -33,6 +34,7 @@ The following arguments are supported: * `username` - (Required/ForceNew) The user username (string) * `password` - (Required/ForceNew) The user password (string) * `name` - (Optional) The user full name (string) +* `must_change_password` - (Optional)The user must change password at first login (bool) * `annotations` - (Optional/Computed) Annotations for global role binding (map) * `labels` - (Optional/Computed) Labels for global role binding (map) diff --git a/go.mod b/go.mod index 519ee9c4..ba5d7556 100644 --- a/go.mod +++ b/go.mod @@ -1,71 +1,71 @@ module github.com/rancher/terraform-provider-rancher2 -go 1.19 +go 1.22.0 + +toolchain go1.22.5 require ( - github.com/emicklei/go-restful v2.16.0+incompatible github.com/ghodss/yaml v1.0.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/terraform-plugin-sdk v1.17.2 - github.com/rancher/norman v0.0.0-20230426211126-d3552b018687 - github.com/rancher/rancher v0.0.0-20230525094739-ff2e09449efc + github.com/rancher/norman v0.0.0-20240708202514-a0127673d1b9 + github.com/rancher/rancher v0.0.0-20240716141526-e0d2afd007d8 github.com/rancher/rancher/pkg/apis v0.0.0 github.com/rancher/rancher/pkg/client v0.0.0 - github.com/stretchr/testify v1.8.4 - golang.org/x/crypto v0.14.0 - golang.org/x/sync v0.3.0 + github.com/stretchr/testify v1.9.0 + golang.org/x/crypto v0.25.0 + golang.org/x/sync v0.7.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.25.12 - k8s.io/apimachinery v0.25.12 - k8s.io/apiserver v0.25.4 + k8s.io/api v0.30.2 + k8s.io/apimachinery v0.30.2 + k8s.io/apiserver v0.30.1 k8s.io/client-go v12.0.0+incompatible ) require ( - cloud.google.com/go v0.110.2 // indirect - cloud.google.com/go/compute v1.20.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.29.0 // indirect + cloud.google.com/go v0.110.10 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.5 // indirect + cloud.google.com/go/storage v1.30.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.44.300 // indirect + github.com/aws/aws-sdk-go v1.50.38 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/blang/semver v3.5.1+incompatible // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.10.1 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.7.0+incompatible // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.1 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.10 // indirect github.com/go-test/deep v1.0.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-github/v29 v29.0.3 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect - github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -84,18 +84,18 @@ require ( github.com/hashicorp/terraform-plugin-test/v2 v2.2.1 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/huandu/xstrings v1.4.0 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.11 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matryer/moq v0.0.0-20200607124540-4638a53893e6 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/cli v1.1.2 // indirect + github.com/matryer/moq v0.3.4 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -111,95 +111,100 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/posener/complete v1.2.3 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/rancher/aks-operator v1.2.0-rc2 // indirect - github.com/rancher/apiserver v0.0.0-20230120214941-e88c32739dc7 // indirect - github.com/rancher/channelserver v0.5.1-0.20220405170618-28c9b37deff1 // indirect - github.com/rancher/eks-operator v1.2.2-rc3 // indirect - github.com/rancher/fleet/pkg/apis v0.0.0-20230810121238-9d0ee7f56848 // indirect - github.com/rancher/gke-operator v1.1.6-rc2 // indirect - github.com/rancher/lasso v0.0.0-20230629200414-8a54b32e6792 // indirect - github.com/rancher/rke v1.5.0-rc2 // indirect - github.com/rancher/wrangler v1.1.1 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rancher/aks-operator v1.9.0-rc.9 // indirect + github.com/rancher/apiserver v0.0.0-20240708202538-39a6f2535146 // indirect + github.com/rancher/channelserver v0.7.0 // indirect + github.com/rancher/eks-operator v1.9.0-rc.9 // indirect + github.com/rancher/fleet/pkg/apis v0.10.0-rc.19 // indirect + github.com/rancher/gke-operator v1.9.0-rc.8 // indirect + github.com/rancher/lasso v0.0.0-20240705194423-b2a060d103c1 // indirect + github.com/rancher/rke v1.6.0-rc9 // indirect + github.com/rancher/wrangler/v3 v3.0.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/ulikunitz/xz v0.5.10 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.0 // indirect github.com/zclconf/go-cty-yaml v1.0.2 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/api v0.130.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect - google.golang.org/grpc v1.56.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/api v0.153.0 // indirect + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.4 // indirect - k8s.io/component-base v0.25.4 // indirect - k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect - k8s.io/klog/v2 v2.90.1 // indirect - k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect - k8s.io/kubernetes v1.25.4 // indirect - k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect - sigs.k8s.io/cli-utils v0.27.0 // indirect - sigs.k8s.io/cluster-api v1.2.12 // indirect - sigs.k8s.io/controller-runtime v0.12.3 // indirect + k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/component-base v0.30.1 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240411171206-dc4e619f62f3 // indirect + k8s.io/kubernetes v1.30.1 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect + sigs.k8s.io/cli-utils v0.35.0 // indirect + sigs.k8s.io/cluster-api v1.7.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( github.com/crewjam/saml => github.com/crewjam/saml v0.4.5 github.com/docker/distribution => github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker => github.com/docker/docker v20.10.17+incompatible - github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20230901132600-5e1ee2611616 - github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20230901132600-5e1ee2611616 + github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20240716141526-e0d2afd007d8 + github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20240716141526-e0d2afd007d8 github.com/spf13/afero => github.com/spf13/afero v1.2.2 + go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v1.19.0 + go.qase.io/client => github.com/rancher/qase-go/client v0.0.0-20231114201952-65195ec001fa helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.9.0-rancher1 - k8s.io/api => k8s.io/api v0.25.4 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.4 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.4 - k8s.io/apiserver => k8s.io/apiserver v0.25.4 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.4 - k8s.io/client-go => github.com/rancher/client-go v1.25.4-rancher1 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.25.4 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.25.4 - k8s.io/code-generator => k8s.io/code-generator v0.25.4 - k8s.io/component-base => k8s.io/component-base v0.25.4 - k8s.io/component-helpers => k8s.io/component-helpers v0.25.4 - k8s.io/controller-manager => k8s.io/controller-manager v0.25.4 - k8s.io/cri-api => k8s.io/cri-api v0.25.4 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.25.4 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.25.4 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.25.4 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.25.4 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.25.4 - k8s.io/kubectl => k8s.io/kubectl v0.25.4 - k8s.io/kubelet => k8s.io/kubelet v0.25.4 - k8s.io/kubernetes => k8s.io/kubernetes v1.25.4 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.25.4 - k8s.io/metrics => k8s.io/metrics v0.25.4 - k8s.io/mount-utils => k8s.io/mount-utils v0.25.4 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.25.4 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.25.4 + + k8s.io/api => k8s.io/api v0.30.1 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.1 + k8s.io/apimachinery => k8s.io/apimachinery v0.30.1 + k8s.io/apiserver => k8s.io/apiserver v0.30.1 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.1 + k8s.io/client-go => k8s.io/client-go v0.30.1 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.30.1 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.30.1 + k8s.io/code-generator => k8s.io/code-generator v0.30.1 + k8s.io/component-base => k8s.io/component-base v0.30.1 + k8s.io/component-helpers => k8s.io/component-helpers v0.30.1 + k8s.io/controller-manager => k8s.io/controller-manager v0.30.1 + k8s.io/cri-api => k8s.io/cri-api v0.30.1 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.30.1 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.30.1 + k8s.io/endpointslice => k8s.io/endpointslice v0.30.1 + k8s.io/kms => k8s.io/kms v0.30.1 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.30.1 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.30.1 + k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.30.1 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.30.1 + k8s.io/kubectl => k8s.io/kubectl v0.30.1 + k8s.io/kubelet => k8s.io/kubelet v0.30.1 + k8s.io/kubernetes => k8s.io/kubernetes v1.30.1 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.30.1 + k8s.io/metrics => k8s.io/metrics v0.30.1 + k8s.io/mount-utils => k8s.io/mount-utils v0.30.1 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.30.1 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.30.1 launchpad.net/gocheck => github.com/go-check/check v0.0.0-20200227125254-8fa46927fb4f ) diff --git a/go.sum b/go.sum index 0bd98a46..45e9b549 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -68,10 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -98,7 +96,6 @@ cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1 cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= @@ -110,8 +107,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -172,8 +169,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -185,56 +182,39 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= 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/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= +github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= 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/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= 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= @@ -244,49 +224,37 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-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/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.300 h1:Zn+3lqgYahIf9yfrwZ+g+hq/c3KzUBaQ8wqY/ZXiAbY= -github.com/aws/aws-sdk-go v1.44.300/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/aws/aws-sdk-go v1.50.38 h1:h8wxaLin7sFGK4sKassc1VpNcDbgAAEQJ5PHjqLAvXQ= +github.com/aws/aws-sdk-go v1.50.38/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 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/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= 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/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= 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/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -296,43 +264,18 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustmop/soup v1.1.2-0.20190516214245-38228baa104e/go.mod h1:CgNC6SGbT+Xb8wGGvzilttZL1mc5sQ/5KkcxsZttMIk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM= -github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= -github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -343,132 +286,52 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.1.0 h1:4pl5BV4o7ZG/lterP4S6WzJ6xr49Ba5ET9ygheTYahk= github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc= github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= 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-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-openapi/swag v0.22.10 h1:4y86NVn7Z2yYd6pfS4Z+Nyh3aAUL3Nul+LMbhFKy0gA= +github.com/go-openapi/swag v0.22.10/go.mod h1:Cnn8BYtRlx6BNE3DPN86f/xkapGIcLWzh3CLEb4C1jI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -484,7 +347,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -503,20 +365,14 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= -github.com/golangplus/bytes v1.0.0/go.mod h1:AdRaCFwmc/00ZzELMWb01soso6W1R/++O1XL80yAn+A= -github.com/golangplus/fmt v1.0.0/go.mod h1:zpM0OfbMCjPtd2qkTD/jX2MgiFCqklhSUFyDW44gVQE= -github.com/golangplus/testing v1.0.0/go.mod h1:ZDreixUV3YzhoVraIDyOzHrr76p6NUh6k/pPg/Q3gYA= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -531,15 +387,15 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v29 v29.0.3 h1:IktKCTwU//aFHnpA+2SLIi7Oo9uhAzgsdZNbcAqhgdc= github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -548,6 +404,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/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= @@ -559,25 +416,24 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= -github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -587,30 +443,16 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 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= @@ -627,18 +469,13 @@ github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9 github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -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-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= @@ -648,10 +485,8 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -661,9 +496,6 @@ github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZ github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= 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/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-exec v0.13.3 h1:R6L2mNpDGSEqtLrSONN8Xth0xYwNrnEVzDz6LF/oJPk= @@ -680,20 +512,19 @@ github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod 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/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/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.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= @@ -702,85 +533,57 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y 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/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/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/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matryer/moq v0.0.0-20200607124540-4638a53893e6 h1:Cx1ZvZ3SQTli1nKee9qvJ/NJP3vt11s+ilM7NF3QSL8= -github.com/matryer/moq v0.0.0-20200607124540-4638a53893e6/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/matryer/moq v0.3.4 h1:czCFIos9rI2tyOehN9ktc/6bQ76N9J4xQ2n3dk063ac= +github.com/matryer/moq v0.3.4/go.mod h1:wqm9QObyoMuUtH81zFfs3EK6mXEcByy+TjvSROOXJ2U= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 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.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.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/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -798,11 +601,7 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX 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/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -811,64 +610,23 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= 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/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulmach/orb v0.1.3/go.mod h1:VFlX/8C+IQ1p6FTRRKzKoOPJnvEtA5G0Veuqwbu//Vk= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -878,130 +636,74 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr 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/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA= -github.com/rancher/aks-operator v1.2.0-rc2 h1:zP1VEzAc/jZ7FyeiQcQ+pkFUxDySrKoN+RdSnnj7LnE= -github.com/rancher/aks-operator v1.2.0-rc2/go.mod h1:ga4p9r8nTUuSRqkYLTBgA5OlPf19iT/i9Qa3kXH7H7Y= -github.com/rancher/apiserver v0.0.0-20201023000256-1a0a904f9197/go.mod h1:8W0EwaR9dH5NDFw6mpAX437D0q+EZqKWbZyX71+z2WI= -github.com/rancher/apiserver v0.0.0-20230120214941-e88c32739dc7 h1:Ob72oeF0iM8gWEMh+qKT5e1pzTwQU70I5kx4gMaqCmI= -github.com/rancher/apiserver v0.0.0-20230120214941-e88c32739dc7/go.mod h1:xwQhXv3XFxWfA6tLa4ZeaERu8ldNbyKv2sF+mT+c5WA= -github.com/rancher/channelserver v0.5.1-0.20220405170618-28c9b37deff1 h1:NMYQzCtLEEaJZ2xleLzDixN6Y+yO9ShzgsjHDg4zOrk= -github.com/rancher/channelserver v0.5.1-0.20220405170618-28c9b37deff1/go.mod h1:dZ4saGTw1S0RwX8ivPijBIR+2obRpfFuO2NkDHUKKXg= -github.com/rancher/client-go v1.25.4-rancher1 h1:9MlBC8QbgngUkhNzMR8rZmmCIj6WNRHFOnYiwC2Kty4= -github.com/rancher/client-go v1.25.4-rancher1/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= -github.com/rancher/eks-operator v1.2.2-rc3 h1:zzf4JNCXJHPmI82bVFbJvywz346vWL9FFaBSrvNOhPQ= -github.com/rancher/eks-operator v1.2.2-rc3/go.mod h1:/wyszmtekvefdRRuBSe0XVZln5BnVrFIeBFrNHCPawo= -github.com/rancher/fleet/pkg/apis v0.0.0-20230810121238-9d0ee7f56848 h1:FNZEI+rCC+u5RVE4dyH7EX8ltlZ74zBowUOviMoGk5c= -github.com/rancher/fleet/pkg/apis v0.0.0-20230810121238-9d0ee7f56848/go.mod h1:TbpjMODeuFUJlHG8IfehZ4FBzgzpxwPwa+GwtFq2Tq0= -github.com/rancher/gke-operator v1.1.6-rc2 h1:ENFi2Cj2t/EwI7m6wSiZ8xYZWS3TpU0owY47pH9raXw= -github.com/rancher/gke-operator v1.1.6-rc2/go.mod h1:Zcc1ROLHoyxI19eVZ3OdXco4S/B1TReOtm7shIxYxwg= -github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08/go.mod h1:9qZd/S8DqWzfKtjKGgSoHqGEByYmUE3qRaBaaAHwfEM= -github.com/rancher/lasso v0.0.0-20230629200414-8a54b32e6792 h1:IaPhDqppVYX2v/nCR8j2i0nqOLD5yggzzy39QUlcqDw= -github.com/rancher/lasso v0.0.0-20230629200414-8a54b32e6792/go.mod h1:dNcwXjcqgdOuKFIVETNAPURRh3e5PAi/nWUjj+MLVZA= -github.com/rancher/norman v0.0.0-20230426211126-d3552b018687 h1:9Bf4fZBIdkidKTqHFsJXMlnzflxx3h4ZAEH/n6HMuyI= -github.com/rancher/norman v0.0.0-20230426211126-d3552b018687/go.mod h1:7MyWxfCmPl6N/UFLu4neLH6nwTFgQQF5rxtUGyZvPFE= -github.com/rancher/rancher v0.0.0-20230525094739-ff2e09449efc h1:gM1tmiUxwjcl2ijQqyBBFz3Mgf/r+PGHKlJgHLXSK6U= -github.com/rancher/rancher v0.0.0-20230525094739-ff2e09449efc/go.mod h1:VvtuvzQVlhE/Xa3WMoyRS1hzjlHge0tbkPs4PAhxmOE= -github.com/rancher/rancher/pkg/apis v0.0.0-20230901132600-5e1ee2611616 h1:jMNvKWFg5XEtzJijQS6IgbpVlT1H7WIoLlXAbiM2Jas= -github.com/rancher/rancher/pkg/apis v0.0.0-20230901132600-5e1ee2611616/go.mod h1:faAHE0MFFEB+fZQMfjfylYuzuVOn5yxKi7JFRsEfFOE= -github.com/rancher/rancher/pkg/client v0.0.0-20230901132600-5e1ee2611616 h1:4GkRP5TXOXqH1M0DOLd8Olohlhna0/0e3kWpzdJ4EZ8= -github.com/rancher/rancher/pkg/client v0.0.0-20230901132600-5e1ee2611616/go.mod h1:eDLHGs0Wrq0gvAY3YCBPbWatkhj1/R+lg04S3slbroY= -github.com/rancher/rke v1.5.0-rc2 h1:gec//2jkyEimO/fZLMMRVAJF8GpKqDf3voe+k3jrhGg= -github.com/rancher/rke v1.5.0-rc2/go.mod h1:wUwsm6dXyzzxWlVwmPPR5XMWX6ICjAdWJ+l45ZqV+P0= -github.com/rancher/wrangler v0.6.1/go.mod h1:L4HtjPeX8iqLgsxfJgz+JjKMcX2q3qbRXSeTlC/CSd4= -github.com/rancher/wrangler v0.8.11-0.20220120160420-18c996a8e956/go.mod h1:Lte9WjPtGYxYacIWeiS9qawvu2R4NujFU9xuXWJvc/0= -github.com/rancher/wrangler v1.1.1 h1:wmqUwqc2M7ADfXnBCJTFkTB5ZREWpD78rnZMzmxwMvM= -github.com/rancher/wrangler v1.1.1/go.mod h1:ioVbKupzcBOdzsl55MvEDN0R1wdGggj8iNCYGFI5JvM= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rancher/aks-operator v1.9.0-rc.9 h1:6eIjtaNz40axGgSQLijMrSImnnPLuWdCGUONpChhmYA= +github.com/rancher/aks-operator v1.9.0-rc.9/go.mod h1:JPkilTHa1Exq8VILHOmcxapgHcr9RfPVm7BqjzveMXg= +github.com/rancher/apiserver v0.0.0-20240708202538-39a6f2535146 h1:6I4Z7PAGmned9+EYxbMS7kvajId3r8+ZwAR5wB7X3kg= +github.com/rancher/apiserver v0.0.0-20240708202538-39a6f2535146/go.mod h1:ZNk+LcRGwQYHqgbsJijRrI49KFbX31/QzoUBq4rAeV0= +github.com/rancher/channelserver v0.7.0 h1:ZN5o8aD4mD31uhjEEW2e9yQXa3eOb+4Cp6DcWm7W/Lc= +github.com/rancher/channelserver v0.7.0/go.mod h1:Mwd7hlMSu9X4FnZKj+0mA5ak8nTyJZtZsVX33G62Gzc= +github.com/rancher/eks-operator v1.9.0-rc.9 h1:dgKDUdBfctCTH+loKO2In8tBnbKR0pvJ6BbCEW+Unf0= +github.com/rancher/eks-operator v1.9.0-rc.9/go.mod h1:CaQyxLNMPkvznhgzlUG3+r5Ih02O0SQD0hE0ocMWqm4= +github.com/rancher/fleet/pkg/apis v0.10.0-rc.19 h1:/FIucfmJo78c6D52/DEONU+P2DGq867fNHsDCw31hE4= +github.com/rancher/fleet/pkg/apis v0.10.0-rc.19/go.mod h1:YmVQ8UKVM1uBgQhCKXABE0ic8p0XwPK5qmaY2UlrMj0= +github.com/rancher/gke-operator v1.9.0-rc.8 h1:KqeRL9OfjsH0jRl8cw8V5Vs2j6rPVP1uGCHcaaNXRB8= +github.com/rancher/gke-operator v1.9.0-rc.8/go.mod h1:ga8AIreFbeHyH4CZVjCpEgCzo3InS+LhAVhU6jWyDNo= +github.com/rancher/lasso v0.0.0-20240705194423-b2a060d103c1 h1:vv1jDlYbd4KhGbPNxmjs8CYgEHUrQm2bMtmULfXJ6iw= +github.com/rancher/lasso v0.0.0-20240705194423-b2a060d103c1/go.mod h1:A/y3BLQkxZXYD60MNDRwAG9WGxXfvd6Z6gWR/a8wPw8= +github.com/rancher/norman v0.0.0-20240708202514-a0127673d1b9 h1:AlRMRs5mHJcdiK83KKJyFVeybPMZ7dOUzC0l3k9aUa8= +github.com/rancher/norman v0.0.0-20240708202514-a0127673d1b9/go.mod h1:dyjfXBsNiroPWOdUZe7diUOUSLf6HQ/r2kEpwH/8zas= +github.com/rancher/rancher v0.0.0-20240716141526-e0d2afd007d8 h1:isft3hbGlfYJaM5oCRF33MPuFeq9qVCBQo9IA5wOfXE= +github.com/rancher/rancher v0.0.0-20240716141526-e0d2afd007d8/go.mod h1:k2aAbIqTi/nSYuSqUGYTZLOOQ6zCEKfbx9sKHkkU8S8= +github.com/rancher/rancher/pkg/apis v0.0.0-20240716141526-e0d2afd007d8 h1:fSlV+/76dHQ1x0CZXc+HWcPSUSuuUNrcfDxTfMWoM8A= +github.com/rancher/rancher/pkg/apis v0.0.0-20240716141526-e0d2afd007d8/go.mod h1:5ET3XVIcWarzwEl0uSCwBgkPx84zYv755akuHfWht18= +github.com/rancher/rancher/pkg/client v0.0.0-20240716141526-e0d2afd007d8 h1:QOWC6pSLFvhEFtydXLCyDn7nU2bJT2b5KCmBRDYRQwI= +github.com/rancher/rancher/pkg/client v0.0.0-20240716141526-e0d2afd007d8/go.mod h1:A+DTKG05BZs1mOoCIB6UpiKo7j0dC6kSz3mgYju9Q20= +github.com/rancher/rke v1.6.0-rc9 h1:P8EVV4hl3cG8CHDuFUEfqFK8sC92aLoemFzmeFQOCck= +github.com/rancher/rke v1.6.0-rc9/go.mod h1:5xRbf3L8PxqJRhABjYRfaBqbpVqAnqyH3maUNQEuwvk= +github.com/rancher/wrangler/v3 v3.0.0 h1:IHHCA+vrghJDPxjtLk4fmeSCFhNe9fFzLFj3m2B0YpA= +github.com/rancher/wrangler/v3 v3.0.0/go.mod h1:Dfckuuq7MJk2JWVBDywRlZXMxEyPxHy4XqGrPEzu5Eg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 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/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= 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/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spyzhov/ajson v0.4.2/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -1010,18 +712,12 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= @@ -1029,18 +725,14 @@ github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 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= @@ -1054,21 +746,6 @@ github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY3 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= 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.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.etcd.io/etcd/pkg/v3 v3.5.4/go.mod h1:OI+TtO+Aa3nhQSppMbwE4ld3uF1/fqqwbpfndbbrEe0= -go.etcd.io/etcd/raft/v3 v3.5.4/go.mod h1:SCuunjYvZFC0fBX0vxMSPjuZmpcSk+XaAcMrD6Do03w= -go.etcd.io/etcd/server/v3 v3.5.4/go.mod h1:S5/YTU15KxymM5l3T6b09sNOHPXqGYIZStpuuGbb65c= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1078,56 +755,21 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-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-20190320223903-b7391e95e576/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-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/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-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1163,36 +805,23 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1204,7 +833,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ 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-20200520004742-59133d7f0dd7/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= @@ -1212,18 +840,13 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1236,8 +859,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1249,7 +873,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -1264,8 +887,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= @@ -1280,42 +903,26 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/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-20191120155948-bd437916bb0e/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-20200106162015-b016eb3dc98e/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= @@ -1327,50 +934,37 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w 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-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1380,17 +974,20 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= 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.20171227012246-e19ae1496984/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1398,44 +995,29 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/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-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/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-20191017205301-920acffc3e65/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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= @@ -1455,7 +1037,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs 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-20200505023115-26f46d2f7ef8/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= @@ -1468,7 +1049,6 @@ golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -1477,10 +1057,9 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= @@ -1490,9 +1069,6 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= 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= @@ -1515,7 +1091,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -1543,15 +1118,14 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.130.0 h1:A50ujooa1h9iizvfzA4rrJr2B7uRmWexwbekQ2+5FPQ= -google.golang.org/api v0.130.0/go.mod h1:J/LCJMYSDFvAVREGCbrESb53n4++NMBDetSHGL5I5RY= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1575,7 +1149,6 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1586,7 +1159,6 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/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= @@ -1657,16 +1229,15 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 h1:DEH99RbiLZhMxrpEJCZ0A+wdTe0EOgou/poSLx9vWf4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= 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.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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= @@ -1701,8 +1272,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= @@ -1719,9 +1290,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1730,39 +1300,20 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= 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= @@ -1770,79 +1321,36 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh 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= -k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs= -k8s.io/api v0.25.4/go.mod h1:IG2+RzyPQLllQxnhzD8KQNEu4c4YvyDTpSMztf4A0OQ= -k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= -k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= -k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc= -k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= -k8s.io/apiserver v0.25.4 h1:/3TwZcgLqX7wUxq7TtXOUqXeBTwXIblVMQdhR5XZ7yo= -k8s.io/apiserver v0.25.4/go.mod h1:rPcm567XxjOnnd7jedDUnGJGmDGAo+cT6H7QHAN+xV0= -k8s.io/cli-runtime v0.25.4/go.mod h1:JGOw1CR8v4Mcz6cEKA7bFQe0bPrNn1l5sGAX1/Ke4Eg= -k8s.io/code-generator v0.25.4/go.mod h1:9F5fuVZOMWRme7MYj2YT3L9ropPWPokd9VRhVyD3+0w= -k8s.io/component-base v0.25.4 h1:n1bjg9Yt+G1C0WnIDJmg2fo6wbEU1UGMRiQSjmj7hNQ= -k8s.io/component-base v0.25.4/go.mod h1:nnZJU8OP13PJEm6/p5V2ztgX2oyteIaAGKGMYb2L2cY= -k8s.io/component-helpers v0.25.4/go.mod h1:X4KJ8SsJ/onWcDQkRhcE2WRG/iNMufCl7RsNSYtguJg= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= -k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.10.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-aggregator v0.25.4/go.mod h1:PH65mLSQoUld53w0VkdYcsIGh7wjJGZ5DyfoARronz0= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661/go.mod h1:daOouuuwd9JXpv1L7Y34iV3yf6nxzipkKMWWlqlvK9M= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= -k8s.io/kubectl v0.25.4/go.mod h1:CKMrQ67Bn2YCP26tZStPQGq62zr9pvzEf65A0navm8k= -k8s.io/kubernetes v1.25.4 h1:M1+MR8IxE64zHhSSDn30twChLaOI+p0Kt77pvyQMKwU= -k8s.io/kubernetes v1.25.4/go.mod h1:lvEY+3iJhh+sGIK1LorGkI56rW0eLGsfalnp68wQwYU= -k8s.io/metrics v0.25.4/go.mod h1:cFxN3gbdb0nld4IGHHM51qKHUCcXvzkKh3z1g2YriL8= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= +k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= +k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= +k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= +k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= +k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8= +k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo= +k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= +k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= +k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ= +k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/kubernetes v1.30.1 h1:XlqS6KslLEA5mQzLK2AJrhr4Z1m8oJfkhHiWJ5lue+I= +k8s.io/kubernetes v1.30.1/go.mod h1:yPbIk3MhmhGigX62FLJm+CphNtjxqCvAIFQXup6RKS0= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= 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= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33/go.mod h1:soWkSNf2tZC7aMibXEqVhCd73GOY5fJikn8qbdzemB0= -sigs.k8s.io/cli-utils v0.16.0/go.mod h1:9Jqm9K2W6ShhCxsEuaz6HSRKKOXigPUx3ZfypGgxBLY= -sigs.k8s.io/cli-utils v0.27.0 h1:BxI7lPNn0fBZa5g4UwR+ShJyL4CCxELA6tLHbr2YrpU= -sigs.k8s.io/cli-utils v0.27.0/go.mod h1:8ll2fyx+bzjbwmwUnKBQU+2LDbMDsxy44DiDZ+drALg= -sigs.k8s.io/cluster-api v1.2.12 h1:/1iFgWUR3Z+KZU9B4PJegmlQQo6uzQXBZNgOk63SLu4= -sigs.k8s.io/cluster-api v1.2.12/go.mod h1:9+fLUuyRsKediKJYrbsyFj6Bmk59oopXpzj3g6/REM8= -sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= -sigs.k8s.io/controller-runtime v0.10.1/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= -sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= -sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/cli-utils v0.35.0 h1:dfSJaF1W0frW74PtjwiyoB4cwdRygbHnC7qe7HF0g/Y= +sigs.k8s.io/cli-utils v0.35.0/go.mod h1:ITitykCJxP1vaj1Cew/FZEaVJ2YsTN9Q71m02jebkoE= +sigs.k8s.io/cluster-api v1.7.3 h1:DsSRxsA+18jxLqPAo29abZ9kOPK1/xwhSuQb/MROzSs= +sigs.k8s.io/cluster-api v1.7.3/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/cmd/config v0.10.9/go.mod h1:T0s850zPV3wKfBALA0dyeP/K74jlJcoP8Pr9ZWwE3MQ= -sigs.k8s.io/kustomize/kustomize/v4 v4.5.7/go.mod h1:VSNKEH9D9d9bLiWEGbS6Xbg/Ih0tgQalmPvntzRxZ/Q= -sigs.k8s.io/kustomize/kyaml v0.4.0/go.mod h1:XJL84E6sOFeNrQ7CADiemc1B0EjIxHo3OhW4o1aJYNw= -sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= -sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/rancher2/0_provider_upgrade_test.go b/rancher2/0_provider_upgrade_test.go index 66cdd7e4..10aa6f62 100644 --- a/rancher2/0_provider_upgrade_test.go +++ b/rancher2/0_provider_upgrade_test.go @@ -108,8 +108,6 @@ provider "rancher2" { ` + testAccRancher2CloudCredentialConfigOpenstack + ` ` + testAccRancher2CloudCredentialConfigVsphere + ` ` + testAccRancher2ClusterConfigRKE + ` -` + testAccRancher2ClusterAlertGroup + ` -` + testAccRancher2ClusterAlertRule + ` ` + testAccRancher2ClusterDriver + ` ` + testAccRancher2User + ` ` + testAccRancher2ClusterRoleTemplateBinding + ` @@ -130,14 +128,6 @@ provider "rancher2" { ` + testAccRancher2NodeTemplateOpennebulaConfig + ` ` + testAccRancher2NodeTemplateOpenstack + ` ` + testAccRancher2NodeTemplateVsphere + ` -` + testAccRancher2NotifierPagerduty + ` -` + testAccRancher2NotifierSlack + ` -` + testAccRancher2NotifierSMTP + ` -` + testAccRancher2NotifierWebhook + ` -` + testAccRancher2NotifierWechat + ` -` + testAccCheckRancher2PodSecurityPolicyTemplate + ` -` + testAccRancher2ProjectAlertGroupConfig + ` -` + testAccRancher2ProjectAlertRule + ` ` + testAccRancher2ProjectRoleTemplateBinding + ` ` + testAccRancher2Project + ` ` + testAccRancher2Registry + ` @@ -159,8 +149,6 @@ provider "rancher2" { ` + testAccRancher2CloudCredentialConfigOpenstack + ` ` + testAccRancher2CloudCredentialConfigVsphere + ` ` + testAccRancher2ClusterConfigRKE + ` -` + testAccRancher2ClusterAlertGroup + ` -` + testAccRancher2ClusterAlertRule + ` ` + testAccRancher2ClusterDriver + ` ` + testAccRancher2User + ` ` + testAccRancher2ClusterRoleTemplateBinding + ` @@ -181,16 +169,6 @@ provider "rancher2" { ` + testAccRancher2NodeTemplateOpennebulaConfig + ` ` + testAccRancher2NodeTemplateOpenstack + ` ` + testAccRancher2NodeTemplateVsphere + ` -` + testAccRancher2NotifierDingtalk + ` -` + testAccRancher2NotifierMSTeams + ` -` + testAccRancher2NotifierPagerduty + ` -` + testAccRancher2NotifierSlack + ` -` + testAccRancher2NotifierSMTP + ` -` + testAccRancher2NotifierWebhook + ` -` + testAccRancher2NotifierWechat + ` -` + testAccCheckRancher2PodSecurityPolicyTemplate + ` -` + testAccRancher2ProjectAlertGroupConfig + ` -` + testAccRancher2ProjectAlertRule + ` ` + testAccRancher2ProjectRoleTemplateBinding + ` ` + testAccRancher2Project + ` ` + testAccRancher2Registry + ` @@ -214,8 +192,6 @@ provider "rancher2" { ` + testAccRancher2CloudCredentialConfigOpenstack + ` ` + testAccRancher2CloudCredentialConfigVsphere + ` ` + testAccRancher2ClusterConfigRKE + ` -` + testAccRancher2ClusterAlertGroup + ` -` + testAccRancher2ClusterAlertRule + ` ` + testAccRancher2ClusterDriver + ` ` + testAccRancher2ConfigMapV2 + ` ` + testAccRancher2User + ` @@ -238,16 +214,6 @@ provider "rancher2" { ` + testAccRancher2NodeTemplateOpennebulaConfig + ` ` + testAccRancher2NodeTemplateOpenstack + ` ` + testAccRancher2NodeTemplateVsphere + ` -` + testAccRancher2NotifierDingtalk + ` -` + testAccRancher2NotifierMSTeams + ` -` + testAccRancher2NotifierPagerduty + ` -` + testAccRancher2NotifierSlack + ` -` + testAccRancher2NotifierSMTP + ` -` + testAccRancher2NotifierWebhook + ` -` + testAccRancher2NotifierWechat + ` -` + testAccCheckRancher2PodSecurityPolicyTemplate + ` -` + testAccRancher2ProjectAlertGroupConfig + ` -` + testAccRancher2ProjectAlertRule + ` ` + testAccRancher2ProjectRoleTemplateBinding + ` ` + testAccRancher2Project + ` ` + testAccRancher2Registry + ` @@ -274,8 +240,6 @@ provider "rancher2" { ` + testAccRancher2CloudCredentialConfigS3 + ` ` + testAccRancher2CloudCredentialConfigVsphere + ` ` + testAccRancher2ClusterConfigRKE + ` -` + testAccRancher2ClusterAlertGroup + ` -` + testAccRancher2ClusterAlertRule + ` ` + testAccRancher2ClusterDriver + ` ` + testAccRancher2ClusterV2 + ` ` + testAccRancher2ConfigMapV2 + ` @@ -299,16 +263,6 @@ provider "rancher2" { ` + testAccRancher2NodeTemplateOpennebulaConfig + ` ` + testAccRancher2NodeTemplateOpenstack + ` ` + testAccRancher2NodeTemplateVsphere + ` -` + testAccRancher2NotifierDingtalk + ` -` + testAccRancher2NotifierMSTeams + ` -` + testAccRancher2NotifierPagerduty + ` -` + testAccRancher2NotifierSlack + ` -` + testAccRancher2NotifierSMTP + ` -` + testAccRancher2NotifierWebhook + ` -` + testAccRancher2NotifierWechat + ` -` + testAccCheckRancher2PodSecurityPolicyTemplate + ` -` + testAccRancher2ProjectAlertGroupConfig + ` -` + testAccRancher2ProjectAlertRule + ` ` + testAccRancher2ProjectRoleTemplateBinding + ` ` + testAccRancher2Project + ` ` + testAccRancher2Registry + ` diff --git a/rancher2/config.go b/rancher2/config.go index dd09e562..cf815757 100644 --- a/rancher2/config.go +++ b/rancher2/config.go @@ -909,14 +909,6 @@ func (c *Config) isClusterConnected(id string) (bool, *managementClient.Cluster, return c.checkClusterCondition(id, clusterConnectedCondition) } -func (c *Config) isClusterMonitoringEnabledCondition(id string) (bool, *managementClient.Cluster, error) { - return c.checkClusterCondition(id, clusterMonitoringEnabledCondition) -} - -func (c *Config) isClusterAlertingEnabledCondition(id string) (bool, *managementClient.Cluster, error) { - return c.checkClusterCondition(id, clusterAlertingEnabledCondition) -} - func (c *Config) ClusterExist(id string) error { _, err := c.GetClusterByID(id) if err != nil { @@ -1835,45 +1827,3 @@ func (c *Config) DeleteCertificate(cert interface{}) error { return fmt.Errorf("[ERROR] Certificate type %s isn't supported", t) } } - -func (c *Config) GetRecipientByNotifier(id string) (*managementClient.Recipient, error) { - if len(id) == 0 { - return nil, fmt.Errorf("[ERROR] Notifier ID can't be nil") - } - - client, err := c.ManagementClient() - if err != nil { - return nil, err - } - - notifier, err := client.Notifier.ByID(id) - if err != nil { - return nil, err - } - - out := &managementClient.Recipient{} - - out.NotifierID = notifier.ID - if notifier.DingtalkConfig != nil { - out.NotifierType = recipientTypeDingtalk - } else if notifier.MSTeamsConfig != nil { - out.NotifierType = recipientTypeMsTeams - } else if notifier.PagerdutyConfig != nil { - out.NotifierType = recipientTypePagerduty - out.Recipient = notifier.PagerdutyConfig.ServiceKey - } else if notifier.SlackConfig != nil { - out.NotifierType = recipientTypeSlack - out.Recipient = notifier.SlackConfig.DefaultRecipient - } else if notifier.SMTPConfig != nil { - out.NotifierType = recipientTypeSMTP - out.Recipient = notifier.SMTPConfig.DefaultRecipient - } else if notifier.WebhookConfig != nil { - out.NotifierType = recipientTypeWebhook - out.Recipient = notifier.WebhookConfig.URL - } else if notifier.WechatConfig != nil { - out.NotifierType = recipientTypeWechat - out.Recipient = notifier.WechatConfig.DefaultRecipient - } - - return out, nil -} diff --git a/rancher2/data_source_rancher2_catalog_v2.go b/rancher2/data_source_rancher2_catalog_v2.go index 028548e0..c7b81361 100644 --- a/rancher2/data_source_rancher2_catalog_v2.go +++ b/rancher2/data_source_rancher2_catalog_v2.go @@ -27,6 +27,24 @@ func dataSourceRancher2CatalogV2() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "exponential_backoff_max_wait": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Maximum amount of seconds to wait before retrying", + }, + "exponential_backoff_min_wait": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Minimum amount of seconds to wait before retrying", + }, + "exponential_backoff_max_retries": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Maximum number of retries before returning error", + }, "git_branch": { Type: schema.TypeString, Computed: true, @@ -35,6 +53,12 @@ func dataSourceRancher2CatalogV2() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "insecure_plain_http": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Only valid for OCI URL's. Allows insecure connections to registries without enforcing TLS checks", + }, "insecure": { Type: schema.TypeBool, Computed: true, diff --git a/rancher2/data_source_rancher2_cluster.go b/rancher2/data_source_rancher2_cluster.go index e2765f38..2976ddb0 100644 --- a/rancher2/data_source_rancher2_cluster.go +++ b/rancher2/data_source_rancher2_cluster.go @@ -136,15 +136,6 @@ func dataSourceRancher2Cluster() *schema.Resource { Schema: clusterAuthEndpoint(), }, }, - "cluster_monitoring_input": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Description: "Cluster monitoring configuration", - Elem: &schema.Resource{ - Schema: monitoringInputFields(), - }, - }, "cluster_registration_token": { Type: schema.TypeList, MaxItems: 1, @@ -180,27 +171,12 @@ func dataSourceRancher2Cluster() *schema.Resource { Computed: true, Description: "Cluster template revision ID", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, Computed: true, Description: "Default pod security admission configuration template name", }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Computed: true, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Computed: true, - Description: "Enable built-in cluster monitoring", - }, "enable_network_policy": { Type: schema.TypeBool, Computed: true, diff --git a/rancher2/data_source_rancher2_cluster_alert_group.go b/rancher2/data_source_rancher2_cluster_alert_group.go deleted file mode 100644 index c415c0f6..00000000 --- a/rancher2/data_source_rancher2_cluster_alert_group.go +++ /dev/null @@ -1,93 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2ClusterAlertGroup() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2ClusterAlertGroupRead, - - Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert group cluster ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert group name", - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "Alert group description", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group wait seconds", - }, - "recipients": { - Type: schema.TypeList, - Computed: true, - Description: "Alert group recipients", - Elem: &schema.Resource{ - Schema: recipientFields(), - }, - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group repeat interval seconds", - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Computed: true, - }, - }, - } -} - -func dataSourceRancher2ClusterAlertGroupRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterID := d.Get("cluster_id").(string) - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "clusterId": clusterID, - "name": name, - } - listOpts := NewListOpts(filters) - - alertGroups, err := client.ClusterAlertGroup.List(listOpts) - if err != nil { - return err - } - - count := len(alertGroups.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] cluster alert group with name \"%s\" on cluster ID \"%s\" not found", name, clusterID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d cluster alert group with name \"%s\" on cluster ID \"%s\"", count, name, clusterID) - } - - return flattenClusterAlertGroup(d, &alertGroups.Data[0]) -} diff --git a/rancher2/data_source_rancher2_cluster_alert_group_test.go b/rancher2/data_source_rancher2_cluster_alert_group_test.go deleted file mode 100644 index 8359f194..00000000 --- a/rancher2/data_source_rancher2_cluster_alert_group_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2ClusterAlertGroupDataSource(t *testing.T) { - testAccCheckRancher2ClusterAlertGroupDataSourceConfig := testAccRancher2ClusterAlertGroupConfig + ` -data "` + testAccRancher2ClusterAlertGroupType + `" "foo" { - cluster_id = rancher2_cluster_alert_group.foo.cluster_id - name = rancher2_cluster_alert_group.foo.name -} -` - name := "data." + testAccRancher2ClusterAlertGroupType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2ClusterAlertGroupDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo"), - resource.TestCheckResourceAttr(name, "description", "Terraform cluster alert group acceptance test"), - resource.TestCheckResourceAttr(name, "group_interval_seconds", "300"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_cluster_alert_rule.go b/rancher2/data_source_rancher2_cluster_alert_rule.go deleted file mode 100644 index 07ec6a1b..00000000 --- a/rancher2/data_source_rancher2_cluster_alert_rule.go +++ /dev/null @@ -1,131 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2ClusterAlertRule() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2ClusterAlertRuleRead, - - Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule cluster ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule name", - }, - "event_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: eventRuleFields(), - }, - Description: "Alert event rule", - }, - "metric_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: metricRuleFields(), - }, - Description: "Alert metric rule", - }, - "node_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: nodeRuleFields(), - }, - Description: "Alert node rule", - }, - "system_service_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: systemServiceRuleFields(), - }, - Description: "Alert system service rule", - }, - "group_id": { - Type: schema.TypeString, - Computed: true, - Description: "Alert rule group ID", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule wait seconds", - }, - "inherited": { - Type: schema.TypeBool, - Computed: true, - Description: "Alert rule inherited", - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule repeat interval seconds", - }, - "severity": { - Type: schema.TypeString, - Computed: true, - Description: "Alert rule severity", - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Optional: true, - }, - }, - } -} - -func dataSourceRancher2ClusterAlertRuleRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterID := d.Get("cluster_id").(string) - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "clusterId": clusterID, - "name": name, - } - listOpts := NewListOpts(filters) - - alertRules, err := client.ClusterAlertRule.List(listOpts) - if err != nil { - return err - } - - count := len(alertRules.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] cluster alert rule with name \"%s\" on cluster ID \"%s\" not found", name, clusterID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d cluster alert rule with name \"%s\" on cluster ID \"%s\"", count, name, clusterID) - } - - return flattenClusterAlertRule(d, &alertRules.Data[0]) -} diff --git a/rancher2/data_source_rancher2_cluster_alert_rule_test.go b/rancher2/data_source_rancher2_cluster_alert_rule_test.go deleted file mode 100644 index f616e32b..00000000 --- a/rancher2/data_source_rancher2_cluster_alert_rule_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2ClusterAlertRuleDataSource(t *testing.T) { - testAccCheckRancher2ClusterAlertRuleDataSourceConfig := testAccRancher2ClusterAlertRuleConfig + ` -data "` + testAccRancher2ClusterAlertRuleType + `" "foo" { - cluster_id = rancher2_cluster_alert_rule.foo.cluster_id - name = rancher2_cluster_alert_rule.foo.name -} -` - name := "data." + testAccRancher2ClusterAlertRuleType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2ClusterAlertRuleDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo"), - resource.TestCheckResourceAttr(name, "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(name, "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_cluster_v2.go b/rancher2/data_source_rancher2_cluster_v2.go index bce67d48..236137c1 100644 --- a/rancher2/data_source_rancher2_cluster_v2.go +++ b/rancher2/data_source_rancher2_cluster_v2.go @@ -46,11 +46,6 @@ func dataSourceRancher2ClusterV2() *schema.Resource { Computed: true, Description: "Cluster V2 cloud credential secret name", }, - "default_pod_security_policy_template_name": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster V2 default pod security policy template name", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Computed: true, diff --git a/rancher2/data_source_rancher2_notifier.go b/rancher2/data_source_rancher2_notifier.go deleted file mode 100644 index 7d49880a..00000000 --- a/rancher2/data_source_rancher2_notifier.go +++ /dev/null @@ -1,133 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2Notifier() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2NotifierRead, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Notifier name", - }, - "cluster_id": { - Type: schema.TypeString, - Required: true, - Description: "Notifier cluster ID", - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "Notifier description", - }, - "dingtalk_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"msteams_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierDingtalkConfigFields(), - }, - }, - "msteams_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierMSTeamsConfigFields(), - }, - }, - "pagerduty_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierPagerdutyConfigFields(), - }, - }, - "slack_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierSlackConfigFields(), - }, - }, - "smtp_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierSMTPConfigFields(), - }, - }, - "webhook_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "slack_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierWebhookConfigFields(), - }, - }, - "wechat_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config"}, - Elem: &schema.Resource{ - Schema: notifierWechatConfigFields(), - }, - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Computed: true, - }, - }, - } -} - -func dataSourceRancher2NotifierRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - name := d.Get("name").(string) - clusterID := d.Get("cluster_id").(string) - - filters := map[string]interface{}{ - "name": name, - "clusterId": clusterID, - } - listOpts := NewListOpts(filters) - - notifiers, err := client.Notifier.List(listOpts) - if err != nil { - return err - } - - count := len(notifiers.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] notifier with name \"%s\" and cluster ID \"%s\" not found", name, clusterID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d notifier with name \"%s\" and cluster ID \"%s\"", count, name, clusterID) - } - - return flattenNotifier(d, ¬ifiers.Data[0]) -} diff --git a/rancher2/data_source_rancher2_notifier_test.go b/rancher2/data_source_rancher2_notifier_test.go deleted file mode 100644 index 60079df9..00000000 --- a/rancher2/data_source_rancher2_notifier_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2NotifierDataSource(t *testing.T) { - testAccCheckRancher2NotifierDataSourceConfig := testAccRancher2NotifierPagerdutyConfig + ` -data "` + testAccRancher2NotifierType + `" "foo" { - name = rancher2_notifier.foo-pagerduty.name - cluster_id = rancher2_notifier.foo-pagerduty.cluster_id -} -` - name := "data." + testAccRancher2NotifierType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2NotifierDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo-pagerduty"), - resource.TestCheckResourceAttr(name, "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(name, "pagerduty_config.0.service_key", "XXXXXXXX"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_pod_security_policy_template.go b/rancher2/data_source_rancher2_pod_security_policy_template.go deleted file mode 100644 index c1503892..00000000 --- a/rancher2/data_source_rancher2_pod_security_policy_template.go +++ /dev/null @@ -1,28 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2PodSecurityPolicyTemplate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2PodSecurityPolicyTemplateRead, - Schema: podSecurityPolicyTemplateFields(), - } -} - -func dataSourceRancher2PodSecurityPolicyTemplateRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - name := d.Get("name").(string) - - pspt, err := client.PodSecurityPolicyTemplate.ByID(name) - if err != nil { - return err - } - - return flattenPodSecurityPolicyTemplate(d, pspt) -} diff --git a/rancher2/data_source_rancher2_pod_security_policy_template_test.go b/rancher2/data_source_rancher2_pod_security_policy_template_test.go deleted file mode 100644 index 4db9eb15..00000000 --- a/rancher2/data_source_rancher2_pod_security_policy_template_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2PodSecurityPolicyTemplateDataSource(t *testing.T) { - testAccCheckRancher2PodSecurityPolicyTemplateDataSourceConfig := testAccCheckRancher2PodSecurityPolicyTemplate + ` -data "` + testAccRancher2PodSecurityPolicyTemplateType + `" "foo" { - name = rancher2_pod_security_policy_template.foo.name -} -` - name := "data." + testAccRancher2PodSecurityPolicyTemplateType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2PodSecurityPolicyTemplateDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo"), - resource.TestCheckResourceAttr(name, "description", "Terraform PodSecurityPolicyTemplate acceptance test"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_project.go b/rancher2/data_source_rancher2_project.go index d2029b37..b5cefca2 100644 --- a/rancher2/data_source_rancher2_project.go +++ b/rancher2/data_source_rancher2_project.go @@ -37,15 +37,6 @@ func dataSourceRancher2Project() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "enable_project_monitoring": { - Type: schema.TypeBool, - Computed: true, - Description: "Enable built-in project monitoring", - }, - "pod_security_policy_template_id": { - Type: schema.TypeString, - Computed: true, - }, "resource_quota": { Type: schema.TypeList, MaxItems: 1, @@ -148,8 +139,6 @@ func dataSourceRancher2ProjectRead(d *schema.ResourceData, meta interface{}) err } } - d.Set("pod_security_policy_template_id", project.PodSecurityPolicyTemplateName) - if project.ResourceQuota != nil && project.NamespaceDefaultResourceQuota != nil { resourceQuota := flattenProjectResourceQuota(project.ResourceQuota, project.NamespaceDefaultResourceQuota) err := d.Set("resource_quota", resourceQuota) diff --git a/rancher2/data_source_rancher2_project_alert_group.go b/rancher2/data_source_rancher2_project_alert_group.go deleted file mode 100644 index 1c53eefd..00000000 --- a/rancher2/data_source_rancher2_project_alert_group.go +++ /dev/null @@ -1,93 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2ProjectAlertGroup() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2ProjectAlertGroupRead, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert group name", - }, - "project_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert group project ID", - }, - "description": { - Type: schema.TypeString, - Computed: true, - Description: "Alert group description", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group wait seconds", - }, - "recipients": { - Type: schema.TypeList, - Computed: true, - Description: "Alert group recipients", - Elem: &schema.Resource{ - Schema: recipientFields(), - }, - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert group repeat interval seconds", - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Computed: true, - }, - }, - } -} - -func dataSourceRancher2ProjectAlertGroupRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectID := d.Get("project_id").(string) - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "name": name, - "projectId": projectID, - } - listOpts := NewListOpts(filters) - - alertGroups, err := client.ProjectAlertGroup.List(listOpts) - if err != nil { - return err - } - - count := len(alertGroups.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] project alert group with name \"%s\" on project ID \"%s\" not found", name, projectID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d project alert group with name \"%s\" on project ID \"%s\"", count, name, projectID) - } - - return flattenProjectAlertGroup(d, &alertGroups.Data[0]) -} diff --git a/rancher2/data_source_rancher2_project_alert_group_test.go b/rancher2/data_source_rancher2_project_alert_group_test.go deleted file mode 100644 index 67154a7a..00000000 --- a/rancher2/data_source_rancher2_project_alert_group_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2ProjectAlertGroupDataSource(t *testing.T) { - testAccCheckRancher2ProjectAlertGroupDataSourceConfig := testAccRancher2ProjectAlertGroupConfig + ` -data "` + testAccRancher2ProjectAlertGroupType + `" "foo" { - name = rancher2_project_alert_group.foo.name - project_id = rancher2_project_alert_group.foo.project_id -} -` - name := "data." + testAccRancher2ProjectAlertGroupType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2ProjectAlertGroupDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo"), - resource.TestCheckResourceAttr(name, "description", "Terraform project alert group acceptance test"), - resource.TestCheckResourceAttr(name, "group_interval_seconds", "300"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_project_alert_rule.go b/rancher2/data_source_rancher2_project_alert_rule.go deleted file mode 100644 index 1c973819..00000000 --- a/rancher2/data_source_rancher2_project_alert_rule.go +++ /dev/null @@ -1,122 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2ProjectAlertRule() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2ProjectAlertRuleRead, - - Schema: map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule project ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule name", - }, - "metric_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: metricRuleFields(), - }, - Description: "Alert metric rule", - }, - "pod_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: podRuleFields(), - }, - Description: "Alert pod rule", - }, - "workload_rule": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: workloadRuleFields(), - }, - Description: "Alert workload rule", - }, - "group_id": { - Type: schema.TypeString, - Computed: true, - Description: "Alert rule group ID", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule wait seconds", - }, - "inherited": { - Type: schema.TypeBool, - Computed: true, - Description: "Alert rule inherited", - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Computed: true, - Description: "Alert rule repeat interval seconds", - }, - "severity": { - Type: schema.TypeString, - Computed: true, - Description: "Alert rule severity", - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Optional: true, - }, - }, - } -} - -func dataSourceRancher2ProjectAlertRuleRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectID := d.Get("project_id").(string) - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "projectId": projectID, - "name": name, - } - listOpts := NewListOpts(filters) - - alertRules, err := client.ProjectAlertRule.List(listOpts) - if err != nil { - return err - } - - count := len(alertRules.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] project alert rule with name \"%s\" on project ID \"%s\" not found", name, projectID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d project alert rule with name \"%s\" on project ID \"%s\"", count, name, projectID) - } - - return flattenProjectAlertRule(d, &alertRules.Data[0]) -} diff --git a/rancher2/data_source_rancher2_project_alert_rule_test.go b/rancher2/data_source_rancher2_project_alert_rule_test.go deleted file mode 100644 index 7c956e74..00000000 --- a/rancher2/data_source_rancher2_project_alert_rule_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" -) - -func TestAccRancher2ProjectAlertRuleDataSource(t *testing.T) { - testAccCheckRancher2ProjectAlertRuleDataSourceConfig := testAccRancher2ProjectAlertRuleConfig + ` -data "` + testAccRancher2ProjectAlertRuleType + `" "foo" { - project_id = rancher2_project_alert_rule.foo.project_id - name = rancher2_project_alert_rule.foo.name -} -` - name := "data." + testAccRancher2ProjectAlertRuleType + ".foo" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2ProjectAlertRuleDataSourceConfig, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "name", "foo"), - resource.TestCheckResourceAttr(name, "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(name, "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} diff --git a/rancher2/data_source_rancher2_role_template.go b/rancher2/data_source_rancher2_role_template.go index 9df079c5..e31a2447 100644 --- a/rancher2/data_source_rancher2_role_template.go +++ b/rancher2/data_source_rancher2_role_template.go @@ -75,6 +75,15 @@ func dataSourceRancher2RoleTemplate() *schema.Resource { Schema: policyRuleFields(), }, }, + "external_rules": { + Type: schema.TypeList, + Computed: true, + Optional: true, + Description: "External policy rules used for authorization", + Elem: &schema.Resource{ + Schema: policyRuleFields(), + }, + }, "annotations": { Type: schema.TypeMap, Computed: true, diff --git a/rancher2/data_source_rancher2_user.go b/rancher2/data_source_rancher2_user.go index 1ff0a3c8..fcc9ebd5 100644 --- a/rancher2/data_source_rancher2_user.go +++ b/rancher2/data_source_rancher2_user.go @@ -26,6 +26,10 @@ func dataSourceRancher2User() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "must_change_password": { + Type: schema.TypeBool, + Computed: true, + }, "is_external": { Type: schema.TypeBool, Optional: true, diff --git a/rancher2/import_rancher2_cluster_alert_group.go b/rancher2/import_rancher2_cluster_alert_group.go deleted file mode 100644 index 7e479524..00000000 --- a/rancher2/import_rancher2_cluster_alert_group.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2ClusterAlertGroupImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2ClusterAlertGroupRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_cluster_alert_rule.go b/rancher2/import_rancher2_cluster_alert_rule.go deleted file mode 100644 index 62912b42..00000000 --- a/rancher2/import_rancher2_cluster_alert_rule.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2ClusterAlertRuleImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2ClusterAlertRuleRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_notifier.go b/rancher2/import_rancher2_notifier.go deleted file mode 100644 index ec6bedff..00000000 --- a/rancher2/import_rancher2_notifier.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2NotifierImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2NotifierRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_pod_security_policy_template.go b/rancher2/import_rancher2_pod_security_policy_template.go deleted file mode 100644 index 5daee7a5..00000000 --- a/rancher2/import_rancher2_pod_security_policy_template.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2PodSecurityPolicyTemplateImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2PodSecurityPolicyTemplateRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_project_alert_group.go b/rancher2/import_rancher2_project_alert_group.go deleted file mode 100644 index b77362ae..00000000 --- a/rancher2/import_rancher2_project_alert_group.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2ProjectAlertGroupImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2ProjectAlertGroupRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_project_alert_rule.go b/rancher2/import_rancher2_project_alert_rule.go deleted file mode 100644 index f482ab5e..00000000 --- a/rancher2/import_rancher2_project_alert_rule.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2ProjectAlertRuleImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2ProjectAlertRuleRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/provider.go b/rancher2/provider.go index 9ca0868e..6e3f19b6 100644 --- a/rancher2/provider.go +++ b/rancher2/provider.go @@ -125,8 +125,6 @@ func Provider() terraform.ResourceProvider { "rancher2_cloud_credential": resourceRancher2CloudCredential(), "rancher2_cluster": resourceRancher2Cluster(), "rancher2_cluster_v2": resourceRancher2ClusterV2(), - "rancher2_cluster_alert_group": resourceRancher2ClusterAlertGroup(), - "rancher2_cluster_alert_rule": resourceRancher2ClusterAlertRule(), "rancher2_cluster_driver": resourceRancher2ClusterDriver(), "rancher2_cluster_role_template_binding": resourceRancher2ClusterRoleTemplateBinding(), "rancher2_cluster_sync": resourceRancher2ClusterSync(), @@ -145,12 +143,8 @@ func Provider() terraform.ResourceProvider { "rancher2_node_driver": resourceRancher2NodeDriver(), "rancher2_node_pool": resourceRancher2NodePool(), "rancher2_node_template": resourceRancher2NodeTemplate(), - "rancher2_notifier": resourceRancher2Notifier(), "rancher2_pod_security_admission_configuration_template": resourceRancher2PodSecurityAdmissionConfigurationTemplate(), - "rancher2_pod_security_policy_template": resourceRancher2PodSecurityPolicyTemplate(), "rancher2_project": resourceRancher2Project(), - "rancher2_project_alert_group": resourceRancher2ProjectAlertGroup(), - "rancher2_project_alert_rule": resourceRancher2ProjectAlertRule(), "rancher2_project_role_template_binding": resourceRancher2ProjectRoleTemplateBinding(), "rancher2_registry": resourceRancher2Registry(), "rancher2_role_template": resourceRancher2RoleTemplate(), @@ -170,8 +164,6 @@ func Provider() terraform.ResourceProvider { "rancher2_cloud_credential": dataSourceRancher2CloudCredential(), "rancher2_cluster": dataSourceRancher2Cluster(), "rancher2_cluster_v2": dataSourceRancher2ClusterV2(), - "rancher2_cluster_alert_group": dataSourceRancher2ClusterAlertGroup(), - "rancher2_cluster_alert_rule": dataSourceRancher2ClusterAlertRule(), "rancher2_cluster_driver": dataSourceRancher2ClusterDriver(), "rancher2_cluster_role_template_binding": dataSourceRancher2ClusterRoleTemplateBinding(), "rancher2_cluster_template": dataSourceRancher2ClusterTemplate(), @@ -185,13 +177,9 @@ func Provider() terraform.ResourceProvider { "rancher2_node_driver": dataSourceRancher2NodeDriver(), "rancher2_node_pool": dataSourceRancher2NodePool(), "rancher2_node_template": dataSourceRancher2NodeTemplate(), - "rancher2_notifier": dataSourceRancher2Notifier(), "rancher2_pod_security_admission_configuration_template": dataSourceRancher2PodSecurityAdmissionConfigurationTemplate(), - "rancher2_pod_security_policy_template": dataSourceRancher2PodSecurityPolicyTemplate(), "rancher2_principal": dataSourceRancher2Principal(), "rancher2_project": dataSourceRancher2Project(), - "rancher2_project_alert_group": dataSourceRancher2ProjectAlertGroup(), - "rancher2_project_alert_rule": dataSourceRancher2ProjectAlertRule(), "rancher2_project_role_template_binding": dataSourceRancher2ProjectRoleTemplateBinding(), "rancher2_registry": dataSourceRancher2Registry(), "rancher2_role_template": dataSourceRancher2RoleTemplate(), diff --git a/rancher2/resource_rancher2_cluster.go b/rancher2/resource_rancher2_cluster.go index 3b7ab2ff..f2deaa34 100644 --- a/rancher2/resource_rancher2_cluster.go +++ b/rancher2/resource_rancher2_cluster.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" norman "github.com/rancher/norman/types" managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - projectClient "github.com/rancher/rancher/pkg/client/generated/project/v3" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" ) @@ -145,7 +144,6 @@ func resourceRancher2ClusterCreate(d *schema.ResourceData, meta interface{}) err } // Creating cluster with monitoring disabled - cluster.EnableClusterMonitoring = false newCluster := &Cluster{} if cluster.EKSConfig != nil && !cluster.EKSConfig.Imported { if !checkClusterEKSConfigV2NodeGroupsDesiredSize(cluster) { @@ -167,7 +165,6 @@ func resourceRancher2ClusterCreate(d *schema.ResourceData, meta interface{}) err return err } - newCluster.EnableClusterMonitoring = d.Get("enable_cluster_monitoring").(bool) d.SetId(newCluster.ID) stateConf := &resource.StateChangeConf{ @@ -183,39 +180,6 @@ func resourceRancher2ClusterCreate(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("[ERROR] waiting for cluster (%s) to be created: %s", newCluster.ID, waitErr) } - monitoringInput := expandMonitoringInput(d.Get("cluster_monitoring_input").([]interface{})) - if newCluster.EnableClusterMonitoring { - if len(newCluster.Actions[monitoringActionEnable]) == 0 { - err = client.APIBaseClient.ByID(managementClient.ClusterType, newCluster.ID, newCluster) - if err != nil { - return err - } - } - clusterResource := &norman.Resource{ - ID: newCluster.ID, - Type: newCluster.Type, - Links: newCluster.Links, - Actions: newCluster.Actions, - } - // Retry enable monitoring until timeout if got api error 500 - ctx, cancel := context.WithTimeout(context.Background(), meta.(*Config).Timeout) - defer cancel() - for { - err = client.APIBaseClient.Action(managementClient.ClusterType, monitoringActionEnable, clusterResource, monitoringInput, nil) - if err == nil { - return resourceRancher2ClusterRead(d, meta) - } - if !IsServerError(err) { - return err - } - select { - case <-time.After(rancher2RetriesWait * time.Second): - case <-ctx.Done(): - break - } - } - } - return resourceRancher2ClusterRead(d, meta) } @@ -254,24 +218,13 @@ func resourceRancher2ClusterRead(d *schema.ResourceData, meta interface{}) error return resource.NonRetryableError(err) } - var monitoringInput *managementClient.MonitoringInput - if len(cluster.Annotations[monitoringInputAnnotation]) > 0 { - monitoringInput = &managementClient.MonitoringInput{} - err = jsonToInterface(cluster.Annotations[monitoringInputAnnotation], monitoringInput) - if err != nil { - return resource.NonRetryableError(err) - } - - } - if err = flattenCluster( d, cluster, clusterRegistrationToken, kubeConfig, defaultProjectID, - systemProjectID, - monitoringInput); err != nil { + systemProjectID); err != nil { return resource.NonRetryableError(err) } @@ -310,14 +263,11 @@ func resourceRancher2ClusterUpdate(d *schema.ResourceData, meta interface{}) err "clusterAgentDeploymentCustomization": clusterAgentDeploymentCustomization, "fleetAgentDeploymentCustomization": fleetAgentDeploymentCustomization, "description": d.Get("description").(string), - "defaultPodSecurityPolicyTemplateId": d.Get("default_pod_security_policy_template_id").(string), "defaultPodSecurityAdmissionConfigurationTemplateName": d.Get("default_pod_security_admission_configuration_template_name").(string), "desiredAgentImage": d.Get("desired_agent_image").(string), "desiredAuthImage": d.Get("desired_auth_image").(string), "dockerRootDir": d.Get("docker_root_dir").(string), "fleetWorkspaceName": d.Get("fleet_workspace_name").(string), - "enableClusterAlerting": d.Get("enable_cluster_alerting").(bool), - "enableClusterMonitoring": d.Get("enable_cluster_monitoring").(bool), "enableNetworkPolicy": &enableNetworkPolicy, "istioEnabled": d.Get("enable_cluster_istio").(bool), "localClusterAuthEndpoint": expandClusterAuthEndpoint(d.Get("cluster_auth_endpoint").([]interface{})), @@ -325,11 +275,6 @@ func resourceRancher2ClusterUpdate(d *schema.ResourceData, meta interface{}) err "labels": toMapString(d.Get("labels").(map[string]interface{})), } - // cluster_monitoring is not updated here. Setting old `enable_cluster_monitoring` value if it was updated - if d.HasChange("enable_cluster_monitoring") { - update["enableClusterMonitoring"] = !d.Get("enable_cluster_monitoring").(bool) - } - if clusterTemplateID, ok := d.Get("cluster_template_id").(string); ok && len(clusterTemplateID) > 0 { update["clusterTemplateId"] = clusterTemplateID if clusterTemplateRevisionID, ok := d.Get("cluster_template_revision_id").(string); ok && len(clusterTemplateRevisionID) > 0 { @@ -420,17 +365,6 @@ func resourceRancher2ClusterUpdate(d *schema.ResourceData, meta interface{}) err return resource.NonRetryableError(fmt.Errorf("[ERROR] waiting for cluster (%s) to be updated: %s", newCluster.ID, waitErr)) } - // update cluster monitoring if it has changed - if d.HasChange("enable_cluster_monitoring") || d.HasChange("cluster_monitoring_input") { - err = updateClusterMonitoring(client, d, meta, *newCluster) - if err != nil { - if IsServerError(err) { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - } - d.SetId(newCluster.ID) // read cluster after update. If an error is returned then the read failed and is non retryable, else @@ -732,100 +666,3 @@ func getClusterKubeconfig(c *Config, id, origconfig string) (*managementClient.G } } } - -func updateClusterMonitoring(client *managementClient.Client, d *schema.ResourceData, meta interface{}, newCluster Cluster) error { - clusterResource := &norman.Resource{ - ID: newCluster.ID, - Type: newCluster.Type, - Links: newCluster.Links, - Actions: newCluster.Actions, - } - enableMonitoring := d.Get("enable_cluster_monitoring").(bool) - - if enableMonitoring { - monitoringInput := expandMonitoringInput(d.Get("cluster_monitoring_input").([]interface{})) - if len(newCluster.Actions[monitoringActionEnable]) > 0 { - err := client.APIBaseClient.Action(managementClient.ClusterType, monitoringActionEnable, clusterResource, monitoringInput, nil) - if err != nil { - return err - } - } else { - monitorVersionChanged := false - if d.HasChange("cluster_monitoring_input") { - old, new := d.GetChange("cluster_monitoring_input") - oldInput := old.([]interface{}) - oldInputLen := len(oldInput) - oldVersion := "" - if oldInputLen > 0 { - oldRow, oldOK := oldInput[0].(map[string]interface{}) - if oldOK { - oldVersion = oldRow["version"].(string) - } - } - newInput := new.([]interface{}) - newInputLen := len(newInput) - newVersion := "" - if newInputLen > 0 { - newRow, newOK := newInput[0].(map[string]interface{}) - if newOK { - newVersion = newRow["version"].(string) - } - } - if oldVersion != newVersion { - monitorVersionChanged = true - } - } - if monitorVersionChanged && monitoringInput != nil { - err := updateClusterMonitoringApps(meta, d.Get("system_project_id").(string), monitoringInput.Version) - if err != nil { - return err - } - } - err := client.APIBaseClient.Action(managementClient.ClusterType, monitoringActionEdit, clusterResource, monitoringInput, nil) - if err != nil { - return err - } - } - } else if len(newCluster.Actions[monitoringActionDisable]) > 0 { - err := client.APIBaseClient.Action(managementClient.ClusterType, monitoringActionDisable, clusterResource, nil, nil) - if err != nil { - return err - } - } - return nil -} - -func updateClusterMonitoringApps(meta interface{}, systemProjectID, version string) error { - cliProject, err := meta.(*Config).ProjectClient(systemProjectID) - if err != nil { - return err - } - - filters := map[string]interface{}{ - "targetNamespace": clusterMonitoringV1Namespace, - } - - listOpts := NewListOpts(filters) - - apps, err := cliProject.App.List(listOpts) - if err != nil { - return err - } - - for _, a := range apps.Data { - if a.Name == "cluster-monitoring" || a.Name == "monitoring-operator" { - externalID := updateVersionExternalID(a.ExternalID, version) - upgrade := &projectClient.AppUpgradeConfig{ - Answers: a.Answers, - ExternalID: externalID, - ForceUpgrade: true, - } - - err = cliProject.App.ActionUpgrade(&a, upgrade) - if err != nil { - return err - } - } - } - return nil -} diff --git a/rancher2/resource_rancher2_cluster_alert_group.go b/rancher2/resource_rancher2_cluster_alert_group.go deleted file mode 100644 index 0e409ea4..00000000 --- a/rancher2/resource_rancher2_cluster_alert_group.go +++ /dev/null @@ -1,233 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2ClusterAlertGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2ClusterAlertGroupCreate, - Read: resourceRancher2ClusterAlertGroupRead, - Update: resourceRancher2ClusterAlertGroupUpdate, - Delete: resourceRancher2ClusterAlertGroupDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2ClusterAlertGroupImport, - }, - Schema: clusterAlertGroupFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2ClusterAlertGroupCreate(d *schema.ResourceData, meta interface{}) error { - err := resourceRancher2ClusterAlertGroupRecients(d, meta) - if err != nil { - return err - } - clusterAlertGroup := expandClusterAlertGroup(d) - - log.Printf("[INFO] Creating Cluster Alert Group %s", clusterAlertGroup.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newClusterAlertGroup, err := client.ClusterAlertGroup.Create(clusterAlertGroup) - if err != nil { - return err - } - - d.SetId(newClusterAlertGroup.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: clusterAlertGroupStateRefreshFunc(client, newClusterAlertGroup.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for cluster alert group (%s) to be created: %s", newClusterAlertGroup.ID, waitErr) - } - - return resourceRancher2ClusterAlertGroupRead(d, meta) -} - -func resourceRancher2ClusterAlertGroupRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Cluster Alert Group ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - clusterAlertGroup, err := client.ClusterAlertGroup.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Alert Group ID %s not found.", d.Id()) - d.SetId("") - return nil - } - } - - if err = flattenClusterAlertGroup(d, clusterAlertGroup); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ClusterAlertGroupUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Cluster Alert Group ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterAlertGroup, err := client.ClusterAlertGroup.ByID(d.Id()) - if err != nil { - return err - } - - if d.HasChange("recipients") { - err = resourceRancher2ClusterAlertGroupRecients(d, meta) - if err != nil { - return err - } - } - - update := map[string]interface{}{ - "clusterId": d.Get("cluster_id").(string), - "description": d.Get("description").(string), - "groupIntervalSeconds": int64(d.Get("group_interval_seconds").(int)), - "groupWaitSeconds": int64(d.Get("group_wait_seconds").(int)), - "name": d.Get("name").(string), - "recipients": expandRecipients(d.Get("recipients").([]interface{})), - "repeatIntervalSeconds": int64(d.Get("repeat_interval_seconds").(int)), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - newClusterAlertGroup, err := client.ClusterAlertGroup.Update(clusterAlertGroup, update) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: clusterAlertGroupStateRefreshFunc(client, newClusterAlertGroup.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert group (%s) to be updated: %s", newClusterAlertGroup.ID, waitErr) - } - - return resourceRancher2ClusterAlertGroupRead(d, meta) -} - -func resourceRancher2ClusterAlertGroupDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Cluster Alert Group ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterAlertGroup, err := client.ClusterAlertGroup.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Alert Group ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.ClusterAlertGroup.Delete(clusterAlertGroup) - if err != nil { - return fmt.Errorf("Error removing Cluster Alert Group: %s", err) - } - - log.Printf("[DEBUG] Waiting for cluster alert group (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: clusterAlertGroupStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert group (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -func resourceRancher2ClusterAlertGroupRecients(d *schema.ResourceData, meta interface{}) error { - recipients, ok := d.Get("recipients").([]interface{}) - if !ok { - return fmt.Errorf("[ERROR] Getting Cluster Alert Group Recipients") - } - - if len(recipients) > 0 { - log.Printf("[INFO] Getting Cluster Alert Group Recipients") - - for i := range recipients { - in := recipients[i].(map[string]interface{}) - - recipient, err := meta.(*Config).GetRecipientByNotifier(in["notifier_id"].(string)) - if err != nil { - return err - } - - in["notifier_type"] = recipient.NotifierType - if v, ok := in["default_recipient"].(bool); ok && v { - in["recipient"] = recipient.Recipient - } - - recipients[i] = in - } - d.Set("recipients", recipients) - } - - return nil -} - -// clusterAlertGroupStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher ClusterAlertGroup. -func clusterAlertGroupStateRefreshFunc(client *managementClient.Client, clusterAlertGroupID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.ClusterAlertGroup.ByID(clusterAlertGroupID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_cluster_alert_group_test.go b/rancher2/resource_rancher2_cluster_alert_group_test.go deleted file mode 100644 index 055245ff..00000000 --- a/rancher2/resource_rancher2_cluster_alert_group_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - testAccRancher2ClusterAlertGroupType = "rancher2_cluster_alert_group" -) - -var ( - testAccRancher2ClusterAlertGroup string - testAccRancher2ClusterAlertGroupUpdate string - testAccRancher2ClusterAlertGroupConfig string - testAccRancher2ClusterAlertGroupUpdateConfig string -) - -func init() { - testAccRancher2ClusterAlertGroup = ` -resource "` + testAccRancher2ClusterAlertGroupType + `" "foo" { - name = "foo" - description = "Terraform cluster alert group acceptance test" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -` - testAccRancher2ClusterAlertGroupUpdate = ` -resource "` + testAccRancher2ClusterAlertGroupType + `" "foo" { - name = "foo" - description = "Terraform cluster alert group acceptance test - updated" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} - ` - testAccRancher2ClusterAlertGroupConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2ClusterAlertGroup - testAccRancher2ClusterAlertGroupUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2ClusterAlertGroupUpdate -} - -func TestAccRancher2ClusterAlertGroup_basic(t *testing.T) { - var ag *managementClient.ClusterAlertGroup - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ClusterAlertGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ClusterAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertGroupExists(testAccRancher2ClusterAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "description", "Terraform cluster alert group acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - { - Config: testAccRancher2ClusterAlertGroupUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertGroupExists(testAccRancher2ClusterAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "description", "Terraform cluster alert group acceptance test - updated"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "group_interval_seconds", "600"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "repeat_interval_seconds", "6000"), - ), - }, - { - Config: testAccRancher2ClusterAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertGroupExists(testAccRancher2ClusterAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "description", "Terraform cluster alert group acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertGroupType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} - -func TestAccRancher2ClusterAlertGroup_disappears(t *testing.T) { - var ag *managementClient.ClusterAlertGroup - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ClusterAlertGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ClusterAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertGroupExists(testAccRancher2ClusterAlertGroupType+".foo", ag), - testAccRancher2ClusterAlertGroupDisappears(ag), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func testAccRancher2ClusterAlertGroupDisappears(ag *managementClient.ClusterAlertGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ClusterAlertGroupType { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - ag, err = client.ClusterAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - err = client.ClusterAlertGroup.Delete(ag) - if err != nil { - return fmt.Errorf("Error removing Cluster Alert Group: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: clusterAlertGroupStateRefreshFunc(client, rs.Primary.ID), - Timeout: 10 * time.Minute, - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert group (%s) to be removed: %s", rs.Primary.ID, waitErr) - } - } - return nil - - } -} - -func testAccCheckRancher2ClusterAlertGroupExists(n string, ag *managementClient.ClusterAlertGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No cluster alert group ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundAg, err := client.ClusterAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("Cluster Alert Group not found") - } - return err - } - - ag = foundAg - - return nil - } -} - -func testAccCheckRancher2ClusterAlertGroupDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ClusterAlertGroupType { - continue - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.ClusterAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - return fmt.Errorf("Cluster Alert Group still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_cluster_alert_rule.go b/rancher2/resource_rancher2_cluster_alert_rule.go deleted file mode 100644 index b88d7025..00000000 --- a/rancher2/resource_rancher2_cluster_alert_rule.go +++ /dev/null @@ -1,212 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2ClusterAlertRule() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2ClusterAlertRuleCreate, - Read: resourceRancher2ClusterAlertRuleRead, - Update: resourceRancher2ClusterAlertRuleUpdate, - Delete: resourceRancher2ClusterAlertRuleDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2ClusterAlertRuleImport, - }, - Schema: clusterAlertRuleFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2ClusterAlertRuleCreate(d *schema.ResourceData, meta interface{}) error { - clusterAlertRule := expandClusterAlertRule(d) - - log.Printf("[INFO] Creating Cluster Alert Rule %s", clusterAlertRule.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newClusterAlertRule, err := client.ClusterAlertRule.Create(clusterAlertRule) - if err != nil { - return err - } - - d.SetId(newClusterAlertRule.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: clusterAlertRuleStateRefreshFunc(client, newClusterAlertRule.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for cluster alert rule (%s) to be created: %s", newClusterAlertRule.ID, waitErr) - } - - return resourceRancher2ClusterAlertRuleRead(d, meta) -} - -func resourceRancher2ClusterAlertRuleRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Cluster Alert Rule ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - clusterAlertRule, err := client.ClusterAlertRule.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Alert Rule ID %s not found.", d.Id()) - d.SetId("") - return nil - } - - return resource.NonRetryableError(err) - } - - if err = flattenClusterAlertRule(d, clusterAlertRule); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ClusterAlertRuleUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Cluster Alert Rule ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterAlertRule, err := client.ClusterAlertRule.ByID(d.Id()) - if err != nil { - return err - } - - inherited := d.Get("inherited").(bool) - update := map[string]interface{}{ - "clusterId": d.Get("cluster_id").(string), - "groupId": d.Get("group_id").(string), - "groupIntervalSeconds": int64(d.Get("group_interval_seconds").(int)), - "groupWaitSeconds": int64(d.Get("group_wait_seconds").(int)), - "inherited": &inherited, - "name": d.Get("name").(string), - "repeatIntervalSeconds": int64(d.Get("repeat_interval_seconds").(int)), - "severity": d.Get("severity").(string), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - if v, ok := d.Get("event_rule").([]interface{}); ok && len(v) > 0 { - update["eventRule"] = expandEventRule(v) - } - - if v, ok := d.Get("metric_rule").([]interface{}); ok && len(v) > 0 { - update["metricRule"] = expandMetricRule(v) - } - - if v, ok := d.Get("node_rule").([]interface{}); ok && len(v) > 0 { - update["nodeRule"] = expandNodeRule(v) - } - - if v, ok := d.Get("system_service_rule").([]interface{}); ok && len(v) > 0 { - update["systemServiceRule"] = expandSystemServiceRule(v) - } - - newClusterAlertRule, err := client.ClusterAlertRule.Update(clusterAlertRule, update) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: clusterAlertRuleStateRefreshFunc(client, newClusterAlertRule.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert rule (%s) to be updated: %s", newClusterAlertRule.ID, waitErr) - } - - return resourceRancher2ClusterAlertRuleRead(d, meta) -} - -func resourceRancher2ClusterAlertRuleDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Cluster Alert Rule ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterAlertRule, err := client.ClusterAlertRule.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Alert Rule ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.ClusterAlertRule.Delete(clusterAlertRule) - if err != nil { - return fmt.Errorf("Error removing Cluster Alert Rule: %s", err) - } - - log.Printf("[DEBUG] Waiting for cluster alert rule (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: clusterAlertRuleStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert rule (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// clusterAlertRuleStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher ClusterAlertRule. -func clusterAlertRuleStateRefreshFunc(client *managementClient.Client, clusterAlertRuleID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.ClusterAlertRule.ByID(clusterAlertRuleID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_cluster_alert_rule_test.go b/rancher2/resource_rancher2_cluster_alert_rule_test.go deleted file mode 100644 index 495af7e7..00000000 --- a/rancher2/resource_rancher2_cluster_alert_rule_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - testAccRancher2ClusterAlertRuleType = "rancher2_cluster_alert_rule" -) - -var ( - testAccRancher2ClusterAlertRuleGroup string - testAccRancher2ClusterAlertRule string - testAccRancher2ClusterAlertRuleUpdate string - testAccRancher2ClusterAlertRuleConfig string - testAccRancher2ClusterAlertRuleUpdateConfig string -) - -func init() { - testAccRancher2ClusterAlertRule = ` -resource "` + testAccRancher2ClusterAlertRuleType + `" "foo" { - cluster_id = rancher2_cluster_sync.testacc.cluster_id - group_id = rancher2_cluster_alert_group.foo.id - name = "foo" - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -` - testAccRancher2ClusterAlertRuleUpdate = ` -resource "` + testAccRancher2ClusterAlertRuleType + `" "foo" { - cluster_id = rancher2_cluster_sync.testacc.cluster_id - group_id = rancher2_cluster_alert_group.foo.id - name = "foo" - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} -` - testAccRancher2ClusterAlertRuleConfig = testAccRancher2ClusterAlertGroupConfig + testAccRancher2ClusterAlertRule - testAccRancher2ClusterAlertRuleUpdateConfig = testAccRancher2ClusterAlertGroupConfig + testAccRancher2ClusterAlertRuleUpdate -} - -func TestAccRancher2ClusterAlertRule_basic(t *testing.T) { - var ar *managementClient.ClusterAlertRule - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ClusterAlertRuleDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ClusterAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertRuleExists(testAccRancher2ClusterAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - { - Config: testAccRancher2ClusterAlertRuleUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertRuleExists(testAccRancher2ClusterAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "group_interval_seconds", "600"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "repeat_interval_seconds", "6000"), - ), - }, - { - Config: testAccRancher2ClusterAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertRuleExists(testAccRancher2ClusterAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ClusterAlertRuleType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} - -func TestAccRancher2ClusterAlertRule_disappears(t *testing.T) { - var ar *managementClient.ClusterAlertRule - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ClusterAlertRuleDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ClusterAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ClusterAlertRuleExists(testAccRancher2ClusterAlertRuleType+".foo", ar), - testAccRancher2ClusterAlertRuleDisappears(ar), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func testAccRancher2ClusterAlertRuleDisappears(ar *managementClient.ClusterAlertRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ClusterAlertRuleType { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - ar, err = client.ClusterAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - err = client.ClusterAlertRule.Delete(ar) - if err != nil { - return fmt.Errorf("Error removing Cluster Alert Rule: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: clusterAlertRuleStateRefreshFunc(client, rs.Primary.ID), - Timeout: 10 * time.Minute, - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for cluster alert rule (%s) to be removed: %s", rs.Primary.ID, waitErr) - } - } - return nil - - } -} - -func testAccCheckRancher2ClusterAlertRuleExists(n string, ar *managementClient.ClusterAlertRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No cluster alert rule ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundAr, err := client.ClusterAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("Cluster Alert Rule not found") - } - return err - } - - ar = foundAr - - return nil - } -} - -func testAccCheckRancher2ClusterAlertRuleDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ClusterAlertRuleType { - continue - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.ClusterAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - return fmt.Errorf("Cluster Alert Rule still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_cluster_sync.go b/rancher2/resource_rancher2_cluster_sync.go index cb8f10f9..bc6d7d4c 100644 --- a/rancher2/resource_rancher2_cluster_sync.go +++ b/rancher2/resource_rancher2_cluster_sync.go @@ -2,10 +2,11 @@ package rancher2 import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "log" "time" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -54,20 +55,6 @@ func resourceRancher2ClusterSyncCreate(d *schema.ResourceData, meta interface{}) } } - if cluster.EnableClusterMonitoring && d.Get("wait_monitoring").(bool) { - _, err := meta.(*Config).WaitForClusterState(clusterID, clusterMonitoringEnabledCondition, d.Timeout(schema.TimeoutCreate)) - if err != nil { - return fmt.Errorf("[ERROR] waiting for cluster ID (%s) monitoring to be running: %v", clusterID, err) - } - } - - if cluster.EnableClusterAlerting && d.Get("wait_alerting").(bool) { - _, err := meta.(*Config).WaitForClusterState(clusterID, clusterAlertingEnabledCondition, d.Timeout(schema.TimeoutCreate)) - if err != nil { - return fmt.Errorf("[ERROR] waiting for cluster ID (%s) alerting to be running: %v", clusterID, err) - } - } - if d.Get("wait_catalogs").(bool) { _, err := waitAllCatalogV2Downloaded(meta.(*Config), clusterID) if err != nil { @@ -127,28 +114,6 @@ func resourceRancher2ClusterSyncRead(d *schema.ResourceData, meta interface{}) e } d.Set("nodes", flattenClusterNodes(nodes)) - if clus.EnableClusterMonitoring && d.Get("wait_monitoring").(bool) { - monitor, _, err := meta.(*Config).isClusterMonitoringEnabledCondition(clusterID) - if err != nil { - return resource.NonRetryableError(err) - } - if !monitor { - d.Set("synced", false) - return nil - } - } - - if clus.EnableClusterAlerting && d.Get("wait_alerting").(bool) { - alert, _, err := meta.(*Config).isClusterAlertingEnabledCondition(clusterID) - if err != nil { - return resource.NonRetryableError(err) - } - if !alert { - d.Set("synced", false) - return nil - } - } - if d.Get("wait_catalogs").(bool) { _, err := waitAllCatalogV2Downloaded(meta.(*Config), clusterID) if err != nil { diff --git a/rancher2/resource_rancher2_cluster_template_test.go b/rancher2/resource_rancher2_cluster_template_test.go index d7c2afd6..ca376b48 100644 --- a/rancher2/resource_rancher2_cluster_template_test.go +++ b/rancher2/resource_rancher2_cluster_template_test.go @@ -26,8 +26,6 @@ resource "` + testAccRancher2ClusterTemplateType + `" "foo" { cluster_auth_endpoint { enabled = true } - enable_cluster_alerting = false - enable_cluster_monitoring = true enable_network_policy = false rke_config { ignore_docker_version = true @@ -67,7 +65,6 @@ resource "` + testAccRancher2ClusterTemplateType + `" "foo" { } kube_api { service_node_port_range = "30000-32767" - pod_security_policy = false always_pull_images = false } } @@ -104,8 +101,6 @@ resource "` + testAccRancher2ClusterTemplateType + `" "foo" { cluster_auth_endpoint { enabled = true } - enable_cluster_alerting = false - enable_cluster_monitoring = true enable_network_policy = false rke_config { ignore_docker_version = true @@ -145,7 +140,6 @@ resource "` + testAccRancher2ClusterTemplateType + `" "foo" { } kube_api { service_node_port_range = "30000-32767" - pod_security_policy = false always_pull_images = false } } diff --git a/rancher2/resource_rancher2_machine_config_v2.go b/rancher2/resource_rancher2_machine_config_v2.go index eae69f73..2b238ad1 100644 --- a/rancher2/resource_rancher2_machine_config_v2.go +++ b/rancher2/resource_rancher2_machine_config_v2.go @@ -60,10 +60,6 @@ func waitForMachineConfigV2(d *schema.ResourceData, config *Config, interval tim return nil } log.Printf("[INFO] Retrying on error Refreshing Machine Config V2 %s: %v", d.Id(), err) - if IsNotFound(err) || IsForbidden(err) { - d.SetId("") - return fmt.Errorf("Machine Config V2 %s not found: %s", d.Id(), err) - } if IsNotAccessibleByID(err) { // Restarting clients to update RBAC config.RestartClients() @@ -72,6 +68,7 @@ func waitForMachineConfigV2(d *schema.ResourceData, config *Config, interval tim select { case <-time.After(rancher2RetriesWait * time.Second): case <-ctx.Done(): + d.SetId("") return fmt.Errorf("Timeout waiting for machine config V2 ID %s", d.Id()) } } diff --git a/rancher2/resource_rancher2_notifier.go b/rancher2/resource_rancher2_notifier.go deleted file mode 100644 index d24d94f0..00000000 --- a/rancher2/resource_rancher2_notifier.go +++ /dev/null @@ -1,191 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2Notifier() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2NotifierCreate, - Read: resourceRancher2NotifierRead, - Update: resourceRancher2NotifierUpdate, - Delete: resourceRancher2NotifierDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2NotifierImport, - }, - - Schema: notifierFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2NotifierCreate(d *schema.ResourceData, meta interface{}) error { - notifier, err := expandNotifier(d) - if err != nil { - return err - } - - log.Printf("[INFO] Creating Notifier %s", notifier.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newNotifier, err := client.Notifier.Create(notifier) - if err != nil { - return err - } - - d.SetId(newNotifier.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: notifierStateRefreshFunc(client, newNotifier.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for notifier (%s) to be created: %s", newNotifier.ID, waitErr) - } - - return resourceRancher2NotifierRead(d, meta) -} - -func resourceRancher2NotifierRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Notifier ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - notifier, err := client.Notifier.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Notifier ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenNotifier(d, notifier); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2NotifierUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Notifier ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - notifier, err := client.Notifier.ByID(d.Id()) - if err != nil { - return err - } - - newNotifier, err := expandNotifier(d) - if err != nil { - return err - } - newNotifier.Links = notifier.Links - newNotifier, err = client.Notifier.Replace(newNotifier) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active"}, - Target: []string{"active"}, - Refresh: notifierStateRefreshFunc(client, newNotifier.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for notifier (%s) to be updated: %s", newNotifier.ID, waitErr) - } - - return resourceRancher2NotifierRead(d, meta) -} - -func resourceRancher2NotifierDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Notifier ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - notifier, err := client.Notifier.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Notifier ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return err - } - - err = client.Notifier.Delete(notifier) - if err != nil { - return fmt.Errorf("Error removing Notifier: %s", err) - } - - log.Printf("[DEBUG] Waiting for notifier (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: notifierStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for notifier (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// notifierStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher Notifier. -func notifierStateRefreshFunc(client *managementClient.Client, notifierID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.Notifier.ByID(notifierID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_notifier_test.go b/rancher2/resource_rancher2_notifier_test.go deleted file mode 100644 index 66c66ee2..00000000 --- a/rancher2/resource_rancher2_notifier_test.go +++ /dev/null @@ -1,799 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - testAccRancher2NotifierType = "rancher2_notifier" -) - -var ( - testAccRancher2NotifierDingtalk string - testAccRancher2NotifierDingtalkUpdate string - testAccRancher2NotifierDingtalkConfig string - testAccRancher2NotifierDingtalkUpdateConfig string - testAccRancher2NotifierMSTeams string - testAccRancher2NotifierMSTeamsUpdate string - testAccRancher2NotifierMSTeamsConfig string - testAccRancher2NotifierMSTeamsUpdateConfig string - testAccRancher2NotifierPagerduty string - testAccRancher2NotifierPagerdutyUpdate string - testAccRancher2NotifierPagerdutyConfig string - testAccRancher2NotifierPagerdutyUpdateConfig string - testAccRancher2NotifierSlack string - testAccRancher2NotifierSlackUpdate string - testAccRancher2NotifierSlackConfig string - testAccRancher2NotifierSlackUpdateConfig string - testAccRancher2NotifierSMTP string - testAccRancher2NotifierSMTPUpdate string - testAccRancher2NotifierSMTPConfig string - testAccRancher2NotifierSMTPUpdateConfig string - testAccRancher2NotifierWebhook string - testAccRancher2NotifierWebhookUpdate string - testAccRancher2NotifierWebhookConfig string - testAccRancher2NotifierWebhookUpdateConfig string - testAccRancher2NotifierWechat string - testAccRancher2NotifierWechatUpdate string - testAccRancher2NotifierWechatConfig string - testAccRancher2NotifierWechatUpdateConfig string -) - -func init() { - testAccRancher2NotifierDingtalk = ` -resource "` + testAccRancher2NotifierType + `" "foo-dingtalk" { - name = "foo-dingtalk" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - dingtalk_config { - url = "http://url.test.io" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierDingtalkUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-dingtalk" { - name = "foo-dingtalk" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - dingtalk_config { - url = "http://url2.test.io" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierDingtalkConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierDingtalk - testAccRancher2NotifierDingtalkUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierDingtalkUpdate - testAccRancher2NotifierMSTeams = ` -resource "` + testAccRancher2NotifierType + `" "foo-msteams" { - name = "foo-msteams" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - msteams_config { - url = "http://url.test.io" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierMSTeamsUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-msteams" { - name = "foo-msteams" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - msteams_config { - url = "http://url2.test.io" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierMSTeamsConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierMSTeams - testAccRancher2NotifierMSTeamsUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierMSTeamsUpdate - testAccRancher2NotifierPagerduty = ` -resource "` + testAccRancher2NotifierType + `" "foo-pagerduty" { - name = "foo-pagerduty" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - pagerduty_config { - service_key = "XXXXXXXX" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierPagerdutyUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-pagerduty" { - name = "foo-pagerduty" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - pagerduty_config { - service_key = "YYYYYYYY" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierPagerdutyConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierPagerduty - testAccRancher2NotifierPagerdutyUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierPagerdutyUpdate - testAccRancher2NotifierSlack = ` -resource "` + testAccRancher2NotifierType + `" "foo-slack" { - name = "foo-slack" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - slack_config { - default_recipient = "XXXXXXXX" - url = "http://url.test.io" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierSlackUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-slack" { - name = "foo-slack" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - slack_config { - default_recipient = "YYYYYYYY" - url = "http://url2.test.io" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierSlackConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierSlack - testAccRancher2NotifierSlackUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierSlackUpdate - testAccRancher2NotifierSMTP = ` -resource "` + testAccRancher2NotifierType + `" "foo-smtp" { - name = "foo-smtp" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - smtp_config { - default_recipient = "XXXXXXXX" - host = "host.test.io" - port = 25 - sender = "sender@test.io" - tls = "true" - } -} -` - testAccRancher2NotifierSMTPUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-smtp" { - name = "foo-smtp" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - smtp_config { - default_recipient = "YYYYYYYY" - host = "host2.test.io" - port = 25 - sender = "sender2@test.io" - tls = "true" - } -} -` - testAccRancher2NotifierSMTPConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierSMTP - testAccRancher2NotifierSMTPUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierSMTPUpdate - testAccRancher2NotifierWebhook = ` -resource "` + testAccRancher2NotifierType + `" "foo-webhook" { - name = "foo-webhook" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - webhook_config { - url = "http://url.test.io" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierWebhookUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-webhook" { - name = "foo-webhook" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - webhook_config { - url = "http://url2.test.io" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierWebhookConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierWebhook - testAccRancher2NotifierWebhookUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierWebhookUpdate - testAccRancher2NotifierWechat = ` -resource "` + testAccRancher2NotifierType + `" "foo-wechat" { - name = "foo-wechat" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "true" - description = "Terraform notifier acceptance test" - wechat_config { - agent = "agent_id" - corp = "corp_id" - default_recipient = "XXXXXXXX" - secret = "XXXXXXXX" - proxy_url = "http://proxy.test.io" - } -} -` - testAccRancher2NotifierWechatUpdate = ` -resource "` + testAccRancher2NotifierType + `" "foo-wechat" { - name = "foo-wechat" - cluster_id = rancher2_cluster_sync.testacc.cluster_id - send_resolved = "false" - description = "Terraform notifier acceptance test - updated" - wechat_config { - agent = "agent_id" - corp = "corp_id" - default_recipient = "YYYYYYYY" - secret = "YYYYYYYY" - proxy_url = "http://proxy2.test.io" - } -} -` - testAccRancher2NotifierWechatConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierWechat - testAccRancher2NotifierWechatUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2NotifierWechatUpdate -} - -func TestAccRancher2Notifier_basic_Dingtalk(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierDingtalkConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-dingtalk", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "name", "foo-dingtalk"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierDingtalkUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-dingtalk", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "name", "foo-dingtalk"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "description", "Terraform notifier acceptance test - updated"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "send_resolved", "false"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.url", "http://url2.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierDingtalkConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-dingtalk", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "name", "foo-dingtalk"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-dingtalk", "dingtalk_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_Dingtalk(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierDingtalkConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-dingtalk", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_MSTeams(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierMSTeamsConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-msteams", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "name", "foo-msteams"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierMSTeamsUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-msteams", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "name", "foo-msteams"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "description", "Terraform notifier acceptance test - updated"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "send_resolved", "false"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.url", "http://url2.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierMSTeamsConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-msteams", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "name", "foo-msteams"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-msteams", "msteams_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_MSTeams(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierMSTeamsConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-msteams", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_Pagerduty(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierPagerdutyConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-pagerduty", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "name", "foo-pagerduty"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "pagerduty_config.0.service_key", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "pagerduty_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierPagerdutyUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-pagerduty", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "name", "foo-pagerduty"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "description", "Terraform notifier acceptance test - updated"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "send_resolved", "false"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "pagerduty_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierPagerdutyConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-pagerduty", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "name", "foo-pagerduty"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "pagerduty_config.0.service_key", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-pagerduty", "pagerduty_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_Pagerduty(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierPagerdutyConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-pagerduty", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_Slack(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierSlackConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-slack", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "name", "foo-slack"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierSlackUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-slack", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "name", "foo-slack"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.default_recipient", "YYYYYYYY"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.url", "http://url2.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierSlackConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-slack", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "name", "foo-slack"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-slack", "slack_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_Slack(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierSlackConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-slack", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_SMTP(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierSMTPConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-smtp", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "name", "foo-smtp"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.host", "host.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.sender", "sender@test.io"), - ), - }, - { - Config: testAccRancher2NotifierSMTPUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-smtp", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "name", "foo-smtp"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.default_recipient", "YYYYYYYY"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.host", "host2.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.sender", "sender2@test.io"), - ), - }, - { - Config: testAccRancher2NotifierSMTPConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-smtp", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "name", "foo-smtp"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.host", "host.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-smtp", "smtp_config.0.sender", "sender@test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_SMTP(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierSMTPConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-smtp", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_Webhook(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierWebhookConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-webhook", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "name", "foo-webhook"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierWebhookUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-webhook", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "name", "foo-webhook"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.url", "http://url2.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierWebhookConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-webhook", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "name", "foo-webhook"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.url", "http://url.test.io"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-webhook", "webhook_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_Webhook(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierWebhookConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-webhook", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccRancher2Notifier_basic_Wechat(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierWechatConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-wechat", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "name", "foo-wechat"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.secret", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - { - Config: testAccRancher2NotifierWechatUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-wechat", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "name", "foo-wechat"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.default_recipient", "YYYYYYYY"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.secret", "YYYYYYYY"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.proxy_url", "http://proxy2.test.io"), - ), - }, - { - Config: testAccRancher2NotifierWechatConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-wechat", notifier), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "name", "foo-wechat"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "description", "Terraform notifier acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "send_resolved", "true"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.default_recipient", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.secret", "XXXXXXXX"), - resource.TestCheckResourceAttr(testAccRancher2NotifierType+".foo-wechat", "wechat_config.0.proxy_url", "http://proxy.test.io"), - ), - }, - }, - }) -} - -func TestAccRancher2Notifier_disappears_Wechat(t *testing.T) { - var notifier *managementClient.Notifier - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2NotifierDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2NotifierWechatConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NotifierExists(testAccRancher2NotifierType+".foo-wechat", notifier), - testAccRancher2NotifierDisappears(notifier), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func testAccRancher2NotifierDisappears(notifier *managementClient.Notifier) resource.TestCheckFunc { - return func(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2NotifierType { - continue - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - notifier, err = client.Notifier.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - err = client.Notifier.Delete(notifier) - if err != nil { - return fmt.Errorf("Error removing Notifier: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active"}, - Target: []string{"removed"}, - Refresh: notifierStateRefreshFunc(client, rs.Primary.ID), - Timeout: 10 * time.Minute, - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for notifier (%s) to be removed: %s", rs.Primary.ID, waitErr) - } - } - return nil - - } -} - -func testAccCheckRancher2NotifierExists(n string, notifier *managementClient.Notifier) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No notifier ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundNot, err := client.Notifier.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("Notifier not found") - } - return err - } - - notifier = foundNot - - return nil - } -} - -func testAccCheckRancher2NotifierDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2NotifierType { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.Notifier.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - return fmt.Errorf("Notifier still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_pod_security_admission_configuration_template.go b/rancher2/resource_rancher2_pod_security_admission_configuration_template.go index 69abc26d..3700f69d 100644 --- a/rancher2/resource_rancher2_pod_security_admission_configuration_template.go +++ b/rancher2/resource_rancher2_pod_security_admission_configuration_template.go @@ -149,14 +149,6 @@ func resourceRancher2PodSecurityAdmissionConfigurationTemplateDelete(d *schema.R // a Rancher PodSecurityAdmissionConfiguration Template func podSecurityAdmissionConfigurationTemplateStateRefreshFunc(client *managementClient.Client, pspID string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - obj, err := client.PodSecurityPolicyTemplate.ByID(pspID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, "active", nil + return nil, "active", nil } } diff --git a/rancher2/resource_rancher2_pod_security_policy_template.go b/rancher2/resource_rancher2_pod_security_policy_template.go deleted file mode 100644 index 915232dc..00000000 --- a/rancher2/resource_rancher2_pod_security_policy_template.go +++ /dev/null @@ -1,155 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2PodSecurityPolicyTemplate() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2PodSecurityPolicyTemplateCreate, - Read: resourceRancher2PodSecurityPolicyTemplateRead, - Update: resourceRancher2PodSecurityPolicyTemplateUpdate, - Delete: resourceRancher2PodSecurityPolicyTemplateDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2PodSecurityPolicyTemplateImport, - }, - - Schema: podSecurityPolicyTemplateFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2PodSecurityPolicyTemplateCreate(d *schema.ResourceData, meta interface{}) error { - podSecurityPolicyTemplate := expandPodSecurityPolicyTemplate(d) - - log.Printf("[INFO] Creating PodSecurityPolicyTemplate %s", podSecurityPolicyTemplate.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newPodSecurityPolicyTemplate, err := client.PodSecurityPolicyTemplate.Create(podSecurityPolicyTemplate) - if err != nil { - return err - } - - d.SetId(newPodSecurityPolicyTemplate.ID) - - return resourceRancher2PodSecurityPolicyTemplateRead(d, meta) -} - -func resourceRancher2PodSecurityPolicyTemplateRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing PodSecurityPolicyTemplate with ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - pspt, err := client.PodSecurityPolicyTemplate.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] PodSecurityPolicyTemplate with ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenPodSecurityPolicyTemplate(d, pspt); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2PodSecurityPolicyTemplateUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating PodSecurityPolicyTemplate with ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - pspt, err := client.PodSecurityPolicyTemplate.ByID(d.Id()) - if err != nil { - return err - } - - update := expandPodSecurityPolicyTemplate(d) - - _, err = client.PodSecurityPolicyTemplate.Update(pspt, update) - if err != nil { - return err - } - - return resourceRancher2PodSecurityPolicyTemplateRead(d, meta) -} - -func resourceRancher2PodSecurityPolicyTemplateDelete(d *schema.ResourceData, meta interface{}) error { - id := d.Id() - log.Printf("[INFO] Deleting PodSecurityPolicyTemplate with ID %s", id) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - pspt, err := client.PodSecurityPolicyTemplate.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] PodSecurityPolicyTemplate with ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.PodSecurityPolicyTemplate.Delete(pspt) - if err != nil { - return fmt.Errorf("[ERROR] removing PodSecurityPolicyTemplate: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active"}, - Target: []string{"removed"}, - Refresh: podSecurityPolicyTemplateStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for PodSecurityPolicyTemplate (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// podSecurityPolicyTemplateStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher PodSecurityPolicyTemplate -func podSecurityPolicyTemplateStateRefreshFunc(client *managementClient.Client, pspID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.PodSecurityPolicyTemplate.ByID(pspID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, "active", nil - } -} diff --git a/rancher2/resource_rancher2_pod_security_policy_template_test.go b/rancher2/resource_rancher2_pod_security_policy_template_test.go deleted file mode 100644 index 66da5a67..00000000 --- a/rancher2/resource_rancher2_pod_security_policy_template_test.go +++ /dev/null @@ -1,275 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const testAccRancher2PodSecurityPolicyTemplateType = "rancher2_pod_security_policy_template" - -var ( - testAccCheckRancher2PodSecurityPolicyTemplate = ` -resource "` + testAccRancher2PodSecurityPolicyTemplateType + `" "foo" { - name = "foo" - description = "Terraform PodSecurityPolicyTemplate acceptance test" - allow_privilege_escalation = false - allowed_csi_driver { - name = "something" - } - allowed_csi_driver { - name = "something-else" - } - allowed_flex_volume { - driver = "something" - } - allowed_flex_volume { - driver = "something-else" - } - allowed_host_path { - path_prefix = "/" - read_only = true - } - allowed_host_path { - path_prefix = "//" - read_only = false - } - allowed_proc_mount_types = ["Default"] - default_allow_privilege_escalation = false - fs_group { - rule = "MustRunAs" - range { - min = 0 - max = 100 - } - range { - min = 0 - max = 100 - } - } - host_ipc = false - host_network = false - host_pid = false - host_port { - min = 0 - max = 65535 - } - host_port { - min = 1024 - max = 8080 - } - privileged = false - read_only_root_filesystem = false - required_drop_capabilities = ["something"] - - run_as_user { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - run_as_group { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - runtime_class { - default_runtime_class_name = "something" - allowed_runtime_class_names = ["something"] - } - se_linux { - rule = "RunAsAny" - } - supplemental_group { - rule = "RunAsAny" - } - volumes = ["azureFile"] -} -` - testAccCheckRancher2PodSecurityPolicyTemplateUpdate = ` -resource "` + testAccRancher2PodSecurityPolicyTemplateType + `" "foo" { - name = "foo" - description = "Terraform PodSecurityPolicyTemplate acceptance test - updated" - allow_privilege_escalation = false - allowed_csi_driver { - name = "something" - } - allowed_csi_driver { - name = "something-else" - } - allowed_flex_volume { - driver = "something" - } - allowed_flex_volume { - driver = "something-else" - } - allowed_host_path { - path_prefix = "/" - read_only = true - } - allowed_host_path { - path_prefix = "//" - read_only = false - } - allowed_proc_mount_types = ["Default"] - default_allow_privilege_escalation = false - fs_group { - rule = "MustRunAs" - range { - min = 0 - max = 100 - } - range { - min = 0 - max = 100 - } - } - host_ipc = false - host_network = false - host_pid = false - host_port { - min = 0 - max = 65535 - } - host_port { - min = 1024 - max = 8080 - } - privileged = false - read_only_root_filesystem = false - required_drop_capabilities = ["something"] - - run_as_user { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - run_as_group { - rule = "MustRunAs" - range { - min = 1 - max = 100 - } - range { - min = 2 - max = 1024 - } - } - runtime_class { - default_runtime_class_name = "something" - allowed_runtime_class_names = ["something"] - } - se_linux { - rule = "RunAsAny" - } - supplemental_group { - rule = "RunAsAny" - } - volumes = ["azureFile"] -} -` -) - -func init() {} - -func TestAccRancher2PodSecurityPolicyTemplate_Basic(t *testing.T) { - var pspTemplate *managementClient.PodSecurityPolicyTemplate - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2PodSecurityPolicyTemplateDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckRancher2PodSecurityPolicyTemplate, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NPodSecurityPolicyTemplateExists(testAccRancher2PodSecurityPolicyTemplateType+".foo", pspTemplate), - resource.TestCheckResourceAttr(testAccRancher2PodSecurityPolicyTemplateType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2PodSecurityPolicyTemplateType+".foo", "description", "Terraform PodSecurityPolicyTemplate acceptance test"), - ), - }, - { - Config: testAccCheckRancher2PodSecurityPolicyTemplateUpdate, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2NPodSecurityPolicyTemplateExists(testAccRancher2PodSecurityPolicyTemplateType+".foo", pspTemplate), - resource.TestCheckResourceAttr(testAccRancher2PodSecurityPolicyTemplateType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2PodSecurityPolicyTemplateType+".foo", "description", "Terraform PodSecurityPolicyTemplate acceptance test - updated"), - ), - }, - }, - }) -} - -func testAccCheckRancher2NPodSecurityPolicyTemplateExists(n string, pspTemplate *managementClient.PodSecurityPolicyTemplate) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No PodSecurityPolicyTemplate ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundPSP, err := client.PodSecurityPolicyTemplate.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("PodSecurityPolicyTemplate not found") - } - return err - } - - pspTemplate = foundPSP - - return nil - } -} - -func testAccCheckRancher2PodSecurityPolicyTemplateDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != "rancher2_pod_security_policy_template" { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.PodSecurityPolicyTemplate.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - return fmt.Errorf("PodSecurityPolicyTemplate still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_project.go b/rancher2/resource_rancher2_project.go index 326ae4bb..8fa64959 100644 --- a/rancher2/resource_rancher2_project.go +++ b/rancher2/resource_rancher2_project.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - projectClient "github.com/rancher/rancher/pkg/client/generated/project/v3" ) func resourceRancher2Project() *schema.Resource { @@ -58,12 +57,10 @@ func resourceRancher2ProjectCreate(d *schema.ResourceData, meta interface{}) err log.Printf("[INFO] Creating Project %s on Cluster ID %s", project.Name, project.ClusterID) // Creating cluster with monitoring disabled - project.EnableProjectMonitoring = false newProject, err := client.Project.Create(project) if err != nil { return err } - newProject.EnableProjectMonitoring = d.Get("enable_project_monitoring").(bool) d.SetId(newProject.ID) stateConf := &resource.StateChangeConf{ @@ -80,46 +77,6 @@ func resourceRancher2ProjectCreate(d *schema.ResourceData, meta interface{}) err "[ERROR] waiting for project (%s) to be created: %s", newProject.ID, waitErr) } - monitoringInput := expandMonitoringInput(d.Get("project_monitoring_input").([]interface{})) - if newProject.EnableProjectMonitoring { - if len(newProject.Actions[monitoringActionEnable]) == 0 { - newProject, err = client.Project.ByID(newProject.ID) - if err != nil { - return err - } - } - err = client.Project.ActionEnableMonitoring(newProject, monitoringInput) - if err != nil { - return err - } - } - - if pspID, ok := d.Get("pod_security_policy_template_id").(string); ok && len(pspID) > 0 { - pspInput := &managementClient.SetPodSecurityPolicyTemplateInput{ - PodSecurityPolicyTemplateName: pspID, - } - err = resource.Retry(3*time.Second, func() *resource.RetryError { - newProject, err = client.Project.ByID(newProject.ID) - if err != nil { - return resource.NonRetryableError(err) - } - _, err = client.Project.ActionSetpodsecuritypolicytemplate(newProject, pspInput) - if err != nil { - if IsConflict(err) || IsForbidden(err) { - return resource.RetryableError(err) - } - // Checking error due to ActionSetpodsecuritypolicytemplate() issue - if error.Error(err) != "unexpected end of JSON input" { - return resource.NonRetryableError(err) - } - } - return nil - }) - if err != nil { - return fmt.Errorf("[ERROR] waiting for pod_security_policy_template_id (%s) to be set on project (%s): %s", pspID, newProject.ID, err) - } - } - return resourceRancher2ProjectRead(d, meta) } @@ -141,17 +98,7 @@ func resourceRancher2ProjectRead(d *schema.ResourceData, meta interface{}) error return resource.NonRetryableError(err) } - var monitoringInput *managementClient.MonitoringInput - if len(project.Annotations[monitoringInputAnnotation]) > 0 { - monitoringInput = &managementClient.MonitoringInput{} - err = jsonToInterface(project.Annotations[monitoringInputAnnotation], monitoringInput) - if err != nil { - return resource.NonRetryableError(err) - } - - } - - if err = flattenProject(d, project, monitoringInput); err != nil { + if err = flattenProject(d, project); err != nil { return resource.NonRetryableError(err) } @@ -192,74 +139,6 @@ func resourceRancher2ProjectUpdate(d *schema.ResourceData, meta interface{}) err "[ERROR] waiting for project (%s) to be updated: %s", newProject.ID, waitErr) } - if d.HasChange("pod_security_policy_template_id") { - pspInput := &managementClient.SetPodSecurityPolicyTemplateInput{ - PodSecurityPolicyTemplateName: d.Get("pod_security_policy_template_id").(string), - } - _, err = client.Project.ActionSetpodsecuritypolicytemplate(newProject, pspInput) - if err != nil { - // Checking error due to ActionSetpodsecuritypolicytemplate() issue - if error.Error(err) != "unexpected end of JSON input" { - return err - } - } - } - - if d.HasChange("enable_project_monitoring") || d.HasChange("project_monitoring_input") { - enableMonitoring := d.Get("enable_project_monitoring").(bool) - if !enableMonitoring && len(newProject.Actions[monitoringActionDisable]) > 0 { - err = client.Project.ActionDisableMonitoring(newProject) - if err != nil { - return err - } - } - if enableMonitoring { - monitoringInput := expandMonitoringInput(d.Get("project_monitoring_input").([]interface{})) - if len(newProject.Actions[monitoringActionEnable]) > 0 { - err = client.Project.ActionEnableMonitoring(newProject, monitoringInput) - if err != nil { - return err - } - } else { - monitorVersionChanged := false - if d.HasChange("project_monitoring_input") { - old, new := d.GetChange("project_monitoring_input") - oldInput := old.([]interface{}) - oldInputLen := len(oldInput) - oldVersion := "" - if oldInputLen > 0 { - oldRow, oldOK := oldInput[0].(map[string]interface{}) - if oldOK { - oldVersion = oldRow["version"].(string) - } - } - newInput := new.([]interface{}) - newInputLen := len(newInput) - newVersion := "" - if newInputLen > 0 { - newRow, newOK := newInput[0].(map[string]interface{}) - if newOK { - newVersion = newRow["version"].(string) - } - } - if oldVersion != newVersion { - monitorVersionChanged = true - } - } - if monitorVersionChanged && monitoringInput != nil { - err = updateProjectMonitoringApps(meta, newProject.ID, monitoringInput.Version) - if err != nil { - return err - } - } - err = client.Project.ActionEditMonitoring(newProject, monitoringInput) - if err != nil { - return err - } - } - } - } - return resourceRancher2ProjectRead(d, meta) } @@ -321,36 +200,3 @@ func projectStateRefreshFunc(client *managementClient.Client, projectID string) return obj, obj.State, nil } } - -func updateProjectMonitoringApps(meta interface{}, projectID, version string) error { - cliProject, err := meta.(*Config).ProjectClient(projectID) - if err != nil { - return err - } - - filters := map[string]interface{}{ - "name": "project-monitoring", - } - - listOpts := NewListOpts(filters) - - apps, err := cliProject.App.List(listOpts) - if err != nil { - return err - } - - for _, a := range apps.Data { - externalID := updateVersionExternalID(a.ExternalID, version) - upgrade := &projectClient.AppUpgradeConfig{ - Answers: a.Answers, - ExternalID: externalID, - ForceUpgrade: true, - } - - err = cliProject.App.ActionUpgrade(&a, upgrade) - if err != nil { - return err - } - } - return nil -} diff --git a/rancher2/resource_rancher2_project_alert_group.go b/rancher2/resource_rancher2_project_alert_group.go deleted file mode 100644 index 8c4e0adc..00000000 --- a/rancher2/resource_rancher2_project_alert_group.go +++ /dev/null @@ -1,234 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2ProjectAlertGroup() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2ProjectAlertGroupCreate, - Read: resourceRancher2ProjectAlertGroupRead, - Update: resourceRancher2ProjectAlertGroupUpdate, - Delete: resourceRancher2ProjectAlertGroupDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2ProjectAlertGroupImport, - }, - Schema: projectAlertGroupFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2ProjectAlertGroupCreate(d *schema.ResourceData, meta interface{}) error { - err := resourceRancher2ProjectAlertGroupRecients(d, meta) - if err != nil { - return err - } - projectAlertGroup := expandProjectAlertGroup(d) - - log.Printf("[INFO] Creating Project Alert Group %s", projectAlertGroup.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newProjectAlertGroup, err := client.ProjectAlertGroup.Create(projectAlertGroup) - if err != nil { - return err - } - - d.SetId(newProjectAlertGroup.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: projectAlertGroupStateRefreshFunc(client, newProjectAlertGroup.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for project alert group (%s) to be created: %s", newProjectAlertGroup.ID, waitErr) - } - - return resourceRancher2ProjectAlertGroupRead(d, meta) -} - -func resourceRancher2ProjectAlertGroupRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Project Alert Group ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - projectAlertGroup, err := client.ProjectAlertGroup.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Project Alert Group ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenProjectAlertGroup(d, projectAlertGroup); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ProjectAlertGroupUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Project Alert Group ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectAlertGroup, err := client.ProjectAlertGroup.ByID(d.Id()) - if err != nil { - return err - } - - if d.HasChange("recipients") { - err = resourceRancher2ProjectAlertGroupRecients(d, meta) - if err != nil { - return err - } - } - - update := map[string]interface{}{ - "description": d.Get("description").(string), - "groupIntervalSeconds": int64(d.Get("group_interval_seconds").(int)), - "groupWaitSeconds": int64(d.Get("group_wait_seconds").(int)), - "name": d.Get("name").(string), - "projectId": d.Get("project_id").(string), - "recipients": expandRecipients(d.Get("recipients").([]interface{})), - "repeatIntervalSeconds": int64(d.Get("repeat_interval_seconds").(int)), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - newProjectAlertGroup, err := client.ProjectAlertGroup.Update(projectAlertGroup, update) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: projectAlertGroupStateRefreshFunc(client, newProjectAlertGroup.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert group (%s) to be updated: %s", newProjectAlertGroup.ID, waitErr) - } - - return resourceRancher2ProjectAlertGroupRead(d, meta) -} - -func resourceRancher2ProjectAlertGroupDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Project Alert Group ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectAlertGroup, err := client.ProjectAlertGroup.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Project Alert Group ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.ProjectAlertGroup.Delete(projectAlertGroup) - if err != nil { - return fmt.Errorf("Error removing Project Alert Group: %s", err) - } - - log.Printf("[DEBUG] Waiting for project alert group (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: projectAlertGroupStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert group (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -func resourceRancher2ProjectAlertGroupRecients(d *schema.ResourceData, meta interface{}) error { - recipients, ok := d.Get("recipients").([]interface{}) - if !ok { - return fmt.Errorf("[ERROR] Getting Project Alert Group Recipients") - } - - if len(recipients) > 0 { - log.Printf("[INFO] Getting Project Alert Group Recipients") - - for i := range recipients { - in := recipients[i].(map[string]interface{}) - - recipient, err := meta.(*Config).GetRecipientByNotifier(in["notifier_id"].(string)) - if err != nil { - return err - } - - in["notifier_type"] = recipient.NotifierType - if v, ok := in["default_recipient"].(bool); ok && v { - in["recipient"] = recipient.Recipient - } - - recipients[i] = in - } - d.Set("recipients", recipients) - } - - return nil -} - -// projectAlertGroupStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher ProjectAlertGroup. -func projectAlertGroupStateRefreshFunc(client *managementClient.Client, projectAlertGroupID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.ProjectAlertGroup.ByID(projectAlertGroupID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_project_alert_group_test.go b/rancher2/resource_rancher2_project_alert_group_test.go deleted file mode 100644 index 438c2729..00000000 --- a/rancher2/resource_rancher2_project_alert_group_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - testAccRancher2ProjectAlertGroupType = "rancher2_project_alert_group" -) - -var ( - testAccRancher2ProjectAlertGroup string - testAccRancher2ProjectAlertGroupUpdate string - testAccRancher2ProjectAlertGroupConfig string - testAccRancher2ProjectAlertGroupUpdateConfig string -) - -func init() { - testAccRancher2ProjectAlertGroup = ` -resource "` + testAccRancher2ProjectAlertGroupType + `" "foo" { - name = "foo" - description = "Terraform project alert group acceptance test" - project_id = rancher2_cluster_sync.testacc.default_project_id - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -` - testAccRancher2ProjectAlertGroupUpdate = ` -resource "` + testAccRancher2ProjectAlertGroupType + `" "foo" { - name = "foo" - description = "Terraform project alert group acceptance test - updated" - project_id = rancher2_cluster_sync.testacc.default_project_id - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} -` - testAccRancher2ProjectAlertGroupConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2ProjectAlertGroup - testAccRancher2ProjectAlertGroupUpdateConfig = testAccCheckRancher2ClusterSyncTestacc + testAccRancher2ProjectAlertGroupUpdate -} - -func TestAccRancher2ProjectAlertGroup_basic(t *testing.T) { - var ag *managementClient.ProjectAlertGroup - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ProjectAlertGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ProjectAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertGroupExists(testAccRancher2ProjectAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "description", "Terraform project alert group acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - { - Config: testAccRancher2ProjectAlertGroupUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertGroupExists(testAccRancher2ProjectAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "description", "Terraform project alert group acceptance test - updated"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "group_interval_seconds", "600"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "repeat_interval_seconds", "6000"), - ), - }, - { - Config: testAccRancher2ProjectAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertGroupExists(testAccRancher2ProjectAlertGroupType+".foo", ag), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "description", "Terraform project alert group acceptance test"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertGroupType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} - -func TestAccRancher2ProjectAlertGroup_disappears(t *testing.T) { - var ag *managementClient.ProjectAlertGroup - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ProjectAlertGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ProjectAlertGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertGroupExists(testAccRancher2ProjectAlertGroupType+".foo", ag), - testAccRancher2ProjectAlertGroupDisappears(ag), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func testAccRancher2ProjectAlertGroupDisappears(ag *managementClient.ProjectAlertGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ProjectAlertGroupType { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - ag, err = client.ProjectAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - err = client.ProjectAlertGroup.Delete(ag) - if err != nil { - return fmt.Errorf("Error removing Project Alert Group: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: projectAlertGroupStateRefreshFunc(client, rs.Primary.ID), - Timeout: 10 * time.Minute, - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert group (%s) to be removed: %s", rs.Primary.ID, waitErr) - } - } - return nil - - } -} - -func testAccCheckRancher2ProjectAlertGroupExists(n string, ag *managementClient.ProjectAlertGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No project alert group ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundAg, err := client.ProjectAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("Project Alert Group not found") - } - return err - } - - ag = foundAg - - return nil - } -} - -func testAccCheckRancher2ProjectAlertGroupDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ProjectAlertGroupType { - continue - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.ProjectAlertGroup.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - return fmt.Errorf("Project Alert Group still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_project_alert_rule.go b/rancher2/resource_rancher2_project_alert_rule.go deleted file mode 100644 index 6ec6ae96..00000000 --- a/rancher2/resource_rancher2_project_alert_rule.go +++ /dev/null @@ -1,207 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2ProjectAlertRule() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2ProjectAlertRuleCreate, - Read: resourceRancher2ProjectAlertRuleRead, - Update: resourceRancher2ProjectAlertRuleUpdate, - Delete: resourceRancher2ProjectAlertRuleDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2ProjectAlertRuleImport, - }, - Schema: projectAlertRuleFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2ProjectAlertRuleCreate(d *schema.ResourceData, meta interface{}) error { - projectAlertRule := expandProjectAlertRule(d) - - log.Printf("[INFO] Creating Project Alert Rule %s", projectAlertRule.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - newProjectAlertRule, err := client.ProjectAlertRule.Create(projectAlertRule) - if err != nil { - return err - } - - d.SetId(newProjectAlertRule.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: projectAlertRuleStateRefreshFunc(client, newProjectAlertRule.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for project alert rule (%s) to be created: %s", newProjectAlertRule.ID, waitErr) - } - - return resourceRancher2ProjectAlertRuleRead(d, meta) -} - -func resourceRancher2ProjectAlertRuleRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Project Alert Rule ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - projectAlertRule, err := client.ProjectAlertRule.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Project Alert Rule ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenProjectAlertRule(d, projectAlertRule); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ProjectAlertRuleUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Project Alert Rule ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectAlertRule, err := client.ProjectAlertRule.ByID(d.Id()) - if err != nil { - return err - } - - inherited := d.Get("inherited").(bool) - update := map[string]interface{}{ - "projectId": d.Get("project_id").(string), - "groupId": d.Get("group_id").(string), - "groupIntervalSeconds": int64(d.Get("group_interval_seconds").(int)), - "groupWaitSeconds": int64(d.Get("group_wait_seconds").(int)), - "inherited": &inherited, - "name": d.Get("name").(string), - "repeatIntervalSeconds": int64(d.Get("repeat_interval_seconds").(int)), - "severity": d.Get("severity").(string), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - if v, ok := d.Get("metric_rule").([]interface{}); ok && len(v) > 0 { - update["metricRule"] = expandMetricRule(v) - } - - if v, ok := d.Get("pod_rule").([]interface{}); ok && len(v) > 0 { - update["podRule"] = expandPodRule(v) - } - - if v, ok := d.Get("workload_rule").([]interface{}); ok && len(v) > 0 { - update["workloadRule"] = expandWorkloadRule(v) - } - - newProjectAlertRule, err := client.ProjectAlertRule.Update(projectAlertRule, update) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: projectAlertRuleStateRefreshFunc(client, newProjectAlertRule.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert rule (%s) to be updated: %s", newProjectAlertRule.ID, waitErr) - } - - return resourceRancher2ProjectAlertRuleRead(d, meta) -} - -func resourceRancher2ProjectAlertRuleDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Project Alert Rule ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - projectAlertRule, err := client.ProjectAlertRule.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Project Alert Rule ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.ProjectAlertRule.Delete(projectAlertRule) - if err != nil { - return fmt.Errorf("Error removing Project Alert Rule: %s", err) - } - - log.Printf("[DEBUG] Waiting for project alert rule (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: projectAlertRuleStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert rule (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// projectAlertRuleStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher ProjectAlertRule. -func projectAlertRuleStateRefreshFunc(client *managementClient.Client, projectAlertRuleID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.ProjectAlertRule.ByID(projectAlertRuleID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_project_alert_rule_test.go b/rancher2/resource_rancher2_project_alert_rule_test.go deleted file mode 100644 index 4f0896a4..00000000 --- a/rancher2/resource_rancher2_project_alert_rule_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package rancher2 - -import ( - "fmt" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - testAccRancher2ProjectAlertRuleType = "rancher2_project_alert_rule" -) - -var ( - testAccRancher2ProjectAlertRule string - testAccRancher2ProjectAlertRuleUpdate string - testAccRancher2ProjectAlertRuleConfig string - testAccRancher2ProjectAlertRuleUpdateConfig string -) - -func init() { - testAccRancher2ProjectAlertRule = ` -resource "` + testAccRancher2ProjectAlertRuleType + `" "foo" { - project_id = rancher2_cluster_sync.testacc.default_project_id - group_id = rancher2_project_alert_group.foo.id - name = "foo" - group_interval_seconds = 300 - repeat_interval_seconds = 3600 -} -` - testAccRancher2ProjectAlertRuleUpdate = ` -resource "` + testAccRancher2ProjectAlertRuleType + `" "foo" { - project_id = rancher2_cluster_sync.testacc.default_project_id - group_id = rancher2_project_alert_group.foo.id - name = "foo" - group_interval_seconds = 600 - repeat_interval_seconds = 6000 -} -` - testAccRancher2ProjectAlertRuleConfig = testAccRancher2ProjectAlertGroupConfig + testAccRancher2ProjectAlertRule - testAccRancher2ProjectAlertRuleUpdateConfig = testAccRancher2ProjectAlertGroupConfig + testAccRancher2ProjectAlertRuleUpdate -} - -func TestAccRancher2ProjectAlertRule_basic(t *testing.T) { - var ar *managementClient.ProjectAlertRule - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ProjectAlertRuleDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ProjectAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertRuleExists(testAccRancher2ProjectAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - { - Config: testAccRancher2ProjectAlertRuleUpdateConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertRuleExists(testAccRancher2ProjectAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "group_interval_seconds", "600"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "repeat_interval_seconds", "6000"), - ), - }, - { - Config: testAccRancher2ProjectAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertRuleExists(testAccRancher2ProjectAlertRuleType+".foo", ar), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "name", "foo"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "group_interval_seconds", "300"), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "severity", alertRuleSeverityCritical), - resource.TestCheckResourceAttr(testAccRancher2ProjectAlertRuleType+".foo", "repeat_interval_seconds", "3600"), - ), - }, - }, - }) -} - -func TestAccRancher2ProjectAlertRule_disappears(t *testing.T) { - var ar *managementClient.ProjectAlertRule - - resource.Test(t, resource.TestCase{ - Providers: testAccProviders, - CheckDestroy: testAccCheckRancher2ProjectAlertRuleDestroy, - Steps: []resource.TestStep{ - { - Config: testAccRancher2ProjectAlertRuleConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckRancher2ProjectAlertRuleExists(testAccRancher2ProjectAlertRuleType+".foo", ar), - testAccRancher2ProjectAlertRuleDisappears(ar), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func testAccRancher2ProjectAlertRuleDisappears(ar *managementClient.ProjectAlertRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ProjectAlertRuleType { - continue - } - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - ar, err = client.ProjectAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - - err = client.ProjectAlertRule.Delete(ar) - if err != nil { - return fmt.Errorf("Error removing Project Alert Rule: %s", err) - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: projectAlertRuleStateRefreshFunc(client, rs.Primary.ID), - Timeout: 10 * time.Minute, - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for project alert rule (%s) to be removed: %s", rs.Primary.ID, waitErr) - } - } - return nil - - } -} - -func testAccCheckRancher2ProjectAlertRuleExists(n string, ar *managementClient.ProjectAlertRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No project alert rule ID is set") - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - foundAr, err := client.ProjectAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return fmt.Errorf("Project Alert Rule not found") - } - return err - } - - ar = foundAr - - return nil - } -} - -func testAccCheckRancher2ProjectAlertRuleDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != testAccRancher2ProjectAlertRuleType { - continue - } - - client, err := testAccProvider.Meta().(*Config).ManagementClient() - if err != nil { - return err - } - - _, err = client.ProjectAlertRule.ByID(rs.Primary.ID) - if err != nil { - if IsNotFound(err) { - return nil - } - return err - } - return fmt.Errorf("Project Alert Rule still exists") - } - return nil -} diff --git a/rancher2/resource_rancher2_role_template.go b/rancher2/resource_rancher2_role_template.go index 91b06046..9b1a73a4 100644 --- a/rancher2/resource_rancher2_role_template.go +++ b/rancher2/resource_rancher2_role_template.go @@ -2,10 +2,11 @@ package rancher2 import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "log" "time" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -112,6 +113,14 @@ func resourceRancher2RoleTemplateUpdate(d *schema.ResourceData, meta interface{} "labels": toMapString(d.Get("labels").(map[string]interface{})), } + if update["external"].(bool) { + if v, ok := d.Get("external_rules").([]interface{}); ok && len(v) > 0 { + update["externalRules"] = expandPolicyRules(v) + } + } else { + update["externalRules"] = nil + } + switch update["context"] { case roleTemplateContextCluster: update["clusterCreatorDefault"] = d.Get("default_role").(bool) diff --git a/rancher2/resource_rancher2_user.go b/rancher2/resource_rancher2_user.go index 3cdacdcd..6cb5347b 100644 --- a/rancher2/resource_rancher2_user.go +++ b/rancher2/resource_rancher2_user.go @@ -108,10 +108,11 @@ func resourceRancher2UserUpdate(d *schema.ResourceData, meta interface{}) error } update := map[string]interface{}{ - "name": d.Get("name").(string), - "enabled": d.Get("enabled").(bool), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), + "name": d.Get("name").(string), + "enabled": d.Get("enabled").(bool), + "must_change_password": d.Get("must_change_password").(bool), + "annotations": toMapString(d.Get("annotations").(map[string]interface{})), + "labels": toMapString(d.Get("labels").(map[string]interface{})), } newUser, err := client.User.Update(user, update) diff --git a/rancher2/resource_rancher2_user_test.go b/rancher2/resource_rancher2_user_test.go index a223fb8f..09f5a2e7 100644 --- a/rancher2/resource_rancher2_user_test.go +++ b/rancher2/resource_rancher2_user_test.go @@ -15,8 +15,9 @@ const ( ) var ( - testAccRancher2User string - testAccRancher2UserUpdate string + testAccRancher2User string + testAccRancher2UserUpdate string + testAccRancher2UserUpdatePasswordReset string ) func init() { @@ -26,6 +27,7 @@ resource "` + testAccRancher2UserType + `" "foo" { username = "foo" password = "TestACC123456" enabled = true + must_change_password = true } ` testAccRancher2UserUpdate = ` @@ -34,8 +36,19 @@ resource "` + testAccRancher2UserType + `" "foo" { username = "foo" password = "TestACC1234567" enabled = false + must_change_password = true } ` + + testAccRancher2UserUpdatePasswordReset = ` + resource "` + testAccRancher2UserType + `" "foo" { + name = "Terraform user acceptance test - Updated" + username = "foo" + password = "TestACC1234567" + enabled = true + must_change_password = false + } + ` } func TestAccRancher2User_basic(t *testing.T) { @@ -52,6 +65,7 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), ), }, { @@ -61,6 +75,48 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test - Updated"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC1234567"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "false"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), + ), + }, + { + Config: testAccRancher2User, + Check: resource.ComposeTestCheckFunc( + testAccCheckRancher2UserExists(testAccRancher2UserType+".foo", user), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), + ), + }, + }, + }) +} + +func TestAccRancher2User_passwordReset(t *testing.T) { + var user *managementClient.User + + resource.Test(t, resource.TestCase{ + Providers: testAccProviders, + CheckDestroy: testAccCheckRancher2UserDestroy, + Steps: []resource.TestStep{ + { + Config: testAccRancher2User, + Check: resource.ComposeTestCheckFunc( + testAccCheckRancher2UserExists(testAccRancher2UserType+".foo", user), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), + ), + }, + { + Config: testAccRancher2UserUpdatePasswordReset, + Check: resource.ComposeTestCheckFunc( + testAccCheckRancher2UserExists(testAccRancher2UserType+".foo", user), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test - Updated (password reset)"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC1234567"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "false"), ), }, { @@ -70,6 +126,7 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), ), }, }, diff --git a/rancher2/schema_alert_group.go b/rancher2/schema_alert_group.go deleted file mode 100644 index 9e481ce1..00000000 --- a/rancher2/schema_alert_group.go +++ /dev/null @@ -1,54 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func alertGroupFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert group name", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Alert group description", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 180, - Description: "Alert group interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 180, - Description: "Alert group wait seconds", - }, - "recipients": { - Type: schema.TypeList, - Optional: true, - Description: "Alert group recipients", - Elem: &schema.Resource{ - Schema: recipientFields(), - }, - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 3600, - Description: "Alert group repeat interval seconds", - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_alert_rule.go b/rancher2/schema_alert_rule.go deleted file mode 100644 index 2ed30c4c..00000000 --- a/rancher2/schema_alert_rule.go +++ /dev/null @@ -1,282 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" -) - -const ( - alertRuleSeverityCritical = "critical" - alertRuleSeverityInfo = "info" - alertRuleSeverityWarning = "warning" - eventRuleTypeWarning = "Warning" - eventRuleTypeNormal = "Normal" - eventRuleResourceKindDaemondSet = "DaemonSet" - eventRuleResourceKindDeployment = "Deployment" - eventRuleResourceKindNode = "Node" - eventRuleResourceKindPod = "Pod" - eventRuleResourceKindStatefulSet = "StatefulSet" - metricRuleComparisonEqual = "equal" - metricRuleComparisonGreaterOrEqual = "greater-or-equal" - metricRuleComparisonGreaterThan = "greater-than" - metricRuleComparisonLessOrEqual = "less-or-equal" - metricRuleComparisonLessThan = "less-than" - metricRuleComparisonNotEqual = "not-equal" - metricRuleComparisonNotNull = "has-value" - nodeRuleConditionCPU = "cpu" - nodeRuleConditionMem = "mem" - nodeRuleConditionNotReady = "notready" - podRuleConditionNotRunning = "notrunning" - podRuleConditionNotScheduled = "notscheduled" - podRuleConditionRestarts = "restarts" - systemServiceRuleConditionControllerManager = "controller-manager" - systemServiceRuleConditionEtcd = "etcd" - systemServiceRuleConditionScheduler = "scheduler" -) - -var ( - alertRuleSeverityTypes = []string{alertRuleSeverityCritical, alertRuleSeverityInfo, alertRuleSeverityWarning} - eventRuleTypes = []string{eventRuleTypeNormal, eventRuleTypeWarning} - eventRuleResourceKinds = []string{ - eventRuleResourceKindDaemondSet, - eventRuleResourceKindDeployment, - eventRuleResourceKindNode, - eventRuleResourceKindPod, - eventRuleResourceKindStatefulSet, - } - metricRuleComparisons = []string{ - metricRuleComparisonEqual, - metricRuleComparisonGreaterOrEqual, - metricRuleComparisonGreaterThan, - metricRuleComparisonLessOrEqual, - metricRuleComparisonLessThan, - metricRuleComparisonNotEqual, - metricRuleComparisonNotNull, - } - nodeRuleConditions = []string{ - nodeRuleConditionCPU, - nodeRuleConditionMem, - nodeRuleConditionNotReady, - } - podRuleConditions = []string{ - podRuleConditionNotRunning, - podRuleConditionNotScheduled, - podRuleConditionRestarts, - } - systemServiceRuleConditions = []string{ - systemServiceRuleConditionControllerManager, - systemServiceRuleConditionEtcd, - systemServiceRuleConditionScheduler, - } -) - -//Schemas - -func alertRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "group_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule group ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule name", - }, - "group_interval_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 180, - Description: "Alert rule interval seconds", - }, - "group_wait_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 180, - Description: "Alert rule wait seconds", - }, - "inherited": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "Alert rule inherited", - }, - "repeat_interval_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 3600, - Description: "Alert rule repeat interval seconds", - }, - "severity": { - Type: schema.TypeString, - Optional: true, - Default: alertRuleSeverityCritical, - Description: "Alert rule severity", - ValidateFunc: validation.StringInSlice(alertRuleSeverityTypes, true), - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} - -func eventRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "event_type": { - Type: schema.TypeString, - Optional: true, - Default: eventRuleTypeWarning, - Description: "Event type", - ValidateFunc: validation.StringInSlice(eventRuleTypes, true), - }, - "resource_kind": { - Type: schema.TypeString, - Required: true, - Description: "Resource kind", - ValidateFunc: validation.StringInSlice(eventRuleResourceKinds, true), - }, - } - return s -} - -func metricRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "comparison": { - Type: schema.TypeString, - Optional: true, - Default: metricRuleComparisonEqual, - Description: "Metric rule comparison", - ValidateFunc: validation.StringInSlice(metricRuleComparisons, true), - }, - "duration": { - Type: schema.TypeString, - Required: true, - Description: "Metric rule duration", - }, - "expression": { - Type: schema.TypeString, - Required: true, - Description: "Metric rule expression", - }, - "threshold_value": { - Type: schema.TypeFloat, - Required: true, - Description: "Metric rule threshold value", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Metric rule description", - }, - } - return s -} - -func nodeRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cpu_threshold": { - Type: schema.TypeInt, - Optional: true, - Default: 70, - Description: "Node rule cpu threshold", - ValidateFunc: validation.IntBetween(1, 100), - }, - "condition": { - Type: schema.TypeString, - Optional: true, - Default: nodeRuleConditionNotReady, - Description: "Node rule condition", - ValidateFunc: validation.StringInSlice(nodeRuleConditions, true), - }, - "mem_threshold": { - Type: schema.TypeInt, - Optional: true, - Default: 70, - Description: "Node rule mem threshold", - ValidateFunc: validation.IntBetween(1, 100), - }, - "node_id": { - Type: schema.TypeString, - Optional: true, - Description: "Node ID", - }, - "selector": { - Type: schema.TypeMap, - Optional: true, - Description: "Node rule selector", - }, - } - return s -} - -func podRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "pod_id": { - Type: schema.TypeString, - Required: true, - Description: "Pod ID", - }, - "condition": { - Type: schema.TypeString, - Optional: true, - Default: podRuleConditionNotRunning, - Description: "Pod rule condition", - ValidateFunc: validation.StringInSlice(podRuleConditions, true), - }, - "restart_interval_seconds": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - Description: "Pod rule restart interval seconds", - ValidateFunc: validation.IntAtLeast(1), - }, - "restart_times": { - Type: schema.TypeInt, - Optional: true, - Default: 3, - Description: "Pod rule restart times", - ValidateFunc: validation.IntAtLeast(1), - }, - } - return s -} - -func systemServiceRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "condition": { - Type: schema.TypeString, - Optional: true, - Default: systemServiceRuleConditionScheduler, - Description: "System service rule condition", - ValidateFunc: validation.StringInSlice(systemServiceRuleConditions, true), - }, - } - return s -} - -func workloadRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "available_percentage": { - Type: schema.TypeInt, - Optional: true, - Default: 70, - Description: "Workload rule available percentage", - ValidateFunc: validation.IntBetween(1, 100), - }, - "selector": { - Type: schema.TypeMap, - Optional: true, - Description: "Workload rule selector", - }, - "workload_id": { - Type: schema.TypeString, - Optional: true, - Description: "Workload ID", - }, - } - return s -} diff --git a/rancher2/schema_catalog_v2.go b/rancher2/schema_catalog_v2.go index 4362c46a..d1af1239 100644 --- a/rancher2/schema_catalog_v2.go +++ b/rancher2/schema_catalog_v2.go @@ -53,6 +53,24 @@ func catalogV2Fields() map[string]*schema.Schema { Default: true, Description: "If disabled the repo clone will not be updated or allowed to be installed from", }, + "exponential_backoff_max_wait": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Maximum amount of seconds to wait before retrying", + }, + "exponential_backoff_min_wait": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Minimum amount of seconds to wait before retrying", + }, + "exponential_backoff_max_retries": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Maximum number of retries before returning error", + }, "git_branch": { Type: schema.TypeString, Optional: true, @@ -65,6 +83,12 @@ func catalogV2Fields() map[string]*schema.Schema { Description: "Git Repository containing Helm chart definitions", ConflictsWith: []string{"url"}, }, + "insecure_plain_http": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Only valid for OCI URL's. Allows insecure connections to registries without enforcing TLS checks", + }, "insecure": { Type: schema.TypeBool, Optional: true, diff --git a/rancher2/schema_cluster.go b/rancher2/schema_cluster.go index 07d9272c..383fbb73 100644 --- a/rancher2/schema_cluster.go +++ b/rancher2/schema_cluster.go @@ -7,13 +7,10 @@ import ( ) const ( - clusterDriverImported = "imported" - clusterRegistrationTokenName = "default-token" - clusterMonitoringV1Namespace = "cattle-prometheus" - clusterActiveCondition = "Updated" - clusterConnectedCondition = "Connected" - clusterMonitoringEnabledCondition = "MonitoringEnabled" - clusterAlertingEnabledCondition = "AlertingEnabled" + clusterDriverImported = "imported" + clusterRegistrationTokenName = "default-token" + clusterActiveCondition = "Updated" + clusterConnectedCondition = "Connected" ) var ( @@ -194,15 +191,6 @@ func clusterFieldsV0() map[string]*schema.Schema { Schema: clusterAuthEndpoint(), }, }, - "cluster_monitoring_input": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Cluster monitoring configuration", - Elem: &schema.Resource{ - Schema: monitoringInputFields(), - }, - }, "cluster_registration_token": { Type: schema.TypeList, MaxItems: 1, @@ -239,12 +227,6 @@ func clusterFieldsV0() map[string]*schema.Schema { Optional: true, Description: "Cluster template revision ID", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -266,18 +248,6 @@ func clusterFieldsV0() map[string]*schema.Schema { Optional: true, Computed: true, }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Enable built-in cluster monitoring", - }, "enable_cluster_istio": { Type: schema.TypeBool, Computed: true, @@ -472,15 +442,6 @@ func clusterFields() map[string]*schema.Schema { Schema: clusterAuthEndpoint(), }, }, - "cluster_monitoring_input": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Cluster monitoring configuration", - Elem: &schema.Resource{ - Schema: monitoringInputFields(), - }, - }, "cluster_registration_token": { Type: schema.TypeList, MaxItems: 1, @@ -518,12 +479,6 @@ func clusterFields() map[string]*schema.Schema { Optional: true, Description: "Cluster template revision ID", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -545,18 +500,6 @@ func clusterFields() map[string]*schema.Schema { Optional: true, Computed: true, }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Enable built-in cluster monitoring", - }, "enable_cluster_istio": { Type: schema.TypeBool, Computed: true, diff --git a/rancher2/schema_cluster_alert_group.go b/rancher2/schema_cluster_alert_group.go deleted file mode 100644 index 31419509..00000000 --- a/rancher2/schema_cluster_alert_group.go +++ /dev/null @@ -1,23 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func clusterAlertGroupFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert group Cluster ID", - }, - } - - for k, v := range alertGroupFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_cluster_alert_rule.go b/rancher2/schema_cluster_alert_rule.go deleted file mode 100644 index ad96dd6b..00000000 --- a/rancher2/schema_cluster_alert_rule.go +++ /dev/null @@ -1,63 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func clusterAlertRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule cluster ID", - }, - "event_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"metric_rule", "node_rule", "system_service_rule"}, - Elem: &schema.Resource{ - Schema: eventRuleFields(), - }, - Description: "Alert event rule", - }, - "metric_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"event_rule", "node_rule", "system_service_rule"}, - Elem: &schema.Resource{ - Schema: metricRuleFields(), - }, - Description: "Alert metric rule", - }, - "node_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"event_rule", "metric_rule", "system_service_rule"}, - Elem: &schema.Resource{ - Schema: nodeRuleFields(), - }, - Description: "Alert node rule", - }, - "system_service_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"event_rule", "metric_rule", "node_rule"}, - Elem: &schema.Resource{ - Schema: systemServiceRuleFields(), - }, - Description: "Alert system service rule", - }, - } - - for k, v := range alertRuleFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_cluster_rke_config_services_kube_api.go b/rancher2/schema_cluster_rke_config_services_kube_api.go index 9153716a..c74dd125 100644 --- a/rancher2/schema_cluster_rke_config_services_kube_api.go +++ b/rancher2/schema_cluster_rke_config_services_kube_api.go @@ -536,11 +536,6 @@ func clusterRKEConfigServicesKubeAPIFieldsV0() map[string]*schema.Schema { Optional: true, Computed: true, }, - "pod_security_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, "secrets_encryption_config": { Type: schema.TypeList, MaxItems: 1, @@ -619,11 +614,6 @@ func clusterRKEConfigServicesKubeAPIFields() map[string]*schema.Schema { Optional: true, Computed: true, }, - "pod_security_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, "secrets_encryption_config": { Type: schema.TypeList, MaxItems: 1, @@ -703,11 +693,6 @@ func clusterRKEConfigServicesKubeAPIFieldsData() map[string]*schema.Schema { Optional: true, Computed: true, }, - "pod_security_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, "secrets_encryption_config": { Type: schema.TypeList, MaxItems: 1, diff --git a/rancher2/schema_cluster_sync.go b/rancher2/schema_cluster_sync.go index e6310cc4..a117c1ca 100644 --- a/rancher2/schema_cluster_sync.go +++ b/rancher2/schema_cluster_sync.go @@ -28,18 +28,6 @@ func clusterSyncFields() map[string]*schema.Schema { Default: false, Description: "Wait until all catalogs are downloaded and active", }, - "wait_alerting": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Wait until alerting is up and running", - }, - "wait_monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Wait until monitoring is up and running", - }, "node_pool_ids": { Type: schema.TypeList, Optional: true, diff --git a/rancher2/schema_cluster_template.go b/rancher2/schema_cluster_template.go index 7466e2d1..52f0dd6d 100644 --- a/rancher2/schema_cluster_template.go +++ b/rancher2/schema_cluster_template.go @@ -66,12 +66,6 @@ func clusterSpecBaseFieldsV0() map[string]*schema.Schema { Computed: true, Description: "Default cluster role for project members", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -96,18 +90,6 @@ func clusterSpecBaseFieldsV0() map[string]*schema.Schema { Computed: true, Description: "Docker Root Dir", }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster monitoring", - }, "enable_network_policy": { Type: schema.TypeBool, Optional: true, @@ -152,12 +134,6 @@ func clusterSpecBaseFields() map[string]*schema.Schema { Computed: true, Description: "Default cluster role for project members", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -182,18 +158,6 @@ func clusterSpecBaseFields() map[string]*schema.Schema { Computed: true, Description: "Docker Root Dir", }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster monitoring", - }, "enable_network_policy": { Type: schema.TypeBool, Optional: true, @@ -239,12 +203,6 @@ func clusterSpecBaseFieldsData() map[string]*schema.Schema { Computed: true, Description: "Default cluster role for project members", }, - "default_pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security policy template ID", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -269,18 +227,6 @@ func clusterSpecBaseFieldsData() map[string]*schema.Schema { Computed: true, Description: "Docker Root Dir", }, - "enable_cluster_alerting": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster alerting", - }, - "enable_cluster_monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in cluster monitoring", - }, "enable_network_policy": { Type: schema.TypeBool, Optional: true, diff --git a/rancher2/schema_cluster_v2.go b/rancher2/schema_cluster_v2.go index 5fedda4a..cab606cb 100644 --- a/rancher2/schema_cluster_v2.go +++ b/rancher2/schema_cluster_v2.go @@ -71,11 +71,6 @@ func clusterV2FieldsV0() map[string]*schema.Schema { Schema: agentDeploymentCustomizationFields(), }, }, - "default_pod_security_policy_template_name": { - Type: schema.TypeString, - Optional: true, - Description: "Cluster V2 default pod security policy template name", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, @@ -191,11 +186,6 @@ func clusterV2Fields() map[string]*schema.Schema { Schema: agentDeploymentCustomizationFields(), }, }, - "default_pod_security_policy_template_name": { - Type: schema.TypeString, - Optional: true, - Description: "Cluster V2 default pod security policy template name", - }, "default_pod_security_admission_configuration_template_name": { Type: schema.TypeString, Optional: true, diff --git a/rancher2/schema_custom_user_token.go b/rancher2/schema_custom_user_token.go index 7f8d6de5..4d1d3ea6 100644 --- a/rancher2/schema_custom_user_token.go +++ b/rancher2/schema_custom_user_token.go @@ -12,6 +12,7 @@ func customUserTokenFields() map[string]*schema.Schema { Type: schema.TypeString, Required: true, Sensitive: true, + ForceNew: true, Description: "The user password", }, "username": { diff --git a/rancher2/schema_machine_config_v2_vsphere.go b/rancher2/schema_machine_config_v2_vsphere.go index 4cb37327..105e5e07 100644 --- a/rancher2/schema_machine_config_v2_vsphere.go +++ b/rancher2/schema_machine_config_v2_vsphere.go @@ -6,7 +6,7 @@ import ( ) const ( - machineConfigV2VmwarevsphereCreationTypeDefault = "legacy" + machineConfigV2VmwarevsphereCreationTypeDefault = "template" ) var ( diff --git a/rancher2/schema_monitoring_input.go b/rancher2/schema_monitoring_input.go deleted file mode 100644 index 19f2628d..00000000 --- a/rancher2/schema_monitoring_input.go +++ /dev/null @@ -1,24 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func monitoringInputFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "answers": { - Type: schema.TypeMap, - Optional: true, - Description: "Answers for monitor input", - }, - "version": { - Type: schema.TypeString, - Optional: true, - Description: "Monitoring version", - }, - } - - return s -} diff --git a/rancher2/schema_notifier.go b/rancher2/schema_notifier.go deleted file mode 100644 index 9a5746aa..00000000 --- a/rancher2/schema_notifier.go +++ /dev/null @@ -1,103 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "Notifier name", - }, - "cluster_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Notifier cluster ID", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Notifier description", - }, - "send_resolved": { - Type: schema.TypeBool, - Optional: true, - Description: "Notifier send resolved", - Default: false, - }, - "dingtalk_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"msteams_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierDingtalkConfigFields(), - }, - }, - "msteams_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierMSTeamsConfigFields(), - }, - }, - "pagerduty_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "smtp_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierPagerdutyConfigFields(), - }, - }, - "slack_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierSlackConfigFields(), - }, - }, - "smtp_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "slack_config", "webhook_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierSMTPConfigFields(), - }, - }, - "webhook_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "slack_config", "wechat_config"}, - Elem: &schema.Resource{ - Schema: notifierWebhookConfigFields(), - }, - }, - "wechat_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"dingtalk_config", "msteams_config", "pagerduty_config", "smtp_config", "slack_config", "webhook_config"}, - Elem: &schema.Resource{ - Schema: notifierWechatConfigFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_notifier_dingtalk_config.go b/rancher2/schema_notifier_dingtalk_config.go deleted file mode 100644 index 81efe0dc..00000000 --- a/rancher2/schema_notifier_dingtalk_config.go +++ /dev/null @@ -1,30 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierDingtalkConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "url": { - Type: schema.TypeString, - Required: true, - Description: "Webhook URL", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "Dingtalk proxy URL", - }, - "secret": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Required for webhook with sign enabled", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_msteams_config.go b/rancher2/schema_notifier_msteams_config.go deleted file mode 100644 index 1816c08a..00000000 --- a/rancher2/schema_notifier_msteams_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierMSTeamsConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "url": { - Type: schema.TypeString, - Required: true, - Description: "Webhook URL", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "MS teams proxy URL", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_pagerduty_config.go b/rancher2/schema_notifier_pagerduty_config.go deleted file mode 100644 index 17e07bfa..00000000 --- a/rancher2/schema_notifier_pagerduty_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierPagerdutyConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "service_key": { - Type: schema.TypeString, - Required: true, - Description: "Pagerduty service key", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "Pagerduty proxy URL", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_slack_config.go b/rancher2/schema_notifier_slack_config.go deleted file mode 100644 index 59eed8d6..00000000 --- a/rancher2/schema_notifier_slack_config.go +++ /dev/null @@ -1,29 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierSlackConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "default_recipient": { - Type: schema.TypeString, - Required: true, - Description: "Slack default channel", - }, - "url": { - Type: schema.TypeString, - Required: true, - Description: "Slack URL", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "Slack proxy URL", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_smtp_config.go b/rancher2/schema_notifier_smtp_config.go deleted file mode 100644 index 6e29112d..00000000 --- a/rancher2/schema_notifier_smtp_config.go +++ /dev/null @@ -1,51 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierSMTPConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "default_recipient": { - Type: schema.TypeString, - Required: true, - Description: "SMTP default recipient address", - }, - "host": { - Type: schema.TypeString, - Required: true, - Description: "SMTP host", - }, - "port": { - Type: schema.TypeInt, - Required: true, - Description: "SMTP port", - }, - "sender": { - Type: schema.TypeString, - Required: true, - Description: "SMTP sender", - }, - "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "SMTP password", - }, - "tls": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "SMTP TLS", - }, - "username": { - Type: schema.TypeString, - Optional: true, - Description: "SMTP username", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_webhook_config.go b/rancher2/schema_notifier_webhook_config.go deleted file mode 100644 index 532f3878..00000000 --- a/rancher2/schema_notifier_webhook_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Schemas - -func notifierWebhookConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "url": { - Type: schema.TypeString, - Required: true, - Description: "Webhook URL", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "Webhook proxy URL", - }, - } - - return s -} diff --git a/rancher2/schema_notifier_wechat_config.go b/rancher2/schema_notifier_wechat_config.go deleted file mode 100644 index 14dededf..00000000 --- a/rancher2/schema_notifier_wechat_config.go +++ /dev/null @@ -1,58 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" -) - -const ( - notifierWechatRecipientTypeParty = "party" - notifierWechatRecipientTypeTag = "tag" - notifierWechatRecipientTypeUser = "user" -) - -var ( - notifierWechatRecipientTypes = []string{notifierWechatRecipientTypeParty, notifierWechatRecipientTypeTag, notifierWechatRecipientTypeUser} -) - -// Schemas - -func notifierWechatConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "agent": { - Type: schema.TypeString, - Required: true, - Description: "Wechat application agent ID", - }, - "corp": { - Type: schema.TypeString, - Required: true, - Description: "Wechat corporation ID", - }, - "default_recipient": { - Type: schema.TypeString, - Required: true, - Description: "Wechat default channel", - }, - "secret": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - Description: "Wechat application secret", - }, - "proxy_url": { - Type: schema.TypeString, - Optional: true, - Description: "Wechat proxy URL", - }, - "recipient_type": { - Type: schema.TypeString, - Optional: true, - Default: notifierWechatRecipientTypeParty, - Description: "Wechat recipient type", - ValidateFunc: validation.StringInSlice(notifierWechatRecipientTypes, true), - }, - } - - return s -} diff --git a/rancher2/schema_policy_rule.go b/rancher2/schema_policy_rule.go index 2f5a3ae3..ba12548f 100644 --- a/rancher2/schema_policy_rule.go +++ b/rancher2/schema_policy_rule.go @@ -21,6 +21,8 @@ const ( policyRuleVerbBind = "bind" policyRuleVerbEscalate = "escalate" policyRuleVerbImpersonate = "impersonate" + policyRuleVerbManageNamespaces = "manage-namespaces" + policyRuleVerbUpdatePSA = "updatepsa" ) var ( @@ -40,6 +42,8 @@ var ( policyRuleVerbBind, policyRuleVerbEscalate, policyRuleVerbImpersonate, + policyRuleVerbManageNamespaces, + policyRuleVerbUpdatePSA, } ) diff --git a/rancher2/schema_project.go b/rancher2/schema_project.go index 85f81f2d..8d63492d 100644 --- a/rancher2/schema_project.go +++ b/rancher2/schema_project.go @@ -116,25 +116,6 @@ func projectFields() map[string]*schema.Schema { Type: schema.TypeString, Optional: true, }, - "enable_project_monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable built-in project monitoring", - }, - "pod_security_policy_template_id": { - Type: schema.TypeString, - Optional: true, - }, - "project_monitoring_input": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Cluster monitoring configuration", - Elem: &schema.Resource{ - Schema: monitoringInputFields(), - }, - }, "resource_quota": { Type: schema.TypeList, MaxItems: 1, diff --git a/rancher2/schema_project_alert_group.go b/rancher2/schema_project_alert_group.go deleted file mode 100644 index aad60329..00000000 --- a/rancher2/schema_project_alert_group.go +++ /dev/null @@ -1,23 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func projectAlertGroupFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert group Project ID", - }, - } - - for k, v := range alertGroupFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_project_alert_rule.go b/rancher2/schema_project_alert_rule.go deleted file mode 100644 index 65ce73c4..00000000 --- a/rancher2/schema_project_alert_rule.go +++ /dev/null @@ -1,53 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func projectAlertRuleFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "project_id": { - Type: schema.TypeString, - Required: true, - Description: "Alert rule Project ID", - }, - "metric_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"pod_rule", "workload_rule"}, - Elem: &schema.Resource{ - Schema: metricRuleFields(), - }, - Description: "Alert metric rule", - }, - "pod_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"metric_rule", "workload_rule"}, - Elem: &schema.Resource{ - Schema: podRuleFields(), - }, - Description: "Alert pod rule", - }, - "workload_rule": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: []string{"metric_rule", "pod_rule"}, - Elem: &schema.Resource{ - Schema: workloadRuleFields(), - }, - Description: "Alert workload rule", - }, - } - - for k, v := range alertRuleFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_recipient.go b/rancher2/schema_recipient.go deleted file mode 100644 index 4a8839fa..00000000 --- a/rancher2/schema_recipient.go +++ /dev/null @@ -1,45 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - recipientTypeDingtalk = "dingtalk" - recipientTypeMsTeams = "msteams" - recipientTypePagerduty = "pagerduty" - recipientTypeSlack = "slack" - recipientTypeSMTP = "email" - recipientTypeWebhook = "webhook" - recipientTypeWechat = "wechat" -) - -//Schemas - -func recipientFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "notifier_id": { - Type: schema.TypeString, - Required: true, - Description: "Recipient notifier ID", - }, - "notifier_type": { - Type: schema.TypeString, - Computed: true, - Description: "Recipient notifier type", - }, - "recipient": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Recipient", - }, - "default_recipient": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Use notifier default recipient", - }, - } - return s -} diff --git a/rancher2/schema_role_template.go b/rancher2/schema_role_template.go index 78e86ee4..578513f3 100644 --- a/rancher2/schema_role_template.go +++ b/rancher2/schema_role_template.go @@ -89,6 +89,15 @@ func roleTemplateFields() map[string]*schema.Schema { Schema: policyRuleFields(), }, }, + "external_rules": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "External policy rules used for authorization", + Elem: &schema.Resource{ + Schema: policyRuleFields(), + }, + }, } for k, v := range commonAnnotationLabelFields() { diff --git a/rancher2/schema_user.go b/rancher2/schema_user.go index 2ed2d9d6..944b9ebf 100644 --- a/rancher2/schema_user.go +++ b/rancher2/schema_user.go @@ -23,6 +23,11 @@ func userFields() map[string]*schema.Schema { Optional: true, Default: true, }, + "must_change_password": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "name": { Type: schema.TypeString, Optional: true, diff --git a/rancher2/structure_alert_rule.go b/rancher2/structure_alert_rule.go deleted file mode 100644 index 9469f9d2..00000000 --- a/rancher2/structure_alert_rule.go +++ /dev/null @@ -1,295 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenEventRule(in *managementClient.EventRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if len(in.EventType) > 0 { - obj["event_type"] = in.EventType - } - - if len(in.ResourceKind) > 0 { - obj["resource_kind"] = in.ResourceKind - } - - return []interface{}{obj} -} - -func flattenMetricRule(in *managementClient.MetricRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if len(in.Comparison) > 0 { - obj["comparison"] = in.Comparison - } - - if len(in.Duration) > 0 { - obj["duration"] = in.Duration - } - - if len(in.Expression) > 0 { - obj["expression"] = in.Expression - } - - if in.ThresholdValue > 0 { - obj["threshold_value"] = in.ThresholdValue - } - - if len(in.Description) > 0 { - obj["description"] = in.Description - } - - return []interface{}{obj} -} - -func flattenNodeRule(in *managementClient.NodeRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if in.CPUThreshold > 0 { - obj["cpu_threshold"] = int(in.CPUThreshold) - } - - if len(in.Condition) > 0 { - obj["condition"] = in.Condition - } - - if in.MemThreshold > 0 { - obj["mem_threshold"] = int(in.MemThreshold) - } - - if len(in.NodeID) > 0 { - obj["node_id"] = in.NodeID - } - - if len(in.Selector) > 0 { - obj["selector"] = toMapInterface(in.Selector) - } - - return []interface{}{obj} -} - -func flattenPodRule(in *managementClient.PodRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if len(in.Condition) > 0 { - obj["condition"] = in.Condition - } - - if len(in.PodID) > 0 { - obj["pod_id"] = in.PodID - } - - if in.RestartIntervalSeconds > 0 { - obj["restart_interval_seconds"] = int(in.RestartIntervalSeconds) - } - - if in.RestartTimes > 0 { - obj["restart_times"] = int(in.RestartTimes) - } - - return []interface{}{obj} -} - -func flattenSystemServiceRule(in *managementClient.SystemServiceRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if len(in.Condition) > 0 { - obj["condition"] = in.Condition - } - - return []interface{}{obj} -} - -func flattenWorkloadRule(in *managementClient.WorkloadRule) []interface{} { - obj := map[string]interface{}{} - - if in == nil { - return []interface{}{} - } - - if in.AvailablePercentage > 0 { - obj["available_percentage"] = int(in.AvailablePercentage) - } - - if len(in.Selector) > 0 { - obj["selector"] = toMapInterface(in.Selector) - } - - if len(in.WorkloadID) > 0 { - obj["workload_id"] = in.WorkloadID - } - - return []interface{}{obj} -} - -// Expanders - -func expandEventRule(p []interface{}) *managementClient.EventRule { - obj := &managementClient.EventRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["event_type"].(string); ok && len(v) > 0 { - obj.EventType = v - } - - if v, ok := in["resource_kind"].(string); ok && len(v) > 0 { - obj.ResourceKind = v - } - - return obj -} - -func expandMetricRule(p []interface{}) *managementClient.MetricRule { - obj := &managementClient.MetricRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["comparison"].(string); ok && len(v) > 0 { - obj.Comparison = v - } - - if v, ok := in["duration"].(string); ok && len(v) > 0 { - obj.Duration = v - } - - if v, ok := in["expression"].(string); ok && len(v) > 0 { - obj.Expression = v - } - - if v, ok := in["threshold_value"].(float64); ok && v > 0 { - obj.ThresholdValue = v - } - - if v, ok := in["description"].(string); ok && len(v) > 0 { - obj.Description = v - } - - return obj -} - -func expandNodeRule(p []interface{}) *managementClient.NodeRule { - obj := &managementClient.NodeRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["cpu_threshold"].(int); ok && v > 0 { - obj.CPUThreshold = int64(v) - } - - if v, ok := in["condition"].(string); ok && len(v) > 0 { - obj.Condition = v - } - - if v, ok := in["mem_threshold"].(int); ok && v > 0 { - obj.MemThreshold = int64(v) - } - - if v, ok := in["node_id"].(string); ok && len(v) > 0 { - obj.NodeID = v - } - - if v, ok := in["selector"].(map[string]interface{}); ok && len(v) > 0 { - obj.Selector = toMapString(v) - } - - return obj -} - -func expandPodRule(p []interface{}) *managementClient.PodRule { - obj := &managementClient.PodRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["condition"].(string); ok && len(v) > 0 { - obj.Condition = v - } - - if v, ok := in["pod_id"].(string); ok && len(v) > 0 { - obj.PodID = v - } - - if v, ok := in["restart_interval_seconds"].(int); ok && v > 0 { - obj.RestartIntervalSeconds = int64(v) - } - - if v, ok := in["restart_times"].(int); ok && v > 0 { - obj.RestartTimes = int64(v) - } - - return obj -} - -func expandSystemServiceRule(p []interface{}) *managementClient.SystemServiceRule { - obj := &managementClient.SystemServiceRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["condition"].(string); ok && len(v) > 0 { - obj.Condition = v - } - - return obj -} - -func expandWorkloadRule(p []interface{}) *managementClient.WorkloadRule { - obj := &managementClient.WorkloadRule{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["available_percentage"].(int); ok && v > 0 { - obj.AvailablePercentage = int64(v) - } - - if v, ok := in["selector"].(map[string]interface{}); ok && len(v) > 0 { - obj.Selector = toMapString(v) - } - - if v, ok := in["workload_id"].(string); ok && len(v) > 0 { - obj.WorkloadID = v - } - - return obj -} diff --git a/rancher2/structure_alert_rule_test.go b/rancher2/structure_alert_rule_test.go deleted file mode 100644 index a507bab1..00000000 --- a/rancher2/structure_alert_rule_test.go +++ /dev/null @@ -1,330 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testAlertEventRuleConf *managementClient.EventRule - testAlertEventRuleInterface []interface{} - testAlertMetricRuleConf *managementClient.MetricRule - testAlertMetricRuleInterface []interface{} - testAlertNodeRuleConf *managementClient.NodeRule - testAlertNodeRuleInterface []interface{} - testAlertPodRuleConf *managementClient.PodRule - testAlertPodRuleInterface []interface{} - testAlertSystemServiceRuleConf *managementClient.SystemServiceRule - testAlertSystemServiceRuleInterface []interface{} - testAlertWorkloadRuleConf *managementClient.WorkloadRule - testAlertWorkloadRuleInterface []interface{} -) - -func init() { - testAlertEventRuleConf = &managementClient.EventRule{ - EventType: eventRuleTypeWarning, - ResourceKind: eventRuleResourceKindNode, - } - testAlertEventRuleInterface = []interface{}{ - map[string]interface{}{ - "event_type": eventRuleTypeWarning, - "resource_kind": eventRuleResourceKindNode, - }, - } - testAlertMetricRuleConf = &managementClient.MetricRule{ - Comparison: metricRuleComparisonEqual, - Duration: "30", - Expression: "expression", - ThresholdValue: float64(3.5), - Description: "description", - } - testAlertMetricRuleInterface = []interface{}{ - map[string]interface{}{ - "comparison": metricRuleComparisonEqual, - "duration": "30", - "expression": "expression", - "threshold_value": float64(3.5), - "description": "description", - }, - } - testAlertNodeRuleConf = &managementClient.NodeRule{ - CPUThreshold: int64(70), - Condition: nodeRuleConditionNotReady, - MemThreshold: int64(70), - NodeID: "node_id", - Selector: map[string]string{ - "selector1": "selector1", - "selector2": "selector2", - }, - } - testAlertNodeRuleInterface = []interface{}{ - map[string]interface{}{ - "cpu_threshold": 70, - "condition": nodeRuleConditionNotReady, - "mem_threshold": 70, - "node_id": "node_id", - "selector": map[string]interface{}{ - "selector1": "selector1", - "selector2": "selector2", - }, - }, - } - testAlertPodRuleConf = &managementClient.PodRule{ - Condition: podRuleConditionNotRunning, - PodID: "pod_id", - RestartIntervalSeconds: int64(70), - RestartTimes: int64(5), - } - testAlertPodRuleInterface = []interface{}{ - map[string]interface{}{ - "condition": podRuleConditionNotRunning, - "pod_id": "pod_id", - "restart_interval_seconds": 70, - "restart_times": 5, - }, - } - testAlertSystemServiceRuleConf = &managementClient.SystemServiceRule{ - Condition: systemServiceRuleConditionScheduler, - } - testAlertSystemServiceRuleInterface = []interface{}{ - map[string]interface{}{ - "condition": systemServiceRuleConditionScheduler, - }, - } - testAlertWorkloadRuleConf = &managementClient.WorkloadRule{ - AvailablePercentage: int64(70), - Selector: map[string]string{ - "selector1": "selector1", - "selector2": "selector2", - }, - WorkloadID: "workload_id", - } - testAlertWorkloadRuleInterface = []interface{}{ - map[string]interface{}{ - "available_percentage": 70, - "selector": map[string]interface{}{ - "selector1": "selector1", - "selector2": "selector2", - }, - "workload_id": "workload_id", - }, - } -} - -func TestFlattenEventRule(t *testing.T) { - - cases := []struct { - Input *managementClient.EventRule - ExpectedOutput []interface{} - }{ - { - testAlertEventRuleConf, - testAlertEventRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenEventRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenMetricRule(t *testing.T) { - - cases := []struct { - Input *managementClient.MetricRule - ExpectedOutput []interface{} - }{ - { - testAlertMetricRuleConf, - testAlertMetricRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenMetricRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenNodeRule(t *testing.T) { - - cases := []struct { - Input *managementClient.NodeRule - ExpectedOutput []interface{} - }{ - { - testAlertNodeRuleConf, - testAlertNodeRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenNodeRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenPodRule(t *testing.T) { - - cases := []struct { - Input *managementClient.PodRule - ExpectedOutput []interface{} - }{ - { - testAlertPodRuleConf, - testAlertPodRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenPodRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenSystemServiceRule(t *testing.T) { - - cases := []struct { - Input *managementClient.SystemServiceRule - ExpectedOutput []interface{} - }{ - { - testAlertSystemServiceRuleConf, - testAlertSystemServiceRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenSystemServiceRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenWorkloadRule(t *testing.T) { - - cases := []struct { - Input *managementClient.WorkloadRule - ExpectedOutput []interface{} - }{ - { - testAlertWorkloadRuleConf, - testAlertWorkloadRuleInterface, - }, - } - - for _, tc := range cases { - output := flattenWorkloadRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandEventRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.EventRule - }{ - { - testAlertEventRuleInterface, - testAlertEventRuleConf, - }, - } - - for _, tc := range cases { - output := expandEventRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandMetricRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.MetricRule - }{ - { - testAlertMetricRuleInterface, - testAlertMetricRuleConf, - }, - } - - for _, tc := range cases { - output := expandMetricRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandNodeRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.NodeRule - }{ - { - testAlertNodeRuleInterface, - testAlertNodeRuleConf, - }, - } - - for _, tc := range cases { - output := expandNodeRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandPodRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.PodRule - }{ - { - testAlertPodRuleInterface, - testAlertPodRuleConf, - }, - } - - for _, tc := range cases { - output := expandPodRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandSystemServiceRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SystemServiceRule - }{ - { - testAlertSystemServiceRuleInterface, - testAlertSystemServiceRuleConf, - }, - } - - for _, tc := range cases { - output := expandSystemServiceRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandWorkloadRule(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.WorkloadRule - }{ - { - testAlertWorkloadRuleInterface, - testAlertWorkloadRuleConf, - }, - } - - for _, tc := range cases { - output := expandWorkloadRule(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_catalog_v2.go b/rancher2/structure_catalog_v2.go index 32bd2fcc..8f345b11 100644 --- a/rancher2/structure_catalog_v2.go +++ b/rancher2/structure_catalog_v2.go @@ -41,6 +41,15 @@ func flattenCatalogV2(d *schema.ResourceData, in *ClusterRepo) error { d.Set("secret_name", in.Spec.ClientSecret.Name) d.Set("secret_namespace", in.Spec.ClientSecret.Namespace) } + + if in.Spec.ExponentialBackOffValues != nil { + d.Set("exponential_backoff_min_wait", in.Spec.ExponentialBackOffValues.MinWait) + d.Set("exponential_backoff_max_wait", in.Spec.ExponentialBackOffValues.MaxWait) + d.Set("exponential_backoff_max_retries", in.Spec.ExponentialBackOffValues.MaxRetries) + } + + d.Set("insecure_plain_http", in.Spec.InsecurePlainHTTP) + d.Set("service_account", in.Spec.ServiceAccount) d.Set("service_account_namespace", in.Spec.ServiceAccountNamespace) d.Set("url", in.Spec.URL) @@ -96,6 +105,39 @@ func expandCatalogV2(in *schema.ResourceData) (*ClusterRepo, error) { if v, ok := in.Get("insecure").(bool); ok { obj.Spec.InsecureSkipTLSverify = v } + if v, ok := in.Get("insecure_plain_http").(bool); ok { + obj.Spec.InsecurePlainHTTP = v + } + if v, ok := in.Get("exponential_backoff_min_wait").(int); ok { + if obj.Spec.ExponentialBackOffValues != nil { + obj.Spec.ExponentialBackOffValues.MinWait = v + } else { + obj.Spec.ExponentialBackOffValues = &v1.ExponentialBackOffValues{ + MinWait: v, + } + } + } + + if v, ok := in.Get("exponential_backoff_max_wait").(int); ok { + if obj.Spec.ExponentialBackOffValues != nil { + obj.Spec.ExponentialBackOffValues.MaxWait = v + } else { + obj.Spec.ExponentialBackOffValues = &v1.ExponentialBackOffValues{ + MaxWait: v, + } + } + } + + if v, ok := in.Get("exponential_backoff_max_retries").(int); ok { + if obj.Spec.ExponentialBackOffValues != nil { + obj.Spec.ExponentialBackOffValues.MaxRetries = v + } else { + obj.Spec.ExponentialBackOffValues = &v1.ExponentialBackOffValues{ + MaxRetries: v, + } + } + } + sName, nok := in.Get("secret_name").(string) sNamespace, nsok := in.Get("secret_namespace").(string) if nok && nsok && len(sName) > 0 { diff --git a/rancher2/structure_catalog_v2_test.go b/rancher2/structure_catalog_v2_test.go index 5b717528..bd54bcbe 100644 --- a/rancher2/structure_catalog_v2_test.go +++ b/rancher2/structure_catalog_v2_test.go @@ -28,10 +28,16 @@ func init() { "label1": "one", "label2": "two", } + testCatalogV2Conf.Spec.ExponentialBackOffValues = &managementClient.ExponentialBackOffValues{ + MinWait: 2, + MaxWait: 10, + MaxRetries: 5, + } testCatalogV2Conf.Spec.CABundle = []byte("test DER data") testCatalogV2Conf.Spec.Enabled = newTrue() testCatalogV2Conf.Spec.GitBranch = "git_branch" testCatalogV2Conf.Spec.GitRepo = "git_repo" + testCatalogV2Conf.Spec.InsecurePlainHTTP = false testCatalogV2Conf.Spec.InsecureSkipTLSverify = false testCatalogV2Conf.Spec.ClientSecret = &managementClient.SecretReference{ Name: "secret_name", @@ -42,17 +48,21 @@ func init() { testCatalogV2Conf.Spec.URL = "url" testCatalogV2Interface = map[string]interface{}{ - "name": "name", - "ca_bundle": "dGVzdCBERVIgZGF0YQ==", - "enabled": true, - "git_branch": "git_branch", - "git_repo": "git_repo", - "insecure": false, - "secret_name": "secret_name", - "secret_namespace": "secret_namespace", - "service_account": "service_account", - "service_account_namespace": "service_account_namespace", - "url": "url", + "name": "name", + "ca_bundle": "dGVzdCBERVIgZGF0YQ==", + "enabled": true, + "exponential_backoff_min_wait": 2, + "exponential_backoff_max_wait": 10, + "exponential_backoff_max_retries": 5, + "git_branch": "git_branch", + "git_repo": "git_repo", + "insecure": false, + "insecure_plain_http": false, + "secret_name": "secret_name", + "secret_namespace": "secret_namespace", + "service_account": "service_account", + "service_account_namespace": "service_account_namespace", + "url": "url", "annotations": map[string]interface{}{ "value1": "one", "value2": "two", diff --git a/rancher2/structure_cluster.go b/rancher2/structure_cluster.go index 687125a0..45a3c46d 100644 --- a/rancher2/structure_cluster.go +++ b/rancher2/structure_cluster.go @@ -45,7 +45,7 @@ func flattenClusterAuthEndpoint(in *managementClient.LocalClusterAuthEndpoint) [ return []interface{}{obj} } -func flattenCluster(d *schema.ResourceData, in *Cluster, clusterRegToken *managementClient.ClusterRegistrationToken, kubeConfig *managementClient.GenerateKubeConfigOutput, defaultProjectID, systemProjectID string, monitoringInput *managementClient.MonitoringInput) error { +func flattenCluster(d *schema.ResourceData, in *Cluster, clusterRegToken *managementClient.ClusterRegistrationToken, kubeConfig *managementClient.GenerateKubeConfigOutput, defaultProjectID, systemProjectID string) error { if in == nil { return fmt.Errorf("[ERROR] flattening cluster: Input cluster is nil") } @@ -100,10 +100,6 @@ func flattenCluster(d *schema.ResourceData, in *Cluster, clusterRegToken *manage } - if len(in.DefaultPodSecurityPolicyTemplateID) > 0 { - d.Set("default_pod_security_policy_template_id", in.DefaultPodSecurityPolicyTemplateID) - } - if len(in.DefaultPodSecurityAdmissionConfigurationTemplateName) > 0 { d.Set("default_pod_security_admission_configuration_template_name", in.DefaultPodSecurityAdmissionConfigurationTemplateName) } @@ -124,8 +120,6 @@ func flattenCluster(d *schema.ResourceData, in *Cluster, clusterRegToken *manage d.Set("fleet_workspace_name", in.FleetWorkspaceName) } - d.Set("enable_cluster_alerting", in.EnableClusterAlerting) - d.Set("enable_cluster_monitoring", in.EnableClusterMonitoring) d.Set("istio_enabled", in.IstioEnabled) if in.EnableNetworkPolicy != nil { @@ -149,11 +143,6 @@ func flattenCluster(d *schema.ResourceData, in *Cluster, clusterRegToken *manage return err } - err = d.Set("cluster_monitoring_input", flattenMonitoringInput(monitoringInput)) - if err != nil { - return err - } - if len(in.CACert) > 0 { d.Set("ca_cert", in.CACert) } @@ -462,10 +451,6 @@ func expandCluster(in *schema.ResourceData) (*Cluster, error) { } } - if v, ok := in.Get("default_pod_security_policy_template_id").(string); ok && len(v) > 0 { - obj.DefaultPodSecurityPolicyTemplateID = v - } - if v, ok := in.Get("default_pod_security_admission_configuration_template_name").(string); ok && len(v) > 0 { obj.DefaultPodSecurityAdmissionConfigurationTemplateName = v } @@ -482,14 +467,6 @@ func expandCluster(in *schema.ResourceData) (*Cluster, error) { obj.DockerRootDir = v } - if v, ok := in.Get("enable_cluster_alerting").(bool); ok { - obj.EnableClusterAlerting = v - } - - if v, ok := in.Get("enable_cluster_monitoring").(bool); ok { - obj.EnableClusterMonitoring = v - } - if v, ok := in.Get("enable_network_policy").(bool); ok { obj.EnableNetworkPolicy = &v } diff --git a/rancher2/structure_cluster_alert_group.go b/rancher2/structure_cluster_alert_group.go deleted file mode 100644 index af85c343..00000000 --- a/rancher2/structure_cluster_alert_group.go +++ /dev/null @@ -1,77 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenClusterAlertGroup(d *schema.ResourceData, in *managementClient.ClusterAlertGroup) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("name", in.Name) - d.Set("cluster_id", in.ClusterID) - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - d.Set("group_interval_seconds", int(in.GroupIntervalSeconds)) - d.Set("group_wait_seconds", int(in.GroupWaitSeconds)) - d.Set("recipients", flattenRecipients(in.Recipients)) - d.Set("repeat_interval_seconds", int(in.RepeatIntervalSeconds)) - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - return nil -} - -// Expanders - -func expandClusterAlertGroup(in *schema.ResourceData) *managementClient.ClusterAlertGroup { - obj := &managementClient.ClusterAlertGroup{} - if in == nil { - return nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - obj.Name = in.Get("name").(string) - obj.ClusterID = in.Get("cluster_id").(string) - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - obj.GroupIntervalSeconds = int64(in.Get("group_interval_seconds").(int)) - obj.GroupWaitSeconds = int64(in.Get("group_wait_seconds").(int)) - - if v, ok := in.Get("recipients").([]interface{}); ok && len(v) > 0 { - obj.Recipients = expandRecipients(v) - } - - obj.RepeatIntervalSeconds = int64(in.Get("repeat_interval_seconds").(int)) - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj -} diff --git a/rancher2/structure_cluster_alert_group_test.go b/rancher2/structure_cluster_alert_group_test.go deleted file mode 100644 index 8ac20d7a..00000000 --- a/rancher2/structure_cluster_alert_group_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testClusterAlertGroupRecipientsConf []managementClient.Recipient - testClusterAlertGroupRecipientsInterface []interface{} - testClusterAlertGroupConf *managementClient.ClusterAlertGroup - testClusterAlertGroupInterface map[string]interface{} -) - -func init() { - testClusterAlertGroupRecipientsConf = []managementClient.Recipient{ - { - NotifierID: "notifier_id", - NotifierType: "webhook", - Recipient: "recipient", - }, - } - testClusterAlertGroupRecipientsInterface = []interface{}{ - map[string]interface{}{ - "notifier_id": "notifier_id", - "notifier_type": "webhook", - "recipient": "recipient", - "default_recipient": false, - }, - } - testClusterAlertGroupConf = &managementClient.ClusterAlertGroup{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - GroupIntervalSeconds: 300, - GroupWaitSeconds: 300, - Recipients: testClusterAlertGroupRecipientsConf, - RepeatIntervalSeconds: 6000, - } - testClusterAlertGroupInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "group_interval_seconds": 300, - "group_wait_seconds": 300, - "recipients": testClusterAlertGroupRecipientsInterface, - "repeat_interval_seconds": 6000, - } -} - -func TestFlattenClusterAlertGroup(t *testing.T) { - - cases := []struct { - Input *managementClient.ClusterAlertGroup - ExpectedOutput map[string]interface{} - }{ - { - testClusterAlertGroupConf, - testClusterAlertGroupInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, clusterAlertGroupFields(), map[string]interface{}{}) - err := flattenClusterAlertGroup(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - expectedOutput, tc.ExpectedOutput) - } - } -} - -func TestExpandClusterAlertGroup(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.ClusterAlertGroup - }{ - { - testClusterAlertGroupInterface, - testClusterAlertGroupConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, clusterAlertGroupFields(), tc.Input) - output := expandClusterAlertGroup(inputResourceData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_cluster_alert_rule.go b/rancher2/structure_cluster_alert_rule.go deleted file mode 100644 index 968a9550..00000000 --- a/rancher2/structure_cluster_alert_rule.go +++ /dev/null @@ -1,130 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenClusterAlertRule(d *schema.ResourceData, in *managementClient.ClusterAlertRule) error { - if in == nil { - return nil - } - - if len(in.ID) > 0 { - d.SetId(in.ID) - } - - d.Set("name", in.Name) - d.Set("cluster_id", in.ClusterID) - - if in.EventRule != nil { - err := d.Set("event_rule", flattenEventRule(in.EventRule)) - if err != nil { - return err - } - } - - d.Set("group_id", in.GroupID) - d.Set("group_interval_seconds", int(in.GroupIntervalSeconds)) - d.Set("group_wait_seconds", int(in.GroupWaitSeconds)) - - if in.Inherited != nil { - d.Set("inherited", *in.Inherited) - } - - if in.MetricRule != nil { - err := d.Set("metric_rule", flattenMetricRule(in.MetricRule)) - if err != nil { - return err - } - } - - if in.NodeRule != nil { - err := d.Set("node_rule", flattenNodeRule(in.NodeRule)) - if err != nil { - return err - } - } - - d.Set("repeat_interval_seconds", int(in.RepeatIntervalSeconds)) - - if len(in.Severity) > 0 { - d.Set("severity", in.Severity) - } - - if in.SystemServiceRule != nil { - err := d.Set("system_service_rule", flattenSystemServiceRule(in.SystemServiceRule)) - if err != nil { - return err - } - } - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - return nil -} - -// Expanders - -func expandClusterAlertRule(in *schema.ResourceData) *managementClient.ClusterAlertRule { - obj := &managementClient.ClusterAlertRule{} - if in == nil { - return nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - obj.Name = in.Get("name").(string) - obj.ClusterID = in.Get("cluster_id").(string) - - if v, ok := in.Get("event_rule").([]interface{}); ok && len(v) > 0 { - obj.EventRule = expandEventRule(v) - } - - obj.GroupID = in.Get("group_id").(string) - obj.GroupIntervalSeconds = int64(in.Get("group_interval_seconds").(int)) - obj.GroupWaitSeconds = int64(in.Get("group_wait_seconds").(int)) - - if v, ok := in.Get("inherited").(bool); ok { - obj.Inherited = &v - } - - if v, ok := in.Get("metric_rule").([]interface{}); ok && len(v) > 0 { - obj.MetricRule = expandMetricRule(v) - } - - if v, ok := in.Get("node_rule").([]interface{}); ok && len(v) > 0 { - obj.NodeRule = expandNodeRule(v) - } - - obj.RepeatIntervalSeconds = int64(in.Get("repeat_interval_seconds").(int)) - - if v, ok := in.Get("severity").(string); ok { - obj.Severity = v - } - - if v, ok := in.Get("system_service_rule").([]interface{}); ok && len(v) > 0 { - obj.SystemServiceRule = expandSystemServiceRule(v) - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj -} diff --git a/rancher2/structure_cluster_alert_rule_test.go b/rancher2/structure_cluster_alert_rule_test.go deleted file mode 100644 index 4866a466..00000000 --- a/rancher2/structure_cluster_alert_rule_test.go +++ /dev/null @@ -1,158 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testClusterAlertEventRuleConf *managementClient.EventRule - testClusterAlertEventRuleInterface []interface{} - testClusterAlertMetricRuleConf *managementClient.MetricRule - testClusterAlertMetricRuleInterface []interface{} - testClusterAlertNodeRuleConf *managementClient.NodeRule - testClusterAlertNodeRuleInterface []interface{} - testClusterAlertSystemServiceRuleConf *managementClient.SystemServiceRule - testClusterAlertSystemServiceRuleInterface []interface{} - testClusterAlertRuleConf *managementClient.ClusterAlertRule - testClusterAlertRuleInterface map[string]interface{} -) - -func init() { - testClusterAlertEventRuleConf = &managementClient.EventRule{ - EventType: eventRuleTypeWarning, - ResourceKind: eventRuleResourceKindNode, - } - testClusterAlertEventRuleInterface = []interface{}{ - map[string]interface{}{ - "event_type": eventRuleTypeWarning, - "resource_kind": eventRuleResourceKindNode, - }, - } - testClusterAlertMetricRuleConf = &managementClient.MetricRule{ - Comparison: metricRuleComparisonEqual, - Duration: "30", - Expression: "expression", - ThresholdValue: float64(3.5), - Description: "description", - } - testClusterAlertMetricRuleInterface = []interface{}{ - map[string]interface{}{ - "comparison": metricRuleComparisonEqual, - "duration": "30", - "expression": "expression", - "threshold_value": float64(3.5), - "description": "description", - }, - } - testClusterAlertNodeRuleConf = &managementClient.NodeRule{ - CPUThreshold: int64(70), - Condition: nodeRuleConditionNotReady, - MemThreshold: int64(70), - NodeID: "node_id", - Selector: map[string]string{ - "selector1": "selector1", - "selector2": "selector2", - }, - } - testClusterAlertNodeRuleInterface = []interface{}{ - map[string]interface{}{ - "cpu_threshold": 70, - "condition": nodeRuleConditionNotReady, - "mem_threshold": 70, - "node_id": "node_id", - "selector": map[string]interface{}{ - "selector1": "selector1", - "selector2": "selector2", - }, - }, - } - testClusterAlertSystemServiceRuleConf = &managementClient.SystemServiceRule{ - Condition: systemServiceRuleConditionScheduler, - } - testClusterAlertSystemServiceRuleInterface = []interface{}{ - map[string]interface{}{ - "condition": systemServiceRuleConditionScheduler, - }, - } - testClusterAlertRuleConf = &managementClient.ClusterAlertRule{ - Name: "name", - ClusterID: "cluster_id", - EventRule: testClusterAlertEventRuleConf, - GroupID: "group_id", - GroupIntervalSeconds: 300, - GroupWaitSeconds: 300, - Inherited: newTrue(), - MetricRule: testClusterAlertMetricRuleConf, - NodeRule: testClusterAlertNodeRuleConf, - RepeatIntervalSeconds: 6000, - Severity: alertRuleSeverityCritical, - SystemServiceRule: testClusterAlertSystemServiceRuleConf, - } - testClusterAlertRuleInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "event_rule": testClusterAlertEventRuleInterface, - "group_id": "group_id", - "group_interval_seconds": 300, - "group_wait_seconds": 300, - "inherited": true, - "metric_rule": testClusterAlertMetricRuleInterface, - "node_rule": testClusterAlertNodeRuleInterface, - "repeat_interval_seconds": 6000, - "severity": alertRuleSeverityCritical, - "system_service_rule": testClusterAlertSystemServiceRuleInterface, - } -} - -func TestFlattenClusterAlertRule(t *testing.T) { - - cases := []struct { - Input *managementClient.ClusterAlertRule - ExpectedOutput map[string]interface{} - }{ - { - testClusterAlertRuleConf, - testClusterAlertRuleInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, clusterAlertRuleFields(), map[string]interface{}{}) - err := flattenClusterAlertRule(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - expectedOutput, tc.ExpectedOutput) - } - } -} - -func TestExpandClusterAlertRule(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.ClusterAlertRule - }{ - { - testClusterAlertRuleInterface, - testClusterAlertRuleConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, clusterAlertRuleFields(), tc.Input) - output := expandClusterAlertRule(inputResourceData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_cluster_rke_config_services_kube_api.go b/rancher2/structure_cluster_rke_config_services_kube_api.go index 8614b257..bc1f043f 100644 --- a/rancher2/structure_cluster_rke_config_services_kube_api.go +++ b/rancher2/structure_cluster_rke_config_services_kube_api.go @@ -179,8 +179,6 @@ func flattenClusterRKEConfigServicesKubeAPI(in *managementClient.KubeAPIService) obj["image"] = in.Image } - obj["pod_security_policy"] = in.PodSecurityPolicy - if in.SecretsEncryptionConfig != nil { customConfig, err := flattenClusterRKEConfigServicesKubeAPISecretsEncryptionConfig(in.SecretsEncryptionConfig) if err != nil { @@ -404,10 +402,6 @@ func expandClusterRKEConfigServicesKubeAPI(p []interface{}) (*managementClient.K obj.Image = v } - if v, ok := in["pod_security_policy"].(bool); ok { - obj.PodSecurityPolicy = v - } - if v, ok := in["secrets_encryption_config"].([]interface{}); ok && len(v) > 0 { obj.SecretsEncryptionConfig = expandClusterRKEConfigServicesKubeAPISecretsEncryptionConfig(v) } diff --git a/rancher2/structure_cluster_rke_config_services_kube_api_test.go b/rancher2/structure_cluster_rke_config_services_kube_api_test.go index 5aa1deb9..94c410e3 100644 --- a/rancher2/structure_cluster_rke_config_services_kube_api_test.go +++ b/rancher2/structure_cluster_rke_config_services_kube_api_test.go @@ -129,7 +129,6 @@ func init() { ExtraBinds: []string{"bind_one", "bind_two"}, ExtraEnv: []string{"env_one", "env_two"}, Image: "image", - PodSecurityPolicy: true, SecretsEncryptionConfig: testClusterRKEConfigServicesKubeAPISecretsEncryptionConfigConf, ServiceClusterIPRange: "10.43.0.0/16", ServiceNodePortRange: "30000-32000", @@ -147,7 +146,6 @@ func init() { "extra_binds": []interface{}{"bind_one", "bind_two"}, "extra_env": []interface{}{"env_one", "env_two"}, "image": "image", - "pod_security_policy": true, "secrets_encryption_config": testClusterRKEConfigServicesKubeAPISecretsEncryptionConfigInterface, "service_cluster_ip_range": "10.43.0.0/16", "service_node_port_range": "30000-32000", diff --git a/rancher2/structure_cluster_template.go b/rancher2/structure_cluster_template.go index bf214314..c0764c95 100644 --- a/rancher2/structure_cluster_template.go +++ b/rancher2/structure_cluster_template.go @@ -60,10 +60,6 @@ func flattenClusterSpecBase(in *managementClient.ClusterSpecBase, p []interface{ obj["default_cluster_role_for_project_members"] = in.DefaultClusterRoleForProjectMembers } - if len(in.DefaultPodSecurityPolicyTemplateID) > 0 { - obj["default_pod_security_policy_template_id"] = in.DefaultPodSecurityPolicyTemplateID - } - if len(in.DefaultPodSecurityAdmissionConfigurationTemplateName) > 0 { obj["default_pod_security_admission_configuration_template_name"] = in.DefaultPodSecurityAdmissionConfigurationTemplateName } @@ -80,8 +76,6 @@ func flattenClusterSpecBase(in *managementClient.ClusterSpecBase, p []interface{ obj["docker_root_dir"] = in.DockerRootDir } - obj["enable_cluster_alerting"] = in.EnableClusterAlerting - obj["enable_cluster_monitoring"] = in.EnableClusterMonitoring obj["enable_network_policy"] = *in.EnableNetworkPolicy if in.RancherKubernetesEngineConfig != nil { @@ -296,10 +290,6 @@ func expandClusterSpecBase(p []interface{}) (*managementClient.ClusterSpecBase, obj.DefaultClusterRoleForProjectMembers = v } - if v, ok := in["default_pod_security_policy_template_id"].(string); ok && len(v) > 0 { - obj.DefaultPodSecurityPolicyTemplateID = v - } - if v, ok := in["default_pod_security_admission_configuration_template_name"].(string); ok && len(v) > 0 { obj.DefaultPodSecurityAdmissionConfigurationTemplateName = v } @@ -316,14 +306,6 @@ func expandClusterSpecBase(p []interface{}) (*managementClient.ClusterSpecBase, obj.DockerRootDir = v } - if v, ok := in["enable_cluster_alerting"].(bool); ok { - obj.EnableClusterAlerting = v - } - - if v, ok := in["enable_cluster_monitoring"].(bool); ok { - obj.EnableClusterMonitoring = v - } - if v, ok := in["enable_network_policy"].(bool); ok { obj.EnableNetworkPolicy = &v } diff --git a/rancher2/structure_cluster_template_test.go b/rancher2/structure_cluster_template_test.go index 13d10262..9cca45b1 100644 --- a/rancher2/structure_cluster_template_test.go +++ b/rancher2/structure_cluster_template_test.go @@ -103,28 +103,22 @@ func testClusterTemplate() { } testClusterTemplateRevisionsConfigConf = &managementClient.ClusterSpecBase{ DefaultClusterRoleForProjectMembers: "default_cluster_role_for_project_members", - DefaultPodSecurityPolicyTemplateID: "default_pod_security_policy_template_id", DefaultPodSecurityAdmissionConfigurationTemplateName: "default_pod_security_admission_configuration_template_name", - DesiredAgentImage: "desired_agent_image", - DesiredAuthImage: "desired_auth_image", - DockerRootDir: "docker_root_dir", - EnableClusterAlerting: true, - EnableClusterMonitoring: true, - EnableNetworkPolicy: newTrue(), - LocalClusterAuthEndpoint: testClusterTemplateRevisionsConfigAuthEndpointConf, - RancherKubernetesEngineConfig: testClusterTemplateRevisionsConfigRKEConf, - WindowsPreferedCluster: true, + DesiredAgentImage: "desired_agent_image", + DesiredAuthImage: "desired_auth_image", + DockerRootDir: "docker_root_dir", + EnableNetworkPolicy: newTrue(), + LocalClusterAuthEndpoint: testClusterTemplateRevisionsConfigAuthEndpointConf, + RancherKubernetesEngineConfig: testClusterTemplateRevisionsConfigRKEConf, + WindowsPreferedCluster: true, } testClusterTemplateRevisionsConfigInterface = []interface{}{ map[string]interface{}{ "cluster_auth_endpoint": testClusterTemplateRevisionsConfigAuthEndpointInterface, "default_cluster_role_for_project_members": "default_cluster_role_for_project_members", - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "desired_agent_image": "desired_agent_image", "desired_auth_image": "desired_auth_image", "docker_root_dir": "docker_root_dir", - "enable_cluster_alerting": true, - "enable_cluster_monitoring": true, "enable_network_policy": true, "rke_config": testClusterTemplateRevisionsConfigRKEInterface, "windows_prefered_cluster": true, diff --git a/rancher2/structure_cluster_test.go b/rancher2/structure_cluster_test.go index 4e425f15..70080fef 100644 --- a/rancher2/structure_cluster_test.go +++ b/rancher2/structure_cluster_test.go @@ -265,9 +265,7 @@ func testCluster() { testClusterConfAKS.Description = "description" testClusterConfAKS.Driver = clusterDriverAKS testClusterConfAKS.AgentEnvVars = testClusterEnvVarsConf - testClusterConfAKS.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfAKS.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfAKS.EnableClusterMonitoring = true testClusterConfAKS.EnableNetworkPolicy = newTrue() testClusterConfAKS.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceAKS = map[string]interface{}{ @@ -278,14 +276,12 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverAKS, - "aks_config": testClusterAKSConfigInterface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverAKS, + "aks_config": testClusterAKSConfigInterface, + "system_project_id": "system_project_id", } testClusterConfEKS = &Cluster{ AmazonElasticContainerServiceConfig: testClusterEKSConfigConf, @@ -294,9 +290,7 @@ func testCluster() { testClusterConfEKS.Description = "description" testClusterConfEKS.Driver = clusterDriverEKS testClusterConfEKS.AgentEnvVars = testClusterEnvVarsConf - testClusterConfEKS.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfEKS.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfEKS.EnableClusterMonitoring = true testClusterConfEKS.EnableNetworkPolicy = newTrue() testClusterConfEKS.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceEKS = map[string]interface{}{ @@ -307,14 +301,12 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverEKS, - "eks_config": testClusterEKSConfigInterface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverEKS, + "eks_config": testClusterEKSConfigInterface, + "system_project_id": "system_project_id", } testClusterConfEKSV2 = &Cluster{} testClusterConfEKSV2.EKSConfig = testClusterEKSConfigV2Conf @@ -324,29 +316,25 @@ func testCluster() { testClusterConfEKSV2.AgentEnvVars = testClusterEnvVarsConf testClusterConfEKSV2.ClusterAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf testClusterConfEKSV2.FleetAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf - testClusterConfEKSV2.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfEKSV2.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfEKSV2.EnableClusterMonitoring = true testClusterConfEKSV2.EnableNetworkPolicy = newTrue() testClusterConfEKSV2.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceEKSV2 = map[string]interface{}{ - "id": "id", - "name": "test", - "agent_env_vars": testClusterEnvVarsInterface, - "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "default_project_id": "default_project_id", - "description": "description", - "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, - "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", + "id": "id", + "name": "test", + "agent_env_vars": testClusterEnvVarsInterface, + "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "default_project_id": "default_project_id", + "description": "description", + "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, + "cluster_registration_token": testClusterRegistrationTokenInterface, "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverEKSV2, - "eks_config_v2": testClusterEKSConfigV2Interface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverEKSV2, + "eks_config_v2": testClusterEKSConfigV2Interface, + "system_project_id": "system_project_id", } testClusterConfGKE = &Cluster{ GoogleKubernetesEngineConfig: testClusterGKEConfigConf, @@ -355,9 +343,7 @@ func testCluster() { testClusterConfGKE.Description = "description" testClusterConfGKE.Driver = clusterDriverGKE testClusterConfGKE.AgentEnvVars = testClusterEnvVarsConf - testClusterConfGKE.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfGKE.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfGKE.EnableClusterMonitoring = true testClusterConfGKE.EnableNetworkPolicy = newTrue() testClusterConfGKE.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceGKE = map[string]interface{}{ @@ -368,14 +354,12 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverGKE, - "gke_config": testClusterGKEConfigInterface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverGKE, + "gke_config": testClusterGKEConfigInterface, + "system_project_id": "system_project_id", } testClusterConfK3S = &Cluster{} testClusterConfK3S.Name = "test" @@ -383,9 +367,7 @@ func testCluster() { testClusterConfK3S.K3sConfig = testClusterK3SConfigConf testClusterConfK3S.Driver = clusterDriverK3S testClusterConfK3S.AgentEnvVars = testClusterEnvVarsConf - testClusterConfK3S.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfK3S.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfK3S.EnableClusterMonitoring = true testClusterConfK3S.EnableNetworkPolicy = newTrue() testClusterConfK3S.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceK3S = map[string]interface{}{ @@ -396,15 +378,13 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverK3S, - "k3s_config": testClusterK3SConfigInterface, - "system_project_id": "system_project_id", - "windows_prefered_cluster": false, + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverK3S, + "k3s_config": testClusterK3SConfigInterface, + "system_project_id": "system_project_id", + "windows_prefered_cluster": false, } testClusterConfGKEV2 = &Cluster{} testClusterConfGKEV2.GKEConfig = testClusterGKEConfigV2Conf @@ -412,9 +392,7 @@ func testCluster() { testClusterConfGKEV2.Description = "description" testClusterConfGKEV2.Driver = clusterDriverGKEV2 testClusterConfGKEV2.AgentEnvVars = testClusterEnvVarsConf - testClusterConfGKEV2.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfGKEV2.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfGKEV2.EnableClusterMonitoring = true testClusterConfGKEV2.EnableNetworkPolicy = newTrue() testClusterConfGKEV2.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceGKEV2 = map[string]interface{}{ @@ -425,14 +403,12 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverGKEV2, - "gke_config_v2": testClusterGKEConfigV2Interface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverGKEV2, + "gke_config_v2": testClusterGKEConfigV2Interface, + "system_project_id": "system_project_id", } testClusterConfOKE = &Cluster{ OracleKubernetesEngineConfig: testClusterOKEConfigConf, @@ -441,9 +417,7 @@ func testCluster() { testClusterConfOKE.Description = "description" testClusterConfOKE.Driver = clusterOKEKind testClusterConfOKE.AgentEnvVars = testClusterEnvVarsConf - testClusterConfOKE.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfOKE.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfOKE.EnableClusterMonitoring = true testClusterConfOKE.EnableNetworkPolicy = newTrue() testClusterConfOKE.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceOKE = map[string]interface{}{ @@ -454,14 +428,12 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterOKEKind, - "oke_config": testClusterOKEConfigInterface, - "system_project_id": "system_project_id", + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterOKEKind, + "oke_config": testClusterOKEConfigInterface, + "system_project_id": "system_project_id", } testClusterConfRKE = &Cluster{} testClusterConfRKE.Name = "test" @@ -471,32 +443,28 @@ func testCluster() { testClusterConfRKE.AgentEnvVars = testClusterEnvVarsConf testClusterConfRKE.ClusterAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf testClusterConfRKE.FleetAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf - testClusterConfRKE.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfRKE.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" testClusterConfRKE.FleetWorkspaceName = "fleet-test" - testClusterConfRKE.EnableClusterMonitoring = true testClusterConfRKE.EnableNetworkPolicy = newTrue() testClusterConfRKE.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceRKE = map[string]interface{}{ - "id": "id", - "name": "test", - "agent_env_vars": testClusterEnvVarsInterface, - "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "default_project_id": "default_project_id", - "description": "description", - "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, - "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", + "id": "id", + "name": "test", + "agent_env_vars": testClusterEnvVarsInterface, + "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "default_project_id": "default_project_id", + "description": "description", + "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, + "cluster_registration_token": testClusterRegistrationTokenInterface, "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "fleet_workspace_name": "fleet-test", - "kube_config": "kube_config", - "driver": clusterDriverRKE, - "rke_config": testClusterRKEConfigInterface, - "system_project_id": "system_project_id", - "windows_prefered_cluster": false, + "enable_network_policy": true, + "fleet_workspace_name": "fleet-test", + "kube_config": "kube_config", + "driver": clusterDriverRKE, + "rke_config": testClusterRKEConfigInterface, + "system_project_id": "system_project_id", + "windows_prefered_cluster": false, } testClusterConfRKE2 = &Cluster{} testClusterConfRKE2.Name = "test" @@ -506,30 +474,26 @@ func testCluster() { testClusterConfRKE2.AgentEnvVars = testClusterEnvVarsConf testClusterConfRKE2.ClusterAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf testClusterConfRKE2.FleetAgentDeploymentCustomization = testClusterAgentDeploymentCustomizationConf - testClusterConfRKE2.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfRKE2.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfRKE2.EnableClusterMonitoring = true testClusterConfRKE2.EnableNetworkPolicy = newTrue() testClusterConfRKE2.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceRKE2 = map[string]interface{}{ - "id": "id", - "name": "test", - "agent_env_vars": testClusterEnvVarsInterface, - "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, - "default_project_id": "default_project_id", - "description": "description", - "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, - "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", + "id": "id", + "name": "test", + "agent_env_vars": testClusterEnvVarsInterface, + "cluster_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "fleet_agent_deployment_customization": testClusterAgentDeploymentCustomizationInterface, + "default_project_id": "default_project_id", + "description": "description", + "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, + "cluster_registration_token": testClusterRegistrationTokenInterface, "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverRKE2, - "rke2_config": testClusterRKE2ConfigInterface, - "system_project_id": "system_project_id", - "windows_prefered_cluster": false, + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverRKE2, + "rke2_config": testClusterRKE2ConfigInterface, + "system_project_id": "system_project_id", + "windows_prefered_cluster": false, } testClusterConfTemplate = &Cluster{} testClusterConfTemplate.Name = "test" @@ -540,10 +504,7 @@ func testCluster() { testClusterConfTemplate.ClusterTemplateRevisionID = "cluster_template_revision_id" testClusterConfTemplate.Driver = clusterDriverRKE testClusterConfTemplate.AgentEnvVars = testClusterEnvVarsConf - testClusterConfTemplate.DefaultPodSecurityPolicyTemplateID = "default_pod_security_policy_template_id" testClusterConfTemplate.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" - testClusterConfTemplate.EnableClusterAlerting = true - testClusterConfTemplate.EnableClusterMonitoring = true testClusterConfTemplate.EnableNetworkPolicy = newTrue() testClusterConfTemplate.LocalClusterAuthEndpoint = testLocalClusterAuthEndpointConf testClusterInterfaceTemplate = map[string]interface{}{ @@ -554,20 +515,17 @@ func testCluster() { "description": "description", "cluster_auth_endpoint": testLocalClusterAuthEndpointInterface, "cluster_registration_token": testClusterRegistrationTokenInterface, - "default_pod_security_policy_template_id": "default_pod_security_policy_template_id", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", - "enable_cluster_alerting": true, - "enable_cluster_monitoring": true, - "enable_network_policy": true, - "kube_config": "kube_config", - "driver": clusterDriverRKE, - "cluster_template_answers": testClusterAnswersInterface, - "cluster_template_id": "cluster_template_id", - "cluster_template_questions": testClusterQuestionsInterface, - "cluster_template_revision_id": "cluster_template_revision_id", - "rke_config": []interface{}{}, - "system_project_id": "system_project_id", - "windows_prefered_cluster": false, + "enable_network_policy": true, + "kube_config": "kube_config", + "driver": clusterDriverRKE, + "cluster_template_answers": testClusterAnswersInterface, + "cluster_template_id": "cluster_template_id", + "cluster_template_questions": testClusterQuestionsInterface, + "cluster_template_revision_id": "cluster_template_revision_id", + "rke_config": []interface{}{}, + "system_project_id": "system_project_id", + "windows_prefered_cluster": false, } } @@ -659,7 +617,7 @@ func TestFlattenCluster(t *testing.T) { for _, tc := range cases { output := schema.TestResourceDataRaw(t, clusterFields(), map[string]interface{}{}) tc.InputToken.ID = "id" - err := flattenCluster(output, tc.Input, tc.InputToken, tc.InputKube, tc.ExpectedOutput["default_project_id"].(string), tc.ExpectedOutput["system_project_id"].(string), nil) + err := flattenCluster(output, tc.Input, tc.InputToken, tc.InputKube, tc.ExpectedOutput["default_project_id"].(string), tc.ExpectedOutput["system_project_id"].(string)) if err != nil { assert.FailNow(t, "[ERROR] on flattener: %#v", err) } @@ -808,7 +766,7 @@ func TestFlattenClusterWithPreservedClusterTemplateAnswers(t *testing.T) { }, }) tc.InputToken.ID = "id" - err := flattenCluster(output, tc.Input, tc.InputToken, tc.InputKube, tc.ExpectedOutput["default_project_id"].(string), tc.ExpectedOutput["system_project_id"].(string), nil) + err := flattenCluster(output, tc.Input, tc.InputToken, tc.InputKube, tc.ExpectedOutput["default_project_id"].(string), tc.ExpectedOutput["system_project_id"].(string)) if err != nil { assert.FailNow(t, "[ERROR] on flattener: %#v", err) } diff --git a/rancher2/structure_cluster_v2.go b/rancher2/structure_cluster_v2.go index 41cc36c0..3444e33d 100644 --- a/rancher2/structure_cluster_v2.go +++ b/rancher2/structure_cluster_v2.go @@ -65,9 +65,6 @@ func flattenClusterV2(d *schema.ResourceData, in *ClusterV2) error { if in.Spec.FleetAgentDeploymentCustomization != nil { d.Set("fleet_agent_deployment_customization", flattenAgentDeploymentCustomizationV2(in.Spec.FleetAgentDeploymentCustomization)) } - if len(in.Spec.DefaultPodSecurityPolicyTemplateName) > 0 { - d.Set("default_pod_security_policy_template_name", in.Spec.DefaultPodSecurityPolicyTemplateName) - } if len(in.Spec.DefaultPodSecurityAdmissionConfigurationTemplateName) > 0 { d.Set("default_pod_security_admission_configuration_template_name", in.Spec.DefaultPodSecurityAdmissionConfigurationTemplateName) } @@ -142,9 +139,6 @@ func expandClusterV2(in *schema.ResourceData) (*ClusterV2, error) { if v, ok := in.Get("cloud_credential_secret_name").(string); ok && len(v) > 0 { obj.Spec.CloudCredentialSecretName = v } - if v, ok := in.Get("default_pod_security_policy_template_name").(string); ok && len(v) > 0 { - obj.Spec.DefaultPodSecurityPolicyTemplateName = v - } if v, ok := in.Get("default_pod_security_admission_configuration_template_name").(string); ok && len(v) > 0 { obj.Spec.DefaultPodSecurityAdmissionConfigurationTemplateName = v } diff --git a/rancher2/structure_cluster_v2_test.go b/rancher2/structure_cluster_v2_test.go index 72974241..3988ce42 100644 --- a/rancher2/structure_cluster_v2_test.go +++ b/rancher2/structure_cluster_v2_test.go @@ -61,7 +61,6 @@ func init() { testClusterV2Conf.Spec.RKEConfig = testClusterV2RKEConfigConf testClusterV2Conf.Spec.AgentEnvVars = testClusterV2EnvVarConf testClusterV2Conf.Spec.CloudCredentialSecretName = "cloud_credential_secret_name" - testClusterV2Conf.Spec.DefaultPodSecurityPolicyTemplateName = "default_pod_security_policy_template_name" testClusterV2Conf.Spec.DefaultPodSecurityAdmissionConfigurationTemplateName = "default_pod_security_admission_configuration_template_name" testClusterV2Conf.Spec.DefaultClusterRoleForProjectMembers = "default_cluster_role_for_project_members" testClusterV2Conf.Spec.EnableNetworkPolicy = newTrue() @@ -153,16 +152,15 @@ func init() { } testClusterV2Interface = map[string]interface{}{ - "name": "name", - "fleet_namespace": "fleet_namespace", - "kubernetes_version": "kubernetes_version", - "local_auth_endpoint": testClusterV2LocalAuthEndpointInterface, - "rke_config": testClusterV2RKEConfigInterface, - "agent_env_vars": testClusterV2EnvVarInterface, - "cluster_agent_deployment_customization": testClusterV2AgentCustomizationInterface, - "fleet_agent_deployment_customization": testClusterV2AgentCustomizationInterface, - "cloud_credential_secret_name": "cloud_credential_secret_name", - "default_pod_security_policy_template_name": "default_pod_security_policy_template_name", + "name": "name", + "fleet_namespace": "fleet_namespace", + "kubernetes_version": "kubernetes_version", + "local_auth_endpoint": testClusterV2LocalAuthEndpointInterface, + "rke_config": testClusterV2RKEConfigInterface, + "agent_env_vars": testClusterV2EnvVarInterface, + "cluster_agent_deployment_customization": testClusterV2AgentCustomizationInterface, + "fleet_agent_deployment_customization": testClusterV2AgentCustomizationInterface, + "cloud_credential_secret_name": "cloud_credential_secret_name", "default_pod_security_admission_configuration_template_name": "default_pod_security_admission_configuration_template_name", "default_cluster_role_for_project_members": "default_cluster_role_for_project_members", "enable_network_policy": true, diff --git a/rancher2/structure_monitoring_input.go b/rancher2/structure_monitoring_input.go deleted file mode 100644 index 04866d66..00000000 --- a/rancher2/structure_monitoring_input.go +++ /dev/null @@ -1,53 +0,0 @@ -package rancher2 - -import ( - "reflect" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -const ( - monitoringInputAnnotation = "field.cattle.io/overwriteAppAnswers" - monitoringActionDisable = "disableMonitoring" - monitoringActionEdit = "editMonitoring" - monitoringActionEnable = "enableMonitoring" -) - -// Flatteners - -func flattenMonitoringInput(in *managementClient.MonitoringInput) []interface{} { - if in == nil || reflect.DeepEqual(in, &managementClient.MonitoringInput{}) { - return []interface{}{} - } - obj := map[string]interface{}{} - - if len(in.Answers) > 0 { - obj["answers"] = toMapInterface(in.Answers) - } - - if len(in.Version) > 0 { - obj["version"] = in.Version - } - - return []interface{}{obj} -} - -// Expanders - -func expandMonitoringInput(p []interface{}) *managementClient.MonitoringInput { - if len(p) == 0 || p[0] == nil { - return nil - } - obj := &managementClient.MonitoringInput{} - in := p[0].(map[string]interface{}) - - if v, ok := in["answers"].(map[string]interface{}); ok && len(v) > 0 { - obj.Answers = toMapString(v) - } - - if v, ok := in["version"].(string); ok && len(v) > 0 { - obj.Version = v - } - - return obj -} diff --git a/rancher2/structure_monitoring_input_test.go b/rancher2/structure_monitoring_input_test.go deleted file mode 100644 index 8f118a14..00000000 --- a/rancher2/structure_monitoring_input_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testMonitoringInputConf *managementClient.MonitoringInput - testMonitoringInputInterface []interface{} -) - -func init() { - testMonitoringInputConf = &managementClient.MonitoringInput{ - Answers: map[string]string{ - "answer_one": "one", - "answer_two": "two", - }, - } - testMonitoringInputInterface = []interface{}{ - map[string]interface{}{ - "answers": map[string]interface{}{ - "answer_one": "one", - "answer_two": "two", - }, - }, - } -} - -func TestFlattenMonitoringInput(t *testing.T) { - - cases := []struct { - Input *managementClient.MonitoringInput - ExpectedOutput []interface{} - }{ - { - testMonitoringInputConf, - testMonitoringInputInterface, - }, - } - for _, tc := range cases { - output := flattenMonitoringInput(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandMonitoringInput(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.MonitoringInput - }{ - { - testMonitoringInputInterface, - testMonitoringInputConf, - }, - } - for _, tc := range cases { - output := expandMonitoringInput(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier.go b/rancher2/structure_notifier.go deleted file mode 100644 index 3d8ce77e..00000000 --- a/rancher2/structure_notifier.go +++ /dev/null @@ -1,164 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifier(d *schema.ResourceData, in *managementClient.Notifier) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("cluster_id", in.ClusterID) - d.Set("name", in.Name) - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - d.Set("send_resolved", in.SendResolved) - - if in.DingtalkConfig != nil { - v, ok := d.Get("dingtalk_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("dingtalk_config", flattenNotifierDingtalkConfig(in.DingtalkConfig, v)) - } - - if in.MSTeamsConfig != nil { - v, ok := d.Get("msteams_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("msteams_config", flattenNotifierMSTeamsConfig(in.MSTeamsConfig, v)) - } - - if in.PagerdutyConfig != nil { - v, ok := d.Get("pagerduty_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("pagerduty_config", flattenNotifierPagerdutyConfig(in.PagerdutyConfig, v)) - } - - if in.SlackConfig != nil { - v, ok := d.Get("slack_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("slack_config", flattenNotifierSlackConfig(in.SlackConfig, v)) - } - - if in.SMTPConfig != nil { - v, ok := d.Get("smtp_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("smtp_config", flattenNotifierSMTPConfig(in.SMTPConfig, v)) - } - - if in.WebhookConfig != nil { - v, ok := d.Get("webhook_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("webhook_config", flattenNotifierWebhookConfig(in.WebhookConfig, v)) - } - - if in.WechatConfig != nil { - v, ok := d.Get("wechat_config").([]interface{}) - if !ok { - v = []interface{}{} - } - - d.Set("wechat_config", flattenNotifierWechatConfig(in.WechatConfig, v)) - } - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - - return nil - -} - -// Expanders - -func expandNotifier(in *schema.ResourceData) (*managementClient.Notifier, error) { - obj := &managementClient.Notifier{} - if in == nil { - return nil, fmt.Errorf("[ERROR] Expanding notifier: Schema Resource data is nil") - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - obj.ClusterID = in.Get("cluster_id").(string) - obj.Name = in.Get("name").(string) - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - if v, ok := in.Get("send_resolved").(bool); ok { - obj.SendResolved = v - } - - if v, ok := in.Get("dingtalk_config").([]interface{}); ok && len(v) > 0 { - obj.DingtalkConfig = expandNotifierDingtalkConfig(v) - } - - if v, ok := in.Get("msteams_config").([]interface{}); ok && len(v) > 0 { - obj.MSTeamsConfig = expandNotifierMSTeamsConfig(v) - } - - if v, ok := in.Get("pagerduty_config").([]interface{}); ok && len(v) > 0 { - obj.PagerdutyConfig = expandNotifierPagerdutyConfig(v) - } - - if v, ok := in.Get("slack_config").([]interface{}); ok && len(v) > 0 { - obj.SlackConfig = expandNotifierSlackConfig(v) - } - - if v, ok := in.Get("smtp_config").([]interface{}); ok && len(v) > 0 { - obj.SMTPConfig = expandNotifierSMTPConfig(v) - } - - if v, ok := in.Get("webhook_config").([]interface{}); ok && len(v) > 0 { - obj.WebhookConfig = expandNotifierWebhookConfig(v) - } - - if v, ok := in.Get("wechat_config").([]interface{}); ok && len(v) > 0 { - obj.WechatConfig = expandNotifierWechatConfig(v) - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj, nil -} diff --git a/rancher2/structure_notifier_dingtalk_config.go b/rancher2/structure_notifier_dingtalk_config.go deleted file mode 100644 index 673b2e4d..00000000 --- a/rancher2/structure_notifier_dingtalk_config.go +++ /dev/null @@ -1,56 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierDingtalkConfig(in *managementClient.DingtalkConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["url"] = in.URL - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - if len(in.Secret) > 0 { - obj["secret"] = in.Secret - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierDingtalkConfig(p []interface{}) *managementClient.DingtalkConfig { - obj := &managementClient.DingtalkConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.URL = in["url"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - if v, ok := in["secret"].(string); ok && len(v) > 0 { - obj.Secret = v - } - - return obj -} diff --git a/rancher2/structure_notifier_dingtalk_config_test.go b/rancher2/structure_notifier_dingtalk_config_test.go deleted file mode 100644 index 11a5c8b2..00000000 --- a/rancher2/structure_notifier_dingtalk_config_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierDingtalkConfigConf *managementClient.DingtalkConfig - testNotifierDingtalkConfigInterface []interface{} -) - -func init() { - testNotifierDingtalkConfigConf = &managementClient.DingtalkConfig{ - URL: "url", - ProxyURL: "proxy_url", - Secret: "secret", - } - testNotifierDingtalkConfigInterface = []interface{}{ - map[string]interface{}{ - "url": "url", - "proxy_url": "proxy_url", - "secret": "secret", - }, - } -} - -func TestFlattenNotifierDingtalkConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.DingtalkConfig - ExpectedOutput []interface{} - }{ - { - testNotifierDingtalkConfigConf, - testNotifierDingtalkConfigInterface, - }, - } - for _, tc := range cases { - output := flattenNotifierDingtalkConfig(tc.Input, tc.ExpectedOutput) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierDingtalkConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.DingtalkConfig - }{ - { - testNotifierDingtalkConfigInterface, - testNotifierDingtalkConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierDingtalkConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_msteams_config.go b/rancher2/structure_notifier_msteams_config.go deleted file mode 100644 index 97b2a6c7..00000000 --- a/rancher2/structure_notifier_msteams_config.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierMSTeamsConfig(in *managementClient.MSTeamsConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["url"] = in.URL - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierMSTeamsConfig(p []interface{}) *managementClient.MSTeamsConfig { - obj := &managementClient.MSTeamsConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.URL = in["url"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - return obj -} diff --git a/rancher2/structure_notifier_msteams_config_test.go b/rancher2/structure_notifier_msteams_config_test.go deleted file mode 100644 index 9f6d6e9f..00000000 --- a/rancher2/structure_notifier_msteams_config_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierMSTeamsConfigConf *managementClient.MSTeamsConfig - testNotifierMSTeamsConfigInterface []interface{} -) - -func init() { - testNotifierMSTeamsConfigConf = &managementClient.MSTeamsConfig{ - URL: "url", - ProxyURL: "proxy_url", - } - testNotifierMSTeamsConfigInterface = []interface{}{ - map[string]interface{}{ - "url": "url", - "proxy_url": "proxy_url", - }, - } -} - -func TestFlattenNotifierMSTeamsConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.MSTeamsConfig - ExpectedOutput []interface{} - }{ - { - testNotifierMSTeamsConfigConf, - testNotifierMSTeamsConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierMSTeamsConfig(tc.Input, tc.ExpectedOutput) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierMSTeamsConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.MSTeamsConfig - }{ - { - testNotifierMSTeamsConfigInterface, - testNotifierMSTeamsConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierMSTeamsConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_pagerduty_config.go b/rancher2/structure_notifier_pagerduty_config.go deleted file mode 100644 index 78a62622..00000000 --- a/rancher2/structure_notifier_pagerduty_config.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierPagerdutyConfig(in *managementClient.PagerdutyConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["service_key"] = in.ServiceKey - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierPagerdutyConfig(p []interface{}) *managementClient.PagerdutyConfig { - obj := &managementClient.PagerdutyConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.ServiceKey = in["service_key"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - return obj -} diff --git a/rancher2/structure_notifier_pagerduty_config_test.go b/rancher2/structure_notifier_pagerduty_config_test.go deleted file mode 100644 index 98f1289a..00000000 --- a/rancher2/structure_notifier_pagerduty_config_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierPagerdutyConfigConf *managementClient.PagerdutyConfig - testNotifierPagerdutyConfigInterface []interface{} -) - -func init() { - testNotifierPagerdutyConfigConf = &managementClient.PagerdutyConfig{ - ServiceKey: "service_key", - ProxyURL: "proxy_url", - } - testNotifierPagerdutyConfigInterface = []interface{}{ - map[string]interface{}{ - "service_key": "service_key", - "proxy_url": "proxy_url", - }, - } -} - -func TestFlattenNotifierPagerdutyConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.PagerdutyConfig - ExpectedOutput []interface{} - }{ - { - testNotifierPagerdutyConfigConf, - testNotifierPagerdutyConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierPagerdutyConfig(tc.Input, testNotifierPagerdutyConfigInterface) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierPagerdutyConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.PagerdutyConfig - }{ - { - testNotifierPagerdutyConfigInterface, - testNotifierPagerdutyConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierPagerdutyConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_slack_config.go b/rancher2/structure_notifier_slack_config.go deleted file mode 100644 index 261d46b7..00000000 --- a/rancher2/structure_notifier_slack_config.go +++ /dev/null @@ -1,50 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierSlackConfig(in *managementClient.SlackConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["default_recipient"] = in.DefaultRecipient - obj["url"] = in.URL - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierSlackConfig(p []interface{}) *managementClient.SlackConfig { - obj := &managementClient.SlackConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.DefaultRecipient = in["default_recipient"].(string) - obj.URL = in["url"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - return obj -} diff --git a/rancher2/structure_notifier_slack_config_test.go b/rancher2/structure_notifier_slack_config_test.go deleted file mode 100644 index 26e173a2..00000000 --- a/rancher2/structure_notifier_slack_config_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierSlackConfigConf *managementClient.SlackConfig - testNotifierSlackConfigInterface []interface{} -) - -func init() { - testNotifierSlackConfigConf = &managementClient.SlackConfig{ - DefaultRecipient: "default_recipient", - URL: "url", - ProxyURL: "proxy_url", - } - testNotifierSlackConfigInterface = []interface{}{ - map[string]interface{}{ - "default_recipient": "default_recipient", - "url": "url", - "proxy_url": "proxy_url", - }, - } -} - -func TestFlattenNotifierSlackConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.SlackConfig - ExpectedOutput []interface{} - }{ - { - testNotifierSlackConfigConf, - testNotifierSlackConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierSlackConfig(tc.Input, testNotifierSlackConfigInterface) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierSlackConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SlackConfig - }{ - { - testNotifierSlackConfigInterface, - testNotifierSlackConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierSlackConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_smtp_config.go b/rancher2/structure_notifier_smtp_config.go deleted file mode 100644 index 049ed6f2..00000000 --- a/rancher2/structure_notifier_smtp_config.go +++ /dev/null @@ -1,68 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierSMTPConfig(in *managementClient.SMTPConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["default_recipient"] = in.DefaultRecipient - obj["host"] = in.Host - obj["port"] = int(in.Port) - obj["sender"] = in.Sender - - if len(in.Password) > 0 { - obj["password"] = in.Password - } - - obj["tls"] = *in.TLS - - if len(in.Username) > 0 { - obj["username"] = in.Username - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierSMTPConfig(p []interface{}) *managementClient.SMTPConfig { - obj := &managementClient.SMTPConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.DefaultRecipient = in["default_recipient"].(string) - obj.Host = in["host"].(string) - obj.Port = int64(in["port"].(int)) - obj.Sender = in["sender"].(string) - - if v, ok := in["password"].(string); ok && len(v) > 0 { - obj.Password = v - } - - if v, ok := in["tls"].(bool); ok { - obj.TLS = &v - } - - if v, ok := in["username"].(string); ok && len(v) > 0 { - obj.Username = v - } - - return obj -} diff --git a/rancher2/structure_notifier_smtp_config_test.go b/rancher2/structure_notifier_smtp_config_test.go deleted file mode 100644 index f5367b2c..00000000 --- a/rancher2/structure_notifier_smtp_config_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierSMTPConfigConf *managementClient.SMTPConfig - testNotifierSMTPConfigInterface []interface{} -) - -func init() { - testNotifierSMTPConfigConf = &managementClient.SMTPConfig{ - DefaultRecipient: "default_recipient", - Host: "url", - Port: int64(25), - Sender: "sender", - Password: "password", - TLS: newTrue(), - Username: "username", - } - testNotifierSMTPConfigInterface = []interface{}{ - map[string]interface{}{ - "default_recipient": "default_recipient", - "host": "host", - "port": 25, - "sender": "sender", - "password": "password", - "tls": newTrue(), - "username": "username", - }, - } -} - -func TestFlattenNotifierSMTPConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.SMTPConfig - ExpectedOutput []interface{} - }{ - { - testNotifierSMTPConfigConf, - testNotifierSMTPConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierSMTPConfig(tc.Input, testNotifierSMTPConfigInterface) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierSMTPConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SMTPConfig - }{ - { - testNotifierSMTPConfigInterface, - testNotifierSMTPConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierSMTPConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_webhook_config.go b/rancher2/structure_notifier_webhook_config.go deleted file mode 100644 index caa65a25..00000000 --- a/rancher2/structure_notifier_webhook_config.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierWebhookConfig(in *managementClient.WebhookConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["url"] = in.URL - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierWebhookConfig(p []interface{}) *managementClient.WebhookConfig { - obj := &managementClient.WebhookConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.URL = in["url"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - return obj -} diff --git a/rancher2/structure_notifier_webhook_config_test.go b/rancher2/structure_notifier_webhook_config_test.go deleted file mode 100644 index c79282cf..00000000 --- a/rancher2/structure_notifier_webhook_config_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierWebhookConfigConf *managementClient.WebhookConfig - testNotifierWebhookConfigInterface []interface{} -) - -func init() { - testNotifierWebhookConfigConf = &managementClient.WebhookConfig{ - URL: "url", - ProxyURL: "proxy_url", - } - testNotifierWebhookConfigInterface = []interface{}{ - map[string]interface{}{ - "url": "url", - "proxy_url": "proxy_url", - }, - } -} - -func TestFlattenNotifierWebhookConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.WebhookConfig - ExpectedOutput []interface{} - }{ - { - testNotifierWebhookConfigConf, - testNotifierWebhookConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierWebhookConfig(tc.Input, testNotifierWebhookConfigInterface) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierWebhookConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.WebhookConfig - }{ - { - testNotifierWebhookConfigInterface, - testNotifierWebhookConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierWebhookConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_wechat_config.go b/rancher2/structure_notifier_wechat_config.go deleted file mode 100644 index 129dd172..00000000 --- a/rancher2/structure_notifier_wechat_config.go +++ /dev/null @@ -1,61 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenNotifierWechatConfig(in *managementClient.WechatConfig, p []interface{}) []interface{} { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{} - } - - obj["agent"] = in.Agent - obj["corp"] = in.Corp - obj["default_recipient"] = in.DefaultRecipient - - if len(in.Secret) > 0 { - obj["secret"] = in.Secret - } - - if len(in.ProxyURL) > 0 { - obj["proxy_url"] = in.ProxyURL - } - - obj["recipient_type"] = in.RecipientType - - return []interface{}{obj} - -} - -// Expanders - -func expandNotifierWechatConfig(p []interface{}) *managementClient.WechatConfig { - obj := &managementClient.WechatConfig{} - - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - obj.Agent = in["agent"].(string) - obj.Corp = in["corp"].(string) - obj.DefaultRecipient = in["default_recipient"].(string) - obj.Secret = in["secret"].(string) - - if v, ok := in["proxy_url"].(string); ok && len(v) > 0 { - obj.ProxyURL = v - } - - obj.RecipientType = in["recipient_type"].(string) - - return obj -} diff --git a/rancher2/structure_notifier_wechat_config_test.go b/rancher2/structure_notifier_wechat_config_test.go deleted file mode 100644 index 89d180c6..00000000 --- a/rancher2/structure_notifier_wechat_config_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierWechatConfigConf *managementClient.WechatConfig - testNotifierWechatConfigInterface []interface{} -) - -func init() { - testNotifierWechatConfigConf = &managementClient.WechatConfig{ - Agent: "agent", - Corp: "corp", - DefaultRecipient: "default_recipient", - Secret: "secret", - ProxyURL: "proxy_url", - RecipientType: "recipient_type", - } - testNotifierWechatConfigInterface = []interface{}{ - map[string]interface{}{ - "agent": "agent", - "corp": "corp", - "default_recipient": "default_recipient", - "secret": "secret", - "proxy_url": "proxy_url", - "recipient_type": "recipient_type", - }, - } -} - -func TestFlattenNotifierWechatConfig(t *testing.T) { - - cases := []struct { - Input *managementClient.WechatConfig - ExpectedOutput []interface{} - }{ - { - testNotifierWechatConfigConf, - testNotifierWechatConfigInterface, - }, - } - - for _, tc := range cases { - output := flattenNotifierWechatConfig(tc.Input, testNotifierWechatConfigInterface) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandNotifierWechatConfig(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.WechatConfig - }{ - { - testNotifierWechatConfigInterface, - testNotifierWechatConfigConf, - }, - } - - for _, tc := range cases { - output := expandNotifierWechatConfig(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_notifier_z_test.go b/rancher2/structure_notifier_z_test.go deleted file mode 100644 index e86e6ee4..00000000 --- a/rancher2/structure_notifier_z_test.go +++ /dev/null @@ -1,213 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testNotifierDingtalkConf *managementClient.Notifier - testNotifierDingtalkInterface map[string]interface{} - testNotifierMSTeamsConf *managementClient.Notifier - testNotifierMSTeamsInterface map[string]interface{} - testNotifierPagerdutyConf *managementClient.Notifier - testNotifierPagerdutyInterface map[string]interface{} - testNotifierSlackConf *managementClient.Notifier - testNotifierSlackInterface map[string]interface{} - testNotifierSMTPConf *managementClient.Notifier - testNotifierSMTPInterface map[string]interface{} - testNotifierWebhookConf *managementClient.Notifier - testNotifierWebhookInterface map[string]interface{} - testNotifierWechatConf *managementClient.Notifier - testNotifierWechatInterface map[string]interface{} -) - -func init() { - testNotifierDingtalkConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - DingtalkConfig: testNotifierDingtalkConfigConf, - } - testNotifierDingtalkInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "dingtalk_config": testNotifierDingtalkConfigInterface, - } - testNotifierMSTeamsConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - MSTeamsConfig: testNotifierMSTeamsConfigConf, - } - testNotifierMSTeamsInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "msteams_config": testNotifierMSTeamsConfigInterface, - } - testNotifierPagerdutyConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - PagerdutyConfig: testNotifierPagerdutyConfigConf, - } - testNotifierPagerdutyInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "pagerduty_config": testNotifierPagerdutyConfigInterface, - } - testNotifierSlackConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - SlackConfig: testNotifierSlackConfigConf, - } - testNotifierSlackInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "slack_config": testNotifierSlackConfigInterface, - } - testNotifierSMTPConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - SMTPConfig: testNotifierSMTPConfigConf, - } - testNotifierSMTPInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "smtp_config": testNotifierSMTPConfigInterface, - } - testNotifierWebhookConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - WebhookConfig: testNotifierWebhookConfigConf, - } - testNotifierWebhookInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "webhook_config": testNotifierWebhookConfigInterface, - } - testNotifierWechatConf = &managementClient.Notifier{ - Name: "name", - ClusterID: "cluster_id", - Description: "description", - WechatConfig: testNotifierWechatConfigConf, - } - testNotifierWechatInterface = map[string]interface{}{ - "name": "name", - "cluster_id": "cluster_id", - "description": "description", - "wechat_config": testNotifierWechatConfigInterface, - } -} - -func TestFlattenNotifier(t *testing.T) { - - cases := []struct { - Input *managementClient.Notifier - ExpectedOutput map[string]interface{} - }{ - { - testNotifierDingtalkConf, - testNotifierDingtalkInterface, - }, - { - testNotifierMSTeamsConf, - testNotifierMSTeamsInterface, - }, - { - testNotifierPagerdutyConf, - testNotifierPagerdutyInterface, - }, - { - testNotifierSlackConf, - testNotifierSlackInterface, - }, - { - testNotifierSMTPConf, - testNotifierSMTPInterface, - }, - { - testNotifierWebhookConf, - testNotifierWebhookInterface, - }, - { - testNotifierWechatConf, - testNotifierWechatInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, notifierFields(), map[string]interface{}{}) - err := flattenNotifier(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - tc.ExpectedOutput, expectedOutput) - } - } -} - -func TestExpandNotifier(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.Notifier - }{ - { - testNotifierDingtalkInterface, - testNotifierDingtalkConf, - }, - { - testNotifierMSTeamsInterface, - testNotifierMSTeamsConf, - }, - { - testNotifierPagerdutyInterface, - testNotifierPagerdutyConf, - }, - { - testNotifierSlackInterface, - testNotifierSlackConf, - }, - { - testNotifierSMTPInterface, - testNotifierSMTPConf, - }, - { - testNotifierWebhookInterface, - testNotifierWebhookConf, - }, - { - testNotifierWechatInterface, - testNotifierWechatConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, notifierFields(), tc.Input) - output, err := expandNotifier(inputResourceData) - if err != nil { - assert.FailNow(t, "[ERROR] on expander: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_allowed_csi_drivers.go b/rancher2/structure_pod_security_policy_allowed_csi_drivers.go deleted file mode 100644 index 0f34b405..00000000 --- a/rancher2/structure_pod_security_policy_allowed_csi_drivers.go +++ /dev/null @@ -1,47 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyAllowedCSIDrivers(in []managementClient.AllowedCSIDriver) []interface{} { - - if len(in) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(in)) - - for i, v := range in { - obj := make(map[string]interface{}) - - obj["name"] = v.Name - - out[i] = obj - } - - return out -} - -// Expanders - -func expandPodSecurityPolicyAllowedCSIDrivers(in []interface{}) []managementClient.AllowedCSIDriver { - - if len(in) == 0 || in[0] == nil { - return []managementClient.AllowedCSIDriver{} - } - - obj := make([]managementClient.AllowedCSIDriver, len(in)) - - for i, v := range in { - if m, ok := v.(map[string]interface{}); ok { - obj[i] = managementClient.AllowedCSIDriver{ - Name: m["name"].(string), - } - } - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_allowed_csi_drivers_test.go b/rancher2/structure_pod_security_policy_allowed_csi_drivers_test.go deleted file mode 100644 index 799bd9c8..00000000 --- a/rancher2/structure_pod_security_policy_allowed_csi_drivers_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyAllowedCSIDriversConf []managementClient.AllowedCSIDriver - testPodSecurityPolicyAllowedCSIDriversInterface []interface{} - testEmptyPodSecurityPolicyAllowedCSIDriversConf []managementClient.AllowedCSIDriver - testEmptyPodSecurityPolicyAllowedCSIDriversInterface []interface{} -) - -func init() { - testPodSecurityPolicyAllowedCSIDriversConf = []managementClient.AllowedCSIDriver{ - { - Name: "foo", - }, - { - Name: "bar", - }, - } - testPodSecurityPolicyAllowedCSIDriversInterface = []interface{}{ - map[string]interface{}{ - "name": "foo", - }, - map[string]interface{}{ - "name": "bar", - }, - } - testEmptyPodSecurityPolicyAllowedCSIDriversInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyAllowedCSIDrivers(t *testing.T) { - - cases := []struct { - Input []managementClient.AllowedCSIDriver - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyAllowedCSIDriversConf, - testPodSecurityPolicyAllowedCSIDriversInterface, - }, - { - testEmptyPodSecurityPolicyAllowedCSIDriversConf, - testEmptyPodSecurityPolicyAllowedCSIDriversInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyAllowedCSIDrivers(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyAllowedCSIDrivers(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.AllowedCSIDriver - }{ - { - testPodSecurityPolicyAllowedCSIDriversInterface, - testPodSecurityPolicyAllowedCSIDriversConf, - }, - } - for _, tc := range cases { - output := expandPodSecurityPolicyAllowedCSIDrivers(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_allowed_flex_volumes.go b/rancher2/structure_pod_security_policy_allowed_flex_volumes.go deleted file mode 100644 index 29ecd49d..00000000 --- a/rancher2/structure_pod_security_policy_allowed_flex_volumes.go +++ /dev/null @@ -1,47 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyAllowedFlexVolumes(in []managementClient.AllowedFlexVolume) []interface{} { - - if len(in) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(in)) - - for i, v := range in { - obj := make(map[string]interface{}) - - obj["driver"] = v.Driver - - out[i] = obj - } - - return out -} - -// Expanders - -func expandPodSecurityPolicyAllowedFlexVolumes(in []interface{}) []managementClient.AllowedFlexVolume { - - if len(in) == 0 || in[0] == nil { - return []managementClient.AllowedFlexVolume{} - } - - obj := make([]managementClient.AllowedFlexVolume, len(in)) - - for i, v := range in { - if m, ok := v.(map[string]interface{}); ok { - obj[i] = managementClient.AllowedFlexVolume{ - Driver: m["driver"].(string), - } - } - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_allowed_flex_volumes_test.go b/rancher2/structure_pod_security_policy_allowed_flex_volumes_test.go deleted file mode 100644 index 3f2dc7fd..00000000 --- a/rancher2/structure_pod_security_policy_allowed_flex_volumes_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyAllowedFlexVolumesConf []managementClient.AllowedFlexVolume - testPodSecurityPolicyAllowedFlexVolumesInterface []interface{} - testEmptyPodSecurityPolicyAllowedFlexVolumesConf []managementClient.AllowedFlexVolume - testEmptyPodSecurityPolicyAllowedFlexVolumesInterface []interface{} -) - -func init() { - testPodSecurityPolicyAllowedFlexVolumesConf = []managementClient.AllowedFlexVolume{ - { - Driver: "foo", - }, - { - Driver: "bar", - }, - } - testPodSecurityPolicyAllowedFlexVolumesInterface = []interface{}{ - map[string]interface{}{ - "driver": "foo", - }, - map[string]interface{}{ - "driver": "bar", - }, - } - testEmptyPodSecurityPolicyAllowedFlexVolumesInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyAllowedFlexVolumes(t *testing.T) { - - cases := []struct { - Input []managementClient.AllowedFlexVolume - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyAllowedFlexVolumesConf, - testPodSecurityPolicyAllowedFlexVolumesInterface, - }, - { - testEmptyPodSecurityPolicyAllowedFlexVolumesConf, - testEmptyPodSecurityPolicyAllowedFlexVolumesInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyAllowedFlexVolumes(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyAllowedFlexVolumes(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.AllowedFlexVolume - }{ - { - testPodSecurityPolicyAllowedFlexVolumesInterface, - testPodSecurityPolicyAllowedFlexVolumesConf, - }, - } - for _, tc := range cases { - output := expandPodSecurityPolicyAllowedFlexVolumes(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_allowed_host_paths.go b/rancher2/structure_pod_security_policy_allowed_host_paths.go deleted file mode 100644 index e2492c46..00000000 --- a/rancher2/structure_pod_security_policy_allowed_host_paths.go +++ /dev/null @@ -1,54 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyAllowedHostPaths(in []managementClient.AllowedHostPath) []interface{} { - - if len(in) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(in)) - - for i, v := range in { - obj := make(map[string]interface{}) - - obj["path_prefix"] = v.PathPrefix - obj["read_only"] = v.ReadOnly - - out[i] = obj - } - - return out -} - -// Expanders - -func expandPodSecurityPolicyAllowedHostPaths(in []interface{}) []managementClient.AllowedHostPath { - - if len(in) == 0 || in[0] == nil { - return []managementClient.AllowedHostPath{} - } - - obj := make([]managementClient.AllowedHostPath, len(in)) - - for i, v := range in { - if m, ok := v.(map[string]interface{}); ok { - hp := managementClient.AllowedHostPath{ - PathPrefix: m["path_prefix"].(string), - } - - if ro, ok := m["read_only"].(bool); ok { - hp.ReadOnly = ro - } - - obj[i] = hp - } - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_allowed_host_paths_test.go b/rancher2/structure_pod_security_policy_allowed_host_paths_test.go deleted file mode 100644 index 5ebbed7d..00000000 --- a/rancher2/structure_pod_security_policy_allowed_host_paths_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyAllowedHostPathsConf []managementClient.AllowedHostPath - testPodSecurityPolicyAllowedHostPathsInterface []interface{} - testEmptyPodSecurityPolicyAllowedHostPathsConf []managementClient.AllowedHostPath - testEmptyPodSecurityPolicyAllowedHostPathsInterface []interface{} -) - -func init() { - testPodSecurityPolicyAllowedHostPathsConf = []managementClient.AllowedHostPath{ - { - PathPrefix: "/var/lib", - ReadOnly: true, - }, - { - PathPrefix: "/tmp", - }, - } - testPodSecurityPolicyAllowedHostPathsInterface = []interface{}{ - map[string]interface{}{ - "path_prefix": "/var/lib", - "read_only": true, - }, - map[string]interface{}{ - "path_prefix": "/tmp", - "read_only": false, - }, - } - testEmptyPodSecurityPolicyAllowedHostPathsInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyAllowedHostPaths(t *testing.T) { - - cases := []struct { - Input []managementClient.AllowedHostPath - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyAllowedHostPathsConf, - testPodSecurityPolicyAllowedHostPathsInterface, - }, - { - testEmptyPodSecurityPolicyAllowedHostPathsConf, - testEmptyPodSecurityPolicyAllowedHostPathsInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyAllowedHostPaths(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyAllowedHostPaths(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.AllowedHostPath - }{ - { - testPodSecurityPolicyAllowedHostPathsInterface, - testPodSecurityPolicyAllowedHostPathsConf, - }, - } - for _, tc := range cases { - output := expandPodSecurityPolicyAllowedHostPaths(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_fs_group.go b/rancher2/structure_pod_security_policy_fs_group.go deleted file mode 100644 index c2ae6d4b..00000000 --- a/rancher2/structure_pod_security_policy_fs_group.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyFSGroup(in *managementClient.FSGroupStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.Rule) > 0 { - obj["rule"] = in.Rule - } - if len(in.Ranges) > 0 { - obj["range"] = flattenPodSecurityPolicyIDRanges(in.Ranges) - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicyFSGroup(in []interface{}) *managementClient.FSGroupStrategyOptions { - - obj := &managementClient.FSGroupStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["rule"].(string); ok { - obj.Rule = v - } - - if v, ok := m["range"].([]interface{}); ok && len(v) > 0 { - obj.Ranges = expandPodSecurityPolicyIDRanges(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_fs_group_test.go b/rancher2/structure_pod_security_policy_fs_group_test.go deleted file mode 100644 index e9a9df35..00000000 --- a/rancher2/structure_pod_security_policy_fs_group_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyFSGroupConf *managementClient.FSGroupStrategyOptions - testPodSecurityPolicyFSGroupInterface []interface{} - testPodSecurityPolicyFSGroupIDRangesConf []managementClient.IDRange - testPodSecurityPolicyFSGroupIDRangesInterface []interface{} - testNilPodSecurityPolicyFSGroupConf *managementClient.FSGroupStrategyOptions - testEmptyPodSecurityPolicyFSGroupInterface []interface{} -) - -func init() { - testPodSecurityPolicyFSGroupIDRangesConf = []managementClient.IDRange{ - { - Min: int64(1), - Max: int64(3000), - }, - { - Min: int64(0), - Max: int64(5000), - }, - } - testPodSecurityPolicyFSGroupIDRangesInterface = []interface{}{ - map[string]interface{}{ - "min": 1, - "max": 3000, - }, - map[string]interface{}{ - "min": 0, - "max": 5000, - }, - } - testPodSecurityPolicyFSGroupConf = &managementClient.FSGroupStrategyOptions{ - Rule: "RunAsAny", - Ranges: testPodSecurityPolicyFSGroupIDRangesConf, - } - testPodSecurityPolicyFSGroupInterface = []interface{}{ - map[string]interface{}{ - "rule": "RunAsAny", - "range": testPodSecurityPolicyFSGroupIDRangesInterface, - }, - } - testEmptyPodSecurityPolicyFSGroupInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyFSGroup(t *testing.T) { - - cases := []struct { - Input *managementClient.FSGroupStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyFSGroupConf, - testPodSecurityPolicyFSGroupInterface, - }, - { - testNilPodSecurityPolicyFSGroupConf, - testEmptyPodSecurityPolicyFSGroupInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyFSGroup(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyFSGroup(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.FSGroupStrategyOptions - }{ - { - testPodSecurityPolicyFSGroupInterface, - testPodSecurityPolicyFSGroupConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicyFSGroup(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_host_port_range.go b/rancher2/structure_pod_security_policy_host_port_range.go deleted file mode 100644 index 71dc808b..00000000 --- a/rancher2/structure_pod_security_policy_host_port_range.go +++ /dev/null @@ -1,49 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyHostPortRanges(in []managementClient.HostPortRange) []interface{} { - - if len(in) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(in)) - - for i, v := range in { - out[i] = map[string]interface{}{ - "min": int(v.Min), - "max": int(v.Max), - } - } - - return out - -} - -// Expanders - -func expandPodSecurityPolicyHostPortRanges(in []interface{}) []managementClient.HostPortRange { - - if len(in) == 0 || in[0] == nil { - return []managementClient.HostPortRange{} - } - - obj := make([]managementClient.HostPortRange, len(in)) - - for i, v := range in { - if m, ok := v.(map[string]interface{}); ok { - obj[i] = managementClient.HostPortRange{ - Min: int64(m["min"].(int)), - Max: int64(m["max"].(int)), - } - } - } - - return obj - -} diff --git a/rancher2/structure_pod_security_policy_host_port_range_test.go b/rancher2/structure_pod_security_policy_host_port_range_test.go deleted file mode 100644 index 4f369fc0..00000000 --- a/rancher2/structure_pod_security_policy_host_port_range_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyHostPortRangesConf []managementClient.HostPortRange - testPodSecurityPolicyHostPortRangesInterface []interface{} - testEmptyPodSecurityPolicyHostPortRangesConf []managementClient.HostPortRange - testEmptyPodSecurityPolicyHostPortRangesInterface []interface{} -) - -func init() { - testPodSecurityPolicyHostPortRangesConf = []managementClient.HostPortRange{ - { - Min: 1, - Max: 3000, - }, - { - Min: 2, - Max: 4000, - }, - } - testPodSecurityPolicyHostPortRangesInterface = []interface{}{ - map[string]interface{}{ - "min": 1, - "max": 3000, - }, - map[string]interface{}{ - "min": 2, - "max": 4000, - }, - } - testEmptyPodSecurityPolicyHostPortRangesInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyHostPortRanges(t *testing.T) { - - cases := []struct { - Input []managementClient.HostPortRange - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyHostPortRangesConf, - testPodSecurityPolicyHostPortRangesInterface, - }, - { - testEmptyPodSecurityPolicyHostPortRangesConf, - testEmptyPodSecurityPolicyHostPortRangesInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyHostPortRanges(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyHostPortRanges(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.HostPortRange - }{ - { - testPodSecurityPolicyHostPortRangesInterface, - testPodSecurityPolicyHostPortRangesConf, - }, - } - for _, tc := range cases { - output := expandPodSecurityPolicyHostPortRanges(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_id_ranges.go b/rancher2/structure_pod_security_policy_id_ranges.go deleted file mode 100644 index a9a5fd78..00000000 --- a/rancher2/structure_pod_security_policy_id_ranges.go +++ /dev/null @@ -1,47 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyIDRanges(in []managementClient.IDRange) []interface{} { - - if len(in) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(in)) - - for i, v := range in { - out[i] = map[string]interface{}{ - "min": int(v.Min), - "max": int(v.Max), - } - } - - return out -} - -// Expanders - -func expandPodSecurityPolicyIDRanges(in []interface{}) []managementClient.IDRange { - - if len(in) == 0 || in[0] == nil { - return []managementClient.IDRange{} - } - - obj := make([]managementClient.IDRange, len(in)) - - for i, v := range in { - if m, ok := v.(map[string]interface{}); ok { - obj[i] = managementClient.IDRange{ - Min: int64(m["min"].(int)), - Max: int64(m["max"].(int)), - } - } - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_id_ranges_test.go b/rancher2/structure_pod_security_policy_id_ranges_test.go deleted file mode 100644 index 5ac74fa3..00000000 --- a/rancher2/structure_pod_security_policy_id_ranges_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyIDRangesConf []managementClient.IDRange - testPodSecurityPolicyIDRangesInterface []interface{} - testEmptyPodSecurityPolicyIDRangesConf []managementClient.IDRange - testEmptyPodSecurityPolicyIDRangesInterface []interface{} -) - -func init() { - testPodSecurityPolicyIDRangesConf = []managementClient.IDRange{ - { - Min: int64(1), - Max: int64(3000), - }, - { - Min: int64(0), - Max: int64(5000), - }, - } - testPodSecurityPolicyIDRangesInterface = []interface{}{ - map[string]interface{}{ - "min": 1, - "max": 3000, - }, - map[string]interface{}{ - "min": 0, - "max": 5000, - }, - } - testEmptyPodSecurityPolicyIDRangesInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyIDRanges(t *testing.T) { - - cases := []struct { - Input []managementClient.IDRange - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyIDRangesConf, - testPodSecurityPolicyIDRangesInterface, - }, - { - testEmptyPodSecurityPolicyIDRangesConf, - testEmptyPodSecurityPolicyIDRangesInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyIDRanges(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyIDRanges(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.IDRange - }{ - { - testPodSecurityPolicyIDRangesInterface, - testPodSecurityPolicyIDRangesConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicyIDRanges(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_run_as_group.go b/rancher2/structure_pod_security_policy_run_as_group.go deleted file mode 100644 index 226f830a..00000000 --- a/rancher2/structure_pod_security_policy_run_as_group.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyRunAsGroup(in *managementClient.RunAsGroupStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.Rule) > 0 { - obj["rule"] = in.Rule - } - if len(in.Ranges) > 0 { - obj["range"] = flattenPodSecurityPolicyIDRanges(in.Ranges) - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicyRunAsGroup(in []interface{}) *managementClient.RunAsGroupStrategyOptions { - - obj := &managementClient.RunAsGroupStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["rule"].(string); ok { - obj.Rule = v - } - - if v, ok := m["range"].([]interface{}); ok && len(v) > 0 { - obj.Ranges = expandPodSecurityPolicyIDRanges(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_run_as_group_test.go b/rancher2/structure_pod_security_policy_run_as_group_test.go deleted file mode 100644 index 95e84949..00000000 --- a/rancher2/structure_pod_security_policy_run_as_group_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyRunAsGroupConf *managementClient.RunAsGroupStrategyOptions - testPodSecurityPolicyRunAsGroupInterface []interface{} - testNilPodSecurityPolicyRunAsGroupConf *managementClient.RunAsGroupStrategyOptions - testEmptyPodSecurityPolicyRunAsGroupInterface []interface{} -) - -func init() { - testPodSecurityPolicyRunAsGroupConf = &managementClient.RunAsGroupStrategyOptions{ - Rule: "RunAsAny", - Ranges: testPodSecurityPolicyIDRangesConf, - } - testPodSecurityPolicyRunAsGroupInterface = []interface{}{ - map[string]interface{}{ - "rule": "RunAsAny", - "range": testPodSecurityPolicyIDRangesInterface, - }, - } - testEmptyPodSecurityPolicyRunAsGroupInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyRunAsGroup(t *testing.T) { - - cases := []struct { - Input *managementClient.RunAsGroupStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyRunAsGroupConf, - testPodSecurityPolicyRunAsGroupInterface, - }, - { - testNilPodSecurityPolicyRunAsGroupConf, - testEmptyPodSecurityPolicyRunAsGroupInterface, - }, - } - for _, tc := range cases { - output := flattenPodSecurityPolicyRunAsGroup(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyRunAsGroup(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.RunAsGroupStrategyOptions - }{ - { - testPodSecurityPolicyRunAsGroupInterface, - testPodSecurityPolicyRunAsGroupConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicyRunAsGroup(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_run_as_user.go b/rancher2/structure_pod_security_policy_run_as_user.go deleted file mode 100644 index 2b1e601a..00000000 --- a/rancher2/structure_pod_security_policy_run_as_user.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyRunAsUser(in *managementClient.RunAsUserStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.Rule) > 0 { - obj["rule"] = string(in.Rule) - } - if len(in.Ranges) > 0 { - obj["range"] = flattenPodSecurityPolicyIDRanges(in.Ranges) - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicyRunAsUser(in []interface{}) *managementClient.RunAsUserStrategyOptions { - - obj := &managementClient.RunAsUserStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["rule"].(string); ok { - obj.Rule = v - } - - if v, ok := m["range"].([]interface{}); ok && len(v) > 0 { - obj.Ranges = expandPodSecurityPolicyIDRanges(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_run_as_user_test.go b/rancher2/structure_pod_security_policy_run_as_user_test.go deleted file mode 100644 index b89eab87..00000000 --- a/rancher2/structure_pod_security_policy_run_as_user_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyRunAsUserConf *managementClient.RunAsUserStrategyOptions - testPodSecurityPolicyRunAsUserInterface []interface{} - testNilPodSecurityPolicyRunAsUserConf *managementClient.RunAsUserStrategyOptions - testEmptyPodSecurityPolicyRunAsUserInterface []interface{} -) - -func init() { - testPodSecurityPolicyRunAsUserConf = &managementClient.RunAsUserStrategyOptions{ - Rule: "RunAsAny", - Ranges: testPodSecurityPolicyIDRangesConf, - } - testPodSecurityPolicyRunAsUserInterface = []interface{}{ - map[string]interface{}{ - "rule": "RunAsAny", - "range": testPodSecurityPolicyIDRangesInterface, - }, - } - testEmptyPodSecurityPolicyRunAsUserInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyRunAsUser(t *testing.T) { - - cases := []struct { - Input *managementClient.RunAsUserStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyRunAsUserConf, - testPodSecurityPolicyRunAsUserInterface, - }, - { - testNilPodSecurityPolicyRunAsUserConf, - testEmptyPodSecurityPolicyRunAsUserInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyRunAsUser(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyRunAsUser(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.RunAsUserStrategyOptions - }{ - { - testPodSecurityPolicyRunAsUserInterface, - testPodSecurityPolicyRunAsUserConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicyRunAsUser(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_runtime_class_strategy.go b/rancher2/structure_pod_security_policy_runtime_class_strategy.go deleted file mode 100644 index b0d1c3eb..00000000 --- a/rancher2/structure_pod_security_policy_runtime_class_strategy.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyRuntimeClassStrategy(in *managementClient.RuntimeClassStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.AllowedRuntimeClassNames) > 0 { - obj["allowed_runtime_class_names"] = toArrayInterface(in.AllowedRuntimeClassNames) - } - if len(in.DefaultRuntimeClassName) > 0 { - obj["default_runtime_class_name"] = in.DefaultRuntimeClassName - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicyRuntimeClassStrategy(in []interface{}) *managementClient.RuntimeClassStrategyOptions { - - obj := &managementClient.RuntimeClassStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["allowed_runtime_class_names"].([]interface{}); ok { - obj.AllowedRuntimeClassNames = toArrayString(v) - } - - if v, ok := m["default_runtime_class_name"].(string); ok { - obj.DefaultRuntimeClassName = v - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_runtime_class_strategy_test.go b/rancher2/structure_pod_security_policy_runtime_class_strategy_test.go deleted file mode 100644 index 22c04b9a..00000000 --- a/rancher2/structure_pod_security_policy_runtime_class_strategy_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyRuntimeClassStrategyConf *managementClient.RuntimeClassStrategyOptions - testPodSecurityPolicyRuntimeClassStrategyInterface []interface{} - testNilPodSecurityPolicyRuntimeClassStrategyConf *managementClient.RuntimeClassStrategyOptions - testEmptyPodSecurityPolicyRuntimeClassStrategyInterface []interface{} -) - -func init() { - testPodSecurityPolicyRuntimeClassStrategyConf = &managementClient.RuntimeClassStrategyOptions{ - AllowedRuntimeClassNames: []string{"foo", "bar"}, - DefaultRuntimeClassName: "foo", - } - testPodSecurityPolicyRuntimeClassStrategyInterface = []interface{}{ - map[string]interface{}{ - "allowed_runtime_class_names": toArrayInterface([]string{"foo", "bar"}), - "default_runtime_class_name": "foo", - }, - } - testEmptyPodSecurityPolicyRuntimeClassStrategyInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicyRuntimeClassStrategy(t *testing.T) { - - cases := []struct { - Input *managementClient.RuntimeClassStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicyRuntimeClassStrategyConf, - testPodSecurityPolicyRuntimeClassStrategyInterface, - }, - { - testNilPodSecurityPolicyRuntimeClassStrategyConf, - testEmptyPodSecurityPolicyRuntimeClassStrategyInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicyRuntimeClassStrategy(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicyRuntimeClassStrategy(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.RuntimeClassStrategyOptions - }{ - { - testPodSecurityPolicyRuntimeClassStrategyInterface, - testPodSecurityPolicyRuntimeClassStrategyConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicyRuntimeClassStrategy(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_se_linux_options.go b/rancher2/structure_pod_security_policy_se_linux_options.go deleted file mode 100644 index d7c8e1c5..00000000 --- a/rancher2/structure_pod_security_policy_se_linux_options.go +++ /dev/null @@ -1,65 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicySELinuxOptions(in *managementClient.SELinuxOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.User) > 0 { - obj["user"] = in.User - } - - if len(in.Role) > 0 { - obj["role"] = in.Role - } - - if len(in.Type) > 0 { - obj["type"] = in.Type - } - - if len(in.Level) > 0 { - obj["level"] = in.Level - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicySELinuxOptions(in []interface{}) *managementClient.SELinuxOptions { - - obj := &managementClient.SELinuxOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["user"].(string); ok { - obj.User = v - } - - if v, ok := m["role"].(string); ok { - obj.Role = v - } - - if v, ok := m["type"].(string); ok { - obj.Type = v - } - - if v, ok := m["level"].(string); ok { - obj.Level = v - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_se_linux_options_test.go b/rancher2/structure_pod_security_policy_se_linux_options_test.go deleted file mode 100644 index 4315fdea..00000000 --- a/rancher2/structure_pod_security_policy_se_linux_options_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicySELinuxOptionsConf *managementClient.SELinuxOptions - testPodSecurityPolicySELinuxOptionsInterface []interface{} - testNilPodSecurityPolicySELinuxOptionsConf *managementClient.SELinuxOptions - testEmptyPodSecurityPolicySELinuxOptionsInterface []interface{} -) - -func init() { - testPodSecurityPolicySELinuxOptionsConf = &managementClient.SELinuxOptions{ - User: "user", - Role: "role", - Type: "type", - Level: "level", - } - testPodSecurityPolicySELinuxOptionsInterface = []interface{}{ - map[string]interface{}{ - "user": "user", - "role": "role", - "type": "type", - "level": "level", - }, - } - testEmptyPodSecurityPolicySELinuxOptionsInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicySELinuxOptions(t *testing.T) { - - cases := []struct { - Input *managementClient.SELinuxOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicySELinuxOptionsConf, - testPodSecurityPolicySELinuxOptionsInterface, - }, - { - testNilPodSecurityPolicySELinuxOptionsConf, - testEmptyPodSecurityPolicySELinuxOptionsInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicySELinuxOptions(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicySELinuxOptions(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SELinuxOptions - }{ - { - testPodSecurityPolicySELinuxOptionsInterface, - testPodSecurityPolicySELinuxOptionsConf, - }, - } - for _, tc := range cases { - output := expandPodSecurityPolicySELinuxOptions(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_se_linux_strategy.go b/rancher2/structure_pod_security_policy_se_linux_strategy.go deleted file mode 100644 index b361576a..00000000 --- a/rancher2/structure_pod_security_policy_se_linux_strategy.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicySELinuxStrategy(in *managementClient.SELinuxStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.Rule) > 0 { - obj["rule"] = in.Rule - } - if in.SELinuxOptions != nil { - obj["se_linux_option"] = flattenPodSecurityPolicySELinuxOptions(in.SELinuxOptions) - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicySELinuxStrategy(in []interface{}) *managementClient.SELinuxStrategyOptions { - - obj := &managementClient.SELinuxStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["rule"].(string); ok { - obj.Rule = v - } - - if v, ok := m["se_linux_option"].([]interface{}); ok && len(v) > 0 { - obj.SELinuxOptions = expandPodSecurityPolicySELinuxOptions(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_se_linux_strategy_test.go b/rancher2/structure_pod_security_policy_se_linux_strategy_test.go deleted file mode 100644 index a9531156..00000000 --- a/rancher2/structure_pod_security_policy_se_linux_strategy_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicySELinuxStrategyConf *managementClient.SELinuxStrategyOptions - testPodSecurityPolicySELinuxStrategyInterface []interface{} - testNilPodSecurityPolicySELinuxStrategyConf *managementClient.SELinuxStrategyOptions - testEmptyPodSecurityPolicySELinuxStrategyInterface []interface{} -) - -func init() { - testPodSecurityPolicySELinuxStrategyConf = &managementClient.SELinuxStrategyOptions{ - Rule: "RunAsAny", - SELinuxOptions: testPodSecurityPolicySELinuxOptionsConf, - } - testPodSecurityPolicySELinuxStrategyInterface = []interface{}{ - map[string]interface{}{ - "rule": "RunAsAny", - "se_linux_option": testPodSecurityPolicySELinuxOptionsInterface, - }, - } - testEmptyPodSecurityPolicySELinuxStrategyInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicySELinuxStrategy(t *testing.T) { - - cases := []struct { - Input *managementClient.SELinuxStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicySELinuxStrategyConf, - testPodSecurityPolicySELinuxStrategyInterface, - }, - { - testNilPodSecurityPolicySELinuxStrategyConf, - testEmptyPodSecurityPolicySELinuxStrategyInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicySELinuxStrategy(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicySELinuxStrategy(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SELinuxStrategyOptions - }{ - { - testPodSecurityPolicySELinuxStrategyInterface, - testPodSecurityPolicySELinuxStrategyConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicySELinuxStrategy(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_supplemental_groups.go b/rancher2/structure_pod_security_policy_supplemental_groups.go deleted file mode 100644 index 2b0a3eee..00000000 --- a/rancher2/structure_pod_security_policy_supplemental_groups.go +++ /dev/null @@ -1,48 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicySupplementalGroups(in *managementClient.SupplementalGroupsStrategyOptions) []interface{} { - - if in == nil { - return []interface{}{} - } - - obj := make(map[string]interface{}) - - if len(in.Rule) > 0 { - obj["rule"] = in.Rule - } - if len(in.Ranges) > 0 { - obj["range"] = flattenPodSecurityPolicyIDRanges(in.Ranges) - } - - return []interface{}{obj} -} - -// Expanders - -func expandPodSecurityPolicySupplementalGroups(in []interface{}) *managementClient.SupplementalGroupsStrategyOptions { - - obj := &managementClient.SupplementalGroupsStrategyOptions{} - - if len(in) == 0 || in[0] == nil { - return obj - } - - m := in[0].(map[string]interface{}) - - if v, ok := m["rule"].(string); ok { - obj.Rule = v - } - - if v, ok := m["range"].([]interface{}); ok && len(v) > 0 { - obj.Ranges = expandPodSecurityPolicyIDRanges(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_supplemental_groups_test.go b/rancher2/structure_pod_security_policy_supplemental_groups_test.go deleted file mode 100644 index bd6cd24f..00000000 --- a/rancher2/structure_pod_security_policy_supplemental_groups_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicySupplementalGroupsConf *managementClient.SupplementalGroupsStrategyOptions - testPodSecurityPolicySupplementalGroupsInterface []interface{} - testNilPodSecurityPolicySupplementalGroupsConf *managementClient.SupplementalGroupsStrategyOptions - testEmptyPodSecurityPolicySupplementalGroupsInterface []interface{} -) - -func init() { - testPodSecurityPolicySupplementalGroupsConf = &managementClient.SupplementalGroupsStrategyOptions{ - Rule: "RunAsAny", - Ranges: testPodSecurityPolicyIDRangesConf, - } - testPodSecurityPolicySupplementalGroupsInterface = []interface{}{ - map[string]interface{}{ - "rule": "RunAsAny", - "range": testPodSecurityPolicyIDRangesInterface, - }, - } - testEmptyPodSecurityPolicySupplementalGroupsInterface = []interface{}{} -} - -func TestFlattenPodSecurityPolicySupplementalGroups(t *testing.T) { - - cases := []struct { - Input *managementClient.SupplementalGroupsStrategyOptions - ExpectedOutput []interface{} - }{ - { - testPodSecurityPolicySupplementalGroupsConf, - testPodSecurityPolicySupplementalGroupsInterface, - }, - { - testNilPodSecurityPolicySupplementalGroupsConf, - testEmptyPodSecurityPolicySupplementalGroupsInterface, - }, - } - - for _, tc := range cases { - output := flattenPodSecurityPolicySupplementalGroups(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandPodSecurityPolicySupplementalGroups(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.SupplementalGroupsStrategyOptions - }{ - { - testPodSecurityPolicySupplementalGroupsInterface, - testPodSecurityPolicySupplementalGroupsConf, - }, - } - - for _, tc := range cases { - output := expandPodSecurityPolicySupplementalGroups(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_pod_security_policy_template.go b/rancher2/structure_pod_security_policy_template.go deleted file mode 100644 index e8950440..00000000 --- a/rancher2/structure_pod_security_policy_template.go +++ /dev/null @@ -1,229 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenPodSecurityPolicyTemplate(d *schema.ResourceData, in *managementClient.PodSecurityPolicyTemplate) error { - if in == nil { - return fmt.Errorf("[ERROR] flattening pod security policy template: Input setting is nil") - } - - d.SetId(in.ID) - d.Set("name", in.Name) - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - - if in.AllowPrivilegeEscalation != nil { - d.Set("allow_privilege_escalation", *in.AllowPrivilegeEscalation) - } - - if len(in.AllowedCapabilities) > 0 { - d.Set("allowed_capabilities", toArrayInterface(in.AllowedCapabilities)) - } - - if len(in.AllowedCSIDrivers) > 0 { - d.Set("allowed_csi_driver", flattenPodSecurityPolicyAllowedCSIDrivers(in.AllowedCSIDrivers)) - } - - if len(in.AllowedFlexVolumes) > 0 { - d.Set("allowed_flex_volume", flattenPodSecurityPolicyAllowedFlexVolumes(in.AllowedFlexVolumes)) - } - - if len(in.AllowedHostPaths) > 0 { - d.Set("allowed_host_path", flattenPodSecurityPolicyAllowedHostPaths(in.AllowedHostPaths)) - } - - if len(in.AllowedProcMountTypes) > 0 { - d.Set("allowed_proc_mount_types", toArrayInterface(in.AllowedProcMountTypes)) - } - - if len(in.AllowedUnsafeSysctls) > 0 { - d.Set("allowed_unsafe_sysctls", toArrayInterface(in.AllowedUnsafeSysctls)) - } - - if len(in.DefaultAddCapabilities) > 0 { - d.Set("default_add_capabilities", toArrayInterface(in.DefaultAddCapabilities)) - } - - if in.DefaultAllowPrivilegeEscalation != nil { - d.Set("default_allow_privilege_escalation", *in.DefaultAllowPrivilegeEscalation) - } - - if len(in.ForbiddenSysctls) > 0 { - d.Set("forbidden_sysctls", toArrayInterface(in.ForbiddenSysctls)) - } - - d.Set("fs_group", flattenPodSecurityPolicyFSGroup(in.FSGroup)) - d.Set("host_ipc", in.HostIPC) - d.Set("host_network", in.HostNetwork) - d.Set("host_pid", in.HostPID) - - if len(in.HostPorts) > 0 { - d.Set("host_port", flattenPodSecurityPolicyHostPortRanges(in.HostPorts)) - } - - d.Set("privileged", in.Privileged) - d.Set("read_only_root_filesystem", in.ReadOnlyRootFilesystem) - - if len(in.RequiredDropCapabilities) > 0 { - d.Set("required_drop_capabilities", toArrayInterface(in.RequiredDropCapabilities)) - } - - d.Set("run_as_user", flattenPodSecurityPolicyRunAsUser(in.RunAsUser)) - - if in.RunAsGroup != nil { - d.Set("run_as_group", flattenPodSecurityPolicyRunAsGroup(in.RunAsGroup)) - } - - d.Set("runtime_class", flattenPodSecurityPolicyRuntimeClassStrategy(in.RuntimeClass)) - d.Set("se_linux", flattenPodSecurityPolicySELinuxStrategy(in.SELinux)) - d.Set("supplemental_group", flattenPodSecurityPolicySupplementalGroups(in.SupplementalGroups)) - d.Set("volumes", toArrayInterface(in.Volumes)) - - return nil -} - -func expandPodSecurityPolicyTemplate(in *schema.ResourceData) *managementClient.PodSecurityPolicyTemplate { - - if in == nil { - return nil - } - - obj := &managementClient.PodSecurityPolicyTemplate{} - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - if v, ok := in.Get("name").(string); ok && len(v) > 0 { - obj.Name = v - } - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - if v, ok := in.Get("allow_privilege_escalation").(bool); ok { - obj.AllowPrivilegeEscalation = &v - } - - if v, ok := in.Get("allowed_capabilities").([]interface{}); ok && len(v) > 0 { - obj.AllowedCapabilities = toArrayString(v) - } - - if v, ok := in.Get("allowed_csi_driver").([]interface{}); ok && len(v) > 0 { - obj.AllowedCSIDrivers = expandPodSecurityPolicyAllowedCSIDrivers(v) - } - - if v, ok := in.Get("allowed_flex_volume").([]interface{}); ok && len(v) > 0 { - obj.AllowedFlexVolumes = expandPodSecurityPolicyAllowedFlexVolumes(v) - } - - if v, ok := in.Get("allowed_host_path").([]interface{}); ok && len(v) > 0 { - obj.AllowedHostPaths = expandPodSecurityPolicyAllowedHostPaths(v) - } - - if v, ok := in.Get("allowed_proc_mount_types").([]interface{}); ok && len(v) > 0 { - obj.AllowedProcMountTypes = toArrayString(v) - } - - if v, ok := in.Get("allowed_unsafe_sysctls").([]interface{}); ok && len(v) > 0 { - obj.AllowedUnsafeSysctls = toArrayString(v) - } - - if v, ok := in.Get("default_add_capabilities").([]interface{}); ok && len(v) > 0 { - obj.DefaultAddCapabilities = toArrayString(v) - } - - if v, ok := in.Get("default_allow_privilege_escalation").(bool); ok { - obj.DefaultAllowPrivilegeEscalation = &v - } - - if v, ok := in.Get("forbidden_sysctls").([]interface{}); ok && len(v) > 0 { - obj.ForbiddenSysctls = toArrayString(v) - } - - if v, ok := in.Get("fs_group").([]interface{}); ok && len(v) > 0 { - obj.FSGroup = expandPodSecurityPolicyFSGroup(v) - } - - if v, ok := in.Get("host_ipc").(bool); ok { - obj.HostIPC = v - } - - if v, ok := in.Get("host_network").(bool); ok { - obj.HostNetwork = v - } - - if v, ok := in.Get("host_pid").(bool); ok { - obj.HostPID = v - } - - if v, ok := in.Get("host_port").([]interface{}); ok && len(v) > 0 { - obj.HostPorts = expandPodSecurityPolicyHostPortRanges(v) - } - - if v, ok := in.Get("privileged").(bool); ok { - obj.Privileged = v - } - - if v, ok := in.Get("read_only_root_filesystem").(bool); ok { - obj.ReadOnlyRootFilesystem = v - } - - if v, ok := in.Get("required_drop_capabilities").([]interface{}); ok && len(v) > 0 { - obj.RequiredDropCapabilities = toArrayString(v) - } - - if v, ok := in.Get("run_as_user").([]interface{}); ok && len(v) > 0 { - obj.RunAsUser = expandPodSecurityPolicyRunAsUser(v) - } - - if v, ok := in.Get("run_as_group").([]interface{}); ok && len(v) > 0 { - obj.RunAsGroup = expandPodSecurityPolicyRunAsGroup(v) - } - - if v, ok := in.Get("runtime_class").([]interface{}); ok && len(v) > 0 { - obj.RuntimeClass = expandPodSecurityPolicyRuntimeClassStrategy(v) - } - - if v, ok := in.Get("se_linux").([]interface{}); ok && len(v) > 0 { - obj.SELinux = expandPodSecurityPolicySELinuxStrategy(v) - } - - if v, ok := in.Get("supplemental_group").([]interface{}); ok && len(v) > 0 { - obj.SupplementalGroups = expandPodSecurityPolicySupplementalGroups(v) - } - - if v, ok := in.Get("volumes").([]interface{}); ok && len(v) > 0 { - obj.Volumes = toArrayString(v) - } - - return obj -} diff --git a/rancher2/structure_pod_security_policy_template_test.go b/rancher2/structure_pod_security_policy_template_test.go deleted file mode 100644 index f59d5eec..00000000 --- a/rancher2/structure_pod_security_policy_template_test.go +++ /dev/null @@ -1,140 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testPodSecurityPolicyBool bool - testPodSecurityPolicyTemplateConf *managementClient.PodSecurityPolicyTemplate - testPodSecurityPolicyTemplateInterface map[string]interface{} -) - -func init() { - testPodSecurityPolicyBool = true - testPodSecurityPolicyTemplateConf = &managementClient.PodSecurityPolicyTemplate{ - Name: "name", - Description: "description", - Annotations: map[string]string{ - "node_one": "one", - "node_two": "two", - }, - Labels: map[string]string{ - "option1": "value1", - "option2": "value2", - }, - Privileged: true, - DefaultAddCapabilities: []string{"NET_ADMIN"}, - RequiredDropCapabilities: []string{"NET_ADMIN"}, - AllowedCapabilities: []string{"NET_ADMIN"}, - Volumes: []string{"hostPath", "emptyDir"}, - HostNetwork: true, - HostPorts: testPodSecurityPolicyHostPortRangesConf, - HostPID: false, - HostIPC: true, - SELinux: testPodSecurityPolicySELinuxStrategyConf, - RunAsUser: testPodSecurityPolicyRunAsUserConf, - RunAsGroup: testPodSecurityPolicyRunAsGroupConf, - SupplementalGroups: testPodSecurityPolicySupplementalGroupsConf, - FSGroup: testPodSecurityPolicyFSGroupConf, - ReadOnlyRootFilesystem: false, - DefaultAllowPrivilegeEscalation: &testPodSecurityPolicyBool, - AllowPrivilegeEscalation: &testPodSecurityPolicyBool, - AllowedHostPaths: testPodSecurityPolicyAllowedHostPathsConf, - AllowedFlexVolumes: testPodSecurityPolicyAllowedFlexVolumesConf, - AllowedCSIDrivers: testPodSecurityPolicyAllowedCSIDriversConf, - AllowedUnsafeSysctls: []string{"foo", "bar"}, - ForbiddenSysctls: []string{"foo", "bar"}, - AllowedProcMountTypes: []string{"Default", "Unmasked"}, - RuntimeClass: testPodSecurityPolicyRuntimeClassStrategyConf, - } - testPodSecurityPolicyTemplateInterface = map[string]interface{}{ - "name": "name", - "description": "description", - "annotations": map[string]interface{}{ - "node_one": "one", - "node_two": "two", - }, - "labels": map[string]interface{}{ - "option1": "value1", - "option2": "value2", - }, - "privileged": true, - "default_add_capabilities": toArrayInterface([]string{"NET_ADMIN"}), - "required_drop_capabilities": toArrayInterface([]string{"NET_ADMIN"}), - "allowed_capabilities": toArrayInterface([]string{"NET_ADMIN"}), - "volumes": toArrayInterface([]string{"hostPath", "emptyDir"}), - "host_network": true, - "host_port": testPodSecurityPolicyHostPortRangesInterface, - "host_pid": false, - "host_ipc": true, - "se_linux": testPodSecurityPolicySELinuxStrategyInterface, - "run_as_user": testPodSecurityPolicyRunAsUserInterface, - "run_as_group": testPodSecurityPolicyRunAsGroupInterface, - "supplemental_group": testPodSecurityPolicySupplementalGroupsInterface, - "fs_group": testPodSecurityPolicyFSGroupInterface, - "read_only_root_filesystem": false, - "default_allow_privilege_escalation": testPodSecurityPolicyBool, - "allow_privilege_escalation": testPodSecurityPolicyBool, - "allowed_host_path": testPodSecurityPolicyAllowedHostPathsInterface, - "allowed_flex_volume": testPodSecurityPolicyAllowedFlexVolumesInterface, - "allowed_csi_driver": testPodSecurityPolicyAllowedCSIDriversInterface, - "allowed_unsafe_sysctls": toArrayInterface([]string{"foo", "bar"}), - "forbidden_sysctls": toArrayInterface([]string{"foo", "bar"}), - "allowed_proc_mount_types": toArrayInterface([]string{"Default", "Unmasked"}), - "runtime_class": testPodSecurityPolicyRuntimeClassStrategyInterface, - } -} - -func TestFlattenPodSecurityPolicyTemplate(t *testing.T) { - - cases := []struct { - Input *managementClient.PodSecurityPolicyTemplate - ExpectedOutput map[string]interface{} - }{ - { - testPodSecurityPolicyTemplateConf, - testPodSecurityPolicyTemplateInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, podSecurityPolicyTemplateFields(), map[string]interface{}{}) - err := flattenPodSecurityPolicyTemplate(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - given := map[string]interface{}{} - for k := range tc.ExpectedOutput { - given[k] = output.Get(k) - } - if !reflect.DeepEqual(given, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - tc.ExpectedOutput, given) - } - } -} - -func TestExpandPodSecurityPolicyTemplate(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.PodSecurityPolicyTemplate - }{ - { - testPodSecurityPolicyTemplateInterface, - testPodSecurityPolicyTemplateConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, podSecurityPolicyTemplateFields(), tc.Input) - output := expandPodSecurityPolicyTemplate(inputResourceData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_project.go b/rancher2/structure_project.go index af9683cb..223204e4 100644 --- a/rancher2/structure_project.go +++ b/rancher2/structure_project.go @@ -109,7 +109,7 @@ func flattenProjectResourceQuota(pQuota *managementClient.ProjectResourceQuota, return []interface{}{obj} } -func flattenProject(d *schema.ResourceData, in *managementClient.Project, monitoringInput *managementClient.MonitoringInput) error { +func flattenProject(d *schema.ResourceData, in *managementClient.Project) error { if in == nil { return nil } @@ -118,7 +118,6 @@ func flattenProject(d *schema.ResourceData, in *managementClient.Project, monito d.Set("cluster_id", in.ClusterID) d.Set("name", in.Name) d.Set("description", in.Description) - d.Set("enable_project_monitoring", in.EnableProjectMonitoring) if in.ContainerDefaultResourceLimit != nil { containerLimit := flattenProjectContainerResourceLimit(in.ContainerDefaultResourceLimit) @@ -128,8 +127,6 @@ func flattenProject(d *schema.ResourceData, in *managementClient.Project, monito } } - d.Set("pod_security_policy_template_id", in.PodSecurityPolicyTemplateName) - if in.ResourceQuota != nil && in.NamespaceDefaultResourceQuota != nil { resourceQuota := flattenProjectResourceQuota(in.ResourceQuota, in.NamespaceDefaultResourceQuota) err := d.Set("resource_quota", resourceQuota) @@ -138,12 +135,7 @@ func flattenProject(d *schema.ResourceData, in *managementClient.Project, monito } } - err := d.Set("project_monitoring_input", flattenMonitoringInput(monitoringInput)) - if err != nil { - return err - } - - err = d.Set("annotations", toMapInterface(in.Annotations)) + err := d.Set("annotations", toMapInterface(in.Annotations)) if err != nil { return err } @@ -286,12 +278,6 @@ func expandProject(in *schema.ResourceData) *managementClient.Project { obj.ContainerDefaultResourceLimit = containerLimit } - if v, ok := in.Get("enable_project_monitoring").(bool); ok { - obj.EnableProjectMonitoring = v - } - - obj.PodSecurityPolicyTemplateName = in.Get("pod_security_policy_template_id").(string) - if v, ok := in.Get("resource_quota").([]interface{}); ok && len(v) > 0 { resourceQuota, nsResourceQuota := expandProjectResourceQuota(v) obj.ResourceQuota = resourceQuota diff --git a/rancher2/structure_project_alert_group.go b/rancher2/structure_project_alert_group.go deleted file mode 100644 index 64ef9f9e..00000000 --- a/rancher2/structure_project_alert_group.go +++ /dev/null @@ -1,77 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenProjectAlertGroup(d *schema.ResourceData, in *managementClient.ProjectAlertGroup) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("name", in.Name) - d.Set("project_id", in.ProjectID) - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - d.Set("group_interval_seconds", int(in.GroupIntervalSeconds)) - d.Set("group_wait_seconds", int(in.GroupWaitSeconds)) - d.Set("recipients", flattenRecipients(in.Recipients)) - d.Set("repeat_interval_seconds", int(in.RepeatIntervalSeconds)) - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - return nil -} - -// Expanders - -func expandProjectAlertGroup(in *schema.ResourceData) *managementClient.ProjectAlertGroup { - obj := &managementClient.ProjectAlertGroup{} - if in == nil { - return nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - obj.Name = in.Get("name").(string) - obj.ProjectID = in.Get("project_id").(string) - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - obj.GroupIntervalSeconds = int64(in.Get("group_interval_seconds").(int)) - obj.GroupWaitSeconds = int64(in.Get("group_wait_seconds").(int)) - - if v, ok := in.Get("recipients").([]interface{}); ok && len(v) > 0 { - obj.Recipients = expandRecipients(v) - } - - obj.RepeatIntervalSeconds = int64(in.Get("repeat_interval_seconds").(int)) - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj -} diff --git a/rancher2/structure_project_alert_group_test.go b/rancher2/structure_project_alert_group_test.go deleted file mode 100644 index d56ca3de..00000000 --- a/rancher2/structure_project_alert_group_test.go +++ /dev/null @@ -1,97 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testProjectAlertGroupRecipientsConf []managementClient.Recipient - testProjectAlertGroupRecipientsInterface []interface{} - testProjectAlertGroupConf *managementClient.ProjectAlertGroup - testProjectAlertGroupInterface map[string]interface{} -) - -func init() { - testProjectAlertGroupRecipientsConf = []managementClient.Recipient{ - { - NotifierID: "notifier_id", - NotifierType: "webhook", - Recipient: "recipient", - }, - } - testProjectAlertGroupRecipientsInterface = []interface{}{ - map[string]interface{}{ - "notifier_id": "notifier_id", - "notifier_type": "webhook", - "recipient": "recipient", - "default_recipient": false, - }, - } - testProjectAlertGroupConf = &managementClient.ProjectAlertGroup{ - Name: "name", - ProjectID: "project_id", - Description: "description", - GroupIntervalSeconds: 300, - GroupWaitSeconds: 300, - Recipients: testProjectAlertGroupRecipientsConf, - RepeatIntervalSeconds: 6000, - } - testProjectAlertGroupInterface = map[string]interface{}{ - "name": "name", - "project_id": "project_id", - "description": "description", - "group_interval_seconds": 300, - "group_wait_seconds": 300, - "recipients": testProjectAlertGroupRecipientsInterface, - "repeat_interval_seconds": 6000, - } -} - -func TestFlattenProjectAlertGroup(t *testing.T) { - - cases := []struct { - Input *managementClient.ProjectAlertGroup - ExpectedOutput map[string]interface{} - }{ - { - testProjectAlertGroupConf, - testProjectAlertGroupInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, projectAlertGroupFields(), map[string]interface{}{}) - err := flattenProjectAlertGroup(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - assert.Equal(t, tc.ExpectedOutput, expectedOutput, "Unexpected output from flattener.") - } -} - -func TestExpandProjectAlertGroup(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.ProjectAlertGroup - }{ - { - testProjectAlertGroupInterface, - testProjectAlertGroupConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, projectAlertGroupFields(), tc.Input) - output := expandProjectAlertGroup(inputResourceData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_project_alert_rule.go b/rancher2/structure_project_alert_rule.go deleted file mode 100644 index 4271c956..00000000 --- a/rancher2/structure_project_alert_rule.go +++ /dev/null @@ -1,114 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenProjectAlertRule(d *schema.ResourceData, in *managementClient.ProjectAlertRule) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("name", in.Name) - d.Set("project_id", in.ProjectID) - d.Set("group_id", in.GroupID) - d.Set("group_interval_seconds", int(in.GroupIntervalSeconds)) - d.Set("group_wait_seconds", int(in.GroupWaitSeconds)) - - if in.Inherited != nil { - d.Set("inherited", *in.Inherited) - } - - if in.MetricRule != nil { - err := d.Set("metric_rule", flattenMetricRule(in.MetricRule)) - if err != nil { - return err - } - } - - if in.PodRule != nil { - err := d.Set("pod_rule", flattenPodRule(in.PodRule)) - if err != nil { - return err - } - } - - d.Set("repeat_interval_seconds", int(in.RepeatIntervalSeconds)) - - if len(in.Severity) > 0 { - d.Set("severity", in.Severity) - } - - if in.WorkloadRule != nil { - err := d.Set("workload_rule", flattenWorkloadRule(in.WorkloadRule)) - if err != nil { - return err - } - } - - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - return nil -} - -// Expanders - -func expandProjectAlertRule(in *schema.ResourceData) *managementClient.ProjectAlertRule { - obj := &managementClient.ProjectAlertRule{} - if in == nil { - return nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - obj.Name = in.Get("name").(string) - obj.ProjectID = in.Get("project_id").(string) - obj.GroupID = in.Get("group_id").(string) - obj.GroupIntervalSeconds = int64(in.Get("group_interval_seconds").(int)) - obj.GroupWaitSeconds = int64(in.Get("group_wait_seconds").(int)) - - if v, ok := in.Get("inherited").(bool); ok { - obj.Inherited = &v - } - - if v, ok := in.Get("metric_rule").([]interface{}); ok && len(v) > 0 { - obj.MetricRule = expandMetricRule(v) - } - - if v, ok := in.Get("pod_rule").([]interface{}); ok && len(v) > 0 { - obj.PodRule = expandPodRule(v) - } - - obj.RepeatIntervalSeconds = int64(in.Get("repeat_interval_seconds").(int)) - - if v, ok := in.Get("severity").(string); ok { - obj.Severity = v - } - - if v, ok := in.Get("workload_rule").([]interface{}); ok && len(v) > 0 { - obj.WorkloadRule = expandWorkloadRule(v) - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj -} diff --git a/rancher2/structure_project_alert_rule_test.go b/rancher2/structure_project_alert_rule_test.go deleted file mode 100644 index faa126ec..00000000 --- a/rancher2/structure_project_alert_rule_test.go +++ /dev/null @@ -1,142 +0,0 @@ -package rancher2 - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testProjectAlertMetricRuleConf *managementClient.MetricRule - testProjectAlertMetricRuleInterface []interface{} - testProjectAlertPodRuleConf *managementClient.PodRule - testProjectAlertPodRuleInterface []interface{} - testProjectAlertWorkloadRuleConf *managementClient.WorkloadRule - testProjectAlertWorkloadRuleInterface []interface{} - testProjectAlertRuleConf *managementClient.ProjectAlertRule - testProjectAlertRuleInterface map[string]interface{} -) - -func init() { - testProjectAlertMetricRuleConf = &managementClient.MetricRule{ - Comparison: metricRuleComparisonEqual, - Duration: "30", - Expression: "expression", - ThresholdValue: float64(3.5), - Description: "description", - } - testProjectAlertMetricRuleInterface = []interface{}{ - map[string]interface{}{ - "comparison": metricRuleComparisonEqual, - "duration": "30", - "expression": "expression", - "threshold_value": float64(3.5), - "description": "description", - }, - } - testProjectAlertPodRuleConf = &managementClient.PodRule{ - Condition: podRuleConditionNotRunning, - PodID: "pod_id", - RestartIntervalSeconds: int64(70), - RestartTimes: int64(5), - } - testProjectAlertPodRuleInterface = []interface{}{ - map[string]interface{}{ - "condition": podRuleConditionNotRunning, - "pod_id": "pod_id", - "restart_interval_seconds": 70, - "restart_times": 5, - }, - } - testProjectAlertWorkloadRuleConf = &managementClient.WorkloadRule{ - AvailablePercentage: int64(70), - Selector: map[string]string{ - "selector1": "selector1", - "selector2": "selector2", - }, - WorkloadID: "workload_id", - } - testProjectAlertWorkloadRuleInterface = []interface{}{ - map[string]interface{}{ - "available_percentage": 70, - "selector": map[string]interface{}{ - "selector1": "selector1", - "selector2": "selector2", - }, - "workload_id": "workload_id", - }, - } - testProjectAlertRuleConf = &managementClient.ProjectAlertRule{ - Name: "name", - ProjectID: "project_id", - GroupID: "group_id", - GroupIntervalSeconds: 300, - GroupWaitSeconds: 300, - Inherited: newTrue(), - MetricRule: testProjectAlertMetricRuleConf, - PodRule: testProjectAlertPodRuleConf, - RepeatIntervalSeconds: 6000, - Severity: alertRuleSeverityCritical, - WorkloadRule: testProjectAlertWorkloadRuleConf, - } - testProjectAlertRuleInterface = map[string]interface{}{ - "name": "name", - "project_id": "project_id", - "group_id": "group_id", - "group_interval_seconds": 300, - "group_wait_seconds": 300, - "inherited": true, - "metric_rule": testProjectAlertMetricRuleInterface, - "pod_rule": testProjectAlertPodRuleInterface, - "repeat_interval_seconds": 6000, - "severity": alertRuleSeverityCritical, - "workload_rule": testProjectAlertWorkloadRuleInterface, - } -} - -func TestFlattenProjectAlertRule(t *testing.T) { - - cases := []struct { - Input *managementClient.ProjectAlertRule - ExpectedOutput map[string]interface{} - }{ - { - testProjectAlertRuleConf, - testProjectAlertRuleInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, projectAlertRuleFields(), map[string]interface{}{}) - err := flattenProjectAlertRule(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - assert.Equal(t, tc.ExpectedOutput, expectedOutput, "Unexpected output from flattener.") - } -} - -func TestExpandProjectAlertRule(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.ProjectAlertRule - }{ - { - testProjectAlertRuleInterface, - testProjectAlertRuleConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, projectAlertRuleFields(), tc.Input) - output := expandProjectAlertRule(inputResourceData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_project_test.go b/rancher2/structure_project_test.go index 37192bc4..03d20bb2 100644 --- a/rancher2/structure_project_test.go +++ b/rancher2/structure_project_test.go @@ -119,19 +119,15 @@ func init() { Name: "test", ContainerDefaultResourceLimit: testProjectContainerResourceLimitConf, Description: "description", - EnableProjectMonitoring: true, - PodSecurityPolicyTemplateName: "pod_security_policy_template_id", ResourceQuota: testProjectResourceQuotaConf, NamespaceDefaultResourceQuota: testProjectNamespaceResourceQuotaConf, } testProjectInterface = map[string]interface{}{ - "cluster_id": "cluster-test", - "name": "test", - "container_resource_limit": testProjectContainerResourceLimitInterface, - "description": "description", - "enable_project_monitoring": true, - "pod_security_policy_template_id": "pod_security_policy_template_id", - "resource_quota": testProjectResourceQuotaInterface, + "cluster_id": "cluster-test", + "name": "test", + "container_resource_limit": testProjectContainerResourceLimitInterface, + "description": "description", + "resource_quota": testProjectResourceQuotaInterface, } } @@ -205,7 +201,7 @@ func TestFlattenProject(t *testing.T) { for _, tc := range cases { output := schema.TestResourceDataRaw(t, projectFields(), map[string]interface{}{}) - err := flattenProject(output, tc.Input, nil) + err := flattenProject(output, tc.Input) if err != nil { assert.FailNow(t, "[ERROR] on flattener: %#v", err) } diff --git a/rancher2/structure_recipient.go b/rancher2/structure_recipient.go deleted file mode 100644 index 18f577b5..00000000 --- a/rancher2/structure_recipient.go +++ /dev/null @@ -1,52 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenRecipients(p []managementClient.Recipient) []interface{} { - if len(p) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(p)) - for i, in := range p { - obj := make(map[string]interface{}) - - obj["notifier_id"] = in.NotifierID - - if len(in.NotifierType) > 0 { - obj["notifier_type"] = in.NotifierType - } - - if len(in.Recipient) > 0 { - obj["recipient"] = in.Recipient - } - - out[i] = obj - } - - return out -} - -// Expanders - -func expandRecipients(p []interface{}) []managementClient.Recipient { - if len(p) == 0 || p[0] == nil { - return []managementClient.Recipient{} - } - - obj := make([]managementClient.Recipient, len(p)) - - for i := range p { - in := p[i].(map[string]interface{}) - - obj[i].NotifierID = in["notifier_id"].(string) - obj[i].NotifierType = in["notifier_type"].(string) - obj[i].Recipient = in["recipient"].(string) - } - - return obj -} diff --git a/rancher2/structure_recipient_test.go b/rancher2/structure_recipient_test.go deleted file mode 100644 index b6a21309..00000000 --- a/rancher2/structure_recipient_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testRecipientsConf []managementClient.Recipient - testRecipientsInterface []interface{} -) - -func init() { - testRecipientsConf = []managementClient.Recipient{ - { - NotifierID: "notifier_id", - NotifierType: "webhook", - Recipient: "recipient", - }, - } - testRecipientsInterface = []interface{}{ - map[string]interface{}{ - "notifier_id": "notifier_id", - "notifier_type": "webhook", - "recipient": "recipient", - }, - } -} - -func TestFlattenRecipients(t *testing.T) { - - cases := []struct { - Input []managementClient.Recipient - ExpectedOutput []interface{} - }{ - { - testRecipientsConf, - testRecipientsInterface, - }, - } - - for _, tc := range cases { - output := flattenRecipients(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandRecipients(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.Recipient - }{ - { - testRecipientsInterface, - testRecipientsConf, - }, - } - - for _, tc := range cases { - output := expandRecipients(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_role_template.go b/rancher2/structure_role_template.go index bba1d846..e7e720ce 100644 --- a/rancher2/structure_role_template.go +++ b/rancher2/structure_role_template.go @@ -60,6 +60,11 @@ func flattenRoleTemplate(d *schema.ResourceData, in *managementClient.RoleTempla return err } + err = d.Set("external_rules", flattenPolicyRules(in.ExternalRules)) + if err != nil { + return err + } + return nil } @@ -113,5 +118,9 @@ func expandRoleTemplate(in *schema.ResourceData) *managementClient.RoleTemplate obj.Labels = toMapString(v) } + if v, ok := in.Get("external_rules").([]interface{}); ok && len(v) > 0 { + obj.ExternalRules = expandPolicyRules(v) + } + return obj } diff --git a/rancher2/structure_role_template_test.go b/rancher2/structure_role_template_test.go index 26564cbe..bc389716 100644 --- a/rancher2/structure_role_template_test.go +++ b/rancher2/structure_role_template_test.go @@ -10,12 +10,14 @@ import ( ) var ( - testRoleTemplatePolicyRulesConf []managementClient.PolicyRule - testRoleTemplatePolicyRulesInterface []interface{} - testRoleTemplateClusterConf *managementClient.RoleTemplate - testRoleTemplateClusterInterface map[string]interface{} - testRoleTemplateProjectConf *managementClient.RoleTemplate - testRoleTemplateProjectInterface map[string]interface{} + testRoleTemplatePolicyExternalRulesConf []managementClient.PolicyRule + testRoleTemplatePolicyExternalRulesInterface []interface{} + testRoleTemplatePolicyRulesConf []managementClient.PolicyRule + testRoleTemplatePolicyRulesInterface []interface{} + testRoleTemplateClusterConf *managementClient.RoleTemplate + testRoleTemplateClusterInterface map[string]interface{} + testRoleTemplateProjectConf *managementClient.RoleTemplate + testRoleTemplateProjectInterface map[string]interface{} ) func init() { @@ -43,6 +45,30 @@ func init() { }, }, } + testRoleTemplatePolicyExternalRulesConf = []managementClient.PolicyRule{ + { + APIGroups: []string{ + "api_group3", + "api_group2", + }, + NonResourceURLs: []string{ + "non_resource_urls3", + "non_resource_urls2", + }, + ResourceNames: []string{ + "resource_names3", + "resource_names2", + }, + Resources: []string{ + "resources3", + "resources2", + }, + Verbs: []string{ + "verbs3", + "verbs2", + }, + }, + } testRoleTemplatePolicyRulesInterface = []interface{}{ map[string]interface{}{ "api_groups": []interface{}{ @@ -67,6 +93,30 @@ func init() { }, }, } + testRoleTemplatePolicyExternalRulesInterface = []interface{}{ + map[string]interface{}{ + "api_groups": []interface{}{ + "api_group3", + "api_group2", + }, + "non_resource_urls": []interface{}{ + "non_resource_urls3", + "non_resource_urls2", + }, + "resource_names": []interface{}{ + "resource_names3", + "resource_names2", + }, + "resources": []interface{}{ + "resources3", + "resources2", + }, + "verbs": []interface{}{ + "verbs3", + "verbs2", + }, + }, + } testRoleTemplateClusterConf = &managementClient.RoleTemplate{ Administrative: true, Context: "cluster", @@ -80,7 +130,8 @@ func init() { "role_template1", "role_template2", }, - Rules: testRoleTemplatePolicyRulesConf, + Rules: testRoleTemplatePolicyRulesConf, + ExternalRules: testRoleTemplatePolicyExternalRulesConf, Annotations: map[string]string{ "node_one": "one", "node_two": "two", @@ -104,7 +155,8 @@ func init() { "role_template1", "role_template2", }, - "rules": testRoleTemplatePolicyRulesInterface, + "rules": testRoleTemplatePolicyRulesInterface, + "external_rules": testRoleTemplatePolicyExternalRulesInterface, "annotations": map[string]interface{}{ "node_one": "one", "node_two": "two", @@ -127,7 +179,8 @@ func init() { "role_template1", "role_template2", }, - Rules: testRoleTemplatePolicyRulesConf, + Rules: testRoleTemplatePolicyRulesConf, + ExternalRules: testRoleTemplatePolicyExternalRulesConf, Annotations: map[string]string{ "node_one": "one", "node_two": "two", @@ -151,7 +204,8 @@ func init() { "role_template1", "role_template2", }, - "rules": testRoleTemplatePolicyRulesInterface, + "rules": testRoleTemplatePolicyRulesInterface, + "external_rules": testRoleTemplatePolicyExternalRulesInterface, "annotations": map[string]interface{}{ "node_one": "one", "node_two": "two", diff --git a/rancher2/structure_user.go b/rancher2/structure_user.go index 645c7fc8..7791521d 100644 --- a/rancher2/structure_user.go +++ b/rancher2/structure_user.go @@ -15,6 +15,7 @@ func flattenUser(d *schema.ResourceData, in *managementClient.User) error { d.SetId(in.ID) d.Set("username", in.Username) d.Set("enabled", in.Enabled) + d.Set("must_change_password", in.MustChangePassword) if len(in.Name) > 0 { d.Set("name", in.Name) @@ -55,6 +56,7 @@ func expandUser(in *schema.ResourceData) *managementClient.User { obj.Username = in.Get("username").(string) enabled := in.Get("enabled").(bool) obj.Enabled = &enabled + obj.MustChangePassword = in.Get("must_change_password").(bool) if v, ok := in.Get("name").(string); ok && len(v) > 0 { obj.Name = v diff --git a/rancher2/structure_user_test.go b/rancher2/structure_user_test.go index 11e71a2a..78e49fac 100644 --- a/rancher2/structure_user_test.go +++ b/rancher2/structure_user_test.go @@ -15,14 +15,16 @@ var ( func init() { testUserConf = &managementClient.User{ - Name: "name", - Username: "username", - Enabled: newTrue(), + Name: "name", + Username: "username", + Enabled: newTrue(), + MustChangePassword: *newTrue(), } testUserInterface = map[string]interface{}{ - "name": "name", - "username": "username", - "enabled": true, + "name": "name", + "username": "username", + "enabled": true, + "must_change_password": true, } } diff --git a/rancher2/util.go b/rancher2/util.go index 769adf21..8a206a2f 100644 --- a/rancher2/util.go +++ b/rancher2/util.go @@ -421,7 +421,7 @@ func splitRegistryID(id string) (namespaceID, projectID, resourceID string) { func clusterIDFromProjectID(projectID string) (string, error) { if projectID == "" || !strings.Contains(projectID, clusterProjectIDSeparator) { - return "", fmt.Errorf("[ERROR] Getting clusted ID from project ID: Bad project id format %s", projectID) + return "", fmt.Errorf("[ERROR] Getting cluster ID from project ID: Bad project id format %s", projectID) } return projectID[0:strings.Index(projectID, clusterProjectIDSeparator)], nil diff --git a/setup-provider.sh b/setup-provider.sh index d39d270e..ca911423 100755 --- a/setup-provider.sh +++ b/setup-provider.sh @@ -28,11 +28,10 @@ PROVIDER=$1 VERSION=$2 VERSION_TAG=$(echo $2 | cut -c 2-) -# Install gzip - -if ! command -v "gzip" &> /dev/null; then - echo "Missing gzip. Installing..." - brew install gzip +# Check for unzip +if ! command -v "unzip" &> /dev/null; then + echo "Missing required tool unzip. unzip can be installed via apt on Linux" + exit 1 fi # Download binary @@ -41,7 +40,16 @@ OS_PLATFORM=$(uname -sp | tr '[:upper:] ' '[:lower:]_' | sed 's/x86_64/amd64/' | DIR=~/.terraform.d/plugins/terraform.local/local/${PROVIDER}/${VERSION_TAG}/${OS_PLATFORM} mkdir -p $DIR -curl -sfL https://github.com/rancher/terraform-provider-${PROVIDER}/releases/download/${VERSION}/terraform-provider-${PROVIDER}_${VERSION_TAG}_${OS_PLATFORM}.zip | gunzip -c - > ${DIR}/terraform-provider-${PROVIDER} + +# unzip can't handle files from stdin, so we create a temporary file +ZIP_FILE=terraform-provider-${PROVIDER}_${VERSION_TAG}_${OS_PLATFORM}.zip +curl -sfL https://github.com/rancher/terraform-provider-${PROVIDER}/releases/download/${VERSION}/${ZIP_FILE} -o ${ZIP_FILE} + +unzip $ZIP_FILE -d ${DIR} +rm ${ZIP_FILE} + +#Note the required 'v' in front of VERSION_TAG +mv ${DIR}/terraform-provider-${PROVIDER}_v${VERSION_TAG} ${DIR}/terraform-provider-${PROVIDER} # Mod binary chmod +x ${DIR}/terraform-provider-${PROVIDER} diff --git a/website/rancher2.erb b/website/rancher2.erb index 06c3634d..2f7544fe 100644 --- a/website/rancher2.erb +++ b/website/rancher2.erb @@ -28,12 +28,6 @@ > rancher2_cluster - > - rancher2_cluster_alert_group - - > - rancher2_cluster_alert_rule - > rancher2_cluster_driver @@ -73,18 +67,9 @@ > rancher2_node_template - > - rancher2_notifier - > rancher2_project - > - rancher2_project_alert_group - - > - rancher2_project_alert_rule - > rancher2_project_logging @@ -157,12 +142,6 @@ > rancher2_cluster - > - rancher2_cluster_alert_group - - > - rancher2_cluster_alert_rule - > rancher2_cluster_driver @@ -205,18 +184,9 @@ > rancher2_node_template - > - rancher2_notifier - > rancher2_project - > - rancher2_project_alert_group - - > - rancher2_project_alert_rule - > rancher2_project_logging