From 0f4744b5a95151a85c4f35010dd2d748228f7f53 Mon Sep 17 00:00:00 2001 From: Lin Yinfeng Date: Mon, 13 Jan 2025 21:21:31 +0800 Subject: [PATCH] Fix fast path in atomicSymlink --- pkgs/sops-install-secrets/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/sops-install-secrets/main.go b/pkgs/sops-install-secrets/main.go index fa51b62..d500ef8 100644 --- a/pkgs/sops-install-secrets/main.go +++ b/pkgs/sops-install-secrets/main.go @@ -730,7 +730,7 @@ func atomicSymlink(oldname, newname string) error { // 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) { - return fmt.Errorf("cannot create symlink %s: %w", newname, err) + return err } // We need to use ioutil.TempDir, as we cannot overwrite a ioutil.TempFile,