From 032014e7b841bb3346f2a9a097fe9bd5983a30e9 Mon Sep 17 00:00:00 2001 From: wind57 Date: Sat, 4 Dec 2021 07:59:07 -0800 Subject: [PATCH 01/79] test --- delme.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 delme.sh diff --git a/delme.sh b/delme.sh new file mode 100644 index 0000000000..707d90cb73 --- /dev/null +++ b/delme.sh @@ -0,0 +1 @@ +dadsa \ No newline at end of file From 10889fd1fc9c5ec3a32699d70d4a0e914aae7577 Mon Sep 17 00:00:00 2001 From: wind57 Date: Thu, 16 Dec 2021 04:15:40 -0800 Subject: [PATCH 02/79] fix @Nested tests not running --- .circleci/config.yml | 2 +- pom.xml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f197c14d8..7eed9f3449 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: echo $CLASSNAMES TEST_ARG=$(echo $CLASSNAMES | sed 's/ /,/g') echo $TEST_ARG - ./mvnw -s .settings.xml -DfailIfNoTests=false -Dtest=$TEST_ARG -e clean org.jacoco:jacoco-maven-plugin:prepare-agent test -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + ./mvnw -s .settings.xml -DfailIfNoTests=false -DtestsToRun=$TEST_ARG -e clean org.jacoco:jacoco-maven-plugin:prepare-agent test -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn mkdir -p $HOME/artifacts/junit/ find . -type f -regex ".*/spring-cloud-*.*/target/*.*" -exec cp {} $HOME/artifacts/ \; find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $HOME/artifacts/junit/ \; diff --git a/pom.xml b/pom.xml index 191dae7c2d..e25caca33c 100644 --- a/pom.xml +++ b/pom.xml @@ -204,6 +204,11 @@ all false + + + + ${testsToRun} + @@ -356,6 +361,11 @@ all false + + + + ${testsToRun} + ${surefireArgLine} From b041c00ea5cac0bb3e7bd43bc75ee470920cc3fe Mon Sep 17 00:00:00 2001 From: wind57 Date: Thu, 13 Jan 2022 15:33:08 +0200 Subject: [PATCH 03/79] trigger again From a34ac473971fca316b05a0b886de000f05220b1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Jul 2022 08:43:39 +0000 Subject: [PATCH 04/79] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000000..7bd954555f --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} From 0f494412bd0c64e4d37129e2201cf84b071a5465 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 14:15:14 +0200 Subject: [PATCH 05/79] drop methods --- .../config/KubernetesClientConfigDataLocationResolver.java | 5 ----- .../config/KubernetesConfigDataLocationResolver.java | 2 +- .../fabric8/config/Fabric8ConfigDataLocationResolver.java | 6 ------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java index 02a9ac4ebd..474c89225a 100644 --- a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java @@ -33,7 +33,6 @@ import org.springframework.cloud.kubernetes.commons.config.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; -import org.springframework.core.env.Environment; import static org.springframework.cloud.kubernetes.client.KubernetesClientUtils.kubernetesApiClient; import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; @@ -95,8 +94,4 @@ private CoreV1Api registerClientAndCoreV1Api(ConfigurableBootstrapContext bootst return coreV1Api; } - protected KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment environment) { - return new KubernetesNamespaceProvider(environment); - } - } diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java index 9463b86b07..9579a2d035 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java @@ -130,7 +130,7 @@ protected final boolean isRetryEnabledForSecrets(SecretsConfigProperties secrets && secretsProperties.failFast(); } - protected KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment environment) { + private KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment environment) { return new KubernetesNamespaceProvider(environment); } diff --git a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java index a67afbd455..20798b18a9 100644 --- a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java @@ -34,7 +34,6 @@ import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.fabric8.Fabric8AutoConfiguration; -import org.springframework.core.env.Environment; import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; @@ -94,9 +93,4 @@ private KubernetesClient registerConfigAndClient(ConfigurableBootstrapContext bo return kubernetesClient; } - @Override - protected KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment environment) { - return new KubernetesNamespaceProvider(environment); - } - } From d7b8dd6d8ece923fff4af3b813227a76c024df89 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 14:34:26 +0200 Subject: [PATCH 06/79] more simplifications --- .../cloud/kubernetes/commons/config/ConfigUtils.java | 6 ++++-- .../config/KubernetesConfigDataLocationResolver.java | 12 ++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index 1c66016e00..c6890dcaab 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -271,9 +271,11 @@ private static Map decodeData(Map data) { public static void registerSingle(ConfigurableBootstrapContext bootstrapContext, Class cls, T instance, String name) { - bootstrapContext.registerIfAbsent(cls, BootstrapRegistry.InstanceSupplier.of(instance)); - bootstrapContext.addCloseListener(event -> event.getApplicationContext().getBeanFactory() + if (instance != null && !bootstrapContext.isRegistered(cls)) { + bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); + bootstrapContext.addCloseListener(event -> event.getApplicationContext().getBeanFactory() .registerSingleton(name, event.getBootstrapContext().get(cls))); + } } public static final class Prefix { diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java index 9579a2d035..bdc5da3a99 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java @@ -142,15 +142,11 @@ private void registerProperties(ConfigDataLocationResolverContext resolverContex registerSingle(bootstrapContext, KubernetesClientProperties.class, clientProperties, "configDataKubernetesClientProperties"); - if (configMapProperties != null) { - registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, - "configDataConfigMapConfigProperties"); - } + registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, + "configDataConfigMapConfigProperties"); - if (secretsProperties != null) { - registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, - "configDataSecretsConfigProperties"); - } + registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, + "configDataSecretsConfigProperties"); } protected record PropertyHolder(KubernetesClientProperties kubernetesClientProperties, From 39bab2c360fef68cf61054976e8009de88d07a8f Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 16:13:09 +0200 Subject: [PATCH 07/79] dirty --- ...netesClientConfigDataLocationResolver.java | 2 +- .../configdata/ConfigDataProperties.java | 41 +++++++ .../KubernetesConfigDataLoader.java | 4 +- .../KubernetesConfigDataLocationResolver.java | 101 ++---------------- .../KubernetesConfigDataResource.java | 4 +- .../commons/config/configdata/Properties.java | 56 ++++++++++ .../main/resources/META-INF/spring.factories | 2 +- .../KubernetesConfigDataLoaderTests.java | 2 + ...rnetesConfigDataLocationResolverTests.java | 2 + .../Fabric8ConfigDataLocationResolver.java | 2 +- 10 files changed, 117 insertions(+), 99 deletions(-) create mode 100644 spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java rename spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/{ => configdata}/KubernetesConfigDataLoader.java (92%) rename spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/{ => configdata}/KubernetesConfigDataLocationResolver.java (54%) rename spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/{ => configdata}/KubernetesConfigDataResource.java (93%) create mode 100644 spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java diff --git a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java index 474c89225a..368ee569a6 100644 --- a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java @@ -30,7 +30,7 @@ import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; -import org.springframework.cloud.kubernetes.commons.config.KubernetesConfigDataLocationResolver; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java new file mode 100644 index 0000000000..fad0275695 --- /dev/null +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java @@ -0,0 +1,41 @@ +package org.springframework.cloud.kubernetes.commons.config.configdata; + +import org.springframework.boot.ConfigurableBootstrapContext; +import org.springframework.boot.context.config.ConfigDataLocationResolverContext; +import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; +import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; + +import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; + +record ConfigDataProperties(KubernetesClientProperties clientProperties, + ConfigMapConfigProperties configMapProperties, SecretsConfigProperties secretsProperties) { + + static Registrar of(ConfigDataLocationResolverContext context) { + Properties all = Properties.of(context); + return () -> { + registerProperties(context, all.clientProperties(), all.configMapProperties(), all.secretsConfigProperties()); + return new ConfigDataProperties(all.clientProperties(), all.configMapProperties(), all.secretsConfigProperties()); + }; + } + + @FunctionalInterface + interface Registrar { + ConfigDataProperties register(); + } + + private static void registerProperties(ConfigDataLocationResolverContext resolverContext, + KubernetesClientProperties clientProperties, ConfigMapConfigProperties configMapProperties, + SecretsConfigProperties secretsProperties) { + + ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); + registerSingle(bootstrapContext, KubernetesClientProperties.class, clientProperties, + "configDataKubernetesClientProperties"); + + registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, + "configDataConfigMapConfigProperties"); + + registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, + "configDataSecretsConfigProperties"); + } +} diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoader.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoader.java similarity index 92% rename from spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoader.java rename to spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoader.java index 624dbdaec3..c35574d01d 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoader.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoader.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.kubernetes.commons.config; +package org.springframework.cloud.kubernetes.commons.config.configdata; import java.io.IOException; import java.util.ArrayList; @@ -26,6 +26,8 @@ import org.springframework.boot.context.config.ConfigDataLoader; import org.springframework.boot.context.config.ConfigDataLoaderContext; import org.springframework.boot.context.config.ConfigDataResourceNotFoundException; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; +import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; import org.springframework.core.env.PropertySource; diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java similarity index 54% rename from spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java rename to spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java index bdc5da3a99..edc33bfd80 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.kubernetes.commons.config; +package org.springframework.cloud.kubernetes.commons.config.configdata; import java.util.Collections; import java.util.HashMap; @@ -23,18 +23,16 @@ import org.apache.commons.logging.Log; -import org.springframework.boot.ConfigurableBootstrapContext; import org.springframework.boot.context.config.ConfigDataLocation; import org.springframework.boot.context.config.ConfigDataLocationNotFoundException; import org.springframework.boot.context.config.ConfigDataLocationResolver; import org.springframework.boot.context.config.ConfigDataLocationResolverContext; import org.springframework.boot.context.config.ConfigDataResourceNotFoundException; import org.springframework.boot.context.config.Profiles; -import org.springframework.boot.context.properties.bind.Bindable; -import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.logging.DeferredLogFactory; -import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; +import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; @@ -43,7 +41,6 @@ import org.springframework.core.env.StandardEnvironment; import static org.springframework.boot.cloud.CloudPlatform.KUBERNETES; -import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; import static org.springframework.util.ClassUtils.isPresent; /** @@ -86,16 +83,13 @@ public final List resolve(ConfigDataLocationResolv public final List resolveProfileSpecific( ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, Profiles profiles) throws ConfigDataLocationNotFoundException { - PropertyHolder propertyHolder = PropertyHolder.of(resolverContext); - KubernetesClientProperties clientProperties = propertyHolder.kubernetesClientProperties(); - ConfigMapConfigProperties configMapProperties = propertyHolder.configMapConfigProperties(); - SecretsConfigProperties secretsProperties = propertyHolder.secretsProperties(); - registerProperties(resolverContext, clientProperties, configMapProperties, secretsProperties); + ConfigDataProperties properties = ConfigDataProperties.of(resolverContext).register(); HashMap kubernetesConfigData = new HashMap<>(); - kubernetesConfigData.put("spring.cloud.kubernetes.client.namespace", clientProperties.namespace()); - if (propertyHolder.applicationName() != null) { + kubernetesConfigData.put("spring.cloud.kubernetes.client.namespace", properties.clientProperties().namespace()); + String applicationName = resolverContext.getBinder().bind("spring.application.name", String.class).orElse(null); + if (applicationName != null) { // If its null it means sprig.application.name was not set so don't add it to // the property source kubernetesConfigData.put("spring.application.name", propertyHolder.applicationName()); @@ -134,85 +128,4 @@ private KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment envi return new KubernetesNamespaceProvider(environment); } - private void registerProperties(ConfigDataLocationResolverContext resolverContext, - KubernetesClientProperties clientProperties, ConfigMapConfigProperties configMapProperties, - SecretsConfigProperties secretsProperties) { - - ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); - registerSingle(bootstrapContext, KubernetesClientProperties.class, clientProperties, - "configDataKubernetesClientProperties"); - - registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, - "configDataConfigMapConfigProperties"); - - registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, - "configDataSecretsConfigProperties"); - } - - protected record PropertyHolder(KubernetesClientProperties kubernetesClientProperties, - ConfigMapConfigProperties configMapConfigProperties, SecretsConfigProperties secretsProperties, - String applicationName) { - - private static PropertyHolder of(ConfigDataLocationResolverContext context) { - Binder binder = context.getBinder(); - - String applicationName = binder.bind("spring.application.name", String.class).orElse(null); - String namespace = binder.bind("spring.cloud.kubernetes.client.namespace", String.class) - .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); - - KubernetesClientProperties kubernetesClientProperties = clientProperties(context, namespace); - ConfigMapAndSecrets both = ConfigMapAndSecrets.of(binder); - - return new PropertyHolder(kubernetesClientProperties, both.configMapProperties(), - both.secretsConfigProperties(), applicationName); - } - - private static KubernetesClientProperties clientProperties(ConfigDataLocationResolverContext context, - String namespace) { - KubernetesClientProperties kubernetesClientProperties; - - if (context.getBootstrapContext().isRegistered(KubernetesClientProperties.class)) { - kubernetesClientProperties = context.getBootstrapContext().get(KubernetesClientProperties.class) - .withNamespace(namespace); - } - else { - kubernetesClientProperties = context.getBinder() - .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) - .withNamespace(namespace); - } - - return kubernetesClientProperties; - - } - - } - - /** - * holds ConfigMapConfigProperties and SecretsConfigProperties, both can be null if - * using such sources is disabled. - */ - private record ConfigMapAndSecrets(ConfigMapConfigProperties configMapProperties, - SecretsConfigProperties secretsConfigProperties) { - - private static ConfigMapAndSecrets of(Binder binder) { - - boolean configEnabled = binder.bind("spring.cloud.kubernetes.config.enabled", boolean.class).orElse(true); - boolean secretsEnabled = binder.bind("spring.cloud.kubernetes.secrets.enabled", boolean.class).orElse(true); - - ConfigMapConfigProperties configMapConfigProperties = null; - if (configEnabled) { - configMapConfigProperties = binder.bindOrCreate(ConfigMapConfigProperties.PREFIX, - ConfigMapConfigProperties.class); - } - - SecretsConfigProperties secretsProperties = null; - if (secretsEnabled) { - secretsProperties = binder.bindOrCreate(SecretsConfigProperties.PREFIX, SecretsConfigProperties.class); - } - - return new ConfigMapAndSecrets(configMapConfigProperties, secretsProperties); - - } - } - } diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataResource.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java similarity index 93% rename from spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataResource.java rename to spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java index a2f958639b..00dbefd3af 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataResource.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.kubernetes.commons.config; +package org.springframework.cloud.kubernetes.commons.config.configdata; import java.util.List; import java.util.Objects; @@ -24,6 +24,8 @@ import org.springframework.boot.context.config.ConfigDataResource; import org.springframework.boot.context.config.Profiles; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; +import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.core.env.Environment; import org.springframework.core.style.ToStringCreator; import org.springframework.util.StringUtils; diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java new file mode 100644 index 0000000000..9811adaa74 --- /dev/null +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java @@ -0,0 +1,56 @@ +package org.springframework.cloud.kubernetes.commons.config.configdata; + +import org.springframework.boot.context.config.ConfigDataLocationResolverContext; +import org.springframework.boot.context.properties.bind.Bindable; +import org.springframework.boot.context.properties.bind.Binder; +import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; +import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; + +/** + * @author wind57 + * + * holds properties needed for ConfigData. + */ +record Properties(KubernetesClientProperties clientProperties, ConfigMapConfigProperties configMapProperties, + SecretsConfigProperties secretsConfigProperties) { + + static Properties of(ConfigDataLocationResolverContext context) { + Binder binder = context.getBinder(); + + boolean configEnabled = binder.bind("spring.cloud.kubernetes.config.enabled", boolean.class).orElse(true); + boolean secretsEnabled = binder.bind("spring.cloud.kubernetes.secrets.enabled", boolean.class).orElse(true); + + ConfigMapConfigProperties configMapConfigProperties = null; + if (configEnabled) { + configMapConfigProperties = binder.bindOrCreate(ConfigMapConfigProperties.PREFIX, + ConfigMapConfigProperties.class); + } + + SecretsConfigProperties secretsProperties = null; + if (secretsEnabled) { + secretsProperties = binder.bindOrCreate(SecretsConfigProperties.PREFIX, SecretsConfigProperties.class); + } + + String namespace = binder.bind("spring.cloud.kubernetes.client.namespace", String.class) + .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); + KubernetesClientProperties clientProperties = clientProperties(context, namespace); + + return new Properties(clientProperties, configMapConfigProperties, secretsProperties); + } + + private static KubernetesClientProperties clientProperties(ConfigDataLocationResolverContext context, + String namespace) { + KubernetesClientProperties kubernetesClientProperties; + if (context.getBootstrapContext().isRegistered(KubernetesClientProperties.class)) { + kubernetesClientProperties = context.getBootstrapContext().get(KubernetesClientProperties.class) + .withNamespace(namespace); + } + else { + kubernetesClientProperties = context.getBinder() + .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) + .withNamespace(namespace); + } + return kubernetesClientProperties; + } +} diff --git a/spring-cloud-kubernetes-commons/src/main/resources/META-INF/spring.factories b/spring-cloud-kubernetes-commons/src/main/resources/META-INF/spring.factories index 03349b4bc7..9193cbfd7e 100644 --- a/spring-cloud-kubernetes-commons/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-kubernetes-commons/src/main/resources/META-INF/spring.factories @@ -3,4 +3,4 @@ org.springframework.cloud.kubernetes.commons.config.KubernetesBootstrapConfigura # ConfigData Loaders org.springframework.boot.context.config.ConfigDataLoader=\ -org.springframework.cloud.kubernetes.commons.config.KubernetesConfigDataLoader +org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLoader diff --git a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java index 3fea125f6b..c50dcee38c 100644 --- a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java +++ b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java @@ -27,6 +27,8 @@ import org.springframework.boot.context.config.ConfigData; import org.springframework.boot.context.config.ConfigDataLoaderContext; import org.springframework.boot.context.config.Profiles; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLoader; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataResource; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertySource; import org.springframework.mock.env.MockEnvironment; diff --git a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java index 3bad5ad2bf..dba9905d7d 100644 --- a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java +++ b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java @@ -35,6 +35,8 @@ import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataResource; import org.springframework.mock.env.MockEnvironment; /** diff --git a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java index 20798b18a9..1c023feb49 100644 --- a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java @@ -30,7 +30,7 @@ import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; -import org.springframework.cloud.kubernetes.commons.config.KubernetesConfigDataLocationResolver; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.fabric8.Fabric8AutoConfiguration; From 3c4e21851fe39b26719d5755670ad1d345d2762a Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 17:55:46 +0200 Subject: [PATCH 08/79] refactor --- ...netesClientConfigDataLocationResolver.java | 12 +++--- .../commons/config/ConfigUtils.java | 2 +- .../configdata/ConfigDataProperties.java | 42 ++++++++++++++----- .../KubernetesConfigDataLocationResolver.java | 13 +++--- .../commons/config/configdata/Properties.java | 26 +++++++++--- .../KubernetesConfigDataLoaderTests.java | 6 +-- ...rnetesConfigDataLocationResolverTests.java | 8 ++-- .../Fabric8ConfigDataLocationResolver.java | 12 +++--- 8 files changed, 78 insertions(+), 43 deletions(-) rename spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/{ => configdata}/KubernetesConfigDataLoaderTests.java (95%) rename spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/{ => configdata}/KubernetesConfigDataLocationResolverTests.java (97%) diff --git a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java index 368ee569a6..54343e3be9 100644 --- a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java @@ -30,9 +30,10 @@ import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; +import org.springframework.cloud.kubernetes.commons.config.configdata.ConfigDataProperties; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import static org.springframework.cloud.kubernetes.client.KubernetesClientUtils.kubernetesApiClient; import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; @@ -48,11 +49,10 @@ public KubernetesClientConfigDataLocationResolver(DeferredLogFactory factory) { @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, - Profiles profiles, KubernetesConfigDataLocationResolver.PropertyHolder propertyHolder, - KubernetesNamespaceProvider namespaceProvider) { - KubernetesClientProperties kubernetesClientProperties = propertyHolder.kubernetesClientProperties(); - ConfigMapConfigProperties configMapProperties = propertyHolder.configMapConfigProperties(); - SecretsConfigProperties secretsProperties = propertyHolder.secretsProperties(); + Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { + KubernetesClientProperties kubernetesClientProperties = properties.clientProperties(); + ConfigMapConfigProperties configMapProperties = properties.configMapProperties(); + SecretsConfigProperties secretsProperties = properties.secretsProperties(); ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); CoreV1Api coreV1Api = registerClientAndCoreV1Api(bootstrapContext, kubernetesClientProperties); diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index c6890dcaab..aad68b9fb6 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -274,7 +274,7 @@ public static void registerSingle(ConfigurableBootstrapContext bootstrapCont if (instance != null && !bootstrapContext.isRegistered(cls)) { bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); bootstrapContext.addCloseListener(event -> event.getApplicationContext().getBeanFactory() - .registerSingleton(name, event.getBootstrapContext().get(cls))); + .registerSingleton(name, event.getBootstrapContext().get(cls))); } } diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java index fad0275695..cdcacc3977 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.cloud.kubernetes.commons.config.configdata; import org.springframework.boot.ConfigurableBootstrapContext; @@ -8,34 +24,38 @@ import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; -record ConfigDataProperties(KubernetesClientProperties clientProperties, +public record ConfigDataProperties(KubernetesClientProperties clientProperties, ConfigMapConfigProperties configMapProperties, SecretsConfigProperties secretsProperties) { static Registrar of(ConfigDataLocationResolverContext context) { Properties all = Properties.of(context); return () -> { - registerProperties(context, all.clientProperties(), all.configMapProperties(), all.secretsConfigProperties()); - return new ConfigDataProperties(all.clientProperties(), all.configMapProperties(), all.secretsConfigProperties()); + registerProperties(context, all.clientProperties(), all.configMapProperties(), + all.secretsConfigProperties()); + return new ConfigDataProperties(all.clientProperties(), all.configMapProperties(), + all.secretsConfigProperties()); }; } - @FunctionalInterface - interface Registrar { - ConfigDataProperties register(); - } - private static void registerProperties(ConfigDataLocationResolverContext resolverContext, KubernetesClientProperties clientProperties, ConfigMapConfigProperties configMapProperties, SecretsConfigProperties secretsProperties) { ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); registerSingle(bootstrapContext, KubernetesClientProperties.class, clientProperties, - "configDataKubernetesClientProperties"); + "configDataKubernetesClientProperties"); registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, - "configDataConfigMapConfigProperties"); + "configDataConfigMapConfigProperties"); registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, - "configDataSecretsConfigProperties"); + "configDataSecretsConfigProperties"); + } + + @FunctionalInterface + interface Registrar { + + ConfigDataProperties register(); + } } diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java index edc33bfd80..bf66ff77fc 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java @@ -90,9 +90,7 @@ public final List resolveProfileSpecific( kubernetesConfigData.put("spring.cloud.kubernetes.client.namespace", properties.clientProperties().namespace()); String applicationName = resolverContext.getBinder().bind("spring.application.name", String.class).orElse(null); if (applicationName != null) { - // If its null it means sprig.application.name was not set so don't add it to - // the property source - kubernetesConfigData.put("spring.application.name", propertyHolder.applicationName()); + kubernetesConfigData.put("spring.application.name", applicationName); } PropertySource> propertySource = new MapPropertySource("kubernetesConfigData", kubernetesConfigData); @@ -101,17 +99,18 @@ public final List resolveProfileSpecific( environment.setActiveProfiles(profiles.getAccepted().toArray(new String[0])); KubernetesNamespaceProvider namespaceProvider = kubernetesNamespaceProvider(environment); - registerBeans(resolverContext, location, profiles, propertyHolder, namespaceProvider); + registerBeans(resolverContext, location, profiles, properties, namespaceProvider); - KubernetesConfigDataResource resource = new KubernetesConfigDataResource(clientProperties, configMapProperties, - secretsProperties, location.isOptional(), profiles, environment); + KubernetesConfigDataResource resource = new KubernetesConfigDataResource(properties.clientProperties(), + properties.configMapProperties(), properties.secretsProperties(), location.isOptional(), profiles, + environment); resource.setLog(log); return List.of(resource); } protected abstract void registerBeans(ConfigDataLocationResolverContext resolverContext, - ConfigDataLocation location, Profiles profiles, PropertyHolder propertyHolder, + ConfigDataLocation location, Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider); protected final boolean isRetryEnabledForConfigMap(ConfigMapConfigProperties configMapProperties) { diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java index 9811adaa74..3acd1c637a 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.cloud.kubernetes.commons.config.configdata; import org.springframework.boot.context.config.ConfigDataLocationResolverContext; @@ -24,7 +40,7 @@ static Properties of(ConfigDataLocationResolverContext context) { ConfigMapConfigProperties configMapConfigProperties = null; if (configEnabled) { configMapConfigProperties = binder.bindOrCreate(ConfigMapConfigProperties.PREFIX, - ConfigMapConfigProperties.class); + ConfigMapConfigProperties.class); } SecretsConfigProperties secretsProperties = null; @@ -33,7 +49,7 @@ static Properties of(ConfigDataLocationResolverContext context) { } String namespace = binder.bind("spring.cloud.kubernetes.client.namespace", String.class) - .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); + .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); KubernetesClientProperties clientProperties = clientProperties(context, namespace); return new Properties(clientProperties, configMapConfigProperties, secretsProperties); @@ -44,12 +60,12 @@ private static KubernetesClientProperties clientProperties(ConfigDataLocationRes KubernetesClientProperties kubernetesClientProperties; if (context.getBootstrapContext().isRegistered(KubernetesClientProperties.class)) { kubernetesClientProperties = context.getBootstrapContext().get(KubernetesClientProperties.class) - .withNamespace(namespace); + .withNamespace(namespace); } else { kubernetesClientProperties = context.getBinder() - .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) - .withNamespace(namespace); + .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) + .withNamespace(namespace); } return kubernetesClientProperties; } diff --git a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoaderTests.java similarity index 95% rename from spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java rename to spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoaderTests.java index c50dcee38c..1efa6f0f69 100644 --- a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLoaderTests.java +++ b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLoaderTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.kubernetes.commons.config; +package org.springframework.cloud.kubernetes.commons.config.configdata; import java.io.IOException; import java.util.List; @@ -27,8 +27,8 @@ import org.springframework.boot.context.config.ConfigData; import org.springframework.boot.context.config.ConfigDataLoaderContext; import org.springframework.boot.context.config.Profiles; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLoader; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataResource; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; +import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.PropertySource; import org.springframework.mock.env.MockEnvironment; diff --git a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java similarity index 97% rename from spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java rename to spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java index dba9905d7d..41b274d2c5 100644 --- a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/KubernetesConfigDataLocationResolverTests.java +++ b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.kubernetes.commons.config; +package org.springframework.cloud.kubernetes.commons.config.configdata; import java.util.Arrays; import java.util.List; @@ -35,8 +35,8 @@ import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataResource; +import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; +import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.mock.env.MockEnvironment; /** @@ -51,7 +51,7 @@ class KubernetesConfigDataLocationResolverTests { FACTORY) { @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, - Profiles profiles, PropertyHolder propertyHolder, KubernetesNamespaceProvider namespaceProvider) { + Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { } }; diff --git a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java index 1c023feb49..e927cdb6cf 100644 --- a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java @@ -30,9 +30,10 @@ import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator; -import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsPropertySourceLocator; +import org.springframework.cloud.kubernetes.commons.config.configdata.ConfigDataProperties; +import org.springframework.cloud.kubernetes.commons.config.configdata.KubernetesConfigDataLocationResolver; import org.springframework.cloud.kubernetes.fabric8.Fabric8AutoConfiguration; import static org.springframework.cloud.kubernetes.commons.config.ConfigUtils.registerSingle; @@ -48,11 +49,10 @@ public Fabric8ConfigDataLocationResolver(DeferredLogFactory factory) { @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, - Profiles profiles, KubernetesConfigDataLocationResolver.PropertyHolder propertyHolder, - KubernetesNamespaceProvider namespaceProvider) { - KubernetesClientProperties kubernetesClientProperties = propertyHolder.kubernetesClientProperties(); - ConfigMapConfigProperties configMapProperties = propertyHolder.configMapConfigProperties(); - SecretsConfigProperties secretsProperties = propertyHolder.secretsProperties(); + Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { + KubernetesClientProperties kubernetesClientProperties = properties.clientProperties(); + ConfigMapConfigProperties configMapProperties = properties.configMapProperties(); + SecretsConfigProperties secretsProperties = properties.secretsProperties(); ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); KubernetesClient kubernetesClient = registerConfigAndClient(bootstrapContext, kubernetesClientProperties); From 587289c8852eece47b4ca88f61ed970a364be639 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 18:17:10 +0200 Subject: [PATCH 09/79] more simplifications --- .../KubernetesConfigDataLocationResolver.java | 20 +++++++++++-------- .../KubernetesConfigDataResource.java | 12 ----------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java index bf66ff77fc..da612fe9c1 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java @@ -86,25 +86,20 @@ public final List resolveProfileSpecific( ConfigDataProperties properties = ConfigDataProperties.of(resolverContext).register(); - HashMap kubernetesConfigData = new HashMap<>(); + Map kubernetesConfigData = new HashMap<>(); kubernetesConfigData.put("spring.cloud.kubernetes.client.namespace", properties.clientProperties().namespace()); String applicationName = resolverContext.getBinder().bind("spring.application.name", String.class).orElse(null); if (applicationName != null) { kubernetesConfigData.put("spring.application.name", applicationName); } - PropertySource> propertySource = new MapPropertySource("kubernetesConfigData", - kubernetesConfigData); - ConfigurableEnvironment environment = new StandardEnvironment(); - environment.getPropertySources().addLast(propertySource); - environment.setActiveProfiles(profiles.getAccepted().toArray(new String[0])); - KubernetesNamespaceProvider namespaceProvider = kubernetesNamespaceProvider(environment); + Environment environment = environment(kubernetesConfigData, profiles); + KubernetesNamespaceProvider namespaceProvider = kubernetesNamespaceProvider(environment); registerBeans(resolverContext, location, profiles, properties, namespaceProvider); KubernetesConfigDataResource resource = new KubernetesConfigDataResource(properties.clientProperties(), properties.configMapProperties(), properties.secretsProperties(), location.isOptional(), profiles, environment); - resource.setLog(log); return List.of(resource); } @@ -127,4 +122,13 @@ private KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment envi return new KubernetesNamespaceProvider(environment); } + private Environment environment(Map kubernetesConfigData, Profiles profiles) { + PropertySource> propertySource = new MapPropertySource("kubernetesConfigData", + kubernetesConfigData); + ConfigurableEnvironment environment = new StandardEnvironment(); + environment.getPropertySources().addLast(propertySource); + environment.setActiveProfiles(profiles.getAccepted().toArray(new String[0])); + return environment; + } + } diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java index 00dbefd3af..ec2cefd186 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataResource.java @@ -19,8 +19,6 @@ import java.util.List; import java.util.Objects; -import org.apache.commons.logging.Log; - import org.springframework.boot.context.config.ConfigDataResource; import org.springframework.boot.context.config.Profiles; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; @@ -45,8 +43,6 @@ public class KubernetesConfigDataResource extends ConfigDataResource { private final Profiles profiles; - private Log log; - private Environment environment; public KubernetesConfigDataResource(KubernetesClientProperties properties, @@ -90,14 +86,6 @@ List getAcceptedProfiles() { return this.profiles.getAccepted(); } - public void setLog(Log log) { - this.log = log; - } - - public Log getLog() { - return this.log; - } - public Environment getEnvironment() { return environment; } From 1225fc227bcef73d92cc627bc8f16acc50331ef2 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 18:26:21 +0200 Subject: [PATCH 10/79] drop logger --- .../configdata/KubernetesConfigDataLocationResolver.java | 9 --------- .../KubernetesConfigDataLocationResolverTests.java | 7 +------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java index da612fe9c1..6c4b04a5fe 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java @@ -21,15 +21,12 @@ import java.util.List; import java.util.Map; -import org.apache.commons.logging.Log; - import org.springframework.boot.context.config.ConfigDataLocation; import org.springframework.boot.context.config.ConfigDataLocationNotFoundException; import org.springframework.boot.context.config.ConfigDataLocationResolver; import org.springframework.boot.context.config.ConfigDataLocationResolverContext; import org.springframework.boot.context.config.ConfigDataResourceNotFoundException; import org.springframework.boot.context.config.Profiles; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; import org.springframework.cloud.kubernetes.commons.config.SecretsConfigProperties; @@ -51,12 +48,6 @@ public abstract class KubernetesConfigDataLocationResolver private static final boolean RETRY_IS_PRESENT = isPresent("org.springframework.retry.annotation.Retryable", null); - private final Log log; - - public KubernetesConfigDataLocationResolver(DeferredLogFactory factory) { - this.log = factory.getLog(KubernetesConfigDataLocationResolver.class); - } - protected final String getPrefix() { return "kubernetes:"; } diff --git a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java index 41b274d2c5..0b086b180e 100644 --- a/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java +++ b/spring-cloud-kubernetes-commons/src/test/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolverTests.java @@ -19,7 +19,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.function.Supplier; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -32,7 +31,6 @@ import org.springframework.boot.context.config.Profiles; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; import org.springframework.cloud.kubernetes.commons.config.ConfigMapConfigProperties; @@ -44,11 +42,8 @@ */ class KubernetesConfigDataLocationResolverTests { - private static final DeferredLogFactory FACTORY = Supplier::get; - // implementation that does nothing when registerBeans is called - private static final KubernetesConfigDataLocationResolver NOOP_RESOLVER = new KubernetesConfigDataLocationResolver( - FACTORY) { + private static final KubernetesConfigDataLocationResolver NOOP_RESOLVER = new KubernetesConfigDataLocationResolver() { @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { From b62545ed0d79a40861871029247da7a87c71f6aa Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 30 Dec 2022 21:47:16 +0200 Subject: [PATCH 11/79] fix build --- .../KubernetesClientConfigDataLocationResolver.java | 5 ----- .../KubernetesClientConfigDataLocationResolverTests.java | 8 +------- .../configdata/KubernetesConfigDataLocationResolver.java | 2 +- .../fabric8/config/Fabric8ConfigDataLocationResolver.java | 5 ----- .../config/Fabric8ConfigDataLocationResolverTests.java | 7 +------ 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java index 54343e3be9..969fd21e87 100644 --- a/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-client-config/src/main/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolver.java @@ -23,7 +23,6 @@ import org.springframework.boot.context.config.ConfigDataLocation; import org.springframework.boot.context.config.ConfigDataLocationResolverContext; import org.springframework.boot.context.config.Profiles; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableConfigMapPropertySourceLocator; @@ -43,10 +42,6 @@ */ public class KubernetesClientConfigDataLocationResolver extends KubernetesConfigDataLocationResolver { - public KubernetesClientConfigDataLocationResolver(DeferredLogFactory factory) { - super(factory); - } - @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { diff --git a/spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolverTests.java b/spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolverTests.java index 3e234007d1..a20fc1f554 100644 --- a/spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolverTests.java +++ b/spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/KubernetesClientConfigDataLocationResolverTests.java @@ -16,8 +16,6 @@ package org.springframework.cloud.kubernetes.client.config; -import java.util.function.Supplier; - import io.kubernetes.client.openapi.ApiClient; import io.kubernetes.client.openapi.apis.CoreV1Api; import org.junit.jupiter.api.Assertions; @@ -30,7 +28,6 @@ import org.springframework.boot.context.config.Profiles; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableConfigMapPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; @@ -45,13 +42,10 @@ */ class KubernetesClientConfigDataLocationResolverTests { - private static final DeferredLogFactory FACTORY = Supplier::get; - private static final ConfigDataLocationResolverContext RESOLVER_CONTEXT = Mockito .mock(ConfigDataLocationResolverContext.class); - private static final KubernetesClientConfigDataLocationResolver RESOLVER = new KubernetesClientConfigDataLocationResolver( - FACTORY); + private static final KubernetesClientConfigDataLocationResolver RESOLVER = new KubernetesClientConfigDataLocationResolver(); /* * both ConfigMapConfigProperties and SecretsConfigProperties are null, thus they are diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java index 6c4b04a5fe..5ad2f009cf 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/KubernetesConfigDataLocationResolver.java @@ -115,7 +115,7 @@ private KubernetesNamespaceProvider kubernetesNamespaceProvider(Environment envi private Environment environment(Map kubernetesConfigData, Profiles profiles) { PropertySource> propertySource = new MapPropertySource("kubernetesConfigData", - kubernetesConfigData); + kubernetesConfigData); ConfigurableEnvironment environment = new StandardEnvironment(); environment.getPropertySources().addLast(propertySource); environment.setActiveProfiles(profiles.getAccepted().toArray(new String[0])); diff --git a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java index e927cdb6cf..09312d2f50 100644 --- a/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java +++ b/spring-cloud-kubernetes-fabric8-config/src/main/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolver.java @@ -23,7 +23,6 @@ import org.springframework.boot.context.config.ConfigDataLocation; import org.springframework.boot.context.config.ConfigDataLocationResolverContext; import org.springframework.boot.context.config.Profiles; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableConfigMapPropertySourceLocator; @@ -43,10 +42,6 @@ */ public class Fabric8ConfigDataLocationResolver extends KubernetesConfigDataLocationResolver { - public Fabric8ConfigDataLocationResolver(DeferredLogFactory factory) { - super(factory); - } - @Override protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location, Profiles profiles, ConfigDataProperties properties, KubernetesNamespaceProvider namespaceProvider) { diff --git a/spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolverTests.java b/spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolverTests.java index e7f4689a80..677f2156d2 100644 --- a/spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolverTests.java +++ b/spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/Fabric8ConfigDataLocationResolverTests.java @@ -16,8 +16,6 @@ package org.springframework.cloud.kubernetes.fabric8.config; -import java.util.function.Supplier; - import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.KubernetesClient; import org.junit.jupiter.api.Assertions; @@ -30,7 +28,6 @@ import org.springframework.boot.context.config.Profiles; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.logging.DeferredLogFactory; import org.springframework.cloud.kubernetes.commons.KubernetesClientProperties; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableConfigMapPropertySourceLocator; import org.springframework.cloud.kubernetes.commons.config.ConfigDataRetryableSecretsPropertySourceLocator; @@ -45,12 +42,10 @@ */ class Fabric8ConfigDataLocationResolverTests { - private static final DeferredLogFactory FACTORY = Supplier::get; - private static final ConfigDataLocationResolverContext RESOLVER_CONTEXT = Mockito .mock(ConfigDataLocationResolverContext.class); - private static final Fabric8ConfigDataLocationResolver RESOLVER = new Fabric8ConfigDataLocationResolver(FACTORY); + private static final Fabric8ConfigDataLocationResolver RESOLVER = new Fabric8ConfigDataLocationResolver(); /* * both ConfigMapConfigProperties and SecretsConfigProperties are null, thus they are From d4746eeab244ddab11f8a64ee191647e1c0b70f7 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 24 Feb 2023 07:24:15 +0200 Subject: [PATCH 12/79] trigger build From 79b64ea72a32cdf71f30390d0a6d76309cdc4ecb Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 24 Feb 2023 07:24:52 +0200 Subject: [PATCH 13/79] trigger build From 4810cc707a1b0e649667c768dc5f7fbf915e6991 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 24 Feb 2023 07:26:12 +0200 Subject: [PATCH 14/79] trigger build From b2caf926368b9947e06cb8d6d87535868492e0cf Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 24 Feb 2023 09:20:54 +0200 Subject: [PATCH 15/79] trigger build From 618f25aeccb763010ba7777653994148514c8d99 Mon Sep 17 00:00:00 2001 From: erabii Date: Tue, 14 Mar 2023 10:39:50 +0200 Subject: [PATCH 16/79] Delete renovate.json --- renovate.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 renovate.json diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 7bd954555f..0000000000 --- a/renovate.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" - ] -} From 100a9cd110d5c5e614573d8c3726b21788c1b550 Mon Sep 17 00:00:00 2001 From: erabii Date: Tue, 14 Mar 2023 10:40:02 +0200 Subject: [PATCH 17/79] Delete delme.sh --- delme.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 delme.sh diff --git a/delme.sh b/delme.sh deleted file mode 100644 index 707d90cb73..0000000000 --- a/delme.sh +++ /dev/null @@ -1 +0,0 @@ -dadsa \ No newline at end of file From c451866d7a6d110d51328f3c43890241280fc493 Mon Sep 17 00:00:00 2001 From: wind57 Date: Thu, 16 Mar 2023 11:54:12 +0200 Subject: [PATCH 18/79] fix test --- .../kubernetes/commons/config/ConfigUtils.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index 60197c3964..61866c228e 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -263,13 +263,15 @@ private static Map decodeData(Map data) { public static void registerSingle(ConfigurableBootstrapContext bootstrapContext, Class cls, T instance, String name) { - bootstrapContext.registerIfAbsent(cls, BootstrapRegistry.InstanceSupplier.of(instance)); - bootstrapContext.addCloseListener(event -> { - if (event.getApplicationContext().getBeanFactory().getSingleton(name) == null) { - event.getApplicationContext().getBeanFactory().registerSingleton(name, + if (instance != null && !bootstrapContext.isRegistered(cls)) { + bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); + bootstrapContext.addCloseListener(event -> { + if (event.getApplicationContext().getBeanFactory().getSingleton(name) == null) { + event.getApplicationContext().getBeanFactory().registerSingleton(name, event.getBootstrapContext().get(cls)); - } - }); + } + }); + } } /** From fc21fd51cda14c0e0625100c9862648de19f761a Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 31 Mar 2023 22:31:52 +0300 Subject: [PATCH 19/79] trigger build From 48b3ba0c53748a4807f7858d604fbf0f9b9fcefd Mon Sep 17 00:00:00 2001 From: wind57 Date: Sat, 1 Apr 2023 00:22:21 +0300 Subject: [PATCH 20/79] large timeout --- .../integration/tests/commons/native_client/Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client/Util.java b/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client/Util.java index aefe2cd1fe..5386879296 100644 --- a/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client/Util.java +++ b/spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client/Util.java @@ -385,7 +385,7 @@ private String secretName(V1Secret secret) { private void waitForDeployment(String namespace, V1Deployment deployment) { String deploymentName = deploymentName(deployment); - await().pollInterval(Duration.ofSeconds(1)).atMost(600, TimeUnit.SECONDS) + await().pollInterval(Duration.ofSeconds(1)).atMost(900, TimeUnit.SECONDS) .until(() -> isDeploymentReady(deploymentName, namespace)); } From ba79eb55966a64e46c09222738855ceea6386e2f Mon Sep 17 00:00:00 2001 From: wind57 Date: Wed, 5 Apr 2023 10:00:59 +0300 Subject: [PATCH 21/79] trigger build From 41484182a4579c707f63a6424db34d3121e5c0ee Mon Sep 17 00:00:00 2001 From: wind57 Date: Sat, 13 May 2023 12:35:48 +0300 Subject: [PATCH 22/79] trigger build From 2e7e421111d06cda34d7a05b6af9222d8fa5ac4c Mon Sep 17 00:00:00 2001 From: wind57 Date: Sat, 5 Aug 2023 14:27:44 +0300 Subject: [PATCH 23/79] trigger From 428372ddacd5924ffb7368df4c4b3cdc021db430 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 8 Aug 2023 10:50:08 +0300 Subject: [PATCH 24/79] trigger From 9ca883d9da9fb5f427cdb557fce3ff877b2e8b1b Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 8 Aug 2023 11:24:11 +0300 Subject: [PATCH 25/79] trigger From a6b2ca8d1f4b6902f6b8543c2db9181e451909a5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Wed, 20 Sep 2023 11:15:01 +0300 Subject: [PATCH 26/79] fix issue --- ...rnetesClientDiscoveryHealthITDelegate.java | 69 ++++++++++--------- .../it/DiscoveryClientFilterNamespaceIT.java | 7 +- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/src/test/java/org/springframework/cloud/kubernetes/client/discovery/it/KubernetesClientDiscoveryHealthITDelegate.java b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/src/test/java/org/springframework/cloud/kubernetes/client/discovery/it/KubernetesClientDiscoveryHealthITDelegate.java index ee03815f27..f11fb27899 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/src/test/java/org/springframework/cloud/kubernetes/client/discovery/it/KubernetesClientDiscoveryHealthITDelegate.java +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/src/test/java/org/springframework/cloud/kubernetes/client/discovery/it/KubernetesClientDiscoveryHealthITDelegate.java @@ -156,8 +156,8 @@ void testDefaultConfiguration(K3sContainer container) { String healthResult = healthClient.method(HttpMethod.GET).retrieve().bodyToMono(String.class) .retryWhen(retrySpec()).block(); - String infoResult = infoClient.method(HttpMethod.GET).retrieve().bodyToMono(String.class) - .retryWhen(retrySpec()).block(); + String infoResult = infoClient.method(HttpMethod.GET).retrieve().bodyToMono(String.class).retryWhen(retrySpec()) + .block(); Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) .extractingJsonPathStringValue("$.components.discoveryComposite.status").isEqualTo("UP"); @@ -188,55 +188,56 @@ void testDefaultConfiguration(K3sContainer container) { } private void assertHealth(String healthResult) { - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.status").isEqualTo("UP"); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.status").isEqualTo("UP"); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.hostIp").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.hostIp").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathBooleanValue( - "$.components.kubernetes.details.inside").isEqualTo(true); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathBooleanValue("$.components.kubernetes.details.inside").isEqualTo(true); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.labels.app").isEqualTo("spring-cloud-kubernetes-client-discovery-it"); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.labels.app") + .isEqualTo("spring-cloud-kubernetes-client-discovery-it"); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.namespace").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.namespace").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.nodeName").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.nodeName").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.podIp").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.podIp").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.podName").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.podName").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)).extractingJsonPathStringValue( - "$.components.kubernetes.details.serviceAccount").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(healthResult)) + .extractingJsonPathStringValue("$.components.kubernetes.details.serviceAccount").isNotEmpty(); } private void assertInfo(String infoResult) { - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.hostIp").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue("$.kubernetes.hostIp") + .isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathBooleanValue( - "$.kubernetes.inside").isEqualTo(true); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathBooleanValue("$.kubernetes.inside") + .isEqualTo(true); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.namespace").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)) + .extractingJsonPathStringValue("$.kubernetes.namespace").isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.nodeName").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue("$.kubernetes.nodeName") + .isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.podIp").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue("$.kubernetes.podIp") + .isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.podName").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue("$.kubernetes.podName") + .isNotEmpty(); - Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)).extractingJsonPathStringValue( - "$.kubernetes.serviceAccount").isNotEmpty(); + Assertions.assertThat(BASIC_JSON_TESTER.from(infoResult)) + .extractingJsonPathStringValue("$.kubernetes.serviceAccount").isNotEmpty(); } private WebClient.Builder builder() { diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java index 65491ee126..3d42774cdc 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java @@ -71,6 +71,8 @@ class DiscoveryClientFilterNamespaceIT { private static RbacAuthorizationV1Api rbacApi; + private static V1ClusterRoleBinding clusterRole; + @BeforeAll static void beforeAll() throws Exception { K3S.start(); @@ -83,18 +85,19 @@ static void beforeAll() throws Exception { util = new Util(K3S); rbacApi = new RbacAuthorizationV1Api(); + clusterRole = (V1ClusterRoleBinding) util + .yaml("namespace-filter/cluster-admin-serviceaccount-role.yaml"); util.createNamespace(NAMESPACE_LEFT); util.createNamespace(NAMESPACE_RIGHT); util.setUp(NAMESPACE); - V1ClusterRoleBinding clusterRole = (V1ClusterRoleBinding) util - .yaml("namespace-filter/cluster-admin-serviceaccount-role.yaml"); rbacApi.createClusterRoleBinding(clusterRole, null, null, null, null); discoveryServer(Phase.CREATE); } @AfterAll static void afterAll() throws Exception { + rbacApi.deleteClusterRoleBinding(clusterRole.getMetadata().getName(), null, null, null, null, null, null); Commons.cleanUp(DISCOVERY_SERVER_APP_NAME, K3S); Commons.cleanUp(SPRING_CLOUD_K8S_DISCOVERY_CLIENT_APP_NAME, K3S); discoveryServer(Phase.DELETE); From 3ed982ac5035dc2ebfea0b49d4d50e6353d8ad62 Mon Sep 17 00:00:00 2001 From: wind57 Date: Wed, 20 Sep 2023 12:42:06 +0300 Subject: [PATCH 27/79] fix issue --- .../it/DiscoveryClientFilterNamespaceIT.java | 9 +++++---- .../discoveryclient/it/DiscoveryClientIT.java | 12 +++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java index 3d42774cdc..fe10560904 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java @@ -71,7 +71,7 @@ class DiscoveryClientFilterNamespaceIT { private static RbacAuthorizationV1Api rbacApi; - private static V1ClusterRoleBinding clusterRole; + private static V1ClusterRoleBinding clusterRoleBinding; @BeforeAll static void beforeAll() throws Exception { @@ -85,19 +85,20 @@ static void beforeAll() throws Exception { util = new Util(K3S); rbacApi = new RbacAuthorizationV1Api(); - clusterRole = (V1ClusterRoleBinding) util + clusterRoleBinding = (V1ClusterRoleBinding) util .yaml("namespace-filter/cluster-admin-serviceaccount-role.yaml"); util.createNamespace(NAMESPACE_LEFT); util.createNamespace(NAMESPACE_RIGHT); util.setUp(NAMESPACE); - rbacApi.createClusterRoleBinding(clusterRole, null, null, null, null); + rbacApi.createClusterRoleBinding(clusterRoleBinding, null, null, null, null); discoveryServer(Phase.CREATE); } @AfterAll static void afterAll() throws Exception { - rbacApi.deleteClusterRoleBinding(clusterRole.getMetadata().getName(), null, null, null, null, null, null); + rbacApi.deleteClusterRoleBinding(clusterRoleBinding.getMetadata().getName(), null, null, null, null, null, + null); Commons.cleanUp(DISCOVERY_SERVER_APP_NAME, K3S); Commons.cleanUp(SPRING_CLOUD_K8S_DISCOVERY_CLIENT_APP_NAME, K3S); discoveryServer(Phase.DELETE); diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientIT.java b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientIT.java index 7f4903717e..e3ca48a385 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientIT.java +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientIT.java @@ -113,6 +113,10 @@ class DiscoveryClientIT { private static Util util; + private static RbacAuthorizationV1Api rbacApi; + + private static V1ClusterRoleBinding clusterRoleBinding; + @BeforeAll static void beforeAll() throws Exception { K3S.start(); @@ -124,15 +128,15 @@ static void beforeAll() throws Exception { Commons.loadSpringCloudKubernetesImage(SPRING_CLOUD_K8S_DISCOVERY_CLIENT_APP_NAME, K3S); util = new Util(K3S); + rbacApi = new RbacAuthorizationV1Api(); util.setUp(NAMESPACE); util.createNamespace(NAMESPACE_LEFT); util.createNamespace(NAMESPACE_RIGHT); - RbacAuthorizationV1Api rbacApi = new RbacAuthorizationV1Api(); - V1ClusterRoleBinding clusterRole = (V1ClusterRoleBinding) util + clusterRoleBinding = (V1ClusterRoleBinding) util .yaml("namespace-filter/cluster-admin-serviceaccount-role.yaml"); - rbacApi.createClusterRoleBinding(clusterRole, null, null, null, null); + rbacApi.createClusterRoleBinding(clusterRoleBinding, null, null, null, null); util.wiremock(NAMESPACE_LEFT, "/wiremock-" + NAMESPACE_LEFT, Phase.CREATE, false); util.wiremock(NAMESPACE_RIGHT, "/wiremock-" + NAMESPACE_RIGHT, Phase.CREATE, false); @@ -143,6 +147,8 @@ static void beforeAll() throws Exception { @AfterAll static void afterAll() throws Exception { + rbacApi.deleteClusterRoleBinding(clusterRoleBinding.getMetadata().getName(), null, null, null, null, null, + null); Commons.cleanUp(DISCOVERY_SERVER_APP_NAME, K3S); Commons.cleanUp(SPRING_CLOUD_K8S_DISCOVERY_CLIENT_APP_NAME, K3S); From ab5796b27308868fa326de5b052219a12e6db2d1 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 09:00:55 +0300 Subject: [PATCH 28/79] test --- .../action.yaml | 2 +- .../action.yaml | 2 +- .../save-controller-images/action.yaml | 15 -------------- .../save-integration-tests-images/action.yaml | 20 ------------------- 4 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/composites/save-controller-images/action.yaml delete mode 100644 .github/workflows/composites/save-integration-tests-images/action.yaml diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml index 39e79ebdd7..0cb4085b21 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml @@ -61,7 +61,7 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${TEST_ARG[@]} \ -e clean install \ - -U -P sonar -nsu --batch-mode \ + -P sonar -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml index ce8c81cff3..f658cfbf58 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml @@ -150,7 +150,7 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${tests_to_run_in_current_index} \ -e clean install \ - -U -P sonar -nsu --batch-mode \ + -P sonar -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/.github/workflows/composites/save-controller-images/action.yaml b/.github/workflows/composites/save-controller-images/action.yaml deleted file mode 100644 index 056b1b2adb..0000000000 --- a/.github/workflows/composites/save-controller-images/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: save controller docker images -description: save controller docker images -runs: - using: "composite" - steps: - - name: save controller docker images - shell: bash - run: | - mkdir -p /tmp/docker/images - TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) - cd spring-cloud-kubernetes-controllers - while read controller_image; do - docker save -o /tmp/docker/images/${controller_image}.tar docker.io/springcloud/${controller_image}:$TAG - done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | grep -v 'spring-cloud-kubernetes-controllers') - cd .. diff --git a/.github/workflows/composites/save-integration-tests-images/action.yaml b/.github/workflows/composites/save-integration-tests-images/action.yaml deleted file mode 100644 index cbc92e55f7..0000000000 --- a/.github/workflows/composites/save-integration-tests-images/action.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: save integration tests docker images -description: save integration tests docker images -runs: - using: "composite" - steps: - - name: save integration tests docker images - shell: bash - run: | - mkdir -p /tmp/docker/images - TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) - cd spring-cloud-kubernetes-integration-tests - while read integ_test; do - docker save -o /tmp/docker/images/${integ_test}.tar docker.io/springcloud/${integ_test}:$TAG - done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q \ - | grep -v 'spring-cloud-kubernetes-integration-tests' \ - | grep -v 'spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps' \ - | grep -v 'spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app' \ - | grep -v 'spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps' \ - | grep -v 'spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app' ) - cd .. From 80c100c1ea084e761bbba334e06470faec3538e6 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 09:27:38 +0300 Subject: [PATCH 29/79] placeholder commit From 4763bdc5bcb5541082c582fd1237d4696241d0ba Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 10:53:24 +0300 Subject: [PATCH 30/79] test --- .../spring-cloud-kubernetes-client-catalog-watcher/pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-client-discovery-it/pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-client-loadbalancer-it/pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-configuration-watcher-it/pom.xml | 1 + .../spring-cloud-kubernetes-discoveryclient-it/pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-fabric8-client-configmap/pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-fabric8-client-discovery/pom.xml | 1 + .../spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml | 1 + .../pom.xml | 1 + .../spring-cloud-kubernetes-fabric8-istio-it/pom.xml | 1 + 17 files changed, 17 insertions(+) diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml index 38f4e18e73..2b5afdca5d 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml index 382886e789..530756302e 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml @@ -55,6 +55,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml index ec84212c8a..243f1a4d32 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml @@ -96,6 +96,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml index dfc5d03931..10a1503128 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml @@ -95,6 +95,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml index 61e6ba120f..1aea888da1 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml @@ -91,6 +91,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml index ba73ef90b8..38b3156899 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml @@ -55,6 +55,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml index 69d3aac1de..4179f2975c 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml @@ -111,6 +111,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml index 74e485be7f..512716a58c 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml @@ -92,6 +92,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml index e30c96300f..0f93f700fb 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml index a1ba8bb15b..bc22366d8b 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml @@ -93,6 +93,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml index c5b250af03..5add6f8edd 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml @@ -96,6 +96,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml index f95d31e806..5d411470b7 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml index 0f5a4a4934..d0eb7669fd 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml @@ -90,6 +90,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml index dfe6a31ec6..bb1d63c5dc 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml index 9362129cb0..1df946c6c0 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml index 0778446710..1c071aa98f 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml @@ -88,6 +88,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml index c1d9fb67a5..3c047314dd 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml @@ -86,6 +86,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.1.2 From 970c875e3e4ceaf444e687a6be7be56bf548b183 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 11:42:21 +0300 Subject: [PATCH 31/79] test --- .github/workflows/composites/clean-space/action.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 69d61642fd..e110dc0c7e 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,6 +7,14 @@ runs: shell: bash run: | sudo apt-get update + + + # temporary workaround for an error in free disk space action + # https://github.com/jlumbroso/free-disk-space/issues/14 + - name: Update Package List and Remove Dotnet + shell: bash + run: | + sudo apt-get update - name: Free Disk Space uses: jlumbroso/free-disk-space@main From edcc9964527cf151de7c0f16346c679f8c4f33f4 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 12:20:39 +0300 Subject: [PATCH 32/79] test --- .github/workflows/composites/clean-space/action.yaml | 8 -------- .github/workflows/maven.yaml | 10 +++++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index e110dc0c7e..69d61642fd 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,14 +7,6 @@ runs: shell: bash run: | sudo apt-get update - - - # temporary workaround for an error in free disk space action - # https://github.com/jlumbroso/free-disk-space/issues/14 - - name: Update Package List and Remove Dotnet - shell: bash - run: | - sudo apt-get update - name: Free Disk Space uses: jlumbroso/free-disk-space@main diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 6264d4c008..eb0740edf4 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: # this might get set to true if there is an existing cache of test times # this happens in 'matrix-bounds-on-test-times-cache-hit' @@ -96,7 +96,7 @@ jobs: test_when_cache_present: needs: [ build ] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 # only run this one if there is a previous cache of test times @@ -145,7 +145,7 @@ jobs: test_when_cache_missing: needs: [ build ] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 timeout-minutes: 60 @@ -197,7 +197,7 @@ jobs: uses: ./.github/workflows/composites/run-and-save-test-times-when-cache-missing save_test_times_when_cache_missing: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: [build, test_when_cache_missing ] steps: @@ -210,7 +210,7 @@ jobs: uses: ./.github/workflows/composites/test-times save_test_times_when_cache_present: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: [ build, test_when_cache_present ] steps: From 82d5f2ff89af9e96324715d3e9a151fc6e3639d9 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 12:52:54 +0300 Subject: [PATCH 33/79] test --- .github/workflows/composites/clean-space/action.yaml | 1 + .github/workflows/maven.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 69d61642fd..e65d11f0c0 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,6 +7,7 @@ runs: shell: bash run: | sudo apt-get update + sudo apt-get remove google-cloud-sdk* - name: Free Disk Space uses: jlumbroso/free-disk-space@main diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index eb0740edf4..6264d4c008 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: # this might get set to true if there is an existing cache of test times # this happens in 'matrix-bounds-on-test-times-cache-hit' @@ -96,7 +96,7 @@ jobs: test_when_cache_present: needs: [ build ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 # only run this one if there is a previous cache of test times @@ -145,7 +145,7 @@ jobs: test_when_cache_missing: needs: [ build ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 timeout-minutes: 60 @@ -197,7 +197,7 @@ jobs: uses: ./.github/workflows/composites/run-and-save-test-times-when-cache-missing save_test_times_when_cache_missing: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: [build, test_when_cache_missing ] steps: @@ -210,7 +210,7 @@ jobs: uses: ./.github/workflows/composites/test-times save_test_times_when_cache_present: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: [ build, test_when_cache_present ] steps: From 2b56337faa481f1e02bb2514095caa36a2fb5e96 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 12:54:50 +0300 Subject: [PATCH 34/79] test --- .github/workflows/composites/clean-space/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index e65d11f0c0..a61f9558e1 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,7 +7,7 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get remove google-cloud-sdk* + sudo apt-get purge google-cloud-sdk - name: Free Disk Space uses: jlumbroso/free-disk-space@main From dcbc5decdccdae860f15a75e89a4322475779359 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 13:09:07 +0300 Subject: [PATCH 35/79] test --- .github/workflows/composites/clean-space/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index a61f9558e1..4f70007353 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,7 +7,7 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get purge google-cloud-sdk + sudo apt-get remove google-cloud-sdk - name: Free Disk Space uses: jlumbroso/free-disk-space@main From d48d61ff3c48e6ea6706aa220971881b56942647 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 13:17:16 +0300 Subject: [PATCH 36/79] test --- .github/workflows/composites/clean-space/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 4f70007353..b8e8b619a1 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,7 +7,7 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get remove google-cloud-sdk + sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - name: Free Disk Space uses: jlumbroso/free-disk-space@main From db8d950892bf7400c7d55919a11564262d82b0a5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 13:20:29 +0300 Subject: [PATCH 37/79] test --- .github/workflows/composites/clean-space/action.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index b8e8b619a1..fd1f337aa7 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -3,11 +3,11 @@ description: clean space runs: using: "composite" steps: - - name: apt-update - shell: bash - run: | - sudo apt-get update - sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri +# - name: apt-update +# shell: bash +# run: | +# sudo apt-get update +# sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - name: Free Disk Space uses: jlumbroso/free-disk-space@main From ae31faf5be485cb1177be65ce40a83670ec73392 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 13:55:02 +0300 Subject: [PATCH 38/79] test --- .github/workflows/composites/clean-space/action.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index fd1f337aa7..3b2761a64c 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -3,11 +3,9 @@ description: clean space runs: using: "composite" steps: -# - name: apt-update -# shell: bash -# run: | -# sudo apt-get update -# sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + - name: gcloud + shell: bash + run: gcloud info - name: Free Disk Space uses: jlumbroso/free-disk-space@main From dfca45b9ef1a4618df5c7b2ab7bb0a6d8aaacc4a Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 14:08:20 +0300 Subject: [PATCH 39/79] test --- .github/workflows/composites/clean-space/action.yaml | 3 --- .github/workflows/maven.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 3b2761a64c..f115de3a20 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -3,9 +3,6 @@ description: clean space runs: using: "composite" steps: - - name: gcloud - shell: bash - run: gcloud info - name: Free Disk Space uses: jlumbroso/free-disk-space@main diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 6264d4c008..4fcc70635b 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -29,9 +29,6 @@ jobs: - name: checkout project uses: actions/checkout@v2 - - name: clean space - uses: ./.github/workflows/composites/clean-space - - name: set env variables uses: ./.github/workflows/composites/env-variables From 34648ebd07b36a70d598ad3b61de9f629ac35c90 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 14:19:09 +0300 Subject: [PATCH 40/79] placeholder commit From 1eacf6cbbe1235a37b912ad6ec6f3bed0d4a952a Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 14:27:40 +0300 Subject: [PATCH 41/79] test --- .github/workflows/composites/clean-space/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index f115de3a20..3b2761a64c 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -3,6 +3,9 @@ description: clean space runs: using: "composite" steps: + - name: gcloud + shell: bash + run: gcloud info - name: Free Disk Space uses: jlumbroso/free-disk-space@main From c77b86acc4a4febe8da63b5783f0b1eac657fb71 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 14:39:06 +0300 Subject: [PATCH 42/79] test --- .github/workflows/composites/clean-space/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 3b2761a64c..e1bb096bd5 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -5,7 +5,9 @@ runs: steps: - name: gcloud shell: bash - run: gcloud info + run: | + sudo apt-get update + gcloud info - name: Free Disk Space uses: jlumbroso/free-disk-space@main From 5c244f5edb3ed12776f97dd28046d417e7b6ebd5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 18:50:16 +0300 Subject: [PATCH 43/79] review comments --- spring-cloud-kubernetes-integration-tests/pom.xml | 11 +++++++++++ .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../spring-cloud-kubernetes-fabric8-istio-it/pom.xml | 1 - 18 files changed, 11 insertions(+), 17 deletions(-) diff --git a/spring-cloud-kubernetes-integration-tests/pom.xml b/spring-cloud-kubernetes-integration-tests/pom.xml index ebd7479cf8..142af47a7c 100644 --- a/spring-cloud-kubernetes-integration-tests/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/pom.xml @@ -32,6 +32,17 @@ + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.1.2 + + + + diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml index 2b5afdca5d..38f4e18e73 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-catalog-watcher/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml index 530756302e..382886e789 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-configmap-test-app/pom.xml @@ -55,7 +55,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml index 243f1a4d32..ec84212c8a 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-discovery-it/pom.xml @@ -96,7 +96,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml index 10a1503128..dfc5d03931 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-event-and-polling-reload/pom.xml @@ -95,7 +95,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml index 1aea888da1..61e6ba120f 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-loadbalancer-it/pom.xml @@ -91,7 +91,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml index 38b3156899..ba73ef90b8 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-secrets-event-reload-multiple-apps/spring-cloud-kubernetes-client-configuration-watcher-secrets-test-app/pom.xml @@ -55,7 +55,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml index 4179f2975c..69d3aac1de 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/pom.xml @@ -111,7 +111,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml index 512716a58c..74e485be7f 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/pom.xml @@ -92,7 +92,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml index 0f93f700fb..e30c96300f 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-catalog-watcher/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml index bc22366d8b..a1ba8bb15b 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-event-reload/pom.xml @@ -93,7 +93,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml index 5add6f8edd..c5b250af03 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml @@ -96,7 +96,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml index 5d411470b7..f95d31e806 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-configmap/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml index d0eb7669fd..0f5a4a4934 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery-with-bootstrap/pom.xml @@ -90,7 +90,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml index bb1d63c5dc..dfe6a31ec6 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-discovery/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml index 1df946c6c0..9362129cb0 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-loadbalancer/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml index 1c071aa98f..0778446710 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-secrets-event-reload/pom.xml @@ -88,7 +88,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml index 3c047314dd..c1d9fb67a5 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/pom.xml @@ -86,7 +86,6 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 From 6810e8f6bcff9ea9ca42b1d8a4e07d759df3fed9 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 19:37:56 +0300 Subject: [PATCH 44/79] test --- .github/workflows/composites/clean-space/action.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index e1bb096bd5..f0e9488b01 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -7,7 +7,14 @@ runs: shell: bash run: | sudo apt-get update - gcloud info + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y '^mongodb-.*' + sudo apt-get remove -y '^mysql-.*' + sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y + sudo apt-get clean - name: Free Disk Space uses: jlumbroso/free-disk-space@main @@ -16,5 +23,5 @@ runs: android: true dotnet: true haskell: true - large-packages: true + large-packages: false swap-storage: true From dc62bbc6eade9231fca82df7b7f7735ba7f85335 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 19:48:30 +0300 Subject: [PATCH 45/79] test --- .../composites/clean-space/action.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index f0e9488b01..5f76a9f56a 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -12,16 +12,16 @@ runs: sudo apt-get remove -y 'php.*' sudo apt-get remove -y '^mongodb-.*' sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get remove -y azure-cli # google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri sudo apt-get autoremove -y sudo apt-get clean - - name: Free Disk Space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: false - swap-storage: true +# - name: Free Disk Space +# uses: jlumbroso/free-disk-space@main +# with: +# tool-cache: true +# android: true +# dotnet: true +# haskell: true +# large-packages: false +# swap-storage: true From 5d5ea38c31d693dcb2836db9cca4484dde3a82ec Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:05:04 +0300 Subject: [PATCH 46/79] test --- .github/workflows/composites/clean-space/action.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 5f76a9f56a..07affc2139 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -12,9 +12,10 @@ runs: sudo apt-get remove -y 'php.*' sudo apt-get remove -y '^mongodb-.*' sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli # google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean + sudo apt-get remove -y azure-cli # google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get remove -y google-cloud-sdk + #sudo apt-get autoremove -y + #sudo apt-get clean # - name: Free Disk Space # uses: jlumbroso/free-disk-space@main From f31d7414544fa277fb6d3c362aa91aadf5c2468a Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:16:31 +0300 Subject: [PATCH 47/79] test --- .github/workflows/composites/clean-space/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 07affc2139..2bf4004714 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -14,8 +14,8 @@ runs: sudo apt-get remove -y '^mysql-.*' sudo apt-get remove -y azure-cli # google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri sudo apt-get remove -y google-cloud-sdk - #sudo apt-get autoremove -y - #sudo apt-get clean + sudo apt-get autoremove -y + sudo apt-get clean # - name: Free Disk Space # uses: jlumbroso/free-disk-space@main From 8de4b9c09390f9d952becc250ef4f4b68dc87bfa Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:24:27 +0300 Subject: [PATCH 48/79] test --- .../composites/clean-space/action.yaml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 2bf4004714..1e33aa9f4f 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -3,6 +3,7 @@ description: clean space runs: using: "composite" steps: + - name: gcloud shell: bash run: | @@ -12,17 +13,15 @@ runs: sudo apt-get remove -y 'php.*' sudo apt-get remove -y '^mongodb-.*' sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli # google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get remove -y google-cloud-sdk - sudo apt-get autoremove -y + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri sudo apt-get clean -# - name: Free Disk Space -# uses: jlumbroso/free-disk-space@main -# with: -# tool-cache: true -# android: true -# dotnet: true -# haskell: true -# large-packages: false -# swap-storage: true + - name: Free Disk Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: false + swap-storage: true From 7715ca5883f8968a4ef154c1b529c4ea128b67b5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:32:09 +0300 Subject: [PATCH 49/79] test --- .github/workflows/composites/clean-space/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 1e33aa9f4f..db87c9a28d 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -13,7 +13,7 @@ runs: sudo apt-get remove -y 'php.*' sudo apt-get remove -y '^mongodb-.*' sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri sudo apt-get clean - name: Free Disk Space From 40c45148a9da56eb0ef906a080c469180c52d958 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:43:14 +0300 Subject: [PATCH 50/79] test --- .github/workflows/composites/clean-space/action.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index db87c9a28d..792bd071a5 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -4,6 +4,10 @@ runs: using: "composite" steps: + - name: remove google-cloud-sdk + shell: bash + run: sudo apt-get remove -y google-cloud-sdk + - name: gcloud shell: bash run: | @@ -13,7 +17,8 @@ runs: sudo apt-get remove -y 'php.*' sudo apt-get remove -y '^mongodb-.*' sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri + sudo apt-get autoremove -y sudo apt-get clean - name: Free Disk Space From 67d1cc4eef488235ef73123bc0e6fc5a85769712 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 20:50:22 +0300 Subject: [PATCH 51/79] test --- .github/workflows/composites/clean-space/action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 792bd071a5..10c8985855 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -6,12 +6,13 @@ runs: - name: remove google-cloud-sdk shell: bash - run: sudo apt-get remove -y google-cloud-sdk + run: | + sudo apt-get update + sudo apt-get remove -y google-cloud-sdk - name: gcloud shell: bash run: | - sudo apt-get update sudo apt-get remove -y '^dotnet-.*' sudo apt-get remove -y '^llvm-.*' sudo apt-get remove -y 'php.*' From 622cc946a8b4d8ced507053e3528a2901df50328 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:00:18 +0300 Subject: [PATCH 52/79] test --- .github/workflows/composites/clean-space/action.yaml | 1 + .github/workflows/maven.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 10c8985855..a0e78799a6 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -8,6 +8,7 @@ runs: shell: bash run: | sudo apt-get update + gcloud info sudo apt-get remove -y google-cloud-sdk - name: gcloud diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 4fcc70635b..6264d4c008 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -29,6 +29,9 @@ jobs: - name: checkout project uses: actions/checkout@v2 + - name: clean space + uses: ./.github/workflows/composites/clean-space + - name: set env variables uses: ./.github/workflows/composites/env-variables From 78734c14cb348d346f529a3238bc8afc0070fad3 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:02:57 +0300 Subject: [PATCH 53/79] test --- .github/workflows/composites/clean-space/action.yaml | 2 +- .github/workflows/maven.yaml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index a0e78799a6..23507eb189 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -11,7 +11,7 @@ runs: gcloud info sudo apt-get remove -y google-cloud-sdk - - name: gcloud + - name: same as 'large-packages' but without 'google-cloud-sdk' shell: bash run: | sudo apt-get remove -y '^dotnet-.*' diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 6264d4c008..4fcc70635b 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -29,9 +29,6 @@ jobs: - name: checkout project uses: actions/checkout@v2 - - name: clean space - uses: ./.github/workflows/composites/clean-space - - name: set env variables uses: ./.github/workflows/composites/env-variables From c2ad21e443aba983f7506eb185f17e838d28c20c Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:12:38 +0300 Subject: [PATCH 54/79] test --- .github/workflows/composites/clean-space/action.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 23507eb189..1e08c8f49b 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -4,13 +4,6 @@ runs: using: "composite" steps: - - name: remove google-cloud-sdk - shell: bash - run: | - sudo apt-get update - gcloud info - sudo apt-get remove -y google-cloud-sdk - - name: same as 'large-packages' but without 'google-cloud-sdk' shell: bash run: | From 1d853d206d1e049a9edea4956a9d02b870d8706f Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:15:51 +0300 Subject: [PATCH 55/79] test --- .github/workflows/composites/clean-space/action.yaml | 9 +++++++++ .github/workflows/maven.yaml | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 1e08c8f49b..ba3b646879 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -4,6 +4,15 @@ runs: using: "composite" steps: + - name: manually remove gcloud + shell: bash + run: | + gcloud_sdk_root=$(gcloud info --format='value(installation.sdk_root)') + gcloud_global_config=$(gcloud info --format='value(config.paths.global_config_dir)') + + sudo rm -fr $gcloud_sdk_root + sudo rm -fr $gcloud_global_config + - name: same as 'large-packages' but without 'google-cloud-sdk' shell: bash run: | diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 4fcc70635b..6264d4c008 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -29,6 +29,9 @@ jobs: - name: checkout project uses: actions/checkout@v2 + - name: clean space + uses: ./.github/workflows/composites/clean-space + - name: set env variables uses: ./.github/workflows/composites/env-variables From 5e985c5e3c50e05f6b16c83a5a5537875cd5471d Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:31:06 +0300 Subject: [PATCH 56/79] test --- .github/workflows/composites/clean-space/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index ba3b646879..588253a3e6 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -10,6 +10,9 @@ runs: gcloud_sdk_root=$(gcloud info --format='value(installation.sdk_root)') gcloud_global_config=$(gcloud info --format='value(config.paths.global_config_dir)') + echo "will remove directory : $gcloud_sdk_root" + echo "will remove directory : $gcloud_global_config" + sudo rm -fr $gcloud_sdk_root sudo rm -fr $gcloud_global_config From c982060ef0d1317fa9161b4e0e116f652ba43079 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 21:38:38 +0300 Subject: [PATCH 57/79] test --- .github/workflows/maven.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 6264d4c008..4fcc70635b 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -29,9 +29,6 @@ jobs: - name: checkout project uses: actions/checkout@v2 - - name: clean space - uses: ./.github/workflows/composites/clean-space - - name: set env variables uses: ./.github/workflows/composites/env-variables From 8a42c1582d13c7768cac841818aff5753390b940 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 22:20:46 +0300 Subject: [PATCH 58/79] fix build --- .github/workflows/composites/clean-space/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index 588253a3e6..2f9906ce2e 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -4,6 +4,9 @@ runs: using: "composite" steps: + ### this is supposed to be simpler, but it's a work-around for: + ### https://github.com/jlumbroso/free-disk-space/issues/14 + - name: manually remove gcloud shell: bash run: | From 6a07b131506b7ac03ade2a9fe11f690e1ca70bce Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 26 Sep 2023 22:58:55 +0300 Subject: [PATCH 59/79] placeholder commit From e9077e285f78ad5c781754c45576ef431a9942a3 Mon Sep 17 00:00:00 2001 From: wind57 Date: Wed, 27 Sep 2023 07:32:32 +0300 Subject: [PATCH 60/79] review comments --- .../action.yaml | 2 +- .../action.yaml | 2 +- .../pom.xml | 27 ++++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml index 0cb4085b21..b1d18fef80 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml @@ -61,7 +61,7 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${TEST_ARG[@]} \ -e clean install \ - -P sonar -nsu --batch-mode \ + -P 'sonar, run-on-github-actions' -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml index f658cfbf58..7130a907c9 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml @@ -150,7 +150,7 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${tests_to_run_in_current_index} \ -e clean install \ - -P sonar -nsu --batch-mode \ + -P 'sonar, run-on-github-actions' -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/spring-cloud-kubernetes-integration-tests/pom.xml b/spring-cloud-kubernetes-integration-tests/pom.xml index 142af47a7c..d1b0cbaf50 100644 --- a/spring-cloud-kubernetes-integration-tests/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/pom.xml @@ -33,18 +33,25 @@ - - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.1.2 - - - - + + + run-on-github-actions + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.1.2 + + + + + + + From 5a7695a53209e195dbc8d9ccf31ec74f2084fbc0 Mon Sep 17 00:00:00 2001 From: wind57 Date: Wed, 27 Sep 2023 14:00:54 +0300 Subject: [PATCH 61/79] merge --- .../kubernetes-leader-election-example/pom.xml | 4 ++-- spring-cloud-kubernetes-integration-tests/pom.xml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-cloud-kubernetes-examples/kubernetes-leader-election-example/pom.xml b/spring-cloud-kubernetes-examples/kubernetes-leader-election-example/pom.xml index d6bc61dbc0..e13b268c78 100644 --- a/spring-cloud-kubernetes-examples/kubernetes-leader-election-example/pom.xml +++ b/spring-cloud-kubernetes-examples/kubernetes-leader-election-example/pom.xml @@ -75,11 +75,11 @@ maven-surefire-plugin - 2.22.2 + 3.1.2 maven-failsafe-plugin - 2.22.2 + 3.1.2 diff --git a/spring-cloud-kubernetes-integration-tests/pom.xml b/spring-cloud-kubernetes-integration-tests/pom.xml index d1b0cbaf50..1dae169f19 100644 --- a/spring-cloud-kubernetes-integration-tests/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/pom.xml @@ -46,6 +46,12 @@ maven-failsafe-plugin 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + From 4636bc864af2f857820155d9bbbb756f544e0693 Mon Sep 17 00:00:00 2001 From: wind57 Date: Thu, 28 Sep 2023 10:03:42 +0300 Subject: [PATCH 62/79] add profile --- .github/workflows/composites/pre-test-actions/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/pre-test-actions/action.yaml b/.github/workflows/composites/pre-test-actions/action.yaml index 657c55e886..da4368c69d 100644 --- a/.github/workflows/composites/pre-test-actions/action.yaml +++ b/.github/workflows/composites/pre-test-actions/action.yaml @@ -25,7 +25,7 @@ runs: - name: build project shell: bash run: | - ./mvnw clean install -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q + ./mvnw clean install -P 'run-on-github-actions' -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q - name: build controllers project uses: ./.github/workflows/composites/build-controllers-project From e13bcd3209513dddd0fb2a72206f4d72478bb577 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 29 Sep 2023 09:33:32 +0300 Subject: [PATCH 63/79] fix --- .../composites/clean-space/action.yaml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/composites/clean-space/action.yaml b/.github/workflows/composites/clean-space/action.yaml index cba74e0221..f115de3a20 100644 --- a/.github/workflows/composites/clean-space/action.yaml +++ b/.github/workflows/composites/clean-space/action.yaml @@ -4,25 +4,6 @@ runs: using: "composite" steps: - ### this is supposed to be simpler, but it's a work-around for: - ### https://github.com/jlumbroso/free-disk-space/issues/14 - - - name: manually remove gcloud - shell: bash - run: sudo apt-get remove google-cloud-cli - - - name: same as 'large-packages' but without 'google-cloud-sdk' - shell: bash - run: | - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y '^mongodb-.*' - sudo apt-get remove -y '^mysql-.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt-get autoremove -y - sudo apt-get clean - - name: Free Disk Space uses: jlumbroso/free-disk-space@main with: @@ -30,5 +11,5 @@ runs: android: true dotnet: true haskell: true - large-packages: false + large-packages: true swap-storage: true From 0515920476866923c1b6bfb0a9cc4257490f0452 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 29 Sep 2023 12:18:07 +0300 Subject: [PATCH 64/79] fix --- .../composites/pre-test-actions/action.yaml | 2 +- .../action.yaml | 3 ++- .../action.yaml | 3 ++- pom.xml | 13 +++++++++-- .../pom.xml | 23 ------------------- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/composites/pre-test-actions/action.yaml b/.github/workflows/composites/pre-test-actions/action.yaml index 657c55e886..3fd401e81f 100644 --- a/.github/workflows/composites/pre-test-actions/action.yaml +++ b/.github/workflows/composites/pre-test-actions/action.yaml @@ -25,7 +25,7 @@ runs: - name: build project shell: bash run: | - ./mvnw clean install -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q + ./mvnw clean install -DCURRENT_INSTANCE=${CURRENT_INDEX} -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q - name: build controllers project uses: ./.github/workflows/composites/build-controllers-project diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml index b1d18fef80..d262d89bbd 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml @@ -60,8 +60,9 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${TEST_ARG[@]} \ + -DCURRENT_INSTANCE=${CURRENT_INDEX} \ -e clean install \ - -P 'sonar, run-on-github-actions' -nsu --batch-mode \ + -P sonar -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml index 7130a907c9..ce2242c3fc 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml @@ -149,8 +149,9 @@ runs: ./mvnw -s .settings.xml \ -DtestsToRun=${tests_to_run_in_current_index} \ + -DCURRENT_INSTANCE=${CURRENT_INDEX} \ -e clean install \ - -P 'sonar, run-on-github-actions' -nsu --batch-mode \ + -P sonar -nsu --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -Dhttp.keepAlive=false \ -Dmaven.wagon.http.pool=false \ diff --git a/pom.xml b/pom.xml index 2f693f6818..199db284b2 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,7 @@ + one 4.8.1 4.0.5-SNAPSHOT @@ -69,8 +70,6 @@ 4.0.1 4.0.5-SNAPSHOT - 3.1.0 - true true @@ -205,8 +204,18 @@ ${testsToRun} + ${project.build.directory}/surefire-reports/${CURRENT_INSTANCE} + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + ${project.build.directory}/failsafe-reports/${CURRENT_INSTANCE} + org.apache.maven.plugins maven-checkstyle-plugin diff --git a/spring-cloud-kubernetes-integration-tests/pom.xml b/spring-cloud-kubernetes-integration-tests/pom.xml index 1dae169f19..03363f509a 100644 --- a/spring-cloud-kubernetes-integration-tests/pom.xml +++ b/spring-cloud-kubernetes-integration-tests/pom.xml @@ -35,29 +35,6 @@ - - - run-on-github-actions - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.1.2 - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.1.2 - - - - - - - From 565679c21b8e39d15cd6208669e341d6184b65ab Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 29 Sep 2023 12:24:12 +0300 Subject: [PATCH 65/79] test --- .../composites/build-controllers-project/action.yaml | 6 +++++- .github/workflows/composites/pre-test-actions/action.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/composites/build-controllers-project/action.yaml b/.github/workflows/composites/build-controllers-project/action.yaml index 307451c8f5..df34f3c443 100644 --- a/.github/workflows/composites/build-controllers-project/action.yaml +++ b/.github/workflows/composites/build-controllers-project/action.yaml @@ -7,5 +7,9 @@ runs: shell: bash run: | cd spring-cloud-kubernetes-controllers - .././mvnw -T 1C -U clean install + .././mvnw -DCURRENT_INSTANCE=${CURRENT_INDEX} -T 1C -U clean install cd .. + + - name: show target path + shell: bash + run: ls spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/target/surefire-reports diff --git a/.github/workflows/composites/pre-test-actions/action.yaml b/.github/workflows/composites/pre-test-actions/action.yaml index 3fd401e81f..657c55e886 100644 --- a/.github/workflows/composites/pre-test-actions/action.yaml +++ b/.github/workflows/composites/pre-test-actions/action.yaml @@ -25,7 +25,7 @@ runs: - name: build project shell: bash run: | - ./mvnw clean install -DCURRENT_INSTANCE=${CURRENT_INDEX} -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q + ./mvnw clean install -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q - name: build controllers project uses: ./.github/workflows/composites/build-controllers-project From 3a869235fd3a1df0ea440725b3bfaabb0c9d929f Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 29 Sep 2023 15:27:10 +0300 Subject: [PATCH 66/79] test --- .../workflows/composites/build-controllers-project/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/composites/build-controllers-project/action.yaml b/.github/workflows/composites/build-controllers-project/action.yaml index df34f3c443..f9df2c519d 100644 --- a/.github/workflows/composites/build-controllers-project/action.yaml +++ b/.github/workflows/composites/build-controllers-project/action.yaml @@ -5,6 +5,8 @@ runs: steps: - name: build controllers project shell: bash + env: + CURRENT_INDEX: ${{ matrix.current_index }} run: | cd spring-cloud-kubernetes-controllers .././mvnw -DCURRENT_INSTANCE=${CURRENT_INDEX} -T 1C -U clean install From 03274168fa2133c0277350d84598264a5ccd0ec5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Mon, 2 Oct 2023 15:49:34 +0300 Subject: [PATCH 67/79] review comments --- .../composites/build-controllers-project/action.yaml | 4 ---- pom.xml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/composites/build-controllers-project/action.yaml b/.github/workflows/composites/build-controllers-project/action.yaml index f9df2c519d..dff8da1648 100644 --- a/.github/workflows/composites/build-controllers-project/action.yaml +++ b/.github/workflows/composites/build-controllers-project/action.yaml @@ -11,7 +11,3 @@ runs: cd spring-cloud-kubernetes-controllers .././mvnw -DCURRENT_INSTANCE=${CURRENT_INDEX} -T 1C -U clean install cd .. - - - name: show target path - shell: bash - run: ls spring-cloud-kubernetes-controllers/spring-cloud-kubernetes-configuration-watcher/target/surefire-reports diff --git a/pom.xml b/pom.xml index 199db284b2..271e4616b0 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,10 @@ + + + + one 4.8.1 From 71e28baea0f056a9f316914e092a5b3037933ac9 Mon Sep 17 00:00:00 2001 From: wind57 Date: Mon, 2 Oct 2023 22:48:05 +0300 Subject: [PATCH 68/79] placeholder commit From 2caa1799930d7da4ea2bbfb1d33c90725dedea01 Mon Sep 17 00:00:00 2001 From: wind57 Date: Mon, 2 Oct 2023 23:39:55 +0300 Subject: [PATCH 69/79] placeholder commit From af7cdbb604defe87200f60b19cb6d720f157f240 Mon Sep 17 00:00:00 2001 From: wind57 Date: Tue, 3 Oct 2023 08:43:09 +0300 Subject: [PATCH 70/79] placeholder commit From df2d07e8979cca4c6b9f631f835c06f860559ae5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 13 Oct 2023 21:47:22 +0300 Subject: [PATCH 71/79] fix --- .github/workflows/maven.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 4fcc70635b..fd2779105d 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -98,7 +98,7 @@ jobs: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 # only run this one if there is a previous cache of test times if: needs.build.outputs.test_times_cache_present == 'true' - timeout-minutes: 60 + timeout-minutes: 120 strategy: fail-fast: true @@ -145,7 +145,7 @@ jobs: runs-on: ubuntu-latest env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30 - timeout-minutes: 60 + timeout-minutes: 120 # only run this one if there is no previous cache of test times if: needs.build.outputs.test_times_cache_present == 'false' From 1029eccaf4a6dbbcafb32145a3d5152094fa39f5 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 13 Oct 2023 22:28:56 +0300 Subject: [PATCH 72/79] trigger From b5477a75c308f4e6dfd77beb0bb4dc9a841e9a61 Mon Sep 17 00:00:00 2001 From: wind57 Date: Sun, 31 Mar 2024 10:17:17 +0300 Subject: [PATCH 73/79] placeholder commit From 9740bef819a97fd54bc557f325a6919ace52447f Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 6 Sep 2024 09:09:02 +0300 Subject: [PATCH 74/79] formatting --- .../commons/config/configdata/Properties.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java index 3acd1c637a..29fbe38e56 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/Properties.java @@ -49,7 +49,7 @@ static Properties of(ConfigDataLocationResolverContext context) { } String namespace = binder.bind("spring.cloud.kubernetes.client.namespace", String.class) - .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); + .orElse(binder.bind("kubernetes.namespace", String.class).orElse("")); KubernetesClientProperties clientProperties = clientProperties(context, namespace); return new Properties(clientProperties, configMapConfigProperties, secretsProperties); @@ -59,13 +59,14 @@ private static KubernetesClientProperties clientProperties(ConfigDataLocationRes String namespace) { KubernetesClientProperties kubernetesClientProperties; if (context.getBootstrapContext().isRegistered(KubernetesClientProperties.class)) { - kubernetesClientProperties = context.getBootstrapContext().get(KubernetesClientProperties.class) - .withNamespace(namespace); + kubernetesClientProperties = context.getBootstrapContext() + .get(KubernetesClientProperties.class) + .withNamespace(namespace); } else { kubernetesClientProperties = context.getBinder() - .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) - .withNamespace(namespace); + .bindOrCreate(KubernetesClientProperties.PREFIX, Bindable.of(KubernetesClientProperties.class)) + .withNamespace(namespace); } return kubernetesClientProperties; } From 9dd5bbf004ac1ebdc8abdcd7d9c85bbb918d3a8a Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 6 Sep 2024 09:27:39 +0300 Subject: [PATCH 75/79] fix test --- .../commons/config/ConfigUtils.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index 5f40858eab..e40958e7db 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -329,15 +329,16 @@ private static Map decodeData(Map data) { } public static void registerSingle(ConfigurableBootstrapContext bootstrapContext, Class cls, T instance, - String name) { - bootstrapContext.registerIfAbsent(cls, BootstrapRegistry.InstanceSupplier.of(instance)); - bootstrapContext.addCloseListener(event -> { - if (event.getApplicationContext().getBeanFactory().getSingleton(name) == null) { - event.getApplicationContext() - .getBeanFactory() - .registerSingleton(name, event.getBootstrapContext().get(cls)); - } - }); + String name) { + if (instance != null && !bootstrapContext.isRegistered(cls)) { + bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); + bootstrapContext.addCloseListener(event -> { + if (event.getApplicationContext().getBeanFactory().getSingleton(name) == null) { + event.getApplicationContext().getBeanFactory().registerSingleton(name, + event.getBootstrapContext().get(cls)); + } + }); + } } /** From 82b51e537d398c9950a8cdb0a39c0af04458cf20 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 6 Sep 2024 09:37:03 +0300 Subject: [PATCH 76/79] formatting --- .../cloud/kubernetes/commons/config/ConfigUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index e40958e7db..e838f5d7e2 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -329,7 +329,7 @@ private static Map decodeData(Map data) { } public static void registerSingle(ConfigurableBootstrapContext bootstrapContext, Class cls, T instance, - String name) { + String name) { if (instance != null && !bootstrapContext.isRegistered(cls)) { bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); bootstrapContext.addCloseListener(event -> { From f9330c3ec004090a3328e2f56a71011750d3a2d6 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 6 Sep 2024 09:37:54 +0300 Subject: [PATCH 77/79] formatting --- .../cloud/kubernetes/commons/config/ConfigUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java index e838f5d7e2..03c3512834 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigUtils.java @@ -334,8 +334,9 @@ public static void registerSingle(ConfigurableBootstrapContext bootstrapCont bootstrapContext.register(cls, BootstrapRegistry.InstanceSupplier.of(instance)); bootstrapContext.addCloseListener(event -> { if (event.getApplicationContext().getBeanFactory().getSingleton(name) == null) { - event.getApplicationContext().getBeanFactory().registerSingleton(name, - event.getBootstrapContext().get(cls)); + event.getApplicationContext() + .getBeanFactory() + .registerSingleton(name, event.getBootstrapContext().get(cls)); } }); } From 66f929c67cc7857864f7b826bcd19ff0191615d7 Mon Sep 17 00:00:00 2001 From: wind57 Date: Fri, 25 Oct 2024 07:25:04 +0300 Subject: [PATCH 78/79] fix test --- .../config/configdata/ConfigDataProperties.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java index cdcacc3977..86a7ede3cb 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/configdata/ConfigDataProperties.java @@ -42,14 +42,20 @@ private static void registerProperties(ConfigDataLocationResolverContext resolve SecretsConfigProperties secretsProperties) { ConfigurableBootstrapContext bootstrapContext = resolverContext.getBootstrapContext(); + registerSingle(bootstrapContext, KubernetesClientProperties.class, clientProperties, "configDataKubernetesClientProperties"); - registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, + if (configMapProperties != null) { + registerSingle(bootstrapContext, ConfigMapConfigProperties.class, configMapProperties, "configDataConfigMapConfigProperties"); + } - registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, + if (secretsProperties != null) { + registerSingle(bootstrapContext, SecretsConfigProperties.class, secretsProperties, "configDataSecretsConfigProperties"); + } + } @FunctionalInterface From ff430591a8ca5500e89c3508bcd6713eca2bafe9 Mon Sep 17 00:00:00 2001 From: wind57 Date: Mon, 10 Feb 2025 09:19:47 +0200 Subject: [PATCH 79/79] fix build Signed-off-by: wind57 --- .github/workflows/composites/pre-test-actions/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/composites/pre-test-actions/action.yaml b/.github/workflows/composites/pre-test-actions/action.yaml index 1a39eaa5ec..b11abd2616 100644 --- a/.github/workflows/composites/pre-test-actions/action.yaml +++ b/.github/workflows/composites/pre-test-actions/action.yaml @@ -24,7 +24,7 @@ runs: - name: build project shell: bash run: | - ./mvnw clean install -Dspring-boot.build-image.skip=true -DskipITs -DskipTests -T1C -U -B -q + ./mvnw clean install -P 'run-on-github-actions' -Dspring-boot.build-image.skip=true -DskipITs -DskipTests -T1C -U -B -q - name: build controllers project uses: ./.github/workflows/composites/build-controllers-project