Skip to content

Commit 5d3bb9c

Browse files
Improve the error message if accessing cluster during validation fails.
1 parent d313541 commit 5d3bb9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/main/java/cd/go/contrib/elasticagent/executors/ValidateConfigurationExecutor.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ private void validateNamespaceExistence() {
8585

8686
result.add(error(NAMESPACE.key(), format("Namespace `{0}` does not exist in you cluster. Run \"kubectl create namespace {1}\" to create a namespace.", namespace, namespace)));
8787
} catch (Exception e) {
88-
LOG.error(format("Failed to validate namespace existence: {0} Please check plugin log for more detail.", namespace), e);
89-
result.add(error(NAMESPACE.key(), format("Failed to validate namespace existence: {0} Please check plugin log for more detail.", namespace)));
88+
String message = "Failed validation of plugin settings. The reasons could be - " +
89+
"Cluster Url is configured incorrectly or " +
90+
"the service account token might not have enough permissions to list namespaces or " +
91+
"incorrect CA certificate.";
92+
LOG.error(message, e);
93+
result.add(error(NAMESPACE.key(), format(message + "Please check the plugin log for more details.")));
9094
}
9195
}
9296

0 commit comments

Comments
 (0)