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

feat(lts/log_group): the log group supports enterprise_project_id #5875

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

wuzhuanhong
Copy link
Contributor

What this PR does / why we need it:

Add enterprise_project_id parameter for log group resource and DataSource.

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

Special notes for your reviewer:

Release note:

1. the log group resource and DataSource supports enterprise_project_id parameter.
2. supports correponding document and acceptance test.

PR Checklist

  • Tests added/passed.
make testacc TEST=./huaweicloud/services/acceptance/lts TESTARGS='-run TestAccLtsGroup'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/lts -v -run TestAccLtsGroup -timeout 360m -parallel 4
=== RUN   TestAccLtsGroup_basic
=== PAUSE TestAccLtsGroup_basic
=== RUN   TestAccLtsGroup_withEpsId
=== PAUSE TestAccLtsGroup_withEpsId
=== CONT  TestAccLtsGroup_basic
=== CONT  TestAccLtsGroup_withEpsId
--- PASS: TestAccLtsGroup_withEpsId (36.22s)
--- PASS: TestAccLtsGroup_basic (99.23s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/lts       99.278s

make testacc TEST=./huaweicloud/services/acceptance/lts TESTARGS='-run TestAccDataSourceGroups_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/lts -v -run TestAccDataSourceGroups_basic -timeout 360m -parallel 4
=== RUN   TestAccDataSourceGroups_basic
=== PAUSE TestAccDataSourceGroups_basic
=== CONT  TestAccDataSourceGroups_basic
--- PASS: TestAccDataSourceGroups_basic (42.84s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/lts       42.890s
  • Documentation updated.

  • Schema updated.

  • CheckDeleted.

    • a. During query operation (Read Context)
      aa. Resource not found
      >>>>>> Paste the screenshot here <<<<<<

    • b. During delete/disassociate/unbind operation (Delete Context)
      ba. Resource not found
      >>>>>> Paste the screenshot here <<<<<<

Comment on lines 59 to 61
output "is_set_epsId" {
value = try([for v in data.huaweicloud_lts_groups.test.groups : v.enterprise_project_id if
v.id == huaweicloud_lts_group.test.id][0] == huaweicloud_lts_group.test.enterprise_project_id, false)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
output "is_set_epsId" {
value = try([for v in data.huaweicloud_lts_groups.test.groups : v.enterprise_project_id if
v.id == huaweicloud_lts_group.test.id][0] == huaweicloud_lts_group.test.enterprise_project_id, false)
}
locals {
eps_filter_result = [for v in data.huaweicloud_lts_groups.test.groups : v.enterprise_project_id == huaweicloud_lts_group.test.enterprise_project_id if v.id == huaweicloud_lts_group.test.id]
}
output "is_eps_return_and_matched" {
value = length(local.eps_filter_result) > 0 && alltrue(local.eps_filter_result)
}

@wuzhuanhong
Copy link
Contributor Author

When acceptance.HW_ENTERPRISE_PROJECT_ID_TEST value is empty.

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

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

@wuzhuanhong
Copy link
Contributor Author

wuzhuanhong commented Nov 20, 2024

When acceptance.HW_ENTERPRISE_PROJECT_ID_TEST value is not empty.

$ echo $HW_DEST_PROJECT_ID_TEST
0a03f1a14a000f612fb1c003810d3bfe

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

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

@Lance52259
Copy link
Collaborator

/approve
/lgtm

@github-ci-robot github-ci-robot added LGTM /lgtm approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 21, 2024
Copy link
Collaborator

@github-ci-robot github-ci-robot left a comment

Choose a reason for hiding this comment

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

This PR has been approved by: @Lance52259

/approve
/lgtm

@github-ci-robot github-ci-robot merged commit d1e3c4f into huaweicloud:master Nov 21, 2024
14 checks passed
@wuzhuanhong wuzhuanhong deleted the lts_eps branch November 27, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. feature LGTM /lgtm size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants