Skip to content

Commit

Permalink
Merge branch 'fix-1715-drop-profiles-support' into fix-1681
Browse files Browse the repository at this point in the history
  • Loading branch information
wind57 committed Jan 21, 2025
2 parents ecba01f + 4066344 commit b857418
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 576 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.Fabric8CatalogWatchWithEndpointSlicesAndNamespaceFilterIT.TestConfig;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.Fabric8CatalogWatchEndpointSlicesFilterIT.TestConfig;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.TestAssertions.assertLogStatement;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.TestAssertions.invokeAndAssert;

Expand All @@ -43,7 +43,7 @@
*/
@SpringBootTest(classes = { KubernetesCatalogWatchAutoConfiguration.class, TestConfig.class, Application.class },
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class Fabric8CatalogWatchWithEndpointSlicesAndNamespaceFilterIT extends Fabric8CatalogWatchBase {
class Fabric8CatalogWatchEndpointSlicesFilterIT extends Fabric8CatalogWatchBase {

@LocalServerPort
private int port;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.Fabric8CatalogWatchWithEndpointsAndNamespaceFilterIT.TestConfig;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.Fabric8CatalogWatchEndpointsIT.TestConfig;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.TestAssertions.assertLogStatement;
import static org.springframework.cloud.kubernetes.fabric8.catalog.watch.TestAssertions.invokeAndAssert;

Expand All @@ -43,7 +43,7 @@
*/
@SpringBootTest(classes = { KubernetesCatalogWatchAutoConfiguration.class, TestConfig.class, Application.class },
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class Fabric8CatalogWatchWithEndpointsAndNamespaceFilterIT extends Fabric8CatalogWatchBase {
class Fabric8CatalogWatchEndpointsIT extends Fabric8CatalogWatchBase {

@LocalServerPort
private int port;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.kubernetes.integration.tests.commons.Images;
import org.springframework.cloud.kubernetes.integration.tests.commons.Phase;
import org.springframework.test.context.TestPropertySource;

import static org.springframework.cloud.kubernetes.fabric8.client.discovery.TestAssertions.assertBlockingConfiguration;
import static org.springframework.cloud.kubernetes.fabric8.client.discovery.TestAssertions.assertPodMetadata;

/**
* @author wind57
Expand All @@ -39,6 +42,9 @@ class Fabric8DiscoveryBlockingIT extends Fabric8DiscoveryBase {
@LocalManagementPort
private int port;

@Autowired
private DiscoveryClient discoveryClient;

@BeforeEach
void beforeEach() {
Images.loadBusybox(K3S);
Expand All @@ -51,8 +57,20 @@ void afterEach() {
}

@Test
void test(CapturedOutput output) {
void test(CapturedOutput output) throws Exception {

String[] busyboxPods = K3S.execInContainer("sh", "-c", "kubectl get pods -l app=busybox -o=name --no-headers")
.getStdout()
.split("\n");

String podOne = busyboxPods[0].split("/")[1];
String podTwo = busyboxPods[1].split("/")[1];

K3S.execInContainer("sh", "-c", "kubectl label pods " + podOne + " my-label=my-value");
K3S.execInContainer("sh", "-c", "kubectl annotate pods " + podTwo + " my-annotation=my-value");

assertBlockingConfiguration(output, port);
assertPodMetadata(discoveryClient);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"spring.cloud.kubernetes.discovery.namespaces[1]=b-uat",
"spring.cloud.kubernetes.discovery.filter=#root.metadata.namespace matches '^.*uat$'",
"logging.level.org.springframework.cloud.kubernetes.fabric8.discovery=DEBUG" })
class Fabric8DiscoveryFilterMatchTwoNamespacesIT extends Fabric8DiscoveryBase {
class Fabric8DiscoveryFilterIT extends Fabric8DiscoveryBase {

private static final String NAMESPACE_A_UAT = "a-uat";

Expand Down
Loading

0 comments on commit b857418

Please sign in to comment.