Skip to content

fix: fail nodeset when MASTER_IP cannot be resolved#35

Merged
viniciusferrao merged 1 commit into
masterfrom
fix/nodeset-empty-master-ip
May 5, 2026
Merged

fix: fail nodeset when MASTER_IP cannot be resolved#35
viniciusferrao merged 1 commit into
masterfrom
fix/nodeset-empty-master-ip

Conversation

@viniciusferrao

Copy link
Copy Markdown
Member

Summary

Template.pm silently continued rendering kickstart templates when getipaddr() failed to resolve the master hostname, producing kickstarts with an empty MASTER_IP. Nodes would install successfully but fail on first reboot when post.xcat and xcatinstallpost tried to contact the master, timing out after 90 retries.

The fix applies the same $tmplerr + return pattern already used elsewhere in the same function (e.g., the unless ($master) check two lines above).

What changed

# Before: silently continues with empty MASTER_IP
my $ipaddr = xCAT::NetworkUtils->getipaddr($master);
if ($ipaddr) {
    $ENV{MASTER_IP} = "$ipaddr";
}

# After: fails nodeset with a clear error
my $ipaddr = xCAT::NetworkUtils->getipaddr($master);
unless ($ipaddr) {
    $tmplerr = "Unable to resolve master \"$master\" to an IP address for $node";
    return;
}
$ENV{MASTER_IP} = "$ipaddr";

Test plan

  • Follows existing $tmplerr pattern (4 other instances in same function)
  • Happy path unchanged (successful resolution sets MASTER_IP as before)
  • git diff --check clean
  • Error path now returns descriptive message to nodeset caller

Fixes xcat2#7544

Template.pm silently continued rendering kickstart templates when
getipaddr() failed to resolve the master hostname, producing
kickstarts with an empty MASTER_IP. Nodes would install successfully
but fail on first reboot when post.xcat and xcatinstallpost tried
to contact the master, timing out after 90 retries with:

    the network between the node and  is not ready

Postage.pm (mypostscript generation) already checks for this and
returns a clear error. Apply the same pattern in Template.pm so
nodeset fails immediately with a descriptive message instead of
producing a broken kickstart.

Fixes xcat2#7544
@viniciusferrao viniciusferrao merged commit e65b968 into master May 5, 2026
1 check passed
@viniciusferrao viniciusferrao deleted the fix/nodeset-empty-master-ip branch May 7, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: nodeset silently renders kickstart with empty MASTER_IP when hostname resolution fails

1 participant