Commit 71cb1a0d ("azurecr: Change namespace from canonical to ubuntu")
changed ACR namespace to Ubuntu. It changed ditionary key from canonical
to ubuntu, which replaced previous key with other registries and so
validation of docker and aws namespaces failed. Fix that by properly
constructing regex for ubuntu namespace.
On new release day and some time after when there's no new devel entry
in /usr/share/distro-info/ubuntu.csv, "distro-info --devel" fails with
"Distribution data outdated." error message. In that case keep
DISTRONAME_DEVEL empty and continue.
Support for Azure is added to most* of the scripts. For scripts to work
with Azure, az tool from azure-cli[1] package must be present in PATH.
Aside from usage strings, the scripts are not changed. The support is
added as specialization of generic functions in lib/ and helpers/.
Dockerfile is also updated to install azure-cli from Microsoft
repository.
* push-images.sh script is not updated as it needs bigger rewrite. It
doesn't use functions in lib/ and helpers/.
Currently the URL is constructed from $REGISTRY_URL and $NAMESPACE. This
works on Docker Hub and AWS ECR. However, in Azure CR, the namespace is
subdomain of azurecr.io. Base all API calls on $REGISTRY_NAMESPACE_URL
instead which is constructed in respective _login_$REGISTRY_registry1.
Put supported registries and namespaces into dictionary
Validation functions worked with data, registries and namespaces,
hardcoded. To simplify adding more registries and namespaces, put them
into single dictionary. The dictionary maps namespace names into
registry regexes.
print_manifest_for_image(): proper cleanup and return
The trap is replaced on each call of the function, so previously created
temporary files are not removed. Also on error return value is still 0.
Instead of checking for HTTP status, let the curl fail on non-success
status by passing -f switch.