You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our pipelines runs an elasticsearch container as a service. For some reason elasticsearch uses "dot case format" for environment variables, as can be seen in their official docker-compose file:
This worked fine for a long time. However since we updated Woodpecker from 2.3.0 to 2.7.0 the variables started to be converted from "dot case" to "snake case". If we describe the pods in Kubernetes we can see:
Environment:
node_name: elasticsearch
This is causing the pipeline to fail, as we can't properly set the cluster's node name and the other steps executing in this pipeline won't be able to find the elasticsearch service in the cluster.
// sanitizeParamKey formats the environment variable key.
func sanitizeParamKey(prefix string, upper bool, k string) string {
r := strings.ReplaceAll(strings.ReplaceAll(k, ".", "_"), "-", "_")
if upper {
r = strings.ToUpper(r)
}
return prefix + r
}
I'm not 100% sure why it worked in 2.3.0 and stopped working after the update but I saw #3515 which seems related.
I think that #3406 which also caused that issue and was introduced in 2.4.0 might have caused this issue too. And then its fix #3516 only addressed the uppercase element, but not the dot case to snake case conversion.
Steps to reproduce
Install Woodpecker 2.7.0+ (probably reproducible starting at 2.4.0)
Component
server
Describe the bug
One of our pipelines runs an elasticsearch container as a service. For some reason elasticsearch uses "dot case format" for environment variables, as can be seen in their official docker-compose file:
This is how the service is configured in woodpecker:
This worked fine for a long time. However since we updated Woodpecker from 2.3.0 to 2.7.0 the variables started to be converted from "dot case" to "snake case". If we describe the pods in Kubernetes we can see:
This is causing the pipeline to fail, as we can't properly set the cluster's node name and the other steps executing in this pipeline won't be able to find the elasticsearch service in the cluster.
The issue seems to be related to this function: https://github.com/qwerty287/woodpecker/blob/main/pipeline/frontend/yaml/compiler/settings/params.go#L47
I'm not 100% sure why it worked in 2.3.0 and stopped working after the update but I saw #3515 which seems related.
I think that #3406 which also caused that issue and was introduced in 2.4.0 might have caused this issue too. And then its fix #3516 only addressed the uppercase element, but not the dot case to snake case conversion.
Steps to reproduce
Expected behavior
No response
System Info
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: