@@ -77,6 +77,7 @@ func (a *DockerConfigFileAuth) loadFromFile(fn string) (err error) {
77
77
_ , _ = hash .Write (cntnt )
78
78
newHash := fmt .Sprintf ("%x" , hash .Sum (nil ))
79
79
if a .hash == newHash {
80
+ log .Infof ("nothing has changed: %s" , fn )
80
81
return nil
81
82
}
82
83
@@ -101,6 +102,7 @@ func (a *DockerConfigFileAuth) loadFromFile(fn string) (err error) {
101
102
func (a * DockerConfigFileAuth ) Authenticate (ctx context.Context , registry string ) (auth * Authentication , err error ) {
102
103
ac , err := a .C .GetAuthConfig (registry )
103
104
if err != nil {
105
+ log .WithError (err ).WithField ("registry" , registry ).Error ("failed DockerConfigFileAuth Authenticate" )
104
106
return nil , err
105
107
}
106
108
@@ -122,7 +124,7 @@ func (ca CompositeAuth) Authenticate(ctx context.Context, registry string) (auth
122
124
for _ , ath := range ca {
123
125
res , err := ath .Authenticate (ctx , registry )
124
126
if err != nil {
125
- log .WithError (err ).Errorf ("failed composite authenticate " )
127
+ log .WithError (err ).WithField ( "registry" , registry ). Errorf ("failed CompositeAuth Authenticate " )
126
128
return nil , err
127
129
}
128
130
if ! res .Empty () {
@@ -173,7 +175,8 @@ func (ath *ECRAuthenticator) Authenticate(ctx context.Context, registry string)
173
175
return nil , err
174
176
}
175
177
if len (tknout .AuthorizationData ) == 0 {
176
- return nil , fmt .Errorf ("no ECR authorization data received" )
178
+ err = fmt .Errorf ("no ECR authorization data received" )
179
+ return nil , err
177
180
}
178
181
179
182
pwd , err := base64 .StdEncoding .DecodeString (aws .ToString (tknout .AuthorizationData [0 ].AuthorizationToken ))
@@ -184,6 +187,8 @@ func (ath *ECRAuthenticator) Authenticate(ctx context.Context, registry string)
184
187
ath .ecrAuth = string (pwd )
185
188
ath .ecrAuthLastRefreshTime = time .Now ()
186
189
log .Info ("refreshed ECR token" )
190
+ } else {
191
+ log .Info ("no ECR token refresh necessary" )
187
192
}
188
193
189
194
segs := strings .Split (ath .ecrAuth , ":" )
@@ -373,7 +378,7 @@ func (a AllowedAuthFor) additionalAuth(domain string) *Authentication {
373
378
res .Password = strings .Join (segs [1 :], ":" )
374
379
}
375
380
} else {
376
- log .WithError ( err ). Errorf ("failed getting additional auth" )
381
+ log .Errorf ("failed getting additional auth" )
377
382
}
378
383
return res
379
384
}
0 commit comments