Skip to content

Commit 72a948e

Browse files
henrybarretogustavosbarreto
authored andcommitted
feat(gateway): use commander abstraction in method to renew certificates
1 parent fc304ff commit 72a948e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

gateway/certbot.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,17 +240,21 @@ func (cb *CertBot) stopACMEServer(server *http.Server) {
240240
}
241241

242242
func (cb *CertBot) executeRenewCertificates() error {
243-
cmd := cb.ex.Command( //nolint:gosec
244-
"certbot",
243+
args := []string{
245244
"renew",
246-
)
245+
}
247246

248247
if cb.Config.Staging {
249248
log.Info("running renew with staging")
250249

251-
cmd.Args = append(cmd.Args, "--staging")
250+
args = append(args, "--staging")
252251
}
253252

253+
cmd := cb.ex.Command( //nolint:gosec
254+
"certbot",
255+
args...,
256+
)
257+
254258
if err := cb.ex.Run(cmd); err != nil {
255259
return err
256260
}

0 commit comments

Comments
 (0)