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

Allow partial matches in the --name option #613

Conversation

julienduchesne
Copy link
Member

Say I get this output:

$ tk diff tanka/environments/my-project
Error: found multiple Environments in 'tanka/environments/my-project':
 - environments/my-project/dev
 - environments/my-project/prod

I can now rerun this command with --name dev or --name ops instead of the whole environment name
When more than one environment matches, the same message as before is given

Say I get this output:
```
$ tk diff tanka/environments/my-project
Error: found multiple Environments in 'tanka/environments/my-project':
 - environments/my-project/dev
 - environments/my-project/prod
 ```

 I can now rerun this command with `--name dev` or `--name ops` instead of the whole environment name
When more than one environment matches, the same message as before is given
@julienduchesne julienduchesne merged commit 2640b74 into grafana:main Oct 1, 2021
julienduchesne added a commit that referenced this pull request Oct 5, 2021
🤦
From #613

If there are two environments and one's name is a superset of the first, there is no longer a way to target the one with the smaller name because they will both be targeted with the smaller name
I think it has to be a pretty rare issue but it'd be good to have this in next release
julienduchesne added a commit that referenced this pull request Oct 5, 2021
)

* fix: If there's a full match on an inline environment name, use it
:facepalm:
From #613

If there are two environments and one's name is a superset of the first, there is no longer a way to target the one with the smaller name because they will both be targeted with the smaller name
I think it has to be a pretty rare issue but it'd be good to have this in next release

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

Successfully merging this pull request may close these issues.

2 participants