Skip to content

Commit 67045a3

Browse files
authored
Merge pull request #30 from MatthiasHertel/master
[feature] Helm delete support
2 parents bddd3f9 + 8ea6378 commit 67045a3

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/Helm.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ public static function upgrade(string $releaseName, string $chart, array $extraF
9393
return static::call('upgrade', [$releaseName, $chart], $extraFlags, $envs);
9494
}
9595

96+
/**
97+
* Initiate a helm delete command.
98+
*
99+
* @param string $releaseName
100+
* @param array $extraFlags
101+
* @param array $envs
102+
* @return \RenokiCo\PhpHelm\Helm
103+
*/
104+
public static function delete(string $releaseName, array $extraFlags = [], array $envs = [])
105+
{
106+
return static::call('delete', [$releaseName], $extraFlags, $envs);
107+
}
108+
96109
/**
97110
* Change the default path for helm CLI.
98111
*

tests/HelmTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ public function test_helm_repo_install()
4949
$this->assertTrue($process->isSuccessful());
5050
}
5151

52+
public function test_helm_repo_delete()
53+
{
54+
Helm::addRepo('bitnami', 'https://charts.bitnami.com/bitnami')->run();
55+
Helm::repoUpdate()->run();
56+
57+
$process = Helm::delete(
58+
'release-1',
59+
['--debug' => true]
60+
);
61+
62+
$process->run();
63+
64+
dump($process->getCommandLine());
65+
dump($process->getOutput());
66+
67+
$this->assertTrue($process->isSuccessful());
68+
}
69+
5270
public function test_helm_repo_upgrade()
5371
{
5472
Helm::addRepo('bitnami', 'https://charts.bitnami.com/bitnami')->run();

0 commit comments

Comments
 (0)