Define tags on WorkerVersions from Docker images
https://redmine.teklia.com/issues/10404
Instance admins creating worker versions through the frontend without arkindex workers publish
and outside of any Git context need a way to get a tag
set on a WorkerVersion to get them to be recommended. As those versions will come with a Docker image, we can try to get this tag from the Docker image, without requiring them to write their own tags.
CreateWorkerVersion
already parses the Docker image to validate it with docker.utils.parse_repository_name
. This function returns a tuple of (repository, tag)
. When this tag
is a valid Python version according to packaging.version.parse
, it should be set as the WorkerVersion.tag
.
Explicitly setting "tag": None
in the API should inhibit this behavior, to still allow creating versions without tags.