Skip to content

Commit 5bada90

Browse files
committed
test/apiv2: fix registry push flake
In our CI env we use a special registries.conf file (test/registries.conf) to redirect some parts but it also defines: [[registry]] location="localhost:5000" insecure=true That means that port 5000 is trusted by default so the /v1.40/images/localhost:5000/myrepo/push?tag=mytag test in 12-imagesMore fails when the test registry uses port 5000. Example failure: not ok 360 [12-imagesMore] POST /v1.40/images/localhost:5000/myrepo/push?tag=mytag [-d {}] : status # expected: 500 # actual: 200 # response: {"status":"The push refers to repository [localhost:5000/myrepo:mytag]"} {"status":"mytag: digest: sha256:d40f8191d6dae366339e318d1004258022f56bd8c649720a72060fad20019c9d size: 758"} To avoid using port 5000 simply start at 5001. Signed-off-by: Paul Holzinger <[email protected]>
1 parent 1d06a1f commit 5bada90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/apiv2/test-apiv2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,12 @@ function stop_registry() {
603603
}
604604

605605
#################
606-
# random_port # Random open port; arg is range (min-max), default 5000-5999
606+
# random_port # Random open port; arg is range (min-max), default 5001-5999
607607
#################
608608
function random_port() {
609-
local range=${1:-5000-5999}
609+
# Note port 5001 is chosen because 5000 is trusted per test/registries.conf.
610+
# The tests try to push without SSL and that must fail so we cannot use that port.
611+
local range=${1:-5001-5999}
610612

611613
local port
612614
for port in $(shuf -i ${range}); do

0 commit comments

Comments
 (0)