spring-cloud-kubernetes icon indicating copy to clipboard operation
spring-cloud-kubernetes copied to clipboard

The `application.yml` in `spring-cloud-kubernetes-configserver` does not behave the same way as in `spring-cloud-configserver`.

Open josef-pones opened this issue 1 year ago • 4 comments

I have config maps like this

apiVersion: v1
kind: ConfigMap
metadata:
  name: service
  namespace: default
data:
  service.yml: |-
    key: value
  service-profile1.yml: |-
    key: value   
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: application
  namespace: default
data:
  application.yml: |-
    key: value
  application-profile1.yml: |-
    key: value

If I call the kubernetes config server with application=service and profile=profile1 curl http://localhost:31888/service/profile1 , I get a response that only includes values from the config map service and service-profile1. I would expect it to also include the contents of application and application-profile1.

response

{
   "name":"service",
   "profiles":[
      "profile1"
   ],
   "label":null,
   "version":null,
   "state":null,
   "propertySources":[
      {
         "name":"configmap.service.default.profile1",
         "source":{
            "key":"value"
         }
      },
      {
         "name":"configmap.service.default.default",
         "source":{
            "key":"value"
         }
      }
   ]
}

If I split the application config map into two separate maps and call the config server, the response includes the contents of application. I would still expect it to include application-profile1 as well.

apiVersion: v1
kind: ConfigMap
metadata:
  name: application
  namespace: default
data:
  application.yml: |-
    key: value      
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: application-profile1
  namespace: default
data:
  application-profile1.yml: |-
    key: value    

response

{
   "name":"service",
   "profiles":[
      "profile1"
   ],
   "label":null,
   "version":null,
   "state":null,
   "propertySources":[
      {
         "name":"configmap.service.default.profile1",
         "source":{
            "key":"value"
         }
      },
      {
         "name":"configmap.service.default.default",
         "source":{
            "key":"value"
         }
      },
      {
         "name":"configmap.application.default",
         "source":{
            "key":"value"
         }
      }
   ]
}

josef-pones avatar Nov 18 '24 09:11 josef-pones

what versions / dependencies are you using?

wind57 avatar Nov 18 '24 09:11 wind57

I tested this on spring-cloud-kubernetes-configserver versions 3.1.0 and 3.2.0-SNAPSHOT. For the config server, I used the image from Docker Hub.

josef-pones avatar Nov 18 '24 10:11 josef-pones

I have created an MR with a fix for this issue. Could you please take a look at it? 1892

josef-pones avatar Mar 11 '25 20:03 josef-pones

I have the same problem, any updates regarding this item?

EduardoRostTR avatar Jun 13 '25 13:06 EduardoRostTR