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

[DDS] Failed to GET resource flexibleengine_dds_databaserole #28

Open
valentin-dubreuil opened this issue Dec 28, 2022 · 0 comments
Open
Assignees
Labels

Comments

@valentin-dubreuil
Copy link
Contributor

valentin-dubreuil commented Dec 28, 2022

Problem

In the resource flexibleengine_dds_databaserole GET request return HTTP 400 (FlexibleEngine API) error when the ressource does not exist. For crossplane an error must not be returned if the resource does not exist

https://github.com/FrangipaneTeam/provider-flexibleengine/blob/6a4a2050f0a4865faca93b5a6e9ac6271de2b0b3/examples/dds/databaserole.yaml#L1-L2

Error message in provider

Status:
  At Provider:
  Conditions:
    Last Transition Time:  2022-12-28T10:18:05Z
    Message:               observe failed: cannot run refresh: refresh failed: error getting database role (example-dds-database) from DDS instance : Bad request with: [GET https://dds.xxx.prod-cloud-ocb.orange-business.com/v3/xxx/instances/xxx/db-roles?db_name=example_dds_database&role_name=example-dds-database], error message: {"error_code":"DBS.200823","error_msg":"The database does not exist."}:

This error is returned by HuaweiCloud Terraform Provider

https://github.com/huaweicloud/terraform-provider-huaweicloud/blob/ebb8bbb6ae31563c4d3a73fa7b47a1f3dd5e8808/huaweicloud/services/dds/resource_huaweicloud_dds_database_role.go#L276-L280

resp, err := roles.List(client, instanceId, opts)
if err != nil {
	return common.CheckDeletedDiag(d, err, fmt.Sprintf("error getting database role (%s) from DDS instance (%s)", name, instanceId))

Reproduce

  1. Clone repo
  2. Use branch feature-dds
  3. kubectl apply -f examples/dds/databaserole.yaml -f examples/dds/instance.yaml -f examples/vpc/securitygroup.yaml -f examples/vpc/vpcsubnet.yaml -f examples/vpc/vpc.yaml
@azrod azrod linked a pull request Jan 12, 2023 that will close this issue
1 task
@azrod azrod changed the title [DDS] Failed to GET resource flexibleengine_dds_databaserole [DDS] Failed to GET resource flexibleengine_dds_databaserole Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants