-
Notifications
You must be signed in to change notification settings - Fork 11
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
Get username either by IMDS or from a local OVF file #100
Conversation
2d2a9df
to
5171131
Compare
Pushed commits to fix minor issues in the e2e tests script. @SeanDougherty Could you please retest with this PR, to see if the issue of #99 was gone? I myself tried to run e2e tests with an Azure Linux gallery image, |
After retesting, I can confirm this has resolved the issue. Thank you Dongsu! And, yes, as you had mentioned, there are other issues with useradd that are being addressed in this PR LGTM |
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.
A few superficial notes, but nothing blocking. At some point we should have the library provide a nice interface for this, but we can tackle that later.
6f5ceea
to
a8245ac
Compare
Username can be obtained either via fetching instance metadata from IMDS or mounting a local device for OVF environment file. It should not fail immediately in a single failure, instead it should fall back to the other mechanism. So it is not a good idea to use `?` for query() or get_environment(). Explicitly get instance metadata to handle error of missing instance metadata before dealing with setting ssh keys or hostname.
When running functional tests, pass in --security-type, usually `TrustedLaunch`, which is nowadays the default for most VMs. It is still possible to override the security type by passing in an environment variable $VM_SECURITY_TYPE, like `Standard`.
a8245ac
to
9f29a9a
Compare
* Get username either by IMDS or from a local OVF file Username can be obtained either via fetching instance metadata from IMDS or mounting a local device for OVF environment file. It should not fail immediately in a single failure, instead it should fall back to the other mechanism. So it is not a good idea to use `?` for query() or get_environment(). Explicitly get instance metadata to handle error of missing instance metadata before dealing with setting ssh keys or hostname. * tests: pass in security type when creating VM When running functional tests, pass in --security-type, usually `TrustedLaunch`, which is nowadays the default for most VMs. It is still possible to override the security type by passing in an environment variable $VM_SECURITY_TYPE, like `Standard`. * tests: address shellcheck warnings in functional_tests.sh
Username can be obtained either via fetching instance metadata from IMDS or mounting a local device for OVF environment file. It should not fail immediately in a single failure, instead it should fall back to the other mechanism. So it is not a good idea to use
?
forquery()
orget_environment()
.Fixes #99