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]: When creating a Linux VMSS, if not providing “sourceImageReference”, a panic is created #909

Open
1 task done
chkp-orhaz opened this issue Dec 31, 2024 · 0 comments
Labels
bug Something isn't working needs:triage

Comments

@chkp-orhaz
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

provider-azure-compute - LinuxVirtualMachineScaleSet

Resource MRs required to reproduce the bug

apiVersion: compute.azure.upbound.io/v1beta2
kind: LinuxVirtualMachineScaleSet
metadata:
name: vmsstest

spec:
providerConfigRef:
name: cool-provider
forProvider:
location: Australia East
resourceGroupName: aue-rg
adminUsername: notused
networkInterface:
- name: eth0
osDisk:
caching: ReadWrite
storageAccountType: Premium_LRS
diskSizeGb: 100
sku: Standard_D4ds_v5

Steps to Reproduce

  1. Apply the manifest without SourceImageReference
  2. Look into the resource (get LinuxVirtualMachineScaleSet vmsstest -oyaml)
    a panic will be seen "runtime error: index out of range [0] with length 0"
  3. Look into the provider pod (kubectl logs provider-azure-compute-as5d64sa4da-asd4as5dsa4-das4as)

What happened?

Instead of throwing an error saying hi, SourceImageReference is missing, it appears that a panic has occured

Relevant Error Output Snippet

github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.expandSourceImageReferenceVMSS({0x15776900?, 0xc4c9a25?, 0xc50eb79?}, {0x0?, 0x5?})
	github.com/hashicorp/[email protected]/internal/services/compute/shared_schema.go:706 +0x5c5
github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.resourceLinuxVirtualMachineScaleSetCreate(0xc006ac1580, {0xaae1160, 0xc006960008})
	github.com/hashicorp/[email protected]/internal/services/compute/linux_virtual_machine_scale_set_resource.go:122 +0xb4d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xd291740?, {0xd291740?, 0xc0015f0e00?}, 0xd?, {0xaae1160?, 0xc006960008?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:766 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000b2aee0, {0xd291740, 0xc0015f0e00}, 0x0, 0xc0063d3000, {0xaae1160, 0xc006960008})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:909 +0xa69
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKExternal).Create(0xc0025c69a0, {0xd291740, 0xc0015f0e00}, {0xd306ec0, 0xc006103508})
	github.com/crossplane/[email protected]/pkg/controller/external_tfpluginsdk.go:592 +0xdd
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Create.func1()
	github.com/crossplane/[email protected]/pkg/controller/external_async_tfpluginsdk.go:166 +0x1d7
created by github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Create in goroutine 5621
	github.com/crossplane/[email protected]/pkg/controller/external_async_tfpluginsdk.go:145 +0x14c
E1231 14:43:04.012765       1 runtime.go:79] Observed a panic: runtime.boundsError{x:0, y:0, signed:true, code:0x0} (runtime error: index out of range [0] with length 0)

Crossplane Version

1.15.0

Provider Version

v1.0.1 - v1.10.2 tested

Kubernetes Version

v1.27.9

Kubernetes Distribution

AKS

Additional Info

No response

@chkp-orhaz chkp-orhaz added bug Something isn't working needs:triage labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage
Projects
None yet
Development

No branches or pull requests

1 participant