Skip to content

Conversation

@glennpratt
Copy link
Contributor

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

github.com/linode/cluster-api-provider-linode/api/v1alpha2.(*LinodeMachine).DeleteCondition(...)
/workspace/api/v1alpha2/linodemachine_types.go:605

What this PR does / why we need it:

Fix this panic hit during Linode creation / launch:

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

"panicGoValue": "runtime.boundsError{x:7, y:7, signed:true, code:0x0}"

goroutine 460 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2eff728, 0xc001280e10}, {0x28a2aa0, 0xc0015a0c00})
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:132 +0xbc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile.func1()
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:108 +0x112
panic({0x28a2aa0?, 0xc0015a0c00?})
	/usr/local/go/src/runtime/panic.go:792 +0x132
github.com/linode/cluster-api-provider-linode/api/v1alpha2.(*LinodeMachine).DeleteCondition(...)
	/workspace/api/v1alpha2/linodemachine_types.go:605
github.com/linode/cluster-api-provider-linode/internal/controller.resizeRootDisk({0x2eff798, 0xc000294bd0}, {{0x2f09548?, 0xc001281350?}, 0x4e61e0?}, 0xc0007a4d00, 0x5f86236)
	/workspace/internal/controller/linodemachine_controller_helpers.go:1382 +0xb77
github.com/linode/cluster-api-provider-linode/internal/controller.configureDisks({0x2eff798, 0xc000294bd0}, {{0x2f09548?, 0xc001281350?}, 0x17eada5?}, 0xc0007a4d00, 0x5f86236)
	/workspace/internal/controller/linodemachine_controller_helpers.go:1226 +0x85
github.com/linode/cluster-api-provider-linode/internal/controller.(*LinodeMachineReconciler).reconcilePreflightConfigure(0xc0002d6f80, {0x2eff798, 0xc000294bd0}, 0x5f86236, {{0x2f09548?, 0xc001281350?}, 0x0?}, 0xc0007a4d00)
	/workspace/internal/controller/linodemachine_controller.go:602 +0x87
github.com/linode/cluster-api-provider-linode/internal/controller.(*LinodeMachineReconciler).reconcileCreate(0xc0002d6f80, {0x2eff798, 0xc000294bd0}, {{0x2f09548?, 0xc001281350?}, 0xc232c667dd529a32?}, 0xc0007a4d00)
	/workspace/internal/controller/linodemachine_controller.go:315 +0x687
github.com/linode/cluster-api-provider-linode/internal/controller.(*LinodeMachineReconciler).reconcile(0xc0002d6f80, {0x2eff798, 0xc000294bd0}, {{0x2f09548?, 0xc001281350?}, 0xc000fdcf08?}, 0xc0007a4d00)
	/workspace/internal/controller/linodemachine_controller.go:254 +0x627
github.com/linode/cluster-api-provider-linode/internal/controller.(*LinodeMachineReconciler).Reconcile(0xc0002d6f80, {0x2eff728?, 0xc001280e40?}, {{{0xc0008c39c8?, 0xc0011f54c0?}, {0xc0008c3a58?, 0x17ee8a7?}}})
	/workspace/internal/controller/linodemachine_controller.go:173 +0x104c
github.com/linode/cluster-api-provider-linode/observability/wrappers/runtimereconciler.RuntimeReconcilerWithTracing.Reconcile({{0x2eccb80?, 0xc0002d6f80?}, 0x2bc0b68?}, {0x2eff728?, 0xc001280e10?}, {{{0xc0008c39c8?, 0x0?}, {0xc0008c3a58?, 0x2a67ef1?}}})
	/workspace/observability/wrappers/runtimereconciler/runtimereconciler.gen.go:60 +0x1b8
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile(0xc001280d80?, {0x2eff728?, 0xc001280e10?}, {{{0xc0008c39c8?, 0x0?}, {0xc0008c3a58?, 0x0?}}})
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0xbf
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler(0x2f34040, {0x2eff760, 0xc000326cd0}, {{{0xc0008c39c8, 0x16}, {0xc0008c3a58, 0x18}}}, 0x0)
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:340 +0x3ad
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem(0x2f34040, {0x2eff760, 0xc000326cd0})
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:300 +0x21b
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.1()
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:202 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2 in goroutine 171
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198 +0x28f

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

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

github.com/linode/cluster-api-provider-linode/api/v1alpha2.(*LinodeMachine).DeleteCondition(...)
	/workspace/api/v1alpha2/linodemachine_types.go:605
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.28%. Comparing base (46f4ab1) to head (17b07c8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #925      +/-   ##
==========================================
+ Coverage   65.94%   66.28%   +0.33%     
==========================================
  Files          71       71              
  Lines        7958     7957       -1     
==========================================
+ Hits         5248     5274      +26     
+ Misses       2408     2381      -27     
  Partials      302      302              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AshleyDumaine
Copy link
Collaborator

LGTM, thanks 👍
giphy

@glennpratt glennpratt merged commit 50188d8 into linode:main Oct 15, 2025
13 checks passed
@glennpratt glennpratt deleted the deletecond-panic branch October 15, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants