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(apig/plugin): support the associate resource #3013

Merged
merged 1 commit into from
May 18, 2023
Merged

feat(apig/plugin): support the associate resource #3013

merged 1 commit into from
May 18, 2023

Conversation

Lance52259
Copy link
Collaborator

What this PR does / why we need it:
Support an associate resource to manage plugin bindings.
The CRD options are support retry logic because of the API is limited to only one attach operation at a time for standrad policy and plugin policy.

make testacc TEST='./huaweicloud/services/acceptance/apig' TESTARGS='-run=TestAccPluginAssociate_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/apig -v -run=TestAccPluginAssociate_basic -timeout 360m -parallel 4
=== RUN   TestAccPluginAssociate_basic
=== PAUSE TestAccPluginAssociate_basic
=== CONT  TestAccPluginAssociate_basic
2023/05/12 16:19:25 ----------------------------------------------------------------------------
2023/05/12 16:19:25 An error was occured
2023/05/12 16:19:25 The error is: golangsdk.ErrDefault500{ErrUnexpectedResponseCode:golangsdk.ErrUnexpectedResponseCode{BaseError:golangsdk.BaseError{DefaultErrString:"", Info:""}, URL:"https://apig.cn-north-4.myhuaweicloud.com/v2/0970dd7a1300f5672ff2c003c60ae115/apigw/instances/c513d5edc7c146cdb7aefcc234f0339d/plugins/801bce1d1f3146f1b696b7d8e65d411a/attach", Method:"POST", Expected:[]int{200, 201, 202}, Actual:500, Body:[]uint8{0x7b, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x22, 0x41, 0x50, 0x49, 0x47, 0x2e, 0x33, 0x35, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x3a, 0x22, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x74, 0x63, 0x64, 0x22, 0x7d}}}
2023/05/12 16:19:25 The error code is 500!!!
2023/05/12 16:19:25 The actual error message is "APIG.3500"
2023/05/12 16:19:25 Matched the error code!
2023/05/12 16:19:25 ----------------------------------------------------------------------------
2023/05/12 16:19:54 ----------------------------------------------------------------------------
2023/05/12 16:19:54 An error was occured
2023/05/12 16:19:54 The error is: golangsdk.ErrDefault500{ErrUnexpectedResponseCode:golangsdk.ErrUnexpectedResponseCode{BaseError:golangsdk.BaseError{DefaultErrString:"", Info:""}, URL:"https://apig.cn-north-4.myhuaweicloud.com/v2/0970dd7a1300f5672ff2c003c60ae115/apigw/instances/c513d5edc7c146cdb7aefcc234f0339d/plugins/6c26a1c8520d4f738cf601d7fbd59855/attach", Method:"POST", Expected:[]int{200, 201, 202}, Actual:500, Body:[]uint8{0x7b, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x22, 0x41, 0x50, 0x49, 0x47, 0x2e, 0x33, 0x35, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x3a, 0x22, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x74, 0x63, 0x64, 0x22, 0x7d}}}
2023/05/12 16:19:54 The error code is 500!!!
2023/05/12 16:19:54 The actual error message is "APIG.3500"
2023/05/12 16:19:54 Matched the error code!
2023/05/12 16:19:54 ----------------------------------------------------------------------------
--- PASS: TestAccPluginAssociate_basic (671.63s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/apig      671.711s

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. support the associate resource.

PR Checklist

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

Acceptance Steps Performed

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

@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

1 similar comment
@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

1 similar comment
@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@Jason-Zhang9309
Copy link
Collaborator

/lgtm

@github-actions github-actions bot added the LGTM /lgtm label May 17, 2023
@github-actions github-actions bot added size/L and removed LGTM /lgtm size/XL labels May 18, 2023
@ShiChangkuo ShiChangkuo added the LGTM /lgtm label May 18, 2023
@ShiChangkuo ShiChangkuo merged commit e168ee2 into huaweicloud:master May 18, 2023
10 checks passed
@Lance52259 Lance52259 deleted the br_apig_plugin_associate branch June 2, 2023 03:13
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.

None yet

4 participants