mirror of https://github.com/portainer/portainer
feat(container-creation): allow empty value for labels (#2655)
* Allow empty values for labels * Allow empty labels when creating containers from a templatepull/3397/head
parent
130c188717
commit
a41ca1fd46
|
@ -221,8 +221,13 @@ function ($q, $scope, $async, $state, $timeout, $transition$, $filter, Container
|
|||
function prepareLabels(config) {
|
||||
var labels = {};
|
||||
$scope.formValues.Labels.forEach(function (label) {
|
||||
if (label.name && label.value) {
|
||||
labels[label.name] = label.value;
|
||||
if (label.name) {
|
||||
if (label.value) {
|
||||
labels[label.name] = label.value;
|
||||
}
|
||||
else {
|
||||
labels[label.name] = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
config.Labels = labels;
|
||||
|
|
|
@ -52,8 +52,13 @@ angular.module('portainer.app')
|
|||
helper.updateContainerConfigurationWithLabels = function(labelsArray) {
|
||||
var labels = {};
|
||||
labelsArray.forEach(function (l) {
|
||||
if (l.name && l.value) {
|
||||
labels[l.name] = l.value;
|
||||
if (l.name) {
|
||||
if (l.value) {
|
||||
labels[l.name] = l.value;
|
||||
}
|
||||
else {
|
||||
labels[l.name] = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
return labels;
|
||||
|
|
Loading…
Reference in New Issue