The reason of the issues 1 and 2 is the desire to help a user if they specified application_name or application_name.instance_name instead of instance_name. It results in inability to use some instance names in some commands which are (likely) supported by any other command. We need to
allow a user to use such names
after verifying that any other command is fine with that.
To preserve existing helpful error messages in case user really specified application_name or application_name.instance_name instead of instance_name (which is rather often), we'll need to rework our approach. If user had provided an invalid info, the command should fail. And if the command had failed,
we additionally check if they had specified application_name or application_name.instance_name instead of instance_name and, if they are, add this info to error message.
Regarding issue 3, we may simply
start to skip duplicate names instead of throwing an error,
but, since there are no such request from customers yet, we may ignore this one for now.
1. Application name as instance name
Now we don't support instance names which coincide with application names:
2. Instance name with dots
The reason is this code in
GetInstancesFromArgs
method: https://github.com/tarantool/cartridge-cli/blob/80f0f6374c320e36806e247c406a49665fc41e57/cli/common/utils.go#L385-L387We also do not support instance names with dots:
The reason is this code in
GetInstancesFromArgs
method: https://github.com/tarantool/cartridge-cli/blob/80f0f6374c320e36806e247c406a49665fc41e57/cli/common/utils.go#L389-L3933. Specifying an instance name multiple times
GetInstancesFromArgs
also doesn't allow to specify an instance multiple times: https://github.com/tarantool/cartridge-cli/blob/80f0f6374c320e36806e247c406a49665fc41e57/cli/common/utils.go#L400-L402Proposed solution
The reason of the issues 1 and 2 is the desire to help a user if they specified
application_name
orapplication_name.instance_name
instead ofinstance_name
. It results in inability to use some instance names in some commands which are (likely) supported by any other command. We need toTo preserve existing helpful error messages in case user really specified
application_name
orapplication_name.instance_name
instead ofinstance_name
(which is rather often), we'll need to rework our approach. If user had provided an invalid info, the command should fail. And if the command had failed,application_name
orapplication_name.instance_name
instead ofinstance_name
and, if they are, add this info to error message.Regarding issue 3, we may simply
but, since there are no such request from customers yet, we may ignore this one for now.
Based on https://jira.vk.team/browse/TNT-765