mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-30 08:59:54 +03:00
fix(custom-labels): history fails on images with no labels
This commit is contained in:
parent
ba2e0b119e
commit
f826381681
1 changed files with 8 additions and 7 deletions
|
@ -180,7 +180,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
};
|
};
|
||||||
|
|
||||||
const getConfig = function (blobs, { historyCustomLabels }) {
|
const getConfig = function (blobs, { historyCustomLabels }) {
|
||||||
console.log(this);
|
|
||||||
const res = [
|
const res = [
|
||||||
'architecture',
|
'architecture',
|
||||||
'User',
|
'User',
|
||||||
|
@ -212,12 +211,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
delete res.Labels.maintainer;
|
delete res.Labels.maintainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
historyCustomLabels
|
if (res.Labels) {
|
||||||
.filter((label) => res.Labels[label])
|
historyCustomLabels
|
||||||
.forEach((label) => {
|
.filter((label) => res.Labels[label])
|
||||||
res[`custom-label-${label}`] = res.Labels[label];
|
.forEach((label) => {
|
||||||
delete res.Labels[label];
|
res[`custom-label-${label}`] = res.Labels[label];
|
||||||
});
|
delete res.Labels[label];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue