Skip to content

Commit 25d0739

Browse files
committed
fix: load env vars having $ in value correctly
1 parent d459e24 commit 25d0739

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

recipe/envs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func populateDataFromLocal() map[string]string {
3939
for _, envvar := range os.Environ() {
4040
keyval := strings.SplitN(envvar, "=", 2) // "sampleKey=sample=Value" returns ["sampleKey", "sample=value"]
4141
key := keyval[0]
42-
val := os.ExpandEnv(keyval[1])
42+
val := keyval[1]
4343

4444
key, ok := mapToMeteorKey(key)
4545
if !ok {

recipe/reader_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111

1212
var (
1313
emptyConfigPath = ""
14-
username = "admin"
15-
password = "1234"
14+
username = "johnsmith@abc.com"
15+
password = "TempPa$sword"
1616
)
1717

1818
func TestReaderRead(t *testing.T) {
@@ -307,6 +307,8 @@ func TestReaderRead(t *testing.T) {
307307
}
308308

309309
func compareRecipes(t *testing.T, expected, actual recipe.Recipe) {
310+
t.Helper()
311+
310312
assert.Equal(t, expected.Name, actual.Name)
311313
assert.Equal(t, len(expected.Sinks), len(actual.Sinks))
312314
assert.Equal(t, len(expected.Processors), len(actual.Processors))

recipe/sample_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SOURCE:
2-
USERNAME: admin
3-
PASSWORD: "1234"
2+
USERNAME: johnsmith@abc.com
3+
PASSWORD: "TempPa$sword"

recipe/testdata/config2.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SOURCE:
2-
USERNAME: admin
3-
PASSWORD: "1234"
2+
USERNAME: johnsmith@abc.com
3+
PASSWORD: "TempPa$sword"

0 commit comments

Comments
 (0)