Skip to content

Commit

Permalink
retry intermittent user lookup failure
Browse files Browse the repository at this point in the history
  • Loading branch information
KerDav authored and hkantare committed Apr 5, 2022
1 parent b149a59 commit 3487be2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"log"
"path/filepath"
"regexp"
"strings"
"time"

Expand Down Expand Up @@ -172,6 +173,10 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf
if strings.Contains(err.Error(), "Could not login to openshift account runtime error:") {
return resource.RetryableError(err)
}
if intermittentUserLookupFailure, _ := regexp.MatchString("Error: lookup of user for \"(.+)\" failed", err.Error()); intermittentUserLookupFailure {
// Intermittent error resulting from synchronisation delay
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
Expand Down Expand Up @@ -200,6 +205,10 @@ func dataSourceIBMContainerClusterConfigRead(d *schema.ResourceData, meta interf
if strings.Contains(err.Error(), "Could not login to openshift account runtime error:") {
return resource.RetryableError(err)
}
if intermittentUserLookupFailure, _ := regexp.MatchString("Error: lookup of user for \"(.+)\" failed", err.Error()); intermittentUserLookupFailure {
// Intermittent error resulting from synchronisation delay
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
Expand Down

0 comments on commit 3487be2

Please sign in to comment.