-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
cloudinfo: Adding AWS, Azure support and InstanceID #1109
cloudinfo: Adding AWS, Azure support and InstanceID #1109
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
what is the Authorized Contributors Group for the CLA ? |
9320eeb
to
1ccd1da
Compare
ok to test |
Overall lgtm |
} | ||
|
||
func NewRealCloudInfo() CloudInfo { | ||
cloudProvider := detectCloudProvider() | ||
instanceType := detectInstanceType(cloudProvider) | ||
instanceID := detectInstanceID(cloudProvider) |
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 this take a long time? (e.g. is it polling ip addresses that may not be always available?)
Would that be a problem? Should this be async?
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.
I think detectCloudProvider could take some time. The others will be almost immediate as we are accessing the correct API server. In short this function could block for some time and its users should be aware of this as it was already blocking before this patch.
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.
@enoodle ok 👍
1ccd1da
to
fd2efdd
Compare
fd2efdd
to
683fdfa
Compare
if err != nil { | ||
return false | ||
} | ||
return strings.Contains(string(data), MicrosoftCorporation) |
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.
@enoodle is this a stable check? Is it documented?
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.
No. I couldn't find any api service comparable to aws/gce 's for Azure, nor any other official documentation on ways to detect if an instance is running on Azure. I did find [1] which explains how to use dmidecode to get the instance ID (hence /sys/class/dmi/id/produect_uuid) and I noticed that on all my instances I had that string for sys_vendor so I used this.
[1] https://azure.microsoft.com/en-us/blog/accessing-and-using-azure-vm-unique-id/
@deads2k can you review this? Thanks |
@googlebot @enoodle is covered under the Red Hat CLA. |
@enoodle When you add the godep packages, can you name the commit |
Is this still a WIP? If so, what is remaining? |
@deads2k Nothing more to implement. It was wip for the dependencies. |
CLAs look good, thanks! |
@deads2k I will rebase to change the dependencies commit name in a moment. |
8d017e4
to
c35ede7
Compare
@vishh Implementation is done. This enables fallback behavior for |
c35ede7
to
a32a138
Compare
@vishh ping? you actually lgtm'ed it before, I only added a tiny fix to remove \n char when reading the azure instance ID from file. |
Sorry. This somehow fell off my radar. LGTM again |
cloudinfo: Adding AWS, Azure support and InstanceID
No description provided.