Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pepanek opened this issue Nov 18, 2024 · 2 comments

Comments

@pepanek
Copy link

pepanek commented Nov 18, 2024

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"
         }
      }
   ]
}
@wind57
Copy link
Contributor

wind57 commented Nov 18, 2024

what versions / dependencies are you using?

@pepanek
Copy link
Author

pepanek commented Nov 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants