File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,10 @@ func (opt *postgresOptions) backupPostgreSQL(targetRef api_v1beta1.TargetRef) (*
221
221
"-h" , appBinding .Spec .ClientConfig .Service .Name ,
222
222
},
223
223
}
224
+ // if port is specified, append port in the arguments
225
+ if appBinding .Spec .ClientConfig .Service .Port != 0 {
226
+ opt .backupOptions .StdinPipeCommand .Args = append (opt .backupOptions .StdinPipeCommand .Args , fmt .Sprintf ("--port=%d" , appBinding .Spec .ClientConfig .Service .Port ))
227
+ }
224
228
for _ , arg := range strings .Fields (opt .pgArgs ) {
225
229
opt .backupOptions .StdinPipeCommand .Args = append (opt .backupOptions .StdinPipeCommand .Args , arg )
226
230
}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package pkg
18
18
19
19
import (
20
20
"context"
21
+ "fmt"
21
22
"path/filepath"
22
23
"strings"
23
24
@@ -182,6 +183,10 @@ func (opt *postgresOptions) restorePostgreSQL(targetRef api_v1beta1.TargetRef) (
182
183
"-h" , appBinding .Spec .ClientConfig .Service .Name ,
183
184
},
184
185
}
186
+ // if port is specified, append port in the arguments
187
+ if appBinding .Spec .ClientConfig .Service .Port != 0 {
188
+ opt .dumpOptions .StdoutPipeCommand .Args = append (opt .dumpOptions .StdoutPipeCommand .Args , fmt .Sprintf ("--port=%d" , appBinding .Spec .ClientConfig .Service .Port ))
189
+ }
185
190
for _ , arg := range strings .Fields (opt .pgArgs ) {
186
191
opt .dumpOptions .StdoutPipeCommand .Args = append (opt .dumpOptions .StdoutPipeCommand .Args , arg )
187
192
}
You can’t perform that action at this time.
0 commit comments