diff --git a/src/Exceptions/KubeConfigBaseEncodedDataInvalid.php b/src/Exceptions/KubeConfigBaseEncodedDataInvalid.php new file mode 100644 index 00000000..56b38ba6 --- /dev/null +++ b/src/Exceptions/KubeConfigBaseEncodedDataInvalid.php @@ -0,0 +1,8 @@ +expectException(KubeConfigBaseEncodedDataInvalid::class); + + KubernetesCluster::fromKubeConfigYamlFile(__DIR__.'/cluster/kubeconfig.yaml', 'minikube-invalid-base64-ca'); + } + public function test_http_authentication() { $cluster = KubernetesCluster::fromUrl('http://127.0.0.1:8080')->httpAuthentication('some-user', 'some-password'); diff --git a/tests/cluster/kubeconfig.yaml b/tests/cluster/kubeconfig.yaml index 94821903..2c32845f 100644 --- a/tests/cluster/kubeconfig.yaml +++ b/tests/cluster/kubeconfig.yaml @@ -13,6 +13,10 @@ clusters: server: https://minikube-2:8443 insecure-skip-tls-verify: true name: minikube-skip-tls +- cluster: + certificate-authority-data: c29tZS1j1YQo= # invalid base64 + server: https://minikube:8443 + name: minikube-invalid-base64-ca contexts: - context: cluster: minikube @@ -39,6 +43,11 @@ contexts: user: no-user name: minikube-without-user namespace: some-namespace +- context: + cluster: minikube-invalid-base64-ca + user: minikube + name: minikube-invalid-base64-ca + namespace: some-namespace current-context: minikube kind: Config preferences: {}