-
Notifications
You must be signed in to change notification settings - Fork 104
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
providers: add Alibaba Cloud (aliyun) #283
Conversation
let mut out = BTreeSet::new(); | ||
for entry in keys_list.lines() { | ||
let key_id = entry.trim_end_matches('/'); | ||
let ep = format!("public-keys/{}/openssh-key", key_id); |
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.
Just curious: Did you find the single key endpoint via trial and error or was it documented? A quick look at the docs and using search didn't turn it up.
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.
It is not documented so I had to do a bit of experiments.
However it is basically a 1:1 copy of the AWS logic:
afterburn/src/providers/aws/mod.rs
Line 88 in 59d3c56
"meta-data/public-keys/{}/openssh-key", |
For that reason, I only documented the "duplicated entry" quirk.
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.
It's also "documented" in the cloud-init implementation :)
canonical/cloud-init@4f8ceff
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.
Makes sense 👍
I did some basic manual testing of this on an |
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.
Looks sane to me!
let mut out = BTreeSet::new(); | ||
for entry in keys_list.lines() { | ||
let key_id = entry.trim_end_matches('/'); | ||
let ep = format!("public-keys/{}/openssh-key", key_id); |
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.
It's also "documented" in the cloud-init implementation :)
canonical/cloud-init@4f8ceff
@lucab is this ready for merge? |
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.
LGTM! Pulled locally and tests passed (as expected)!
Another documentation on cloud-init about AliYun
metadata: https://cloudinit.readthedocs.io/en/latest/topics/datasources/aliyun.html
Also I could add basic testing on attribute fetching method, much like this commit 103f694 |
This adds support for Alibaba Cloud, with platform ID `aliyun`.
991bc80
to
b3c9d6e
Compare
@zonggen good point, I added a fixup commit (and introduced |
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.
Looks even better now to me 😄
Nice! Works locally. Will update the testing to my commit too 👍 |
This adds support for Alibaba Cloud, with platform ID
aliyun
.Closes: #279