fix: support try mode apply without prior config - #14050
Merged
Merged
Conversation
frezbo
approved these changes
Aug 14, 2026
There was a problem hiding this comment.
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
nilhandling inState.SetConfigto 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.
Orzelius
approved these changes
Aug 15, 2026
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
force-pushed
the
fix/config-revert-nil
branch
from
August 16, 2026 15:19
8ea1e43 to
be6b963
Compare
Member
Author
|
/m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this fix, Talos panics while trying to set the config to
nilvalue. 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