mirror of
https://github.com/portainer/portainer.git
synced 2025-07-27 17:29:39 +02:00
feat(templates): add labels to container template (#1538)
This commit is contained in:
parent
f8c7ee7ae6
commit
03f6cc0acf
5 changed files with 53 additions and 2 deletions
|
@ -18,7 +18,8 @@ angular.module('portainer.helpers')
|
|||
Privileged: false,
|
||||
ExtraHosts: []
|
||||
},
|
||||
Volumes: {}
|
||||
Volumes: {},
|
||||
Labels: {}
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -46,6 +47,16 @@ angular.module('portainer.helpers')
|
|||
return portConfiguration;
|
||||
};
|
||||
|
||||
helper.updateContainerConfigurationWithLabels = function(labelsArray) {
|
||||
var labels = {};
|
||||
labelsArray.forEach(function (l) {
|
||||
if (l.name && l.value) {
|
||||
labels[l.name] = l.value;
|
||||
}
|
||||
});
|
||||
return labels;
|
||||
};
|
||||
|
||||
helper.EnvToStringArray = function(templateEnvironment, containerMapping) {
|
||||
var env = [];
|
||||
templateEnvironment.forEach(function(envvar) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue