Skip to content

fix: Fix boot device selection crash#887

Merged
adeatcu-ionos merged 1 commit intomasterfrom
fix-boot-device-selection-crash
Oct 29, 2025
Merged

fix: Fix boot device selection crash#887
adeatcu-ionos merged 1 commit intomasterfrom
fix-boot-device-selection-crash

Conversation

@adeatcu-ionos
Copy link
Copy Markdown
Contributor

What does this fix or implement?

Fix boot device selection crash by providing a value for the error sentinel. With the previous version, the err was nil and this condition:

if err != nil {
		if errors.Is(err, cloudapiserver.ErrServerNotFound) {
			d.SetId("")
			return nil
		}
		return diag.FromErr(err)
}

Was not met, even when the server didn't exist.

Other observations:

  • I provided a value for ErrSuspendCubeLast also, but this is rather used as a signal instead of an actual error, maybe this is not the right approach for this but redesigning it it's out of the scope of this PR

Checklist

  • PR name added as appropriate (e.g. feat:/fix:/doc:/test:/refactor:)
  • Tests added or updated
  • Documentation updated
  • Changelog updated and version incremented (label: upcoming release)
  • Github Issue linked if any
  • Jira task updated

@sonarqubecloud
Copy link
Copy Markdown

@adeatcu-ionos adeatcu-ionos requested a review from Copilot October 24, 2025 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a crash in the boot device selection functionality by properly initializing error sentinel values. The issue occurred because ErrServerNotFound was nil, preventing proper error handling when a server didn't exist.

Key Changes:

  • Initialized ErrServerNotFound and ErrSuspendCubeLast sentinel errors with actual error values
  • Updated changelog to document the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
services/cloudapi/cloudapiserver/server.go Initialized sentinel error variables with errors.New() to fix nil error checking
CHANGELOG.md Added entry documenting the crash fix in version 6.7.18

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@adeatcu-ionos adeatcu-ionos merged commit 170e5ee into master Oct 29, 2025
7 checks passed
@adeatcu-ionos adeatcu-ionos deleted the fix-boot-device-selection-crash branch October 29, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants