Repository navigation
examples: add SLES 16 OS patch plan with drain and conditional reboot - #503
Merged
Merged
Conversation
brandond
reviewed
Dec 1, 2026
| patch.sh: | | ||
| #!/bin/sh | ||
| set -u | ||
| for i in 1 2 3 4 5 6 7 8 9 10; do |
Member
There was a problem hiding this comment.
this is an odd way to express retrying 10 times but sure!
Contributor
Author
There was a problem hiding this comment.
Sorry about that, you're right. I changed it to a counter loop. That is the only change; the rest of the file is the same.
brandond
approved these changes
Dec 1, 2026
The existing SUSE example targets SLE 15 with 'zypper up' and does not handle reboots. This plan patches SLES 16 nodes one at a time: nodes are selected by label, cordoned and drained, patched with 'zypper patch', services using deleted libraries are restarted, and the node reboots only when zypper flags a reboot. The script is idempotent, so the pod that runs after the reboot completes and the controller uncordons the node and clears the label through postCompleteLabels. Tested with system-upgrade-controller v0.21.1 on RKE2 v1.36.6 with SLES 16.1 nodes: forced reboot path, no-reboot path, and retry while zypp is locked by another process. Signed-off-by: Gustavo Varela <gvarela@suse.com>
gusraggio
force-pushed
the
examples-sles16-patch
branch
from
December 1, 2026 19:49
1bd20bc to
0893a2d
Compare
brandond
approved these changes
Dec 1, 2026
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.
Summary
examples/suse/sles.yamltargets SLE 15 withzypper upand does not handle reboots. This addsexamples/suse/sles16-patch.yaml: a Secret with an idempotent patch script and a Plan that patches SLES 16 nodes one at a time.patch.suse.com/pending=true), so an external patch management tool can decide which nodes to patch.zypper patch, services still using deleted libraries are restarted (except the Kubernetes runtime), and the node reboots only when zypper flags a reboot (/run/reboot-needed).postCompleteLabels.Related: #282 (reboot handling) and #22 (examples per OS). Because the reboot happens inside the job and the controller only uncordons when the job completes after the reboot, the node is not uncordoned before it reboots.
Testing
system-upgrade-controller v0.21.1 (release manifests) on RKE2 v1.36.6 with SLES 16.1 nodes:
/run/reboot-neededpresent): node cordoned, script rebooted the node, post-boot pod completed ("node patched, no reboot needed"), node uncordoned and label set tofalse; 0 failed requests to a 3-replica NodePort service during the run.Also run earlier with v0.20.1 as shipped by Rancher 2.15.4 (kernel patch applied, 0 failed requests).
Signed-off-by: Gustavo Varela gvarela@suse.com