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

support updating backup_strategy in opengauss #823

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

Jason-Zhang9309
Copy link
Collaborator

@Jason-Zhang9309 Jason-Zhang9309 commented Jan 18, 2021

support updating backup_strategy in opengauss
Test result:

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

@ShiChangkuo
Copy link
Collaborator

@Jason-Zhang9309 could you add the change into acc test? thanks

@Jason-Zhang9309
Copy link
Collaborator Author

@Jason-Zhang9309 could you add the change into acc test? thanks

Sure. It has been added.

@@ -92,7 +92,7 @@ The following arguments are supported:
* `datastore` - (Optional, List, ForceNew) Specifies the datastore information. Structure is documented below.
Changing this parameter will create a new resource.

* `backup_strategy` - (Optional, List, ForceNew) Specifies the advanced backup policy. Structure is documented below.
* `backup_strategy` - (Optional, List) Specifies the advanced backup policy. Structure is documented below.
Changing this parameter will create a new resource.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should also be deprecated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 692 to 697
updateOpts.KeepDays = &keep_days
updateOpts.StartTime = rawMap["start_time"].(string)
// Fixed to "1,2,3,4,5,6,7"
updateOpts.Period = "1,2,3,4,5,6,7"
// Fixed to "30"
updateOpts.DifferentialPeriod = "30"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use a more graceful way, like:
updateOpts := backups.UpdateOpts {
....
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Jason-Zhang9309
Copy link
Collaborator Author

New Test result:

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

@ShiChangkuo ShiChangkuo merged commit 230ee32 into huaweicloud:master Jan 19, 2021
@Jason-Zhang9309 Jason-Zhang9309 deleted the dev-gaussdb branch January 20, 2021 06:43
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.

2 participants