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

[#6243] Ensure "node-to-node" tls is enabled in order to use "client-to-node" tls during create universe testcase #6910

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaydeepkumara
Copy link
Contributor

No description provided.

@SergeyPotachev
Copy link
Contributor

SergeyPotachev commented Jan 18, 2021

Sorry, @jaydeepkumara,
We already have a fix for this problem (#6899) prepared by Daniel (it is already accepted but not landed yet). Unfortunately you don't have access to see this. :(
@streddy-yb We need a way to avoid such situations...

Copy link
Contributor

@sb-yb sb-yb left a comment

Choose a reason for hiding this comment

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

Sorry, @jaydeepkumara,
In this case its ok since he actually added two new test cases.
If Daniel can add his fix on top of this if it is any different or adds some value.


ObjectNode bodyJson = Json.newObject();
ObjectNode userIntentJson = Json.newObject().put("universeName", "SingleUserUniverse")
.put("instanceType", i.getInstanceTypeCode()).put("replicationFactor", 3).put("numNodes", 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure line length does not exceed 100.


String url = "/api/customers/" + customer.uuid + "/universes";
Result result = doRequestWithAuthTokenAndBody("POST", url, authToken, bodyJson);
String expectedResult = String.format("It is imperative that the NodeToNode TLS encryption should be enabled for enabling the ClientToNode TLS encryption.");
Copy link
Contributor

Choose a reason for hiding this comment

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

same.

@daniel-yb daniel-yb self-requested a review January 19, 2021 04:53
JsonNode clusters = formData.get("clusters");
if (clusters == null) {
return true;
}
for (JsonNode cluster : formData.get("clusters")) {
JsonNode nodeToNodeEncryption = cluster.get("userIntent").get("enableNodeToNodeEncrypt");
Copy link
Contributor

Choose a reason for hiding this comment

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

This can still result in a NPE if a cluster does not have a userIntent field. This method should not assume the data is in any specific shape since we don't have upstream validation of the shape of the JSON request payload before this method is called.

@daniel-yb
Copy link
Contributor

I just landed my diff fixing the NPE in UniverseController.java. If you want to change this diff to only include the extra unit tests that would still be useful though.

Copy link
Contributor

@daniel-yb daniel-yb left a comment

Choose a reason for hiding this comment

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

See my last comment. As @SergeyPotachev mentioned, we definitely should figure out a way to give you guys more visibility on the PRs that we have up internally somehow to avoid duplicate work in the future. I should have better communicated that I had a fix up for review already for this, my bad.

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.

None yet

4 participants