conu
conu copied to clipboard
dockerbackend.Image eats tag
In [9]: image = db.ImageClass(im)
13:29:31.985 image.py DEBUG pull policy set to 'if_not_present' and image is not present, pulling the image
13:29:32.484 image.py DEBUG {'status': 'Trying to pull repository registry.fedoraproject.org/fedora ... '}
13:29:32.484 image.py INFO Trying to pull repository registry.fedoraproject.org/fedora ...
13:29:36.710 image.py DEBUG {'status': 'Pulling from registry.fedoraproject.org/fedora', 'id': 'sha256:a91e9da91a6d39386e98685e91e8ccbd35197a91f29516fca0392de2bb93
82a7'}
13:29:36.711 image.py INFO Pulling from registry.fedoraproject.org/fedora
13:29:37.695 image.py DEBUG {'status': 'Pulling fs layer', 'progressDetail': {}, 'id': '7aee9caab031'}
13:29:37.695 image.py INFO Pulling fs layer
13:29:38.677 image.py DEBUG {'status': 'Downloading', 'progressDetail': {'current': 539815, 'total': 89937508}, 'progress': '[>
] 539.8 kB/89.94 MB', 'id': '7aee9caab031'}
13:29:38.678 image.py INFO Downloading
...
In [10]: im
Out[10]: 'registry.fedoraproject.org/fedora:29'
Maybe we should either error out if there is :
in image name; or parse it and use and error out in case tag param is set and there is tag in the name.
But anyway, when I set tag in the image name, conu should not eat it.
Suggestions are welcome.
Edit: yeah, and the image instance is completely unusable:
ImageNotFound: 404 Client Error: Not Found ("No such image: registry.fedoraproject.org/fedora:29:latest")
Edit 2: TODO:
- [ ] if there is
:
in image name: parse it - [ ] if there is
:
in image name and tag param is also set, raise an exception - [ ] utilize code from colin to parse the image name, Franta mentioned it in his comment.
- [ ] write good tests for this
Maybe we should either error out if there is : in image name; or parse it and use and error out in case tag param is set and there is tag in the name.
I think this approach is perfect.
Is the tag being mentioned as name:tag
a standard thing for all container technologies, or is just a docker thing? If it is a standard thing, then it could implemented in the apidefs
, otherwise implementing it only in the DockerBackend
would be better.
Good (and hopefully well tested) parsing we have in the colin. The plan was to move that code to conu.
@SkullTech AFAIK all the container runtimes utilize images names and tags, so we can totally put ti to apidefs
Gentlemen, thanks for feedback, I updated the original post with TODO for this one.