Add timeout to Azure ACR credential provider
Adds a default timeout to the Azure ACR HTTP client to avoid hanging when unable to reach server. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This commit is contained in:
parent
bb89384f39
commit
7c7cff6d27
@ -57,7 +57,10 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
||||
)
|
||||
|
||||
type authDirective struct {
|
||||
@ -75,7 +78,10 @@ const userAgent = "kubernetes-credentialprovider-acr"
|
||||
|
||||
const dockerTokenLoginUsernameGUID = "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
var client = &http.Client{}
|
||||
var client = &http.Client{
|
||||
Transport: utilnet.SetTransportDefaults(&http.Transport{}),
|
||||
Timeout: time.Second * 10,
|
||||
}
|
||||
|
||||
func receiveChallengeFromLoginServer(serverAddress string) (*authDirective, error) {
|
||||
challengeURL := url.URL{
|
||||
|
Loading…
Reference in New Issue
Block a user