Skip to content

Commit e617cc3

Browse files
authored
[ec2metadata] Switch IMDSv2 token warning message to debug (#440)
If IMDSv2 is unreachable or disabled on the EC2 instances, the logs are filled with such messages without providing any real value or action as the application fallbacks to IMDSv1 anyway. We can move such messages to the debug level in order to try and keep the log messages clean for any warnings that might be missed with this flooding. These messages probably fail into the debug category anyway as they are mostly helpful when debugging the application.
1 parent 6f9aa8b commit e617cc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/ec2metadata/ec2metadata.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (e *Service) Request(contextPath string) (*http.Response, error) {
226226
if err != nil {
227227
e.v2Token = ""
228228
e.tokenTTL = -1
229-
log.Warn().Msgf("Unable to retrieve an IMDSv2 token, continuing with IMDSv1, %v", err)
229+
log.Debug().Msgf("Unable to retrieve an IMDSv2 token, continuing with IMDSv1, %v", err)
230230
} else {
231231
e.v2Token = token
232232
e.tokenTTL = ttl

0 commit comments

Comments
 (0)