-
Notifications
You must be signed in to change notification settings - Fork 877
Cannot correctly guess image type from name of format: image-name-with-hyphens:some_hash #3326
Description
Environment
systemctl: command not found
rkt Version: 1.15.0
appc Version: 0.8.7
Go Version: go1.7.1
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL
--
Linux 4.4.0-45-generic x86_64
--
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
--
What did you do?
sudo rkt --debug run stripe-internal-henson-test-subject:f6432b725a9a5f27eaecfa47a0cbab3c0ea00f22 --exec /bin/bash
image: using image from local store for image name coreos.com/rkt/stage1-coreos:1.15.0
run:
└─an unsupported URL scheme "stripe-internal-henson-test-subject" - the only URL schemes supported by rkt are docker, http, https and file
What did you expect to see?
I expected it to start a container.
What did you see instead?
It emitted an error.
This is because url.Parse() is a little screwy when you pass it an argument that includes a string with hyphens followed by a colon. The hash/tag bit at the end of the image name doesn't matter. See these two play.golangs:
https://play.golang.org/p/Ov1sddryW0
and
https://play.golang.org/p/1nSGYoAg13
If there is a list of supported URL schemes, then we should perhaps check for one of those here, instead of just making sure that URL scheme is not "":
This works with images that have /'s in them, because the url.Scheme ends up coming back as "", and so you proceed on to detect it as an image name. But, because this has a : in it and no /, it ends up being detected, basically, as a bare url scheme, because it's at the beginning of the string.