Skip to content

Commit 83d299e

Browse files
authored
PR feedback
1 parent c0896c6 commit 83d299e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/pgbouncer/reconcile.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ func Pod(
150150
}
151151

152152
mkdirCommand := ""
153-
if logfile != "" && filepath.Dir(logfile) != "/tmp" {
154-
mkdirCommand = shell.MakeDirectories("/tmp", filepath.Dir(logfile)) + "; "
153+
// filepath.Dir will return an "" when given an ""
154+
logPath := filepath.Dir(logfile)
155+
// If the logpath is `/tmp`, we don't need to worry about creating/chmoding it.
156+
// Otherwise, use `MakeDirectories` to create/chmod that specific directory,
157+
// without worrying about parent directories.
158+
if logfile != "" && logPath != "/tmp" {
159+
mkdirCommand = shell.MakeDirectories(logPath, logPath) + "; "
155160
}
156161

157162
container := corev1.Container{

0 commit comments

Comments
 (0)