Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename to --admin-enabled on update/create for acr operations #1276

Merged
merged 2 commits into from
Nov 11, 2016

Conversation

skkestrel
Copy link

@skkestrel skkestrel commented Nov 9, 2016

This PR renames --admin-user-enabled to --admin-enabled on create and update operations.

Usage:

  • az acr update -n ... [--admin-enabled true/false]
  • az acr create ... [--admin-enabled true/false]

Also removed short flags -a and -s in readme for update operation. Additionally, updates descriptions to match new swagger file.

@skkestrel skkestrel changed the title rename to --admin-enabled on update/create for acr operations [do not merge before #1269] rename to --admin-enabled on update/create for acr operations Nov 9, 2016
@skkestrel
Copy link
Author

Due to the interface update the tests added in #1269 will not work with this PR. Once #1269 is merged we will update this branch to include the changes to tests.

@tjprescott
Copy link
Member

@skkestrel #1269 has been merged.

@skkestrel skkestrel force-pushed the t-kezh/admin-flag branch 2 times, most recently from cd5f062 to dca0f0c Compare November 10, 2016 18:18
@skkestrel skkestrel changed the title [do not merge before #1269] rename to --admin-enabled on update/create for acr operations rename to --admin-enabled on update/create for acr operations Nov 10, 2016
@skkestrel
Copy link
Author

Tests have been updated to match with the changed flag, with a few other description changes to match Swagger.

@djyou djyou force-pushed the t-kezh/admin-flag branch from 0624617 to a6b1f3d Compare November 10, 2016 19:28
@yugangw-msft
Copy link
Contributor

CI known issue, should be fixed #1285. I am restarting it

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend highly you don't confuse your users by having two ways of updating a thing: the create command (which 'updates' by overwriting) and the update command (which patches).

show : Get a container registry.
update : Update a container registry.
check-name: Checks whether the container registry name is available for use.
create : Creates or updates a container registry with the specified parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I recognize the SDK call is "create_or_update", it will confuse users as to why you have a command called create that "creates or updates" and a command called update that just updates--and why they update differently. I would keep the help the same as it was--i.e. that it just creates (and you can then drop the 'with the specified parameters' part because that is implied in all commands).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agreed that it might be confusing to the user. This description was meant to match what the actual behavior is. If the user "creates" an existing registry with different properties, it is indeed an update, while in update command, all parameters are optional. VM has similar behaviors in their create command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't update so much as overwrite. Every create in the CLI that is backed by a PUT does the same thing, but we don't advertise that because it will confuse and/or frustrate users. Invariably someone will just use 'create' to update something and then be suprised when some optional parameter was thrown away instead of being left alone.


Create a container registry
-------------
::

Command
az acr create: Create a container registry.
az acr create: Creates or updates a container registry with the specified parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. I think this will confuse and frustrate more than help.

existing tags.

--name -n [Required]: The name of the container registry.
--admin-enabled : The value that indicates whether the admin user is enabled. Allowed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make this more concise. "Indicates whether the admin user is enabled."

enable_admin=False):
'''Create a container registry.
admin_enabled='false'):
'''Creates or updates a container registry with the specified parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. PUT doesn't really "update" so much as "overwrite existing", which is different from your actual update command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants