fix: correctly handle property and data perms

This commit is contained in:
Jose Diaz-Gonzalez committed 2020-11-21 20:57:33 -05:00
1 parent c9a0f88bf1
commit 6e0c376b62
1 file changed
+13 -1
+13 -1
View File
@@ -35,6 +35,10 @@ func TriggerCorePostDeploy(appName string) error {
// TriggerInstall initializes app restart policies // TriggerInstall initializes app restart policies
func TriggerInstall() error { 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") directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "ps")
if err := os.MkdirAll(directory, 0755); err != nil { if err := os.MkdirAll(directory, 0755); err != nil {
return err return err
@@ -106,7 +110,15 @@ func TriggerPostCreate(appName string) error {
// TriggerPostDelete destroys the ps properties for a given app container // TriggerPostDelete destroys the ps properties for a given app container
func TriggerPostDelete(appName string) error { 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 // TriggerPostExtract validates a procfile