From 63245430efa417d88ea7c13ffea433ea9bb069fe Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Mon, 26 Jan 2026 10:08:44 +0100 Subject: [PATCH] Make 'dockerSocketPath' an attribute Signed-off-by: Pablo Zmdl --- php/src/ContainerDefinitionFetcher.php | 2 +- php/src/Data/ConfigurationManager.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index 3bbc37e2..ead82363 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -129,7 +129,7 @@ readonly class ContainerDefinitionFetcher { continue; } } elseif ($value['source'] === '%WATCHTOWER_DOCKER_SOCKET_PATH%') { - $value['source'] = $this->configurationManager->GetDockerSocketPath(); + $value['source'] = $this->configurationManager->dockerSocketPath; if($value['source'] === '') { continue; } diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 41097c8d..090762ae 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -667,11 +667,9 @@ class ConfigurationManager set { $this->set('fulltextsearch_java_options', $value); } } - public function GetDockerSocketPath() : string { - $envVariableName = 'WATCHTOWER_DOCKER_SOCKET_PATH'; - $configName = 'docker_socket_path'; - $defaultValue = '/var/run/docker.sock'; - return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue); + public string $dockerSocketPath { + get => $this->GetEnvironmentalVariableOrConfig('WATCHTOWER_DOCKER_SOCKET_PATH', 'docker_socket_path', '/var/run/docker.sock'); + set { $this->set('docker_socket_path', $value); } } public function GetTrustedCacertsDir() : string {