Skip to content

Commit 99a5c94

Browse files
authored
Merge pull request #9425 from iocanel/s2i-win-fix2
chore: Align methods in S2iProcessor
2 parents 9f25d3e + 478d393 commit 99a5c94

File tree

1 file changed

+10
-5
lines changed
  • extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment

1 file changed

+10
-5
lines changed

extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,19 @@ public void s2iBuildFromNative(S2iConfig s2iConfig, ContainerImageConfig contain
219219
LOG.info("Performing s2i binary build with native image on server: " + kubernetesClient.getClient().getMasterUrl()
220220
+ " in namespace:" + namespace + ".");
221221

222-
GeneratedFileSystemResourceBuildItem openshiftYml = generatedResources
222+
Optional<GeneratedFileSystemResourceBuildItem> openshiftYml = generatedResources
223223
.stream()
224-
.filter(r -> r.getName().endsWith("kubernetes/openshift.yml"))
225-
.findFirst().orElseThrow(() -> new IllegalStateException("Could not find kubernetes/openshift.yml"));
224+
.filter(r -> r.getName().endsWith("kubernetes" + File.separator + "openshift.yml"))
225+
.findFirst();
226+
227+
if (!openshiftYml.isPresent()) {
228+
LOG.warn(
229+
"No Openshift manifests were generated (most likely due to the fact that the service is not an HTTP service) so no s2i process will be taking place");
230+
return;
231+
}
226232

227-
createContainerImage(kubernetesClient, openshiftYml, s2iConfig, out.getOutputDirectory(), nativeImage.getPath());
233+
createContainerImage(kubernetesClient, openshiftYml.get(), s2iConfig, out.getOutputDirectory(), nativeImage.getPath());
228234
artifactResultProducer.produce(new ArtifactResultBuildItem(null, "native-container", Collections.emptyMap()));
229-
;
230235
}
231236

232237
public static void createContainerImage(KubernetesClientBuildItem kubernetesClient,

0 commit comments

Comments
 (0)