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

Error trying to read ibm_satellite_endpoint resource #4057

Closed
rmoe opened this issue Sep 21, 2022 · 0 comments · Fixed by #4394
Closed

Error trying to read ibm_satellite_endpoint resource #4057

rmoe opened this issue Sep 21, 2022 · 0 comments · Fixed by #4394
Labels
bug service/Satellite Issues related to IBMCloud Satellite

Comments

@rmoe
Copy link

rmoe commented Sep 21, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

$ terraform -v
Terraform v1.2.9
on linux_amd64
+ provider registry.terraform.io/bgpat/travis v1.4.0
+ provider registry.terraform.io/gavinbunney/kubectl v1.14.0
+ provider registry.terraform.io/hashicorp/helm v2.5.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.11.0
+ provider registry.terraform.io/hashicorp/null v3.1.1
+ provider registry.terraform.io/hashicorp/time v0.8.0
+ provider registry.terraform.io/ibm-cloud/ibm v1.44.3
+ provider registry.terraform.io/logdna/logdna v1.8.0
+ provider registry.terraform.io/pagerduty/pagerduty v2.4.0
+ provider registry.terraform.io/sysdiglabs/sysdig v0.5.30

Affected Resource(s)

  • ibm_satellite_endpoint

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_satellite_endpoint" "manager_link" {
  location        = ibm_satellite_location.sat-location.id
  connection_type = "location"
  display_name    = "manager-link"
  server_host     = ibm_satellite_cluster.sat-cluster.ingress_hostname
  server_port     = 30060
  client_protocol = "https"
  server_protocol = "tls"
}

Expected Behavior

Terraform can read the resource so we can run a plan.

Actual Behavior

Any action which reads the satellite link resource fails with:

│ Error: [ERROR] Error setting performance: Invalid address to set: []string{"performance", "0", "connectors", "0", "txBW"}

Steps to Reproduce

  1. Create a satellite endpoint.
  2. Run terraform plan and it might fail.

Important Factoids

The issue here is when the endpolnt has performance data, specifically connectors. The provider tries to set RxBW and TxBW attributes but I don't see those in the raw response from the API. For our failing endpoint the API returns:

    "Result": {
        "conn_type": "location",
        "display_name": "manager-link",

        <A bunch of other attributes>

        "performance": {
            "connection": 15,
            "rx_bandwidth": 32,
            "tx_bandwidth": 15,
            "bandwidth": 47,
            "connectors": [
                {
                    "connector": "satellite-link-connector-xrp9g",
                    "connections": 6
                },
                {
                    "connector": "satellite-link-connector-rxbv6",
                    "connections": 6
                },
                {
                    "connector": "satellite-link-connector-jcqgh",
                    "connections": 3
                }
            ]
        }
    },

The connectors only have two attributes but it looks like the provider is trying to update the object in Terraform state with 4 attributes (two of which end up as nil) which causes the error shown above.

@github-actions github-actions bot added bug service/Satellite Issues related to IBMCloud Satellite labels Sep 21, 2022
rmoe pushed a commit to rmoe/terraform-provider-ibm that referenced this issue Mar 3, 2023
Not all API responses include these fields so they should be
conditionally added to the endpoint connectors map.

Closes: IBM-Cloud#4057
kavya498 pushed a commit that referenced this issue Mar 8, 2023
Not all API responses include these fields so they should be
conditionally added to the endpoint connectors map.

Closes: #4057
IBM-diksha pushed a commit to IBM-diksha/terraform-provider-ibm that referenced this issue Mar 17, 2023
Not all API responses include these fields so they should be
conditionally added to the endpoint connectors map.

Closes: IBM-Cloud#4057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug service/Satellite Issues related to IBMCloud Satellite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant