diff --git a/services/nginx/app/resources/edge-gateway-agent/agent.php b/services/nginx/app/resources/edge-gateway-agent/agent.php index 1c9c3c3b..8797a448 100644 --- a/services/nginx/app/resources/edge-gateway-agent/agent.php +++ b/services/nginx/app/resources/edge-gateway-agent/agent.php @@ -2890,7 +2890,10 @@ final class TruckwashEdgeAgent { $reloaded = AgentConfig::load($this->config->path); $this->config = $reloaded; - $this->workerHttp = new HttpJsonClient((string)$this->config->get('workerBaseUrl', self::DEFAULT_WORKER_BASE_URL)); + $this->workerHttp = new HttpJsonClient( + (string)$this->config->get('workerBaseUrl', self::DEFAULT_WORKER_BASE_URL), + $this->workerAuthorizationHeaders() + ); $this->configureBrokerClient(); } diff --git a/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayUpdateLifecycleTest.php b/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayUpdateLifecycleTest.php index 664549ac..5087d81d 100644 --- a/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayUpdateLifecycleTest.php +++ b/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayUpdateLifecycleTest.php @@ -134,6 +134,16 @@ it('builds the installer around the compose stack artifacts and management polli expect($agentSource)->toContain("'last_transport_failure_at'"); expect($agentSource)->toContain("'last_transport_error'"); expect($agentSource)->toContain('private function recordTransportFailure(string $context, Throwable $throwable): void'); + expect($agentSource)->toContain( + "private function reloadConfigFromDisk(): void\n" . + " {\n" . + " \$reloaded = AgentConfig::load(\$this->config->path);\n" . + " \$this->config = \$reloaded;\n" . + " \$this->workerHttp = new HttpJsonClient(\n" . + " (string)\$this->config->get('workerBaseUrl', self::DEFAULT_WORKER_BASE_URL),\n" . + " \$this->workerAuthorizationHeaders()\n" . + ' );' + ); expect($edgeDockerfileSource)->toContain('FROM ${BASE_IMAGE}'); expect($edgeDockerfileSource)->not->toContain('docker-php-ext-install'); expect($edgeDockerfileSource)->toContain('extension_loaded($extension)');