Skip to content

Commit 182b57f

Browse files
committed
Use os.Lstat instead of os.Stat on symlinks
1 parent c4a49cb commit 182b57f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hack/tls-cert-gen/tls-cert-gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func printYaml(secret yamlSecret, projectRoot string) error {
153153
// Attach the real file to the end of the relative directory path.
154154
relativeTarget := filepath.Join(relativeDirectory, filepath.Base(realFilePath))
155155

156-
if _, err = os.Stat(absSymlinkTarget); err == nil {
156+
if _, err = os.Lstat(absSymlinkTarget); err == nil {
157157
// symlink exists, delete it
158158
err = os.Remove(absSymlinkTarget)
159159
if err != nil {

0 commit comments

Comments
 (0)