docker: parse registry also
This commit is contained in:
@@ -690,8 +690,10 @@ function parseImageRef(ref) {
|
||||
// a ref is like registry.docker.com/cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4
|
||||
// registry.docker.com is registry name . cloudron is namespace . base is image name . cloudron/base is repository path
|
||||
// registry.docker.com/cloudron/base is fullRepositoryName
|
||||
const result = { fullRepositoryName: null, tag: null, digest: null };
|
||||
const result = { fullRepositoryName: null, registry: null, tag: null, digest: null };
|
||||
result.fullRepositoryName = ref.split(/[:@]/)[0];
|
||||
const parts = result.fullRepositoryName.split('/');
|
||||
result.registry = parts.length === 3 ? parts[0] : null;
|
||||
let remaining = ref.substr(result.fullRepositoryName.length);
|
||||
if (remaining.startsWith(':')) {
|
||||
result.tag = remaining.substr(1).split('@', 1)[0];
|
||||
|
||||
Reference in New Issue
Block a user