fix: correctly handle property and data perms

This commit is contained in:
Jose Diaz-Gonzalez
2020-11-21 02:32:28 -05:00
parent c9a0f88bf1
commit 6e0c376b62

View File

@@ -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