Hello community, here is the log from the commit of package azure-cli-acr for openSUSE:Factory checked in at 2018-05-13 16:00:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-acr (Old) and /work/SRC/openSUSE:Factory/.azure-cli-acr.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-acr" Sun May 13 16:00:57 2018 rev:3 rq:600029 version:2.0.23 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-acr/azure-cli-acr.changes 2018-02-14 09:29:25.684250041 +0100 +++ /work/SRC/openSUSE:Factory/.azure-cli-acr.new/azure-cli-acr.changes 2018-05-13 16:01:01.211186177 +0200 @@ -1,0 +2,7 @@ +Tue Apr 17 13:26:34 UTC 2018 - [email protected] + +- New upstream release + + Version 2.0.23 +- Move LICENSE.txt from %doc to %license section + +------------------------------------------------------------------- Old: ---- azure-cli-acr-2.0.20.tar.gz New: ---- azure-cli-acr-2.0.23.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-acr.spec ++++++ --- /var/tmp/diff_new_pack.QBt40n/_old 2018-05-13 16:01:01.935159763 +0200 +++ /var/tmp/diff_new_pack.QBt40n/_new 2018-05-13 16:01:01.939159618 +0200 @@ -17,7 +17,7 @@ Name: azure-cli-acr -Version: 2.0.20 +Version: 2.0.23 Release: 0 Summary: Microsoft Azure CLI 'acr' Command Module License: MIT @@ -66,7 +66,8 @@ %files %defattr(-,root,root,-) -%doc HISTORY.rst LICENSE.txt README.rst +%doc HISTORY.rst README.rst +%license LICENSE.txt %{python3_sitelib}/azure/cli/command_modules/acr %{python3_sitelib}/azure_cli_acr-*.egg-info ++++++ azure-cli-acr-2.0.20.tar.gz -> azure-cli-acr-2.0.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/HISTORY.rst new/azure-cli-acr-2.0.23/HISTORY.rst --- old/azure-cli-acr-2.0.20/HISTORY.rst 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/HISTORY.rst 2018-04-06 19:33:13.000000000 +0200 @@ -2,6 +2,22 @@ Release History =============== + +2.0.23 +++++++ +* Improve error handling of wincred fallback. +* `sdist` is now compatible with wheel 0.31.0 + +2.0.22 +++++++ +* Improve repository delete command with --image parameter to support docker image format. +* Deprecate --manifest and --tag parameters in repository delete command. +* Add acr repository untag command to remove a tag without deleting data. + +2.0.21 +++++++ +* Minor fixes + 2.0.20 ++++++ * minor fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/PKG-INFO new/azure-cli-acr-2.0.23/PKG-INFO --- old/azure-cli-acr-2.0.20/PKG-INFO 2018-01-26 17:12:53.000000000 +0100 +++ new/azure-cli-acr-2.0.23/PKG-INFO 2018-04-06 19:33:49.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: azure-cli-acr -Version: 2.0.20 +Version: 2.0.23 Summary: Microsoft Azure Command-Line Tools ACR Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT +Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'acr' Command Module ======================================== @@ -17,6 +18,22 @@ Release History =============== + + 2.0.23 + ++++++ + * Improve error handling of wincred fallback. + * `sdist` is now compatible with wheel 0.31.0 + + 2.0.22 + ++++++ + * Improve repository delete command with --image parameter to support docker image format. + * Deprecate --manifest and --tag parameters in repository delete command. + * Add acr repository untag command to remove a tag without deleting data. + + 2.0.21 + ++++++ + * Minor fixes + 2.0.20 ++++++ * minor fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/_help.py new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/_help.py --- old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/_help.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/_help.py 2018-04-06 19:33:13.000000000 +0200 @@ -99,7 +99,8 @@ helps['acr login'] = """ type: command - short-summary: Log in to a container registry through Docker. + short-summary: Log in to a container registry through the Docker CLI. + long-summary: Docker must be installed on your machine. examples: - name: Log in to a container registry text: > @@ -168,24 +169,27 @@ helps['acr repository delete'] = """ type: command - short-summary: Delete a repository, manifest, or tag in a container registry. - parameters: - - name: --manifest - populator-commands: - - az acr repository show-manifests + short-summary: Delete a repository or image in a container registry. examples: - name: Delete a repository from a container registry. text: - az acr repository delete -n MyRegistry --repository MyRepository - - name: Delete a tag from a repository. This does not delete the manifest referenced by the tag or any associated layer data. + az acr repository delete -n MyRegistry --repository hello-world + - name: Delete an image by tag. This deletes the manifest referenced by 'hello-world:latest', all other tags referencing the manifest, and any associated layer data. text: - az acr repository delete -n MyRegistry --repository MyRepository --tag MyTag - - name: Delete the manifest referenced by a tag. This also deletes any associated layer data and all other tags referencing the manifest. + az acr repository delete -n MyRegistry --image hello-world:latest + - name: Delete an image by sha256-based manifest digest. This deletes all tags referencing the manifest and any associated layer data. text: - az acr repository delete -n MyRegistry --repository MyRepository --tag MyTag --manifest - - name: Delete a manifest using a sha256 based digest. This also deletes any associated layer data and all tags referencing the manifest. + az acr repository delete -n MyRegistry --image hello-world@sha256:abc123 +""" + +helps['acr repository untag'] = """ + type: command + short-summary: Untag an image in a container registry. + long-summary: This command does not delete the manifest referenced by the tag or any associated layer data. + examples: + - name: Untag an image from a repository. text: - az acr repository delete -n MyRegistry --repository MyRepository --manifest sha256:abc123 + az acr repository untag -n MyRegistry --image hello-world:latest """ helps['acr webhook list'] = """ @@ -201,10 +205,10 @@ type: command short-summary: Create a webhook for a container registry. examples: - - name: Create a webhook for a container registry that will deliver Docker push and delete events to a service URI. + - name: Create a webhook for a container registry that will deliver docker push and delete events to a service URI. text: > az acr webhook create -n MyWebhook -r MyRegistry --uri http://myservice.com --actions push delete - - name: Create a webhook for a container registry that will deliver Docker push events to a service URI with a basic authentication header. + - name: Create a webhook for a container registry that will deliver docker push events to a service URI with a basic authentication header. text: > az acr webhook create -n MyWebhook -r MyRegistry --uri http://myservice.com --actions push --headers "Authorization=Basic 000000" """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/_params.py new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/_params.py --- old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/_params.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/_params.py 2018-04-06 19:33:13.000000000 +0200 @@ -4,6 +4,8 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long +import argparse + from azure.cli.core.commands.parameters import ( resource_group_name_type, get_location_type, @@ -44,10 +46,14 @@ c.argument('admin_enabled', help='Indicates whether the admin user is enabled', choices=['true', 'false']) with self.argument_context('acr repository delete') as c: - c.argument('manifest', nargs='?', required=False, const='', default=None, help='The sha256 based digest of manifest to delete') + c.argument('manifest', nargs='?', required=False, const='', default=None, help=argparse.SUPPRESS) c.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation') - c.argument('repository', help='The name of the repository to delete.') - c.argument('tag', help='The name of tag to delete') + c.argument('repository', help="The name of the repository to delete") + c.argument('tag', help=argparse.SUPPRESS) + c.argument('image', help="The name of the image to delete. May include a tag in the format 'name:tag' or digest in the format 'name@digest'.") + + with self.argument_context('acr repository untag') as c: + c.argument('image', help="The name of the image to untag. May include a tag in the format 'name:tag'.") with self.argument_context('acr repository show-manifests') as c: c.argument('repository', help='The repository to obtain manifests from.') @@ -67,8 +73,8 @@ c.argument('registry_name', options_list=['--registry', '-r'], help='The name of the container registry. You can configure the default registry name using `az configure --defaults acr=<registry name>`', completer=get_resource_name_completion_list(REGISTRY_RESOURCE_TYPE), configured_default='acr') c.argument('webhook_name', options_list=['--name', '-n'], help='The name of the webhook', completer=get_resource_name_completion_list(WEBHOOK_RESOURCE_TYPE)) c.argument('uri', help='The service URI for the webhook to post notifications.') - c.argument('headers', nargs='+', help="Space separated custom headers in 'key[=value]' format that will be added to the webhook notifications. Use {} to clear existing headers.".format(quotes), validator=validate_headers) - c.argument('actions', nargs='+', help='Space separated list of actions that trigger the webhook to post notifications.', choices=['push', 'delete']) + c.argument('headers', nargs='+', help="Space-separated custom headers in 'key[=value]' format that will be added to the webhook notifications. Use {} to clear existing headers.".format(quotes), validator=validate_headers) + c.argument('actions', nargs='+', help='Space-separated list of actions that trigger the webhook to post notifications.', choices=['push', 'delete']) c.argument('status', help='Indicates whether the webhook is enabled.', choices=['enabled', 'disabled']) c.argument('scope', help="The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means events for all repositories.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/commands.py new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/commands.py --- old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/commands.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/commands.py 2018-04-06 19:33:13.000000000 +0200 @@ -64,6 +64,7 @@ g.command('show-tags', 'acr_repository_show_tags') g.command('show-manifests', 'acr_repository_show_manifests') g.command('delete', 'acr_repository_delete') + g.command('untag', 'acr_repository_untag') with self.command_group('acr webhook', acr_webhook_util) as g: g.command('list', 'acr_webhook_list') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/custom.py new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/custom.py --- old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/custom.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/custom.py 2018-04-06 19:33:13.000000000 +0200 @@ -59,6 +59,9 @@ admin_user_enabled = admin_enabled == 'true' if sku == SkuName.classic.value: + logger.warning( + "Due to the planned deprecation of the Classic registry SKU, we recommend using " + "Basic, Standard, or Premium for all new registries. See https://aka.ms/acr/skus for details.") if storage_account_name is None: storage_account_name = random_storage_account_name(cmd.cli_ctx, registry_name) logger.warning( @@ -104,17 +107,7 @@ deployment_name) ) - registry = client.get(resource_group_name, registry_name) - logger.warning('\nCreate a new service principal and assign access:') - logger.warning( - ' az ad sp create-for-rbac --scopes %s --role Owner --password <password>', - registry.id) # pylint: disable=no-member - logger.warning('\nUse an existing service principal and assign access:') - logger.warning( - ' az role assignment create --scope %s --role Owner --assignee <app-id>', - registry.id) # pylint: disable=no-member - - return registry + return client.get(resource_group_name, registry_name) def acr_delete(cmd, client, registry_name, resource_group_name=None): @@ -257,7 +250,8 @@ if platform.system() == 'Windows': import json from os.path import expanduser, isfile, join - config_path = join(expanduser('~'), '.docker', 'config.json') + docker_directory = join(expanduser('~'), '.docker') + config_path = join(docker_directory, 'config.json') logger.debug("Docker config file path %s", config_path) if isfile(config_path): with open(config_path) as input_file: @@ -275,18 +269,23 @@ with open(config_path, 'w') as output_file: json.dump(content, output_file, indent=4) output_file.close() - return True + return True return False except NoTTYException: return False # Don't update config file or retry as this doesn't seem to be a wincred issue return False else: + import os content = { "auths": { login_server: {} } } + try: + os.makedirs(docker_directory) + except OSError: + pass with open(config_path, 'w') as output_file: json.dump(content, output_file, indent=4) output_file.close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/repository.py new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/repository.py --- old/azure-cli-acr-2.0.20/azure/cli/command_modules/acr/repository.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure/cli/command_modules/acr/repository.py 2018-04-06 19:33:13.000000000 +0200 @@ -21,8 +21,9 @@ logger = get_logger(__name__) -DELETE_NOT_SUPPORTED = 'Delete is not supported for registries in Basic SKU.' -LIST_MANIFESTS_NOT_SUPPORTED = 'List manifests is not supported for registries in Basic SKU.' +UNTAG_NOT_SUPPORTED = 'Untag is only supported for managed registries.' +DELETE_NOT_SUPPORTED = 'Delete is only supported for managed registries.' +LIST_MANIFESTS_NOT_SUPPORTED = 'List manifests is only supported for managed registries.' def _get_basic_auth_str(username, password): @@ -228,15 +229,136 @@ result_index='manifests') +def acr_repository_untag(cmd, + registry_name, + image, + resource_group_name=None, + username=None, + password=None): + _, resource_group_name = validate_managed_registry( + cmd.cli_ctx, registry_name, resource_group_name, UNTAG_NOT_SUPPORTED) + + repository, tag, _ = _parse_image_name(image) + + login_server, username, password = get_access_credentials( + cli_ctx=cmd.cli_ctx, + registry_name=registry_name, + resource_group_name=resource_group_name, + username=username, + password=password, + repository=repository, + permission='*') + + return _delete_data_from_registry( + login_server=login_server, + path='/v2/_acr/{}/tags/{}'.format(repository, tag), + username=username, + password=password) + + def acr_repository_delete(cmd, registry_name, - repository, + repository=None, + image=None, tag=None, manifest=None, resource_group_name=None, username=None, password=None, yes=False): + if bool(repository) == bool(image): + raise CLIError('Usage error: --image IMAGE | --repository REPOSITORY') + + # Check if this is a legacy command. --manifest can be used as a flag so None is checked. + if repository and (tag or manifest is not None): + return _legacy_delete(cmd=cmd, + registry_name=registry_name, + repository=repository, + tag=tag, + manifest=manifest, + resource_group_name=resource_group_name, + username=username, + password=password, + yes=yes) + + # At this point the specified command must not be a legacy command so we process it as a new command. + # If --tag/--manifest are specified with --repository, it's a legacy command handled above. + # If --tag/--manifest are specified with --image, error out here. + if tag: + raise CLIError("The parameter --tag is redundant and deprecated. Please use --image to delete an image.") + if manifest is not None: + raise CLIError("The parameter --manifest is redundant and deprecated. Please use --image to delete an image.") + + _, resource_group_name = validate_managed_registry( + cmd.cli_ctx, registry_name, resource_group_name, DELETE_NOT_SUPPORTED) + + if image: + # If --image is specified, repository/tag/manifest must be empty. + repository, tag, manifest = _parse_image_name(image, allow_digest=True) + + login_server, username, password = get_access_credentials( + cli_ctx=cmd.cli_ctx, + registry_name=registry_name, + resource_group_name=resource_group_name, + username=username, + password=password, + repository=repository, + permission='*') + + if tag or manifest: + manifest = _delete_manifest_confirmation( + login_server=login_server, + username=username, + password=password, + repository=repository, + tag=tag, + manifest=manifest, + yes=yes) + path = '/v2/{}/manifests/{}'.format(repository, manifest) + else: + _user_confirmation("Are you sure you want to delete the repository '{}' " + "and all images under it?".format(repository), yes) + path = '/v2/_acr/{}/repository'.format(repository) + + return _delete_data_from_registry( + login_server=login_server, + path=path, + username=username, + password=password) + + +def _parse_image_name(image, allow_digest=False): + if allow_digest and '@' in image: + # This is probably an image name by manifest digest + tokens = image.split('@') + if len(tokens) == 2: + return tokens[0], None, tokens[1] + + if ':' in image: + # This is probably an image name by tag + tokens = image.split(':') + if len(tokens) == 2: + return tokens[0], tokens[1], None + else: + # This is probably an image with implicit latest tag + return image, 'latest', None + + if allow_digest: + raise CLIError("The name of the image to delete may include a tag in the" + " format 'name:tag' or digest in the format 'name@digest'.") + else: + raise CLIError("The name of the image may include a tag in the format 'name:tag'.") + + +def _legacy_delete(cmd, + registry_name, + repository, + tag=None, + manifest=None, + resource_group_name=None, + username=None, + password=None, + yes=False): _, resource_group_name = validate_managed_registry( cmd.cli_ctx, registry_name, resource_group_name, DELETE_NOT_SUPPORTED) @@ -258,6 +380,10 @@ "and all images under it?".format(repository), yes) path = '/v2/_acr/{}/repository'.format(repository) else: + logger.warning( + "This command is deprecated. The new command for this operation " + "is 'az acr repository untag --name %s --image %s:%s'.", + registry_name, repository, tag) _user_confirmation("Are you sure you want to delete the tag '{}:{}'?".format(repository, tag), yes) path = '/v2/_acr/{}/tags/{}'.format(repository, tag) # If --manifest is specified as a flag @@ -265,6 +391,10 @@ # Raise if --tag is empty if not tag: raise CLIError(_INVALID) + logger.warning( + "This command is deprecated. The new command for this operation " + "is 'az acr repository delete --name %s --image %s:%s'.", + registry_name, repository, tag) manifest = _delete_manifest_confirmation( login_server=login_server, username=username, @@ -279,6 +409,10 @@ # Raise if --tag is not empty if tag: raise CLIError(_INVALID) + logger.warning( + "This command is deprecated. The new command for this operation " + "is 'az acr repository delete --name %s --image %s@%s'.", + registry_name, repository, manifest) manifest = _delete_manifest_confirmation( login_server=login_server, username=username, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/azure_cli_acr.egg-info/PKG-INFO new/azure-cli-acr-2.0.23/azure_cli_acr.egg-info/PKG-INFO --- old/azure-cli-acr-2.0.20/azure_cli_acr.egg-info/PKG-INFO 2018-01-26 17:12:53.000000000 +0100 +++ new/azure-cli-acr-2.0.23/azure_cli_acr.egg-info/PKG-INFO 2018-04-06 19:33:49.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: azure-cli-acr -Version: 2.0.20 +Version: 2.0.23 Summary: Microsoft Azure Command-Line Tools ACR Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT +Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'acr' Command Module ======================================== @@ -17,6 +18,22 @@ Release History =============== + + 2.0.23 + ++++++ + * Improve error handling of wincred fallback. + * `sdist` is now compatible with wheel 0.31.0 + + 2.0.22 + ++++++ + * Improve repository delete command with --image parameter to support docker image format. + * Deprecate --manifest and --tag parameters in repository delete command. + * Add acr repository untag command to remove a tag without deleting data. + + 2.0.21 + ++++++ + * Minor fixes + 2.0.20 ++++++ * minor fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-acr-2.0.20/setup.py new/azure-cli-acr-2.0.23/setup.py --- old/azure-cli-acr-2.0.20/setup.py 2018-01-26 17:12:23.000000000 +0100 +++ new/azure-cli-acr-2.0.23/setup.py 2018-04-06 19:33:13.000000000 +0200 @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.20" +VERSION = "2.0.23" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers',
