diff --git a/src/KubernetesCluster.php b/src/KubernetesCluster.php index 60df8ddbeabba972f70130e219c03764e89cdb58..291570e504fd4eccd8e92c95f1c3ac726e5f2a74 100644 --- a/src/KubernetesCluster.php +++ b/src/KubernetesCluster.php @@ -51,11 +51,16 @@ class KubernetesCluster protected function loadFromConfig(array $config) { switch ($config['driver'] ?? null) { - case 'kubeconfig': $this->configureWithKubeConfigFile($config); break; - case 'http': $this->configureWithHttpAuth($config); break; - case 'token': $this->configureWithToken($config); break; - case 'cluster': $this->configureInCluster($config); break; - case 'variable': $this->configureWithKubeConfigVariable($config); break; + case 'kubeconfig': $this->configureWithKubeConfigFile($config); + break; + case 'http': $this->configureWithHttpAuth($config); + break; + case 'token': $this->configureWithToken($config); + break; + case 'cluster': $this->configureInCluster($config); + break; + case 'variable': $this->configureWithKubeConfigVariable($config); + break; default: break; } } diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index 1eec432a3cb0901a66c8a8164d8b34e37bfe36a9..69a724505bf94d278f6e62a2892a49fa4e5e0c8d 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -134,7 +134,7 @@ class ConfigurationTest extends TestCase /** * @dataProvider environmentVariableContextProvider */ - public function test_from_environment_variable(string $context = null, string $expectedDomain) + public function test_from_environment_variable(?string $context = null, string $expectedDomain) { $_SERVER['KUBECONFIG'] = __DIR__.'/cluster/kubeconfig.yaml::'.__DIR__.'/cluster/kubeconfig-2.yaml';