From b94c6edbb8355756c53efc8ca3874c63622f287a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 18 Apr 2024 14:30:16 +0200 Subject: [PATCH] fix symlink directory not existing --- pkgs/sops-install-secrets/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/sops-install-secrets/main.go b/pkgs/sops-install-secrets/main.go index 57fdd57..2597fc5 100644 --- a/pkgs/sops-install-secrets/main.go +++ b/pkgs/sops-install-secrets/main.go @@ -539,6 +539,10 @@ func (app *appContext) validateManifest() error { } func atomicSymlink(oldname, newname string) error { + if err := os.MkdirAll(filepath.Dir(newname), 0o755); err != nil { + return err + } + // Fast path: if newname does not exist yet, we can skip the whole dance // below. if err := os.Symlink(oldname, newname); err == nil || !os.IsExist(err) {