-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make metadata logging best-effort #1028
Make metadata logging best-effort #1028
Conversation
This issue is currently awaiting triage. If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
GetInstanceIdentityDocument returns a fatal error when AWS_EC2_METADATA_DISABLED is true. Make the logging best-effort and ignore errors from GetInstanceIdentityDocument.
6884171
to
dbdac92
Compare
@sjenning looks good to me! looks like there may be unrelated reasons for the ci failures though :( |
/test pull-cloud-provider-aws-e2e |
@dims tests are green now. Can you approve/lgtm? |
@@ -211,18 +211,17 @@ func (p *awsSDKProvider) Metadata() (config.EC2Metadata, error) { | |||
p.addAPILoggingHandlers(&client.Handlers) | |||
|
|||
identity, err := client.GetInstanceIdentityDocument() | |||
if err != nil { | |||
return nil, fmt.Errorf("unable to get instance identity document: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a log line for this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
The line would be logged for every invocation of the function and it would basically be a log line that says "I wanted to log something useful but the call failed so I'm logging the fact that I couldn't log something useful".
How often is this function called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calls to IMDS can fail for reasons other than AWS_EC2_METADATA_DISABLED
, so I think its worth logging. It's only called once in an init()
:
cloud-provider-aws/pkg/providers/v1/aws.go
Line 473 in d7e05d5
metadata, err := newAWSSDKProvider(nil, cfg).Metadata() |
we also need to update the go version to update to 1.22.7 for the govulncheck to succeed. Can you do it if possible else i can make a new PR for it? |
/retest |
Can we proceed with merging this PR? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cartermckinnon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…028-origin-release-1.31 Automated cherry pick of #1028: Make metadata logging best-effort
Fixes #1027
/kind bug