-
Notifications
You must be signed in to change notification settings - Fork 807
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
instance metadata issue fix #855
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
Hi @vdhanan. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
Pull Request Test Coverage Report for Build 1916
💛 - Coveralls |
/ok-to-test |
aef6203
to
72d1dd9
Compare
pkg/cloud/metadata.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
return NewMetadataService(svc, clientset) |
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.
IMO we should wrap this error in something helpful. like: error getting information from metadata service or node object : err. Looking back at the issue where people reported that the driver couldnt run because of metadata being unavailable, some context would have helped, because otherwise the driver just crashes with weird 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.
can you confirm that this is the idiomatic way to wrap errors?
func NewMetadata() (MetadataService, error) {
sess := session.Must(session.NewSession(&aws.Config{}))
svc := ec2metadata.New(sess)
// creates the in-cluster config
config, err := rest.InClusterConfig()
if err != nil && !svc.Available() {
return nil, err
}
// creates the clientset
clientset, err := kubernetes.NewForConfig(config)
if err != nil && !svc.Available() {
return nil, err
}
metadataService, err := NewMetadataService(svc, clientset)
if err != nil {
err = fmt.Errorf("error getting information from metadata service or node object: %w", err)
}
return metadataService, err
}
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdhanan, wongma7 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 |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
/lgtm feel free to squash, i think im going to have to manually merge anyway if coveralls keeps complaining |
/lgtm |
/lgtm |
I'm going to merge, because coveralls is still complaining, and the lates tcommit was just changing helm chart and there's no need to retest. |
Is this a bug fix or adding new feature?
bug fix (fixes #474)
What is this PR about? / Why do we need it?
alternative way to fetch instance metadata
What testing is done?
manual and unit testing
messed up my original PR #846 this is a replacement for that one