Fix nodelist segment being sent from queue where gethostname() is only a container name, added ability to control filename when sending nodelist segment
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 38s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m38s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
2025-03-18 17:18:28 +11:00
parent 3797f3c7c5
commit 2458ca2408
3 changed files with 12 additions and 11 deletions

View File

@@ -18,7 +18,7 @@ class NodelistSegment extends Dynamic
{
private const LOGKEY = 'DNL';
private string $name = '';
private ?string $name;
private Address $our_address;
private Carbon $now;
@@ -27,11 +27,7 @@ class NodelistSegment extends Dynamic
$this->our_address = our_address($ao->zone->domain)->first();
$this->now = Carbon::now();
$this->name = sprintf('z%dn%d.%d',
$this->our_address->zone->zone_id,
$this->our_address->host_id,
$this->now->format('z'),
);
$this->name = $arg->get('name','');
Log::debug(sprintf('%s:- Generating Nodelist for [%s] from [%s] as [%s] with arguments',self::LOGKEY,$ao->ftn,$this->our_address->ftn,$this->our_address->role_name),['args'=>$arg]);
}
@@ -157,6 +153,8 @@ class NodelistSegment extends Dynamic
public function getName(): string
{
return $this->name;
return ($this->name ?: sprintf('z%dn%d',
$this->our_address->zone->zone_id,
$this->our_address->host_id)).'.'.sprintf('%03d',$this->now->format('z'));
}
}