I am getting this exception looged for every one of my Junit 5 Tests in a Spring Boot 2.5 project using org.springframework.cloud:spring-cloud-starter-kubernetes-client-config. I use local yaml property files for tests, not Kubernetes anywhere.
I wonder if it is just because I run the tests locally (not in Kubernetes) or if is a real problema that will arise when I deploy in Kubernetes (and try to read the configuration from Kubernetes ConfigMaps)
io.kubernetes.client.openapi.ApiException: Missing the required parameter 'namespace' when calling listNamespacedConfigMap(Async)
at io.kubernetes.client.openapi.apis.CoreV1Api.listNamespacedConfigMapValidateBeforeCall(CoreV1Api.java:28159) ~[client-java-api-11.0.2.jar:na]
at io.kubernetes.client.openapi.apis.CoreV1Api.listNamespacedConfigMapWithHttpInfo(CoreV1Api.java:28361) ~[client-java-api-11.0.2.jar:na]
at io.kubernetes.client.openapi.apis.CoreV1Api.listNamespacedConfigMap(CoreV1Api.java:28263) ~[client-java-api-11.0.2.jar:na]
at org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapPropertySource.getData(KubernetesClientConfigMapPropertySource.java:56) ~[spring-cloud-kubernetes-client-config-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapPropertySource.<init>(KubernetesClientConfigMapPropertySource.java:41) ~[spring-cloud-kubernetes-client-config-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapPropertySourceLocator.getMapPropertySource(KubernetesClientConfigMapPropertySourceLocator.java:62) ~[spring-cloud-kubernetes-client-config-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.getMapPropertySourceForSingleConfigMap(ConfigMapPropertySourceLocator.java:81) ~[spring-cloud-kubernetes-commons-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.lambda$locate$0(ConfigMapPropertySourceLocator.java:67) ~[spring-cloud-kubernetes-commons-2.0.3.jar:2.0.3]
at java.base/java.util.Collections$SingletonList.forEach(Collections.java:4933) ~[na:na]
at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.locate(ConfigMapPropertySourceLocator.java:67) ~[spring-cloud-kubernetes-commons-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationChangeDetector.locateMapPropertySources(ConfigurationChangeDetector.java:177) ~[spring-cloud-kubernetes-commons-2.0.3.jar:2.0.3]
at org.springframework.cloud.kubernetes.commons.config.reload.PollingConfigMapChangeDetector.executeCycle(PollingConfigMapChangeDetector.java:72) ~[spring-cloud-kubernetes-commons-2.0.3.jar:2.0.3]
at jdk.internal.reflect.GeneratedMethodAccessor121.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.9.jar:5.3.9]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.9.jar:5.3.9]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]