Skip to content

Commit 0ee08b9

Browse files
committed
Skip duplicate name validation if odo list fails
This PR fixes redhat-developer#2036. Signed-off-by: Denis Golovin [email protected]
1 parent b6a1233 commit 0ee08b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/openshift/openshiftItem.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ export default class OpenShiftItem {
5252
let validationMessage = OpenShiftItem.emptyName(`Empty ${message}`, value.trim());
5353
if (!validationMessage) validationMessage = OpenShiftItem.validateMatches(`Not a valid ${message}. Please use lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character`, value);
5454
if (!validationMessage) validationMessage = OpenShiftItem.lengthName(`${message} should be between 2-63 characters`, value, offset ? offset.length : 0);
55-
if (!validationMessage) validationMessage = OpenShiftItem.validateUniqueName(await data, value);
55+
if (!validationMessage) {
56+
try {
57+
const existingResources = await data;
58+
validationMessage = OpenShiftItem.validateUniqueName(existingResources, value);
59+
} catch (err) {
60+
//ignore to keep other validation to work
61+
}
62+
}
5663
return validationMessage;
5764
}
5865
});

0 commit comments

Comments
 (0)