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

[BUG] Inconsistent error handling for routes in App Resource #101

Closed
1 task done
vipinvkmenon opened this issue Apr 27, 2024 · 0 comments · Fixed by #104
Closed
1 task done

[BUG] Inconsistent error handling for routes in App Resource #101

vipinvkmenon opened this issue Apr 27, 2024 · 0 comments · Fixed by #104
Labels
bug Something isn't working

Comments

@vipinvkmenon
Copy link
Member

vipinvkmenon commented Apr 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What version of the Terraform provider are you using?

No response

What version of the Terraform CLI are you using?

1.8.2

What CF API version are you using?

3.159.0

What type of issue are you facing

bug report

Describe the bug

When we add routes to an app resource, it overwrites errors/diagnostics thrown by other fields

Expected Behavior

Consistent behaviour. routes does not overwrite errors thrown by other fields.

Steps To Reproduce

Execute terraform apply

Your Terraform Configuration

# This resource creation will fail with error: don't know how to reflect tftypes.String into interface {}
# due to issues with params.
resource "cloudfoundry_app" "http-bin-server" {
  name         = "tf-test-do-not-delete-http-bin2"
  space_name   = "Space Name"
  org_name     = "Org Name"
  docker_image = "kennethreitz/httpbin"

service_bindings = [
    {
      service_instance : "xsuaa_svc"
      params = {
        role = "Token_Exchange"
      }
    }
  ]
 }

# -------------------------------------------

# The resource http-bin-server2
# will not fail when `routes` is present

 resource "cloudfoundry_app" "http-bin-server2" {
  name         = "tf-test-do-not-delete-http-bin3"
  space_name   = data.cloudfoundry_space.space.name
  org_name     = "PerformanceTeamBLR"
  docker_image = "kennethreitz/httpbin"

  service_bindings = [
    {
      service_instance : "xsuaa_svc"
      params = {
        role = "Token_Exchange"
      }
    }
  ]

  routes = [
    {
      route = "asdjkasss.cfapps.sap.hana.ondemand.com"
    }
  ]
 }

Roles

No response

Add screenshots to help explain your problem

No response

Additional context

Seems like in mapAppTypeToValues writes to diags instead of tempDiags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant