-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add alibaba cloud provider to machine controller #643
Add alibaba cloud provider to machine controller #643
Conversation
/test pull-machine-controller-build |
@moadqassem You need to rebase it onto master first, it become incompatible |
defb326
to
1018db2
Compare
1018db2
to
4375810
Compare
7af82e5
to
9e3f287
Compare
/retest pull-machine-controller-e2e-alibaba |
/test pull-machine-controller-e2e-alibaba |
c03827f
to
ba6be5a
Compare
/test pull-machine-controller-e2e-alibaba |
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
* Init Alibaba provider * Update dependencies * Add boilerplate header * Add example deployment file * Add e2e test for Alibaba * Add omitempty json tags
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
* some cleanup of alibaba cloud * dep ensure
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
Signed-off-by: Moath Qasim <moad.qassem@gmail.com> Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
e337ca3
to
2733908
Compare
Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
/test pull-machine-controller-e2e-alibaba |
/retest |
/test pull-machine-controller-e2e-alibaba |
2 similar comments
/test pull-machine-controller-e2e-alibaba |
/test pull-machine-controller-e2e-alibaba |
/test pull-machine-controller-e2e-vsphere |
6d0829a
to
cc2554f
Compare
/test pull-machine-controller-e2e-ubuntu-upgrade |
/test pull-machine-controller-e2e-alibaba |
/retest |
} | ||
|
||
createInstanceRequest := ecs.CreateCreateInstanceRequest() | ||
createInstanceRequest.ImageId, _ = p.getImageIDForOS(machine.Spec, pc.OperatingSystem) |
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.
Nit: Can we handle the error here?
|
||
func getInstance(client *ecs.Client, instanceName string) (*ecs.Instance, error) { | ||
describeInstanceRequest := ecs.CreateDescribeInstancesRequest() | ||
describeInstanceRequest.InstanceName = instanceName |
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 don't follow, how does that code address anything? The code here still filters the retrieved instance only based on the name and not on the tags
return nil, fmt.Errorf("failed to get alibaba instance %v due to %v", machine.Name, err) | ||
} | ||
|
||
tag := ecs.AddTagsTag{ |
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.
Please configure the tags as part of the creation by setting it on the createInstanceRequest
to make this atomic. Otherwise if the creation succeeds at the labeling does not, we won't find our instance in the Get
func and will orphan it
deleteInstancesRequest.InstanceId = &[]string{foundInstance.InstanceId} | ||
|
||
deleteInstancesRequest.Force = requests.Boolean("True") | ||
if _, err = client.DeleteInstances(deleteInstancesRequest); err != nil { |
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.
Please update this code to ignore 404, i.E. if someone deleted the instance out of bounds, else we are stuck here because we won't remove the finalizer but the deletion doesn't succeed here
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.
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 see. But then you need to move the finalizer cleanup after the if err == cloudprovidererrors.ErrInstanceNotFound
Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
cc2554f
to
7898134
Compare
/retest |
@alvaroaleman PTAL |
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.
One point regarding the cleanup, other than that it looks good
deleteInstancesRequest.InstanceId = &[]string{foundInstance.InstanceId} | ||
|
||
deleteInstancesRequest.Force = requests.Boolean("True") | ||
if _, err = client.DeleteInstances(deleteInstancesRequest); err != nil { |
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 see. But then you need to move the finalizer cleanup after the if err == cloudprovidererrors.ErrInstanceNotFound
Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
5cdf351
to
0983487
Compare
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
/approve
LGTM label has been added. Git tree hash: 78342079182292998f6166c52a17cf88e956e24d
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, moadqassem The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-machine-controller-e2e-alibaba |
/retest |
@moadqassem: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What this PR does / why we need it:
Adding a cloud provider for AlibabaCloud in the machine-controller
Which issue(s) this PR fixes
Fixes #4356