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

[Fix] Fix the error of access type setting #902

Merged
merged 1 commit into from
Feb 5, 2021
Merged

[Fix] Fix the error of access type setting #902

merged 1 commit into from
Feb 5, 2021

Conversation

Lance52259
Copy link
Collaborator

@Lance52259 Lance52259 commented Feb 5, 2021

What this PR does / why we need it:
Access type and access level hasn't default value, program will throw a Error when SFS doing upodation.
In huaweicloud SFS API, access level has a default value 'rw' and access type is 'cert'. When program doing updation,
Terraform will doing read and use it to compare with state config. Then, program find a difference because of access type
set null in updation and state config is not empty. The API doesn't accept null values, so, the Error happiend.

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

NONE

Special notes for your reviewer:

Release note:

1. set access_level and access_type to computed.
2. use d.GetOk() instead of d.Get() and empty check because of d.GetOk() contains d.Get() and empty check.

PR Checklist

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

Acceptance Steps Performed

make testacc TEST='./huaweicloud' TESTARGS='-run=TestAccSFSFileSystemV2_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud -v -run=TestAccSFSFileSystemV2_basic -timeout 360m -parallel 4
=== RUN   TestAccSFSFileSystemV2_basic
=== PAUSE TestAccSFSFileSystemV2_basic
=== CONT  TestAccSFSFileSystemV2_basic
--- PASS: TestAccSFSFileSystemV2_basic (103.77s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud       103.818s

@Lance52259 Lance52259 changed the title [Fix] Fix the error of access type setting exception [Fix] Fix the error of access type setting Error Feb 5, 2021
@Lance52259 Lance52259 changed the title [Fix] Fix the error of access type setting Error [Fix] Fix the error of access type setting Feb 5, 2021
- make access_level and access_type schema computed true
- use d.GetOk() instead of d.Get() and empty check
@ShiChangkuo ShiChangkuo merged commit f9f5727 into huaweicloud:master Feb 5, 2021
@Lance52259 Lance52259 deleted the AccessTypePatch branch February 7, 2021 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants