Describe the bug
When importing Kubernetes secrets with use-name-as-prefix, I would expect the prefix to be the name of the secret. This does not work when using a label selector with duplicate keys:
application.yaml
spring:
config:
import: "kubernetes:"
cloud:
kubernetes:
secrets:
enable-api: true
sources:
- labels:
load: "true"
use-name-as-prefix: true
k8s-secrets.yaml
---
apiVersion: v1
kind: Secret
metadata:
name: client-1
labels:
load: "true"
stringData:
client-id: client-1
client-secret: S3cr371!
---
apiVersion: v1
kind: Secret
metadata:
name: client-2
labels:
load: "true"
stringData:
client-id: client-2
client-secret: S3cr372!
will result in these properties:
client-1.client-2.client-secret: S3cr372!
client-1.client-2.client-id: client-2
Expected result:
client-1.client-secret: S3cr371!
client-1.client-id: client-1
client-2.client-secret: S3cr372!
client-2.client-id: client-2
Spring Cloud: 2023.0.3
Sample
I built an example application here: https://github.com/jnodorp-jaconi/spring-cloud-kubernetes-reproducer
Describe the bug
When importing Kubernetes secrets with
use-name-as-prefix, I would expect the prefix to be the name of the secret. This does not work when using a label selector with duplicate keys:application.yamlk8s-secrets.yamlwill result in these properties:
Expected result:
Spring Cloud: 2023.0.3
Sample
I built an example application here: https://github.com/jnodorp-jaconi/spring-cloud-kubernetes-reproducer