Fabric8 it part 10 (#1477)

This commit is contained in:
erabii
2023-10-13 18:26:35 +03:00
committed by GitHub
parent 54caa3c7df
commit 0d13b6d021
54 changed files with 68 additions and 65 deletions

View File

@@ -48,20 +48,25 @@
</dependencyManagement>
<modules>
<!-- catalog-watcher -->
<module>spring-cloud-kubernetes-fabric8-client-catalog-watcher</module>
<module>spring-cloud-kubernetes-k8s-client-catalog-watcher</module>
<!-- discovery client -->
<module>spring-cloud-kubernetes-fabric8-client-discovery</module>
<module>spring-cloud-kubernetes-k8s-client-discovery</module>
<!-- reload via plain reload/paths/configtree and catalog watcher -->
<module>spring-cloud-kubernetes-fabric8-client-reload</module>
<module>spring-cloud-kubernetes-k8s-client-reload</module>
<module>spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap</module>
<module>spring-cloud-kubernetes-fabric8-istio-it</module>
<module>spring-cloud-kubernetes-discoveryclient-it</module>
<module>spring-cloud-kubernetes-client-loadbalancer-it</module>
<module>spring-cloud-kubernetes-configuration-watcher-it</module>
<module>spring-cloud-kubernetes-client-event-and-polling-reload</module>
<module>spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps</module>
<module>spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps</module>
</modules>

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import java.time.Duration;
import java.util.Map;
@@ -31,10 +31,10 @@ import org.springframework.http.HttpMethod;
import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.builder;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.logs;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.replaceConfigMap;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.retrySpec;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.builder;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.logs;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.replaceConfigMap;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.retrySpec;
final class DataChangesInConfigMapReloadDelegate {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import java.io.InputStream;
import java.time.Duration;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import java.time.Duration;
import java.util.Base64;
@@ -32,8 +32,8 @@ import org.springframework.http.HttpMethod;
import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.builder;
import static org.springframework.cloud.kubernetes.fabric8.reload.TestUtil.retrySpec;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.builder;
import static org.springframework.cloud.kubernetes.fabric8.client.reload.TestUtil.retrySpec;
/**
* @author wind57

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.fabric8.client.reload;
import java.io.InputStream;
import java.time.Duration;

View File

@@ -49,9 +49,6 @@ import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.integration.tests.commons.Commons.waitForLogStatement;
import static org.springframework.cloud.kubernetes.k8s.client.catalog.watcher.KubernetesClientCatalogWatchUtils.patchForEndpointSlices;
import static org.springframework.cloud.kubernetes.k8s.client.catalog.watcher.KubernetesClientCatalogWatchUtils.patchForEndpointSlicesNamespaces;
import static org.springframework.cloud.kubernetes.k8s.client.catalog.watcher.KubernetesClientCatalogWatchUtils.patchForEndpointsNamespaces;
/**
* @author wind57
@@ -115,7 +112,7 @@ class KubernetesClientCatalogWatchIT {
@Test
@Order(2)
void testCatalogWatchWithEndpointSlices() {
patchForEndpointSlices(APP_NAME, NAMESPACE, DOCKER_IMAGE);
KubernetesClientCatalogWatchUtils.patchForEndpointSlices(APP_NAME, NAMESPACE, DOCKER_IMAGE);
waitForLogStatement("stateGenerator is of type: KubernetesEndpointSlicesCatalogWatch", K3S, APP_NAME);
test();
@@ -128,12 +125,13 @@ class KubernetesClientCatalogWatchIT {
util.setUpClusterWide(NAMESPACE, Set.of(NAMESPACE_A, NAMESPACE_B));
util.busybox(NAMESPACE_A, Phase.CREATE);
util.busybox(NAMESPACE_B, Phase.CREATE);
patchForEndpointsNamespaces(APP_NAME, NAMESPACE, DOCKER_IMAGE);
KubernetesClientCatalogWatchUtils.patchForEndpointsNamespaces(APP_NAME, NAMESPACE, DOCKER_IMAGE);
KubernetesClientCatalogWatchNamespacesDelegate.testCatalogWatchWithEndpointsNamespaces(APP_NAME);
util.busybox(NAMESPACE_A, Phase.CREATE);
util.busybox(NAMESPACE_B, Phase.CREATE);
patchForEndpointSlicesNamespaces(APP_NAME, NAMESPACE, DOCKER_IMAGE);
KubernetesClientCatalogWatchUtils.patchForEndpointSlicesNamespaces(APP_NAME, NAMESPACE, DOCKER_IMAGE);
KubernetesClientCatalogWatchNamespacesDelegate.testCatalogWatchWithEndpointSlicesNamespaces(APP_NAME);
}

View File

@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: spring-cloud-kubernetes-k8s-client-catalog-watcher-ingress
name: spring-cloud-kubernetes-k8s-client-catalog-watcher
namespace: default
spec:
rules:
@@ -11,6 +11,6 @@ spec:
pathType: Prefix
backend:
service:
name: spring-cloud-kubernetes-k8s-client-catalog-watcher-service
name: spring-cloud-kubernetes-k8s-client-catalog-watcher
port:
number: 8080

View File

@@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: spring-cloud-kubernetes-k8s-client-catalog-watcher-service
name: spring-cloud-kubernetes-k8s-client-catalog-watcher-service
app: spring-cloud-kubernetes-k8s-client-catalog-watcher
name: spring-cloud-kubernetes-k8s-client-catalog-watcher
spec:
ports:
- name: http

View File

@@ -9,7 +9,7 @@
<version>3.0.5-SNAPSHOT</version>
</parent>
<artifactId>spring-cloud-kubernetes-client-event-and-polling-reload</artifactId>
<artifactId>spring-cloud-kubernetes-k8s-client-reload</artifactId>
<dependencies>
<dependency>

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.fabric8.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.client.configmap.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload.configmap;
import java.time.Duration;
import java.util.Map;
@@ -43,21 +43,21 @@ import org.springframework.http.HttpMethod;
import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.client.configmap.reload.BootstrapEnabledPollingReloadConfigMapMountDelegate.testBootstrapEnabledPollingReloadConfigMapMount;
import static org.springframework.cloud.kubernetes.client.configmap.reload.DataChangesInConfigMapReloadDelegate.testSimple;
import static org.springframework.cloud.kubernetes.client.configmap.reload.K8sClientConfigMapReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.client.configmap.reload.K8sClientConfigMapReloadITUtil.patchOne;
import static org.springframework.cloud.kubernetes.client.configmap.reload.K8sClientConfigMapReloadITUtil.patchThree;
import static org.springframework.cloud.kubernetes.client.configmap.reload.K8sClientConfigMapReloadITUtil.patchTwo;
import static org.springframework.cloud.kubernetes.client.configmap.reload.K8sClientConfigMapReloadITUtil.retrySpec;
import static org.springframework.cloud.kubernetes.client.configmap.reload.PollingReloadConfigMapMountDelegate.testPollingReloadConfigMapMount;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.BootstrapEnabledPollingReloadConfigMapMountDelegate.testBootstrapEnabledPollingReloadConfigMapMount;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.DataChangesInConfigMapReloadDelegate.testSimple;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.K8sClientConfigMapReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.K8sClientConfigMapReloadITUtil.patchOne;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.K8sClientConfigMapReloadITUtil.patchThree;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.K8sClientConfigMapReloadITUtil.patchTwo;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.K8sClientConfigMapReloadITUtil.retrySpec;
import static org.springframework.cloud.kubernetes.k8s.client.reload.configmap.PollingReloadConfigMapMountDelegate.testPollingReloadConfigMapMount;
/**
* @author wind57
*/
class K8sClientConfigMapReloadIT {
private static final String IMAGE_NAME = "spring-cloud-kubernetes-client-event-and-polling-reload";
private static final String IMAGE_NAME = "spring-cloud-kubernetes-k8s-client-reload";
private static final String DEPLOYMENT_NAME = "spring-k8s-client-reload";

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.client.secrets.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload.secret;
import java.time.Duration;
import java.util.Map;
@@ -32,8 +32,8 @@ import org.springframework.http.HttpMethod;
import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.client.secrets.reload.K8sClientSecretsReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.client.secrets.reload.K8sClientSecretsReloadITUtil.retrySpec;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.K8sClientSecretsReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.K8sClientSecretsReloadITUtil.retrySpec;
final class DataChangesInSecretsReloadDelegate {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.kubernetes.client.secrets.reload;
package org.springframework.cloud.kubernetes.k8s.client.reload.secret;
import java.time.Duration;
import java.util.Map;
@@ -36,10 +36,10 @@ import org.springframework.http.HttpMethod;
import org.springframework.web.reactive.function.client.WebClient;
import static org.awaitility.Awaitility.await;
import static org.springframework.cloud.kubernetes.client.secrets.reload.DataChangesInSecretsReloadDelegate.testDataChangesInSecretsReload;
import static org.springframework.cloud.kubernetes.client.secrets.reload.K8sClientSecretsReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.client.secrets.reload.K8sClientSecretsReloadITUtil.patchOne;
import static org.springframework.cloud.kubernetes.client.secrets.reload.K8sClientSecretsReloadITUtil.retrySpec;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.DataChangesInSecretsReloadDelegate.testDataChangesInSecretsReload;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.K8sClientSecretsReloadITUtil.builder;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.K8sClientSecretsReloadITUtil.patchOne;
import static org.springframework.cloud.kubernetes.k8s.client.reload.secret.K8sClientSecretsReloadITUtil.retrySpec;
/**
* @author wind57
@@ -48,7 +48,7 @@ class K8sClientSecretsReloadIT {
private static final String PROPERTY_URL = "http://localhost:80/key";
private static final String IMAGE_NAME = "spring-cloud-kubernetes-client-event-and-polling-reload";
private static final String IMAGE_NAME = "spring-cloud-kubernetes-k8s-client-reload";
private static final String NAMESPACE = "default";

View File

@@ -14,7 +14,7 @@ spec:
serviceAccountName: spring-cloud-kubernetes-serviceaccount
containers:
- name: spring-k8s-client-reload
image: docker.io/springcloud/spring-cloud-kubernetes-client-event-and-polling-reload
image: docker.io/springcloud/spring-cloud-kubernetes-k8s-client-reload
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet:

View File

@@ -14,7 +14,7 @@ spec:
serviceAccountName: spring-cloud-kubernetes-serviceaccount
containers:
- name: spring-k8s-client-reload
image: docker.io/springcloud/spring-cloud-kubernetes-client-event-and-polling-reload
image: docker.io/springcloud/spring-cloud-kubernetes-k8s-client-reload
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet: