File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ protected function writeTempFileForContext(
244
244
/** @var \RenokiCo\PhpK8s\KubernetesCluster $this */
245
245
$ tempFolder = static ::$ tempFolder ?: sys_get_temp_dir ();
246
246
247
- $ tempFilePath = $ tempFolder .DIRECTORY_SEPARATOR .Str::slug ("ctx- {$ context }- {$ userName }- {$ url }- {$ fileName }" ) ;
247
+ $ tempFilePath = $ tempFolder .DIRECTORY_SEPARATOR .Str::slug ("ctx- {$ context }- {$ userName }- {$ url }" ). " - {$ fileName }" ;
248
248
249
249
if (file_exists ($ tempFilePath )) {
250
250
return $ tempFilePath ;
Original file line number Diff line number Diff line change 11
11
12
12
class KubeConfigTest extends TestCase
13
13
{
14
+ private $ tempFolder ;
15
+
14
16
/**
15
17
* {@inheritdoc}
16
18
*/
17
19
public function setUp (): void
18
20
{
19
21
parent ::setUp ();
20
22
21
- KubernetesCluster::setTempFolder (__DIR__ .DIRECTORY_SEPARATOR .'temp ' );
23
+ $ this ->tempFolder = __DIR__ .DIRECTORY_SEPARATOR .'temp ' ;
24
+ KubernetesCluster::setTempFolder ($ this ->tempFolder );
22
25
}
23
26
24
27
/**
@@ -41,6 +44,12 @@ public function test_kube_config_from_yaml_file_with_base64_encoded_ssl()
41
44
'ssl_key ' => $ keyPath ,
42
45
] = $ cluster ->getClient ()->getConfig ();
43
46
47
+ $ tempFilePath = $ this ->tempFolder .DIRECTORY_SEPARATOR .'ctx-minikube-minikube-httpsminikube8443- ' ;
48
+
49
+ $ this ->assertSame ($ tempFilePath .'ca-cert.pem ' , $ caPath );
50
+ $ this ->assertSame ($ tempFilePath .'client-cert.pem ' , $ certPath );
51
+ $ this ->assertSame ($ tempFilePath .'client-key.pem ' , $ keyPath );
52
+
44
53
$ this ->assertEquals ("some-ca \n" , file_get_contents ($ caPath ));
45
54
$ this ->assertEquals ("some-cert \n" , file_get_contents ($ certPath ));
46
55
$ this ->assertEquals ("some-key \n" , file_get_contents ($ keyPath ));
You can’t perform that action at this time.
0 commit comments