From 97a0c8d7ac9ba9f07343163d02fe52976fcfae5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 21 Oct 2026 16:45:22 -0300 Subject: [PATCH] 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. --- xCAT-server/lib/xcat/plugins/destiny.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index ea5114ea17..f16f1cd3a5 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -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