mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-28 08:10:36 +00:00
fix: recreate cmd as it cannot be reused after calling run (#23)
This commit is contained in:
parent
742af367bb
commit
deb92f29b2
@ -155,17 +155,17 @@ func (p *Plugin) Execute() error {
|
|||||||
// add proxy build args
|
// add proxy build args
|
||||||
addProxyBuildArgs(&p.Settings.Build)
|
addProxyBuildArgs(&p.Settings.Build)
|
||||||
|
|
||||||
|
backoffOps := func() error {
|
||||||
versionCmd := commandVersion() // docker version
|
versionCmd := commandVersion() // docker version
|
||||||
|
|
||||||
versionCmd.Stdout = os.Stdout
|
versionCmd.Stdout = os.Stdout
|
||||||
versionCmd.Stderr = os.Stderr
|
versionCmd.Stderr = os.Stderr
|
||||||
trace(versionCmd)
|
trace(versionCmd)
|
||||||
|
|
||||||
backoffOps := func() error {
|
|
||||||
return versionCmd.Run()
|
return versionCmd.Run()
|
||||||
}
|
}
|
||||||
backoffLog := func(err error, delay time.Duration) {
|
backoffLog := func(err error, delay time.Duration) {
|
||||||
log.Error().Msgf("failed to exec docker version: %v: retry in %s", err, delay.Truncate(time.Second))
|
log.Error().Msgf("failed to run docker version command: %v: retry in %s", err, delay.Truncate(time.Second))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := backoff.RetryNotify(backoffOps, newBackoff(daemonBackoffMaxRetries), backoffLog); err != nil {
|
if err := backoff.RetryNotify(backoffOps, newBackoff(daemonBackoffMaxRetries), backoffLog); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user