Skip to content

Commit 73d5906

Browse files
author
Axel von Bertoldi
committed
Add retryPulpCmd method to basePusher
This methods combines a pulp command with the list of retryable errors, of which there are currently just one.
1 parent cd23003 commit 73d5906

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

magefiles/pulp/push.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ func (p *basePusher) runPulpCmd(args ...string) error {
114114
return p.run("pulp", args...)
115115
}
116116

117+
var pulpRetryErrors = []*regexp.Regexp{
118+
regexp.MustCompile(`Artifact with sha256 checksum of '.*' already exists`),
119+
}
120+
121+
func (p *basePusher) retryPulpCmd(args []string, out io.Writer) error {
122+
slog.Info("executing", "cmd", "pulp", "args", args)
123+
if p.dryrun {
124+
return nil
125+
}
126+
127+
return newRetryCommand("pulp", args, pulpRetryErrors, out, p.exec).run()
128+
}
129+
117130
func (p *basePusher) execCmd(out io.Writer, cmd string, args ...string) error {
118131
slog.Info("executing", "cmd", cmd, "args", args)
119132
if p.dryrun {

0 commit comments

Comments
 (0)