aliyun-cli icon indicating copy to clipboard operation
aliyun-cli copied to clipboard

Aliyun CLI - Pull images from enterprise ECR

Open rogerioefonseca opened this issue 5 years ago • 8 comments

We are trying to use Aliyun with the Alicloud Container Registry Enterprise edition and it is actually working but the Aliyun CLI is not updated with the latest API options, so in there NEither the --InstanceId, nor the --force nor the --version nor the --endpoint is listed on the GetAuthorizationToken help command, and we should not force a skip of "api and parameters check" or force the api version as this sounds like something that could cause issues`

rogerioefonseca avatar Jun 18 '20 16:06 rogerioefonseca

cli only stores information about specific versions of APIs, so it is not possible to check parameters for parameters of other versions. The --force, --version, --endpoint options have nothing to do with the interface, and belong to the global behavior options of cli. Under a specific interface, the help command only displays the parameters of the interface, you can directly run aliyun to get the option of cli behavior.

night556 avatar Jun 19 '20 02:06 night556

Fair enough, so the parameters are documented, we just didn't see them. But why do we have to use the --force flag in order to get credentials for the Alicloud Container Registry Enterprise Edition?

aschleifer avatar Jun 19 '20 08:06 aschleifer

If the interface or parameter you call is not recorded in cli, cli will return an error. At this time, you must use --force to skip the check of cli. As you described, the parameters of the Enterprise Edition are not recorded in the cli, so you need to use the --force option.

night556 avatar Jun 19 '20 10:06 night556

Hm this sounds like a design error for me. And the error message you get for this is very unclear.

aschleifer avatar Jun 19 '20 10:06 aschleifer

Regarding to the --version, how would I know what API version should I use? I was not able to see it in the CLI documentation.

rogerioefonseca avatar Jun 22 '20 07:06 rogerioefonseca

You can use aliyun <product> help to check the version. For example:

$ aliyun ecs help
Alibaba Cloud Command Line Interface Version 3.0.45

Usage:
  aliyun Ecs <ApiName> --parameter1 value1 --parameter2 value2 ...

Product: Ecs (Elastic Compute Service)
Version: 2014-05-26 
Link: https://help.aliyun.com/api/ecs

# Omit other output

night556 avatar Jun 22 '20 08:06 night556

Please add support like aliyun cr-ee xxx without --force, thanks.

yongzhang avatar Nov 27 '20 07:11 yongzhang

I just re-tested this and it works now without --force --endpoint=xxx --version=xxx.

@rogerioefonseca you can close this issue now.

aschleifer avatar Jan 31 '23 09:01 aschleifer