mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-26 15:09:53 +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 }) {
|
||||
console.log(this);
|
||||
const res = [
|
||||
'architecture',
|
||||
'User',
|
||||
|
@ -212,12 +211,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
delete res.Labels.maintainer;
|
||||
}
|
||||
|
||||
historyCustomLabels
|
||||
.filter((label) => res.Labels[label])
|
||||
.forEach((label) => {
|
||||
res[`custom-label-${label}`] = res.Labels[label];
|
||||
delete res.Labels[label];
|
||||
});
|
||||
if (res.Labels) {
|
||||
historyCustomLabels
|
||||
.filter((label) => res.Labels[label])
|
||||
.forEach((label) => {
|
||||
res[`custom-label-${label}`] = res.Labels[label];
|
||||
delete res.Labels[label];
|
||||
});
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue