Skip to content

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

@josef-pones

Description

@josef-pones

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"
         }
      }
   ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions