Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions parsers/manifest_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,13 @@ func (dm *YAMLParser) composePackageInputs(projectInputs map[string]Parameter, r
}
// if value is set to default value for its type,
// check for input key being an env. variable itself
if value == getTypeDefaultValue(i.Type) {
if safeCompare(value, getTypeDefaultValue(i.Type)) {
value = wskenv.InterpolateStringWithEnvVar("${" + name + "}")
}

// if at this point, still value is set to default value of its type
// check if input key is defined under Project Inputs
if value == getTypeDefaultValue(i.Type) {
if safeCompare(value, getTypeDefaultValue(i.Type)) {
if i.Type == STRING && i.Value != nil {
n := wskenv.GetEnvVarName(i.Value.(string))
if v, ok := projectInputs[n]; ok {
Expand Down Expand Up @@ -1504,3 +1504,9 @@ func isGatewayBasePathValid(basePath string) bool {
}
return true
}

func safeCompare(a interface{}, b interface{}) bool {
aa, _ := json.Marshal(a)
bb, _ := json.Marshal(b)
return (string(aa) == string(bb))
}