Skip to content

Commit

Permalink
chore: substitute refs to deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Jan 24, 2022
1 parent b80cde5 commit 10a30b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private static List<DecoratorBuildItem> createAppConfigVolumeAndEnvDecorators(Op
config.getAppSecret().ifPresent(s -> {
result.add(new DecoratorBuildItem(target, new AddSecretVolumeDecorator(new SecretVolumeBuilder()
.withSecretName(s)
.withNewVolumeName("app-secret")
.withVolumeName("app-secret")
.build())));
result.add(new DecoratorBuildItem(target, new AddMountDecorator(new MountBuilder()
.withName("app-secret")
Expand All @@ -342,7 +342,7 @@ private static List<DecoratorBuildItem> createAppConfigVolumeAndEnvDecorators(Op
config.getAppConfigMap().ifPresent(s -> {
result.add(new DecoratorBuildItem(target, new AddConfigMapVolumeDecorator(new ConfigMapVolumeBuilder()
.withConfigMapName(s)
.withNewVolumeName("app-config-map")
.withVolumeName("app-config-map")
.build())));
result.add(new DecoratorBuildItem(target, new AddMountDecorator(new MountBuilder()
.withName("app-config-map")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.quarkus.bootstrap.model.AppArtifact;
import io.quarkus.builder.Version;
import io.quarkus.test.ProdBuildResults;
import io.quarkus.test.ProdModeTestResults;
import io.quarkus.test.QuarkusProdModeTest;
Expand All @@ -23,7 +26,11 @@ public class KubernetesWithQuarkusAppNameTest {
.withApplicationRoot((jar) -> jar.addClasses(GreetingResource.class))
.setApplicationName("kubernetes-with-quarkus-app-name")
.setApplicationVersion("0.1-SNAPSHOT")
.withConfigurationResource("kubernetes-with-quarkus-app-name.properties");
.withConfigurationResource("kubernetes-with-quarkus-app-name.properties")
.setForcedDependencies(
Arrays.asList(
new AppArtifact("io.quarkus", "quarkus-kubernetes", Version.getVersion()),
new AppArtifact("io.quarkus", "quarkus-container-image-s2i", Version.getVersion())));

@ProdBuildResults
private ProdModeTestResults prodModeTestResults;
Expand All @@ -48,7 +55,7 @@ public void assertGeneratedResources() throws IOException {
List<HasMetadata> openshiftList = DeserializationUtil
.deserializeAsList(kubernetesDir.resolve("openshift.yml"));
assertThat(openshiftList).allSatisfy(h -> {
assertThat(h.getMetadata().getName()).isIn("ofoo", "s2ifoo", "s2i-java");
assertThat(h.getMetadata().getName()).isIn("ofoo", "foo", "openjdk-11");
assertThat(h.getMetadata().getLabels()).contains(entry("app.kubernetes.io/name", "ofoo"),
entry("app.kubernetes.io/version", "1.0-openshift"));
});
Expand Down

0 comments on commit 10a30b7

Please sign in to comment.