refactor: only delete the helm chart in the scheduler-post-delete hook
This commit is contained in:
1 parent
10e3bac24c
commit
9d27ff39da
3 files changed
+15
-3
No files matched your search
@@ -69,8 +69,11 @@ func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerPostDelete destroys the scheduler-k3s data for a given app container
|
||||
func TriggerPostDelete(appName string) error {
|
||||
// TriggerSchedulerPostDelete destroys the scheduler-k3s data for a given app container
|
||||
func TriggerSchedulerPostDelete(scheduler string, appName string) error {
|
||||
if scheduler != "k3s" {
|
||||
return nil
|
||||
}
|
||||
namespace := common.PropertyGetDefault("scheduler-k3s", appName, "namespace", "default")
|
||||
helmAgent, err := NewHelmAgent(namespace, DeployLogPrinter)
|
||||
if err != nil {
|
||||
@@ -82,6 +85,11 @@ func TriggerPostDelete(appName string) error {
|
||||
return fmt.Errorf("Error uninstalling chart: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerPostDelete destroys the scheduler-k3s data for a given app container
|
||||
func TriggerPostDelete(appName string) error {
|
||||
dataErr := common.RemoveAppDataDirectory("scheduler-k3s", appName)
|
||||
propertyErr := common.PropertyDestroy("scheduler-k3s", appName)
|
||||
|
||||
|
||||
Reference in new issue
Block a user