-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Initialize cloud provider in node #11620
Conversation
1742e3d
to
55f3024
Compare
[test] |
return nil, err | ||
} | ||
if cloud != nil { | ||
glog.V(2).Infof("Successfully initialized cloud provider: %q from the config file: %q\n", server.CloudProvider, server.CloudConfigFile) |
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.
No need for \n
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.
fixed, however master prints with '\n': https://github.com/openshift/origin/blob/master/pkg/cmd/server/kubernetes/master_config.go#L213
55f3024
to
df73137
Compare
I mean, it does the right thing, I am not sure it does it on the right place. |
@@ -214,6 +216,18 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enable | |||
return nil, err | |||
} | |||
|
|||
// Initialize cloud provider | |||
if len(server.CloudProvider) > 0 && server.CloudProvider != v1alpha1.AutoDetectCloudProvider { |
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'd like to have at least one test that validates this is setup or executed so it doesn't regress.
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 added some simple unit tests for server.CloudProvider parsing, however there is not a single unit test that would test whole BuildKubernetesNodeConfig
. This function does many decisions that are not tested anywhere and building a cloud provider is just one of its duties.
IMO, there should be e2e tests that would catch GCE or AWS volume plugin throwing errors when mounting a volume.
df73137
to
8c698c5
Compare
Evaluated for origin test up to 8c698c5 |
server := kubeletoptions.NewKubeletServer() | ||
server.CloudProvider = providerName | ||
|
||
cloud, err := buildCloudProvider(server) |
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.
@smarterclayton are you looking for a test that ensures that BuildKubernetesNodeConfig ends up with the cloud provider filled in correctly?
Yes. On Mon, Oct 31, 2016 at 10:10 AM, Andy Goldstein [email protected]
|
@jsafrane do you think you could take a stab at writing a new test that calls BuildKubernetesNodeConfig? |
@ncdc no, I really do not feel comfortable testing this code. I've barely seen it and it looks pretty complex to me. |
I'll write one On Mon, Oct 31, 2016 at 10:24 AM, Jan Šafránek [email protected]
|
Thanks! I'd like to point out that this PR blocks testing of OpenShift on GCE and AWS, our QE literally cannot do anything there and there is plenty of new stuff to test in 1.4. |
Let's merge this as-is and I'll do a follow-up with the test (assuming it's not impossible). LGTM. Let's get 1 more +1 and then we'll tag - @liggitt @derekwaynecarr @mfojtik @pweil- @deads2k anyone? 😄 |
[merge] On Mon, Oct 31, 2016 at 10:38 AM, Andy Goldstein [email protected]
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Image: devenv-rhel7_5279) |
Evaluated for origin merge up to 8c698c5 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Base Commit: cb88171) |
1 similar comment
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Base Commit: cb88171) |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1379600
Be careful with review, I don't know these parts of OpenShift very well. I tested AWS and GCE and it fixes the bug there.