Merge branch '3.1.x'

This commit is contained in:
Ryan Baxter
2024-10-16 10:23:28 -04:00
14 changed files with 3 additions and 33 deletions

View File

@@ -133,7 +133,6 @@ class Fabric8DiscoveryPodMetadataIT {
manifests(Phase.DELETE);
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
}
@Test

View File

@@ -92,7 +92,6 @@ class Fabric8IstioIT {
static void afterAll() throws Exception {
util.deleteNamespace("istio-system");
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
}
@AfterAll

View File

@@ -84,7 +84,6 @@ class Fabric8EventReloadIT {
util.deleteNamespace("left");
util.deleteNamespace("right");
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
manifests(Phase.DELETE);
}

View File

@@ -90,7 +90,6 @@ class KubernetesClientCatalogWatchIT {
util.deleteNamespace(NAMESPACE_A);
util.deleteNamespace(NAMESPACE_B);
app(Phase.DELETE);
Commons.systemPrune();
}
@BeforeEach

View File

@@ -80,7 +80,6 @@ class ActuatorRefreshIT {
static void afterAll() throws Exception {
configWatcher(Phase.DELETE);
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
Commons.systemPrune();
}
@BeforeEach

View File

@@ -84,7 +84,6 @@ class ActuatorRefreshMultipleNamespacesIT {
util.deleteNamespace(LEFT_NAMESPACE);
util.deleteNamespace(RIGHT_NAMESPACE);
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
Commons.systemPrune();
}
/**

View File

@@ -189,7 +189,6 @@ class DiscoveryClientIT {
discoveryServer(Phase.DELETE);
discoveryClient(Phase.DELETE);
Commons.systemPrune();
}
@Test

View File

@@ -93,7 +93,6 @@ class KubernetesClientDiscoveryClientIT {
static void afterAll() throws Exception {
manifests(Phase.DELETE);
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
}
/**

View File

@@ -104,7 +104,6 @@ class KubernetesClientDiscoverySelectiveNamespacesIT {
util.deleteNamespace(NAMESPACE_A);
util.deleteNamespace(NAMESPACE_B);
manifests(Phase.DELETE);
Commons.systemPrune();
}
/**

View File

@@ -89,7 +89,6 @@ class ConfigurationWatcherMultipleAppsIT {
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
Commons.cleanUp(CONFIG_WATCHER_APP_A_IMAGE, K3S);
Commons.cleanUp(CONFIG_WATCHER_APP_B_IMAGE, K3S);
Commons.systemPrune();
}
@BeforeEach

View File

@@ -88,7 +88,6 @@ class ConfigurationWatcherMultipleAppIT {
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
Commons.cleanUp(CONFIG_WATCHER_APP_A_IMAGE, K3S);
Commons.cleanUp(CONFIG_WATCHER_APP_B_IMAGE, K3S);
Commons.systemPrune();
}
@BeforeEach

View File

@@ -91,7 +91,6 @@ class K8sClientConfigMapReloadIT {
util.deleteNamespace("left");
util.deleteNamespace("right");
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
}
/**

View File

@@ -78,7 +78,6 @@ class K8sClientSecretsReloadIT {
static void afterAll() throws Exception {
configK8sClientIt(Phase.DELETE);
Commons.cleanUp(IMAGE_NAME, K3S);
Commons.systemPrune();
}
@Test

View File

@@ -156,7 +156,7 @@ public final class Commons {
.findFirst();
if (found.isPresent()) {
LOG.info("running in github actions, will load from : " + TMP_IMAGES + " tar : " + found.get());
Commons.loadImageFromPath(found.get(), container);
loadImageFromPath(found.get(), container);
return;
}
else {
@@ -174,8 +174,8 @@ public final class Commons {
try {
LOG.info("no tars found, will resort to pulling the image");
LOG.info("using : " + imageVersion + " for : " + imageNameForDownload);
Commons.pullImage(imageNameForDownload, imageVersion, container);
Commons.loadImage(imageNameForDownload, imageVersion, tarName, container);
pullImage(imageNameForDownload, imageVersion, container);
loadImage(imageNameForDownload, imageVersion, tarName, container);
}
catch (Exception e) {
throw new RuntimeException(e);
@@ -198,10 +198,6 @@ public final class Commons {
container.execInContainer("rm", TEMP_FOLDER + "/" + image + ".tar");
}
public static void cleanUpDownloadedImage(String image) throws Exception {
CONTAINER.execInContainer("crictl", "rmi", image);
}
/**
* validates that the provided image does exist in the local docker registry.
*/
@@ -232,19 +228,6 @@ public final class Commons {
return execResult.getStdout();
}
/**
* equivalent of 'docker system prune', but for crictl.
*/
public static void systemPrune() {
try {
CONTAINER.execInContainer("sh", "-c",
"crictl ps -a | grep -v Running | awk '{print $1}' | xargs crictl rm && crictl rmi --prune");
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public static String pomVersion() {
try (InputStream in = new ClassPathResource(KUBERNETES_VERSION_FILE).getInputStream()) {
String version = StreamUtils.copyToString(in, StandardCharsets.UTF_8);