0
0
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:
Robert Kaussow 2023-09-05 10:24:03 +02:00 committed by GitHub
parent 742af367bb
commit deb92f29b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,17 +155,17 @@ func (p *Plugin) Execute() error {
// add proxy build args
addProxyBuildArgs(&p.Settings.Build)
versionCmd := commandVersion() // docker version
versionCmd.Stdout = os.Stdout
versionCmd.Stderr = os.Stderr
trace(versionCmd)
backoffOps := func() error {
versionCmd := commandVersion() // docker version
versionCmd.Stdout = os.Stdout
versionCmd.Stderr = os.Stderr
trace(versionCmd)
return versionCmd.Run()
}
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 {