-
Notifications
You must be signed in to change notification settings - Fork 106
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
ibmcloud: add support for SSH keys #475
Conversation
I attempted to squash all 13 commits into one, but I appear to have done it poorly and somehow pulled in a bunch of other commits. I think I'm just going to create a new fork and start over with a new PR. Oops. |
@erlarese as you prefer, but from the current branch status I think it is only missing a rebase on master (which should automatically detect and drop the other commits), see https://git-scm.com/book/en/v2/Git-Branching-Rebasing for guidance. |
e232494
to
4fbb6c1
Compare
Thanks Luca for the pointer. I think I hopefully got everything squashed into a single commit and rebased now. |
No worries, and thanks for submitting this PR! Personally it took me quite a while to learn Rust but it was also a rewarding process. Luca already went over some things, but in general don't hesitate to reach out with questions and the like on e.g. #forum-coreos on freenode. |
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.
Hi Luca, thanks for the feedback! I have attempted to implement everything. Please let me know what you think now. Thanks !
@erlarese thanks, great work! I've left a few minor nits and a bunch of suggestions in order to avoid a couple of unwrapping points. |
I'm not sure if this is candidate for merging yet, but please hold off on merging for now. I just built an FCOS image with the latest patches and afterburn is failing to run, I'm still debugging what exactly is wrong.
|
@erlarese no hurry. A |
Hi @lucab , thanks for the tip. The problem was that the IBM Cloud VPC control plane was generating a MIME I fixed this by adding an additional check for a cloud-config section with With these updates, it appears the unit tests pass, the linters pass, and an FCOS image built with this boots successfully on the IBM Cloud and I can connect via SSH. Please re-review and let me know if anything else is needed, thanks ! |
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.
Hi @lucab, I believe I've made the requested changes.
One confusing thing is the linter is failing saying the import of use std::fs
is unused, but it's pretty clearly used in that file to read the new fixture, and if I remove the import the code doesn't compile because fs
can't be found. I tried a few variations of prefixing the read
call with std::
and such, but I can't quite figure out why the linter thinks this import isn't used when the compiler seems to require it. Any idea on how to fix this?
Ah, ignore the earlier comment about the import error, I realized the unit tests actually have a separate dependency declaration and moving the import down there seems to have fixed the issue. |
@erlarese thanks, code now looks overall fine to me. Can you please squash everything into a single commit, so that I'll do the final pass? |
This allows IBM Cloud VPC Gen 2 SSH keys to be parsed by Afterburn. Fixes coreos#472
Hi @lucab -- the commits should be squashed back into one again. Please let me know if anything else needs to be changed! |
LGTM, thanks for the patch! |
This PR adds support to the ibmcloud provider for parsing SSH keys. This applies to the IBM Cloud VPC Gen 2 environment. It does not apply to other aspects of IBM Cloud including the "classic" environment.
This code looks for the
vendor-data
file in thecidata
drive and finds thecloud-config
section within that file. A YAML parser is used to pull the SSH keys out from this section.This is my first time writing any Rust code, so I apologize for anything that's obviously wrong. I have attempted to update the unit tests and verify they still pass. Please let me know if anything else is needed !