2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-23 19:02:17 +00:00

fix(destiny): match complete states when advancing the chain

Substring and regular-expression matches can mistake a different boot state
or image name for a completed chain. Compare the full state values while
preserving the completed boot exception.
This commit is contained in:
Vinícius Ferrão
2026-10-21 16:45:22 -03:00
parent e5df3dde1b
commit 97a0c8d7ac
+4 -1
View File
@@ -845,7 +845,10 @@ sub nextdestiny {
unless ($ref->{currchain}) { #If no current chain, copy the default
$ref->{currchain} = $ref->{chain};
} elsif ($ref->{currchain} !~ /[,;]/){
if ($ref->{currstate} and ($ref->{currchain} =~ /$ref->{currstate}/)) {
my $completed_state = $ref->{currchain};
# setdestiny records ondiscover without its command arguments.
$completed_state = 'ondiscover' if $completed_state =~ /^ondiscover=/;
if ($ref->{currstate} and $completed_state eq $ref->{currstate}) {
# 'boot' is the steady state a completed provision leaves behind,
# set by setdestiny once the install or netboot destiny is applied.
# Some installers advance the destiny more than once, so it has to