{"record":{"id":"e7ede262fba1baad","repo":"kubernetes/kops","slug":"expected-virtualmachinescalesetvm-got-t","errorCode":null,"errorMessage":"expected VirtualMachineScaleSetVM, got %T","messagePattern":"expected VirtualMachineScaleSetVM, got %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/azure/dump.go","lineNumber":87,"sourceCode":"\tdata := make(map[string]interface{})\n\tdata[\"id\"] = r.ID\n\tdata[\"type\"] = r.Type\n\tdata[\"raw\"] = r.Obj\n\top.Dump.Resources = append(op.Dump.Resources, data)\n\n\treturn nil\n}\n\nfunc DumpVMScaleSetVM(op *resources.DumpOperation, r *resources.Resource) error {\n\tdata := make(map[string]interface{})\n\tdata[\"id\"] = r.ID\n\tdata[\"type\"] = r.Type\n\tdata[\"raw\"] = r.Obj\n\top.Dump.Resources = append(op.Dump.Resources, data)\n\n\tvm, ok := r.Obj.(*compute.VirtualMachineScaleSetVM)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expected VirtualMachineScaleSetVM, got %T\", r.Obj)\n\t}\n\n\trid, err := arm.ParseResourceID(r.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvmssName := \"\"\n\tif rid.Parent != nil {\n\t\tvmssName = rid.Parent.Name\n\t}\n\n\tinstance := &resources.Instance{Name: r.Name}\n\tif instance.Name == \"\" {\n\t\tif vm.Properties != nil && vm.Properties.OSProfile != nil && vm.Properties.OSProfile.ComputerName != nil {\n\t\t\tinstance.Name = *vm.Properties.OSProfile.ComputerName\n\t\t} else {\n\t\t\tinstance.Name = rid.Name\n\t\t}","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/azure/dump.go#L69-L105","documentation":"A type assertion guard: DumpVMScaleSetVM finds the resource's Obj is not a *compute.VirtualMachineScaleSetVM, so the dump cannot proceed — an internal invariant violation in resource tracker construction, not user input.","triggerScenarios":"Thrown at pkg/resources/azure/dump.go:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the resource tracker was built by toVMScaleSetVMResource with the correct Obj type","Report a kOps bug if triggered by unmodified code","Re-run the dump after rebuilding resource discovery state"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}