Repository: quarkusio/quarkus
Issue: the `container-image-s2i` extension runs `oc version` without reason

**Describe the bug**

I added the `container-image-s2i` extension so that I can customize the base S2I image in generated OpenShift resources. (When the extension is not present, the base S2I image is always `fabric8/s2i-java`, even though I added the `quarkus.s2i.base-jvm-image` config property. I personally consider the `fabric8/s2i-java` image long deprecated and dangerous to use, as it clearly hasn't been kept up to date.)

That works fine, if the `oc` binary is present. (If the `oc` binary is not present, I still get all the resources, but again, I always get `fabric8/s2i-java`, even though I added the `quarkus.s2i.base-jvm-image` config property.)

However, there's a noticeable delay as it's running `oc version` to determine OpenShift version. This is because `oc version` by default talks to the OpenShift API server, which takes time.

(The process of determining server version is actually tailored to `oc` from OpenShift 3.x. The `oc` binary from OpenShift 4.x no longer prints a line starting with `kubernetes`. Also the server version is not even used!)

**Expected behavior**
I don't know why I even need the `container-image-s2i` extension to get S2I configuration applied, because the old deprecated `s2i.builder-image` config property works without the extension!

But even if I add the `container-image-s2i` extension, I expect the S2I configuration to be applied when I don't have the `oc` binary present, and I certainly don't expect the build to talk to OpenShift if I don't ask it to. (If I ask to push the container image to the OpenShift registry, or start a build in OpenShift, then sure. But not for creating the YAML files locally!)

**Actual behavior**
The build process talks to OpenShift server needlessly.

**To Reproduce**
Steps to reproduce the behavior:
1. Add the `container-image-s2i` extension.
2. Run `mvn clean package`.
3. If `oc` is present: observe noticeable delay. If `oc` is not present: observe that S2I configuration is not taken into account.

**Configuration**
```properties
quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.expose=true
quarkus.s2i.base-jvm-image=registry.access.redhat.com/openjdk/openjdk-11-rhel7
```

Changed files:
extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBuild.java

diff --git a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBuild.java b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBuild.java
index 9ed67bab85b..a1b88d0515f 100644
--- a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBuild.java
+++ b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iBuild.java
@@ -1,25 +1,11 @@
 package io.quarkus.container.image.s2i.deployment;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
 import java.util.function.BooleanSupplier;
-import java.util.function.Function;
-
-import org.jboss.logging.Logger;
 
 import io.quarkus.container.image.deployment.ContainerImageConfig;
-import io.quarkus.deployment.util.ExecUtil;
 
 public class S2iBuild implements BooleanSupplier {
 
-    private static final Logger LOGGER = Logger.getLogger(S2iBuild.class.getName());
-
     private ContainerImageConfig containerImageConfig;
 
     S2iBuild(ContainerImageConfig containerImageConfig) {
@@ -28,47 +14,6 @@ public class S2iBuild implements BooleanSupplier {
 
     @Override
     public boolean getAsBoolean() {
-        OutputFilter filter = new OutputFilter();
-        try {
-            if (ExecUtil.exec(new File("."), filter, "oc", "version")) {
-                Optional<String> version = getServerVersionFromOc(filter.getLines());
-                return true;
-            }
-        } catch (Exception e) {
-            return false;
-        }
-        return false;
-    }
-
-    private static Optional<String> getServerVersionFromOc(List<String> lines) {
-        return lines.stream()
-                .filter(l -> l.startsWith("kubernetes"))
-                .map(l -> l.split(" "))
-                .filter(a -> a.length > 2)
-                .map(a -> a[1])
-                .findFirst();
-    }
-
-    private static class OutputFilter implements Function<InputStream, Runnable> {
-        private final List<String> list = new ArrayList();
-
-        @Override
-        public Runnable apply(InputStream is) {
-            return () -> {
-                try (InputStreamReader isr = new InputStreamReader(is);
-                        BufferedReader reader = new BufferedReader(isr)) {
-
-                    for (String line = reader.readLine(); line != null; line = reader.readLine()) {
-                        list.add(line);
-                    }
-                } catch (IOException e) {
-                    throw new RuntimeException("Error reading stream.", e);
-                }
-            };
-        }
-
-        public List<String> getLines() {
-            return list;
-        }
+        return true;
     }
 }