mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(templates): support env variables with default value (#161)
This commit is contained in:
parent
71eb3feac9
commit
4827d33ca1
2 changed files with 5 additions and 4 deletions
|
@ -72,8 +72,9 @@ function createConfigFromTemplate(template) {
|
|||
};
|
||||
if (template.env) {
|
||||
template.env.forEach(function (v) {
|
||||
if (v.value) {
|
||||
containerConfig.Env.push(v.name + "=" + v.value);
|
||||
if (v.value || v.default) {
|
||||
var val = v.default ? v.default : v.value;
|
||||
containerConfig.Env.push(v.name + "=" + val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue