Skip to content

Commit

Permalink
Remove test changes
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Aug 7, 2024
1 parent f39e1b8 commit d8f78a6
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public Optional<ObjectNode> create(
// Remove some settings which will cause errors if you try to pass them to the API
ObjectNode settings = indexMetadata.getSettings();

// String[] problemFields = { "creation_date", "provided_name", "uuid", "version" };
// for (String field : problemFields) {
// settings.remove(field);
// }
String[] problemFields = { "creation_date", "provided_name", "uuid", "version" };
for (String field : problemFields) {
settings.remove(field);
}

// Assemble the request body
ObjectNode body = mapper.createObjectNode();
Expand All @@ -52,7 +52,7 @@ public Optional<ObjectNode> create(
var illegalArguments = invalidResponse.getIllegalArguments();

if (illegalArguments.isEmpty()) {
log.debug("Unable to alter index creation request to retry");
log.debug("Cannot retry invalid response.");
return Optional.empty();
}

Expand Down Expand Up @@ -85,12 +85,9 @@ private void removeFieldsByPath(ObjectNode node, String path) {
if (nextNode != null && nextNode.isObject()) {
currentNode = (ObjectNode) nextNode;
} else {
// Path is invalid or does not exist
log.debug("Unable to remove path " + path + " , on current node " + node.toPrettyString());
return;
}
}
log.debug("Removing " + pathParts[pathParts.length - 1] + " on node " + currentNode.toPrettyString());
currentNode.remove(pathParts[pathParts.length - 1]);
}
}

0 comments on commit d8f78a6

Please sign in to comment.