mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-30 05:59:39 +02:00
including container names when no conditions (#3733)
Co-authored-by: anilkeshav27 <you@example.com>
This commit is contained in:
parent
7e0ec525bf
commit
3c08a3bd7a
@ -40,6 +40,13 @@ func consolidateContextDefaults(stepData *config.StepData) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for paramName, val := range containerParams {
|
||||
if _, ok := paramConditions[paramName]; !ok {
|
||||
paramConditions[paramName] = &conditionDefaults{}
|
||||
}
|
||||
paramConditions[paramName].equal = append(paramConditions[paramName].equal, conditionDefault{def: val})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,12 @@ func formatDefault(param config.StepParameters, stepParameterNames []string) str
|
||||
defaults := []string{}
|
||||
for _, condDef := range v {
|
||||
//ToDo: add type-specific handling of default
|
||||
defaults = append(defaults, fmt.Sprintf("%v=`%v`: `%v`", condDef.key, condDef.value, condDef.def))
|
||||
if len(condDef.key) > 0 && len(condDef.value) > 0 {
|
||||
defaults = append(defaults, fmt.Sprintf("%v=`%v`: `%v`", condDef.key, condDef.value, condDef.def))
|
||||
} else {
|
||||
// containers with no condition will only hold def
|
||||
defaults = append(defaults, fmt.Sprintf("`%v`", condDef.def))
|
||||
}
|
||||
}
|
||||
return strings.Join(defaults, "<br />")
|
||||
case []interface{}:
|
||||
|
Loading…
x
Reference in New Issue
Block a user