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

ibm_satellite_attach_host_script shows incorrect syntax for labels #4099

Closed
andrewferrier-ibm opened this issue Oct 10, 2022 · 0 comments · Fixed by #4100
Closed

ibm_satellite_attach_host_script shows incorrect syntax for labels #4099

andrewferrier-ibm opened this issue Oct 10, 2022 · 0 comments · Fixed by #4100
Labels
bug crash Panics on provider documentation service/Satellite Issues related to IBMCloud Satellite

Comments

@andrewferrier-ibm
Copy link

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

New or Affected Resource(s) or Datasource(s)

  • ibm_satellite_attach_host_script

Description

ibm_satellite_attach_host_script documentation is incorrect: https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/satellite_attach_host_script. It shows labels as being of the form cpu=4. However, they must be of the form cpu:4, otherwise this causes a crash in the Terraform provider:

tack trace from the terraform-provider-ibm_v1.46.0 plugin:

panic: runtime error: index out of range [1] with length 1

goroutine 771 [running]:
github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex.FlattenHostLabels(0x14002ed9670, 0x1, 0x1, 0x1)
	github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex/structures.go:2745 +0x158
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite.dataSourceIBMSatelliteAttachHostScriptRead(0x14002c99a80, 0x103a6cae0, 0x140004d5b00, 0x103a849e0, 0x0)
	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite/data_source_ibm_satellite_host_script.go:123 +0x414
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x1400094f5e0, 0x103b141a0, 0x14002c2a300, 0x14002c99a80, 0x103a6cae0, 0x140004d5b00, 0x0, 0x0, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:712 +0x170
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0x1400094f5e0, 0x103b141a0, 0x14002c2a300, 0x14002c99980, 0x103a6cae0, 0x140004d5b00, 0x140004d5b00, 0x14002c99980, 0x0, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:943 +0x118
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0x1400000d578, 0x103b140f8, 0x14002c2a300, 0x14003da3220, 0x102c8cb3c, 0x12, 0x0)

I confirmed this by inspecting the provider code.

@github-actions github-actions bot added bug crash Panics on provider service/Satellite Issues related to IBMCloud Satellite labels Oct 10, 2022
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Oct 11, 2022
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash Panics on provider documentation service/Satellite Issues related to IBMCloud Satellite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant