Skip to content

fix: support try mode apply without prior config - #14050

Merged
talos-bot merged 1 commit into
siderolabs:mainfrom
smira:fix/config-revert-nil
Aug 16, 2026
Merged

fix: support try mode apply without prior config#14050
talos-bot merged 1 commit into
siderolabs:mainfrom
smira:fix/config-revert-nil

Conversation

@smira

@smira smira commented Aug 14, 2026

Copy link
Copy Markdown
Member

Without this fix, Talos panics while trying to set the config to nil value. This is an edge case specifically for naving no machine config prior to the requested try operation.

Add a regression test in the maintenance test.

Fixes #14044

@smira smira added the integration/provision-3 Run provision integration tests for track 3 (maintenance API basic, maintenance API + SideroLink) label Aug 14, 2026
Copilot AI lite review requested due to automatic review settings August 14, 2026 16:29
@github-project-automation github-project-automation Bot moved this to To Do in Planning Aug 14, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Aug 14, 2026
@github-project-automation github-project-automation Bot moved this from In Review to Approved in Planning Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Prevents a panic when applying machine configuration in TRY mode while the node has no prior machine config (maintenance edge-case). The runtime state now treats nil config as “remove config resource”, and an integration regression test exercises apply+rollback behavior.

Changes:

  • Add nil handling in State.SetConfig to destroy the MachineConfig resource (no-op if absent).
  • Add a maintenance-mode integration test that applies a sysctl config in TRY mode and verifies rollback removes the corresponding runtime resource.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/integration/provision/maintenance_basic.go Adds a maintenance regression test covering TRY-mode apply when no prior config exists, and validates rollback removes the sysctl spec.
internal/app/machined/pkg/runtime/v1alpha2/v1alpha2_state.go Fixes the panic by handling nil config via resource destruction instead of attempting to create/update a config resource with a nil provider.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/integration/provision/maintenance_basic.go
Without this fix, Talos panics while trying to set the config to `nil`
value. This is an edge case specifically for naving no machine config
prior to the requested try operation.

Add a regression test in the maintenance test.

Fixes siderolabs#14044

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira
smira force-pushed the fix/config-revert-nil branch from 8ea1e43 to be6b963 Compare August 16, 2026 15:19
@smira

smira commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

/m

@talos-bot
talos-bot merged commit be6b963 into siderolabs:main Aug 16, 2026
69 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Planning Aug 16, 2026
@smira smira moved this from Proposed to Accepted in Backports to v1.13 Aug 17, 2026
@smira smira moved this from Accepted to In Progress in Backports to v1.13 Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration/provision-3 Run provision integration tests for track 3 (maintenance API basic, maintenance API + SideroLink)

Projects

Status: In Progress
Status: Proposed
Archived in project

Development

Successfully merging this pull request may close these issues.

apply config in try mode in maintenance would panic

5 participants