mirror of https://github.com/portainer/portainer
fix(images): fix the way the registry and image name are extracted fr… (#1099)
* fix(images): fix the way the registry and image name are extracted from a repositorypull/1101/head
parent
12adeadc94
commit
d7769dec33
|
@ -8,10 +8,15 @@ angular.module('portainer.helpers')
|
||||||
var slashCount = _.countBy(repository)['/'];
|
var slashCount = _.countBy(repository)['/'];
|
||||||
var registry = null;
|
var registry = null;
|
||||||
var image = repository;
|
var image = repository;
|
||||||
if (slashCount > 1) {
|
if (slashCount >= 1) {
|
||||||
// assume something/some/thing[/...]
|
// assume something/something[/...]
|
||||||
registry = repository.substr(0, repository.indexOf('/'));
|
registry = repository.substr(0, repository.indexOf('/'));
|
||||||
image = repository.substr(repository.indexOf('/') + 1);
|
// assume valid DNS name or IP (contains at least one '.')
|
||||||
|
if (_.countBy(registry)['.'] > 0) {
|
||||||
|
image = repository.substr(repository.indexOf('/') + 1);
|
||||||
|
} else {
|
||||||
|
registry = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue