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

Initialize cloud provider in node #11620

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

jsafrane
Copy link
Contributor

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.

@jsafrane jsafrane added this to the 1.4.0 milestone Oct 27, 2016
@jsafrane jsafrane changed the title Initialize cloud config in node Initialize cloud provider in node Oct 27, 2016
@jsafrane
Copy link
Contributor Author

[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)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for \n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ncdc
Copy link
Contributor

ncdc commented Oct 27, 2016

@jsafrane
Copy link
Contributor Author

Be careful with review, I don't know these parts of OpenShift very well.

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 8c698c5

server := kubeletoptions.NewKubeletServer()
server.CloudProvider = providerName

cloud, err := buildCloudProvider(server)
Copy link
Contributor

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?

@smarterclayton
Copy link
Contributor

Yes.

On Mon, Oct 31, 2016 at 10:10 AM, Andy Goldstein [email protected]
wrote:

@ncdc commented on this pull request.

In pkg/cmd/server/kubernetes/node_config_test.go
#11620 (review)
:

@@ -157,3 +160,49 @@ func TestProxyConfig(t *testing.T) {
}

}
+
+func TestBuildCloudProviderFake(t *testing.T) {

  • providerName := "fake"
  • cloudprovider.RegisterCloudProvider(providerName, func(config io.Reader) (cloudprovider.Interface, error) {
  • return &fake.FakeCloud{}, nil
    
  • })
    +
  • server := kubeletoptions.NewKubeletServer()
  • server.CloudProvider = providerName
    +
  • cloud, err := buildCloudProvider(server)

@smarterclayton https://github.com/smarterclayton are you looking for a
test that ensures that BuildKubernetesNodeConfig ends up with the cloud
provider filled in correctly?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11620 (review),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG_p2YUIdZXWoRUkEkq8Yuhzn4F4RiHks5q5fbQgaJpZM4KidvJ
.

@ncdc
Copy link
Contributor

ncdc commented Oct 31, 2016

@jsafrane do you think you could take a stab at writing a new test that calls BuildKubernetesNodeConfig?

@jsafrane
Copy link
Contributor Author

@ncdc no, I really do not feel comfortable testing this code. I've barely seen it and it looks pretty complex to me.

@ncdc
Copy link
Contributor

ncdc commented Oct 31, 2016

I'll write one

On Mon, Oct 31, 2016 at 10:24 AM, Jan Šafránek [email protected]
wrote:

@ncdc https://github.com/ncdc no, I really do not feel comfortable
testing this code. I've barely seen it and it looks pretty complex to me.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11620 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAABYqZDFEsTyfXx43S5_GbnDcsPvvChks5q5fobgaJpZM4KidvJ
.

@jsafrane
Copy link
Contributor Author

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.

@ncdc
Copy link
Contributor

ncdc commented Oct 31, 2016

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? 😄

@smarterclayton
Copy link
Contributor

[merge]

On Mon, Oct 31, 2016 at 10:38 AM, Andy Goldstein [email protected]
wrote:

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
https://github.com/liggitt @derekwaynecarr
https://github.com/derekwaynecarr @mfojtik https://github.com/mfojtik
@pweil- https://github.com/pweil- @deads2k https://github.com/deads2k
anyone? 😄


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11620 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG_pzmhSlP3LdOTFEM_QtbnQjTDjcNIks5q5f1ZgaJpZM4KidvJ
.

@openshift-bot
Copy link
Contributor

openshift-bot commented Oct 31, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Image: devenv-rhel7_5279)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 8c698c5

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Base Commit: cb88171)

1 similar comment
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10851/) (Base Commit: cb88171)

@openshift-bot openshift-bot merged commit 11d3928 into openshift:master Oct 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants