Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
fix: placeholders not replaced in resource params
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Stephenson <chris.stephenson@humanitec.com>
  • Loading branch information
chrishumanitec authored and ghen committed Aug 23, 2023
1 parent 56cd6b0 commit 069dcdf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/humanitec/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func ConvertSpec(name, envID string, spec *score.WorkloadSpec, ext *extensions.H
"type": res.Type,
}
if len(res.Params) > 0 {
extRes["params"] = res.Params
extRes["params"] = ctx.SubstituteAll(res.Params)
}
externals[resName] = extRes
} else if scope == "shared" {
Expand All @@ -242,7 +242,7 @@ func ConvertSpec(name, envID string, spec *score.WorkloadSpec, ext *extensions.H
"type": res.Type,
}
if len(res.Params) > 0 {
sharedRes["params"] = res.Params
sharedRes["params"] = ctx.SubstituteAll(res.Params)
}
shared = append(shared, humanitec.UpdateAction{
Operation: "add",
Expand Down
12 changes: 12 additions & 0 deletions internal/humanitec/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ func TestScoreConvert(t *testing.T) {
},
Type: "some-type",
},
"route": {
Type: "route",
Params: map[string]interface{}{
"host": "${resources.dns.host}",
},
},
},
},
Extensions: &extensions.HumanitecExtensionsSpec{
Expand Down Expand Up @@ -410,6 +416,12 @@ func TestScoreConvert(t *testing.T) {
},
},
},
"route": map[string]interface{}{
"type": "route",
"params": map[string]interface{}{
"host": "${shared.dns.host}",
},
},
},
},
},
Expand Down

0 comments on commit 069dcdf

Please sign in to comment.