Skip to content

🐛 Fix wrong error variable returned in initAwsEc2Volume#6965

Merged
tas50 merged 1 commit intomainfrom
fix/ec2-volume-init-error
Mar 17, 2026
Merged

🐛 Fix wrong error variable returned in initAwsEc2Volume#6965
tas50 merged 1 commit intomainfrom
fix/ec2-volume-init-error

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 17, 2026

Summary

  • initAwsEc2Volume (aws_ec2.go:1906) checks rawResources.Error but returns the stale err variable from a prior CreateResource call on line 1898
  • This silently swallows the actual error from GetVolumes(), making volume init failures invisible

Test plan

  • go vet ./providers/aws/... passes
  • make test/lint passes

🤖 Generated with Claude Code

GetVolumes() error was silently swallowed because the code
returned a stale `err` from an earlier CreateResource call
instead of `rawResources.Error`.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a nil error being returned instead of the actual error when EC2 volume listing fails.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

5 481 tests   5 477 ✅  2m 14s ⏱️
  410 suites      4 💤
   31 files        0 ❌

Results for commit 1bbd149.

@tas50 tas50 merged commit 265a9e0 into main Mar 17, 2026
22 checks passed
@tas50 tas50 deleted the fix/ec2-volume-init-error branch March 17, 2026 18:11
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant