Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(cbr/vault): refactor vault resoruces structure #1515

Merged
merged 1 commit into from
Sep 28, 2021
Merged

refactor(cbr/vault): refactor vault resoruces structure #1515

merged 1 commit into from
Sep 28, 2021

Conversation

Lance52259
Copy link
Collaborator

@Lance52259 Lance52259 commented Sep 10, 2021

What this PR does / why we need it:
The current resources structure is not conducive to writing terraform scripts for mounting storage resources (EVS Disk and SFS Turbo).

  • include_volume and exclude_volumes is not used in the update function.
  • It is more reasonable to mount multiple disk by list structure.

I adjust the resources structure:

  1. id to server_id: now, the server_id only used to specify ecs instance that attach to vault.
  2. include_volumes to includes: now, the includes is used to configure the volume IDs to attach to disk and turbo vault.
  3. exclude_volumes to excludes: now, the excludes is used to specify the disks included in the backup except for the array that contains one or more disk IDs.
  4. remove name, protect_status, size, backup_size and backup_count.

Which issue this PR fixes:
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
fixes #1208

Special notes for your reviewer:

Release note:

1. refactor include and exclude structure for disk and turbo.
2. adjust parameter name.
3. remove some expired parameters.

PR Checklist

  • Tests added/passed.
  • Documentation updated.
  • Schema updated.

Acceptance Steps Performed

make testacc TEST='./huaweicloud/services/acceptance/cbr' TESTARGS='-run=TestAccCBRV3Vault_BasicServer'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cbr -v -run=TestAccCBRV3Vault_BasicServer -timeout 360m -parallel 4
=== RUN   TestAccCBRV3Vault_BasicServer
=== PAUSE TestAccCBRV3Vault_BasicServer
=== CONT  TestAccCBRV3Vault_BasicServer
--- PASS: TestAccCBRV3Vault_BasicServer (412.37s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cbr       412.698s
make testacc TEST='./huaweicloud/services/acceptance/cbr' TESTARGS='-run=TestAccCBRV3Vault_ReplicaServer'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cbr -v -run=TestAccCBRV3Vault_ReplicaServer -timeout 360m -parallel 4
=== RUN   TestAccCBRV3Vault_ReplicaServer
=== PAUSE TestAccCBRV3Vault_ReplicaServer
=== CONT  TestAccCBRV3Vault_ReplicaServer
--- PASS: TestAccCBRV3Vault_ReplicaServer (44.89s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cbr       44.954s
make testacc TEST='./huaweicloud/services/acceptance/cbr' TESTARGS='-run=TestAccCBRV3Vault_BasicVolume'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cbr -v -run=TestAccCBRV3Vault_BasicVolume -timeout 360m -parallel 4
=== RUN   TestAccCBRV3Vault_BasicVolume
=== PAUSE TestAccCBRV3Vault_BasicVolume
=== CONT  TestAccCBRV3Vault_BasicVolume
--- PASS: TestAccCBRV3Vault_BasicVolume (108.29s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cbr       108.401s
make testacc TEST='./huaweicloud/services/acceptance/cbr' TESTARGS='-run=TestAccCBRV3Vault_BasicTurbo'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cbr -v -run=TestAccCBRV3Vault_BasicTurbo -timeout 360m -parallel 4
=== RUN   TestAccCBRV3Vault_BasicTurbo
=== PAUSE TestAccCBRV3Vault_BasicTurbo
=== CONT  TestAccCBRV3Vault_BasicTurbo
--- PASS: TestAccCBRV3Vault_BasicTurbo (790.30s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cbr 790.413s
make testacc TEST='./huaweicloud/services/acceptance/cbr' TESTARGS='-run=TestAccCBRV3Vault_ReplicaTurbo'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/cbr -v -run=TestAccCBRV3Vault_ReplicaTurbo -timeout 360m -parallel 4
=== RUN   TestAccCBRV3Vault_ReplicaTurbo
=== PAUSE TestAccCBRV3Vault_ReplicaTurbo
=== CONT  TestAccCBRV3Vault_ReplicaTurbo
--- PASS: TestAccCBRV3Vault_ReplicaTurbo (43.81s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/cbr       43.920s

@Lance52259 Lance52259 changed the title [WIP]refactor(cbr/vault): refactor vault resoruces structure refactor(cbr/vault): refactor vault resoruces structure Sep 11, 2021
docs/resources/cbr_vault.md Outdated Show resolved Hide resolved
docs/resources/cbr_vault.md Show resolved Hide resolved
docs/resources/cbr_vault.md Outdated Show resolved Hide resolved
docs/resources/cbr_vault.md Show resolved Hide resolved
- refactor include and exclude structure for disk and turbo
- adjust parameter name
- remove some expired parameters
@ShiChangkuo
Copy link
Collaborator

/lgtm

@github-actions github-actions bot added the LGTM /lgtm label Sep 28, 2021
@ShiChangkuo ShiChangkuo merged commit ccb3313 into huaweicloud:master Sep 28, 2021
@Lance52259 Lance52259 deleted the br_cbr_refactor_active branch September 28, 2021 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not being able to attach multiple evs disks to one vault on terraform in an easier way
5 participants