Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wind57 committed Dec 21, 2024
1 parent 11996b6 commit 4c23063
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ static void beforeAllInNested() {

private void externalNameServices(Phase phase) {
if (phase == Phase.CREATE) {
util.createAndWait(NAMESPACE, null, null, externalServiceName, null, true);
util.createAndWait(NAMESPACE, null, null, externalServiceName, true);
}
else {
util.deleteAndWait(NAMESPACE, null, externalServiceName, null);
util.deleteAndWait(NAMESPACE, null, externalServiceName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ void beforeEach() {
util.createNamespace(NAMESPACE_A_UAT);
util.createNamespace(NAMESPACE_B_UAT);

util.wiremock(NAMESPACE_A_UAT, "/wiremock", Phase.CREATE, false);
util.wiremock(NAMESPACE_B_UAT, "/wiremock", Phase.CREATE, false);
util.wiremock(NAMESPACE_A_UAT, Phase.CREATE);
util.wiremock(NAMESPACE_B_UAT, Phase.CREATE);

}

@AfterEach
void afterEach() {

util.wiremock(NAMESPACE_A_UAT, "/wiremock", Phase.DELETE, false);
util.wiremock(NAMESPACE_B_UAT, "/wiremock", Phase.DELETE, false);
util.wiremock(NAMESPACE_A_UAT, Phase.DELETE);
util.wiremock(NAMESPACE_B_UAT, Phase.DELETE);

util.deleteNamespace(NAMESPACE_A_UAT);
util.deleteNamespace(NAMESPACE_B_UAT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
logging:
level:
org:
springframework: DEBUG

spring:
cloud:
istio:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
import io.fabric8.kubernetes.client.utils.Serialization;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -97,7 +96,7 @@ static void after() {

@Test
void test() {
WebClient client = builder().baseUrl("http://localhost/profiles").build();
WebClient client = builder().baseUrl("http://localhost:32321/profiles").build();

@SuppressWarnings("unchecked")
List<String> result = client.method(HttpMethod.GET)
Expand All @@ -114,18 +113,16 @@ private static void appManifests(Phase phase) {

InputStream deploymentStream = util.inputStream("istio-deployment.yaml");
InputStream serviceStream = util.inputStream("istio-service.yaml");
InputStream ingressStream = util.inputStream("istio-ingress.yaml");

Deployment deployment = Serialization.unmarshal(deploymentStream, Deployment.class);

Service service = Serialization.unmarshal(serviceStream, Service.class);
Ingress ingress = Serialization.unmarshal(ingressStream, Ingress.class);

if (phase.equals(Phase.CREATE)) {
util.createAndWait(NAMESPACE, null, deployment, service, ingress, true);
util.createAndWait(NAMESPACE, null, deployment, service, true);
}
else {
util.deleteAndWait(NAMESPACE, deployment, service, ingress);
util.deleteAndWait(NAMESPACE, deployment, service);
}

}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
- name: http
port: 8080
targetPort: 8080
nodePort: 32321
selector:
app: spring-cloud-kubernetes-fabric8-client-istio
type: ClusterIP
type: NodePort
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void test() {
Commons.waitForLogStatement("will add file-based property source : /tmp/application.properties", K3S,
IMAGE_NAME);
// (3)
WebClient webClient = builder().baseUrl("http://localhost/key").build();
WebClient webClient = builder().baseUrl("http://localhost:32321/key").build();
String result = webClient.method(HttpMethod.GET)
.retrieve()
.bodyToMono(String.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void test() {
Commons.waitForLogStatement("will add file-based property source : /tmp/application.properties", K3S,
IMAGE_NAME);
// (3)
WebClient webClient = builder().baseUrl("http://localhost/key").build();
WebClient webClient = builder().baseUrl("http://localhost:32321/key").build();
String result = webClient.method(HttpMethod.GET)
.retrieve()
.bodyToMono(String.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.utils.Serialization;

Expand Down Expand Up @@ -90,22 +89,20 @@ static void manifests(Phase phase, Util util, String namespace) {

InputStream deploymentStream = util.inputStream("manifests/deployment.yaml");
InputStream serviceStream = util.inputStream("manifests/service.yaml");
InputStream ingressStream = util.inputStream("manifests/ingress.yaml");
InputStream configMapAsStream = util.inputStream("manifests/configmap.yaml");

Deployment deployment = Serialization.unmarshal(deploymentStream, Deployment.class);

Service service = Serialization.unmarshal(serviceStream, Service.class);
Ingress ingress = Serialization.unmarshal(ingressStream, Ingress.class);
ConfigMap configMap = Serialization.unmarshal(configMapAsStream, ConfigMap.class);

if (phase.equals(Phase.CREATE)) {
util.createAndWait(namespace, configMap, null);
util.createAndWait(namespace, null, deployment, service, ingress, true);
util.createAndWait(namespace, null, deployment, service, true);
}
else {
util.deleteAndWait(namespace, configMap, null);
util.deleteAndWait(namespace, deployment, service, ingress);
util.deleteAndWait(namespace, deployment, service);
}

}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
- name: http
port: 8080
targetPort: 8080
nodePort: 32321
selector:
app: spring-cloud-kubernetes-fabric8-client-reload
type: ClusterIP
type: NodePort
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class FixedPortsK3sContainer extends K3sContainer {
/**
* Test containers exposed ports.
*/
private static final int[] EXPOSED_PORTS = new int[] { 80, 6443, 8080, 8888, 9092 };
private static final int[] EXPOSED_PORTS = new int[] { 80, 6443, 8080, 8888, 9092, 32321 };

/**
* Rancher version to use for test-containers.
Expand Down

0 comments on commit 4c23063

Please sign in to comment.