This is a follow up of #1181 . Turns out my connection string cannot be parsed because I am setting it up using interdependent environment variables
My setup looks like this:
env:
- name: SERVICEBUS_CONNECT_GENERAL
valueFrom:
secretKeyRef:
name: service-bus
key: connectionString
- name: SERVICEBUS_CONNECT
value: $(SERVICEBUS_CONNECT_GENERAL);EntityPath=my-topic
Which I use, since I have around 20 topics and do not want to maintain 20 different secrets, as the connection string is always the same. The concept is supported from a kubernetes point of view, but apparantly the function ResolveContainerEnvdoes not consider interdependent variables.
The connection string is extracted from the environment like it is done in kubernetes
the connection string is extracted as $(SERVICEBUS_CONNECT_GENERAL);EntityPath=my-topic and can thus cannot be parsed.
KEDA Version: 2.0.0 beta
Platform & Version: Azure Kubernetes Service
Kubernetes Version: 1.17.9
Scaler(s): Azure Service Bus
Agree, we should support this. @rangp Are you willing to contribute this part?
@zroubalik in theory yes, in practice I have 0 experience in go. I suspect keda should use the logic here https://github.com/kubernetes/kubernetes/blob/88512be213159f87ed2dad07f75c02d355eadac5/pkg/kubelet/kubelet_pods.go, or at least emulate it.
But I don't think I will be able to contribute much in terms of a pull request.
@rangp okay, no worries.
For reference, these seems like relevant parts:
https://github.com/kubernetes/kubernetes/blob/88512be213159f87ed2dad07f75c02d355eadac5/pkg/kubelet/kubelet_pods.go#L681
Can I try to work on this? I am interested in this.
@mosesyou that's great, absolutely, go ahead 馃憤 Would be great to add some tests for env resolving as part of this effort.
Most helpful comment
Can I try to work on this? I am interested in this.