Skip to content

Commit 3d286e6

Browse files
committed
Fix detection of http pull urls
1 parent 51800fb commit 3d286e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ sync-images:
5959
- if: $CI_PIPELINE_SOURCE == "schedule"
6060
- if: $CI_MERGE_REQUEST_ID
6161
when: manual
62+
allow_failure: true
6263
tags:
6364
- libvirt
6465
script:
@@ -67,4 +68,3 @@ sync-images:
6768
- ./virter image pull $name $url
6869
- ./virter image push $name ${LINBIT_DOCKER_REGISTRY}/vm/${name}:latest
6970
- done < <(./virter image ls --available | tail -n +2)
70-
- ./virter image pull

cmd/image.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ func GetLocalImage(ctx context.Context, imageName string, source string, v *virt
114114
return nil, fmt.Errorf("unknown pull policy %s", policy)
115115
}
116116

117+
isHttpUrl := strings.HasPrefix(source, "http://") || strings.HasPrefix(source, "https://")
118+
117119
parsedRef, err := name.ParseReference(source, name.WithDefaultRegistry(""))
118-
if err != nil || parsedRef.Context().Registry.Name() == "" {
120+
if isHttpUrl || err != nil || parsedRef.Context().Registry.Name() == "" {
119121
log.Tracef("Source %s failed to parse or has no registry location, trying non-registry pull", source)
120122
return pullNonContainerRegistry(ctx, v, localName, source, p)
121123
}

0 commit comments

Comments
 (0)