Skip to content

Commit 1639bbc

Browse files
author
Dov Alperin
committed
Truncate repmgr config on initialize
Closes #35
1 parent 234cd08 commit 1639bbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/flypg/repmgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (r *RepMgr) NewRemoteConnection(ctx context.Context, hostname string) (*pgx
7272
func (r *RepMgr) initialize() error {
7373
r.setDefaults()
7474

75-
f, err := os.OpenFile(r.ConfigPath, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
75+
f, err := os.OpenFile(r.ConfigPath, os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
7676
if err != nil {
7777
return nil
7878
}

0 commit comments

Comments
 (0)