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

SonarQube AI Fix - kubernetes-maven-plugin #3581

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,20 @@ protected ResourceClassifier getResourceClassifier() {
private void validateIfRequired(File resourceDir, ResourceClassifier classifier)
throws MojoExecutionException, MojoFailureException {
try {
if (!skipResourceValidation) {
if (Boolean.FALSE.equals(skipResourceValidation)) {
log.verbose("Validating resources");
new ResourceValidator(resourceDir, classifier, log).validate();
}
} catch (ConstraintViolationException e) {
if (failOnValidationError) {
if (Boolean.TRUE.equals(failOnValidationError)) {
log.error("[[R]]" + e.getMessage() + "[[R]]");
log.error("[[R]]use \"mvn -Djkube.skipResourceValidation=true\" option to skip the validation[[R]]");
throw new MojoFailureException("Failed to generate kubernetes descriptor");
} else {
log.warn("[[Y]]" + e.getMessage() + "[[Y]]");
}
} catch (Exception e) {
if (failOnValidationError) {
if (Boolean.TRUE.equals(failOnValidationError)) {
throw new MojoExecutionException("Failed to validate resources", e);
} else {
log.warn("Failed to validate resources: %s", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ void execute_withException_shouldStop() throws Exception {
// Then
assertThat(remoteDevelopmentService.constructed())
.singleElement()
.satisfies(remoteDevelopmentService -> verify(remoteDevelopmentService, times(1)).stop());
.satisfies(service -> verify(service, times(1)).stop());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void setUp() throws IOException {
.log(new KitLogger.SilentLogger())
.platformMode(RuntimeMode.KUBERNETES)
.build();
// log = new KitLogger.SilentLogger();

mojoExecution = new MojoExecution(new MojoDescriptor());
mojoExecution.getMojoDescriptor().setPluginDescriptor(new PluginDescriptor());
mojoExecution.getMojoDescriptor().getPluginDescriptor().setGoalPrefix("k8s");
Expand Down
Loading