Skip to content
Snippets Groups Projects

Make kubernetes API retries configurable

6 files
+ 154
140
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -201,17 +201,18 @@ func (c *ArtifactsUploaderCommand) Execute(*cli.Context) {
}
// If the upload fails, exit with a non-zero exit code to indicate an issue?
logger := logrus.WithField("context", "artifacts-uploader")
retryable := retry.
New(c.Run).
WithCheck(c.shouldRetry).
WithLogrus(logger)
if err := retryable.Run(); err != nil {
if err := retry.WithFn(c, c.Run).Run(); err != nil {
logrus.Fatalln(err)
}
}
func (c *ArtifactsUploaderCommand) NewRetry() *retry.Retry {
return retry.
New().
WithCheck(c.shouldRetry).
WithLogrus(logrus.WithField("context", "artifacts-uploader"))
}
func (c *ArtifactsUploaderCommand) normalizeArgs() {
if c.URL == "" || c.Token == "" {
logrus.Fatalln("Missing runner credentials")
Loading