From 6e0c376b62f28ef5d3b6d28eec73c464663a83c3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 21 Nov 2020 02:32:28 -0500 Subject: [PATCH] fix: correctly handle property and data perms --- plugins/ps/triggers.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index c4affe305..6d2322f71 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -35,6 +35,10 @@ func TriggerCorePostDeploy(appName string) error { // TriggerInstall initializes app restart policies func TriggerInstall() error { + if err := common.PropertySetup("buildpacks"); err != nil { + return fmt.Errorf("Unable to install the buildpacks plugin: %s", err.Error()) + } + directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps") if err := os.MkdirAll(directory, 0755); err != nil { return err @@ -106,7 +110,15 @@ func TriggerPostCreate(appName string) error { // TriggerPostDelete destroys the ps properties for a given app container func TriggerPostDelete(appName string) error { - return common.PropertyDestroy("ps", appName) + directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps", appName) + dataErr := os.RemoveAll(directory) + propertyErr := common.PropertyDestroy("ps", appName) + + if dataErr != nil { + return dataErr + } + + return propertyErr } // TriggerPostExtract validates a procfile