mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(container-creation): allow empty value for labels (#2655)
* Allow empty values for labels * Allow empty labels when creating containers from a template
This commit is contained in:
parent
130c188717
commit
a41ca1fd46
2 changed files with 14 additions and 4 deletions
|
@ -221,8 +221,13 @@ function ($q, $scope, $async, $state, $timeout, $transition$, $filter, Container
|
||||||
function prepareLabels(config) {
|
function prepareLabels(config) {
|
||||||
var labels = {};
|
var labels = {};
|
||||||
$scope.formValues.Labels.forEach(function (label) {
|
$scope.formValues.Labels.forEach(function (label) {
|
||||||
if (label.name && label.value) {
|
if (label.name) {
|
||||||
labels[label.name] = label.value;
|
if (label.value) {
|
||||||
|
labels[label.name] = label.value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
labels[label.name] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
config.Labels = labels;
|
config.Labels = labels;
|
||||||
|
|
|
@ -52,8 +52,13 @@ angular.module('portainer.app')
|
||||||
helper.updateContainerConfigurationWithLabels = function(labelsArray) {
|
helper.updateContainerConfigurationWithLabels = function(labelsArray) {
|
||||||
var labels = {};
|
var labels = {};
|
||||||
labelsArray.forEach(function (l) {
|
labelsArray.forEach(function (l) {
|
||||||
if (l.name && l.value) {
|
if (l.name) {
|
||||||
labels[l.name] = l.value;
|
if (l.value) {
|
||||||
|
labels[l.name] = l.value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
labels[l.name] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return labels;
|
return labels;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue