Skip to content
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

Merged
merged 4 commits into from
Oct 9, 2019

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Oct 8, 2019

This adds support for Alibaba Cloud, with platform ID aliyun.

Closes: #279

@lucab
Copy link
Contributor Author

lucab commented Oct 8, 2019

/cc @ashcrow @jlebon @zonggen for review

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);
Copy link
Member

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.

Copy link
Contributor Author

@lucab lucab Oct 8, 2019

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:

"meta-data/public-keys/{}/openssh-key",

For that reason, I only documented the "duplicated entry" quirk.

Copy link
Member

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

Copy link
Member

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

@lucab
Copy link
Contributor Author

lucab commented Oct 8, 2019

I did some basic manual testing of this on an aliyun plain Debian VM, both attributes and ssh-keys logic worked there.

@ashcrow ashcrow requested review from jlebon and zonggen October 8, 2019 13:35
Copy link
Member

@jlebon jlebon left a 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);
Copy link
Member

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

@ashcrow
Copy link
Member

ashcrow commented Oct 8, 2019

@lucab is this ready for merge?

Copy link
Member

@zonggen zonggen left a 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

@zonggen
Copy link
Member

zonggen commented Oct 8, 2019

Also I could add basic testing on attribute fetching method, much like this commit 103f694

@lucab
Copy link
Contributor Author

lucab commented Oct 9, 2019

@zonggen good point, I added a fixup commit (and introduced maplit); how does it look now?

Copy link
Member

@ashcrow ashcrow left a 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 😄

@zonggen
Copy link
Member

zonggen commented Oct 9, 2019

Nice! Works locally. Will update the testing to my commit too 👍

@ashcrow ashcrow merged commit b421699 into coreos:master Oct 9, 2019
@lucab lucab deleted the ups/provider-aliyun branch June 22, 2020 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

providers: add support for Alibaba Cloud
4 participants