From ea310e5ba30292625782c88f2b3aefdfbb648a37 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 9 Mar 2021 09:41:22 +0200 Subject: [PATCH] Don't run Kubernetes manifest generation in tests In tests, various Build Items are population with the proper values (like the output target), so it's best to not run the Kubernetes manifest generation at all in order to avoid getting NPEs Fixes: #15555 --- .../io/quarkus/kubernetes/deployment/KubernetesProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java index 80271ffa204953..e98cbfa5d3bea4 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java @@ -17,6 +17,7 @@ import java.util.Set; import java.util.stream.Collectors; +import io.quarkus.deployment.IsTest; import org.jboss.logging.Logger; import io.dekorate.Session; @@ -75,7 +76,7 @@ public EnabledKubernetesDeploymentTargetsBuildItem enabledKubernetesDeploymentTa return new EnabledKubernetesDeploymentTargetsBuildItem(entries); } - @BuildStep + @BuildStep(onlyIfNot = IsTest.class) public void build(ApplicationInfoBuildItem applicationInfo, OutputTargetBuildItem outputTarget, PackageConfig packageConfig,