Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void beforeAll() throws Exception {
}

@AfterAll
static void afterAll() throws Exception {
static void afterAll() {
util.deleteClusterWide(NAMESPACE, Set.of("left", "right"));
manifests(Phase.DELETE);
util.deleteNamespace("left");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.springframework.cloud.kubernetes.integration.tests.commons;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand All @@ -41,7 +40,6 @@
import org.testcontainers.k3s.K3sContainer;

import org.springframework.core.io.ClassPathResource;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StreamUtils;
import org.springframework.util.StringUtils;

Expand All @@ -59,6 +57,8 @@
*/
public final class Commons {

private static String POM_VERSION;

private static final Log LOG = LogFactory.getLog(Commons.class);

private Commons() {
Expand Down Expand Up @@ -204,22 +204,22 @@ public static void pullImage(String image, String tag, K3sContainer container) t
try (PullImageCmd pullImageCmd = container.getDockerClient().pullImageCmd(image)) {
pullImageCmd.withTag(tag).start().awaitCompletion();
}

}

public static String pomVersion() {
try (InputStream in = new ClassPathResource(KUBERNETES_VERSION_FILE).getInputStream()) {
String version = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
if (StringUtils.hasText(version)) {
version = version.trim();
if (POM_VERSION == null) {
try (InputStream in = new ClassPathResource(KUBERNETES_VERSION_FILE).getInputStream()) {
String version = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
if (StringUtils.hasText(version)) {
POM_VERSION = version.trim();
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
return version;
}
catch (IOException e) {
ReflectionUtils.rethrowRuntimeException(e);
}
// not reachable since exception rethrown at runtime
return null;

return POM_VERSION;
}

/**
Expand Down
Loading