fix: storage plugin install setup and post-delete permissions

apps:destroy was failing in CI because the post-delete trigger called PropertyListWrite, which tried to mkdir /var/lib/dokku/config/storage/<app> as the dokku user but the parent directory had been created by the install trigger as root. The install trigger now calls PropertySetup("storage") so the per-plugin config root has the correct ownership, and post-delete / post-app-clone / post-app-rename short-circuit when the app has no attachments to begin with so they can't fail on a never-touched property tree. The entry registry and migration flag directories also moved out of config/storage (where they would have collided with the property-store path config/storage/<appName>) into a dedicated data/storage-registry tree.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-29 22:36:00 -04:00
parent b601a626f5
commit 89afd09087
4 changed files with 33 additions and 7 deletions

View File

@@ -76,10 +76,19 @@ type Entry struct {
SchemaVersion int `json:"schema_version"`
}
// RegistryDirectory returns the parent directory for storage-plugin
// state that lives outside the property store. Kept under data/ rather
// than config/ so it doesn't collide with the property-list paths
// `config/storage/<appName>/<property>` that the rest of the plugin
// relies on for per-app attachments.
func RegistryDirectory() string {
root := common.GetenvWithDefault("DOKKU_LIB_ROOT", "/var/lib/dokku")
return filepath.Join(root, "data", "storage-registry")
}
// EntriesDirectory returns the directory holding per-entry JSON files.
func EntriesDirectory() string {
root := common.GetenvWithDefault("DOKKU_LIB_ROOT", "/var/lib/dokku")
return filepath.Join(root, "config", "storage", "entries")
return filepath.Join(RegistryDirectory(), "entries")
}
// entryPath returns the on-disk path for a named entry.