Skip to content

Commit

Permalink
Merge pull request #23831 from ioforks/fix-23788
Browse files Browse the repository at this point in the history
Fix typo in OpenshiftConfig
  • Loading branch information
geoand committed Feb 21, 2022
2 parents 9b6822c + d3773da commit 5267baf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Expand Up @@ -7,6 +7,8 @@
import static io.quarkus.kubernetes.deployment.Constants.DEPLOYMENT_CONFIG_VERSION;
import static io.quarkus.kubernetes.deployment.Constants.DEPLOYMENT_GROUP;
import static io.quarkus.kubernetes.deployment.Constants.DEPLOYMENT_VERSION;
import static io.quarkus.kubernetes.deployment.Constants.OPENSHIFT;
import static io.quarkus.kubernetes.deployment.Constants.S2I;
import static io.quarkus.kubernetes.deployment.Constants.STATEFULSET;

import java.util.List;
Expand Down Expand Up @@ -510,8 +512,8 @@ public Optional<ExpositionConfig> getExposition() {

public static boolean isOpenshiftBuildEnabled(ContainerImageConfig containerImageConfig, Capabilities capabilities) {
boolean implictlyEnabled = ContainerImageCapabilitiesUtil.getActiveContainerImageCapability(capabilities)
.filter(c -> c.contains("openshift") || c.contains("s2i")).isPresent();
return containerImageConfig.builder.map(b -> b.equals("openshfit") || b.equals("s2i")).orElse(implictlyEnabled);
.filter(c -> c.contains(OPENSHIFT) || c.contains(S2I)).isPresent();
return containerImageConfig.builder.map(b -> b.equals(OPENSHIFT) || b.equals(S2I)).orElse(implictlyEnabled);
}

public DeploymentResourceKind getDeploymentResourceKind() {
Expand Down
Expand Up @@ -58,6 +58,20 @@ public void assertGeneratedResources() throws IOException {
});

assertThat(openshiftList).filteredOn(h -> "BuildConfig".equals(h.getKind())).hasSize(1);
// Has output image stream
assertThat(openshiftList)
.filteredOn(h -> "ImageStream".equals(h.getKind()) && h.getMetadata().getName().equals("openshift-s2i"))
.hasSize(1);

// Has builder image stream
assertThat(openshiftList)
.filteredOn(h -> "ImageStream".equals(h.getKind()) && !h.getMetadata().getName().equals("openshift-s2i"))
.singleElement().satisfies(r -> {
assertThat(r).isInstanceOfSatisfying(ImageStream.class, i -> {
assertThat(i.getSpec()).isNotNull();
assertThat(i.getSpec().getDockerImageRepository()).isNotNull();
});
});

assertThat(openshiftList).filteredOn(h -> "DeploymentConfig".equals(h.getKind())).singleElement().satisfies(h -> {
assertThat(h.getMetadata()).satisfies(m -> {
Expand Down

0 comments on commit 5267baf

Please sign in to comment.