Skip to content
Snippets Groups Projects

Make kubernetes API retries configurable

1 unresolved thread
Files
9
@@ -201,17 +201,18 @@ func (c *ArtifactsUploaderCommand) Execute(*cli.Context) {
@@ -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?
// If the upload fails, exit with a non-zero exit code to indicate an issue?
logger := logrus.WithField("context", "artifacts-uploader")
if err := retry.WithFn(c, c.Run).Run(); err != nil {
retryable := retry.
New(c.Run).
WithCheck(c.shouldRetry).
WithLogrus(logger)
if err := retryable.Run(); err != nil {
logrus.Fatalln(err)
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() {
func (c *ArtifactsUploaderCommand) normalizeArgs() {
if c.URL == "" || c.Token == "" {
if c.URL == "" || c.Token == "" {
logrus.Fatalln("Missing runner credentials")
logrus.Fatalln("Missing runner credentials")
Loading