mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-24 12:50:41 +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)
|
||||||
|
|
||||||
versionCmd := commandVersion() // docker version
|
|
||||||
|
|
||||||
versionCmd.Stdout = os.Stdout
|
|
||||||
versionCmd.Stderr = os.Stderr
|
|
||||||
trace(versionCmd)
|
|
||||||
|
|
||||||
backoffOps := func() error {
|
backoffOps := func() error {
|
||||||
|
versionCmd := commandVersion() // docker version
|
||||||
|
|
||||||
|
versionCmd.Stdout = os.Stdout
|
||||||
|
versionCmd.Stderr = os.Stderr
|
||||||
|
trace(versionCmd)
|
||||||
|
|
||||||
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