Skip to content

Commit ddb3468

Browse files
k3s fix (#130)
1 parent 7b373be commit ddb3468

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

sal-service/src/main/java/org/ow2/proactive/sal/service/service/ClusterService.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,20 @@ private void validateNode(ClusterNodeDefinition node) {
6464
}
6565
}
6666

67-
public static String stripQuotes(String value) {
68-
if (value == null || value.isEmpty())
69-
return value;
70-
71-
int start = 0;
72-
int end = value.length();
67+
private static String stripQuotes(String value) {
68+
if (value == null)
69+
return null;
70+
value = value.trim();
7371

74-
if (value.charAt(0) == '"' || value.charAt(0) == '\'') {
75-
start++;
72+
while (!value.isEmpty() && (value.startsWith("\"") || value.startsWith("'"))) {
73+
value = value.substring(1).trim();
7674
}
77-
if (value.length() > 1 &&
78-
(value.charAt(value.length() - 1) == '"' || value.charAt(value.length() - 1) == '\'')) {
79-
end--;
75+
76+
while (!value.isEmpty() && (value.endsWith("\"") || value.endsWith("'"))) {
77+
value = value.substring(0, value.length() - 1).trim();
8078
}
8179

82-
return value.substring(start, end);
80+
return value;
8381
}
8482

8583
public static String getContainerizationFlavor(String envVarsScript) {

0 commit comments

Comments
 (0)