tanka
tanka copied to clipboard
Support alternative syntax for specifying inline environment
Regular (static and single-inline) environments are specified like so:
tk show environments/default
Given environments/default/main.jsonnet returns multiple tanka.dev/Environment objects, the following is required:
tk show environments/default --name=myFancyEnv
While this usually works fine, it makes some automation much harder than needed. Previously this was possible:
for i in $(tk env list --names); do tk diff $i; done
This would have given you a diff of all environments. But it is impossible / unnecessarily hard to handle the flag case because we only know once it failed.
A solution to that would be to incorporate the name into the existing argument, maybe like so:
tk show environments/default:myFancyEnv
In return we could allow tk env list to return such strings, so above automation works again.
I propose to add that as an alternative way solely handled in the cmd/tk package for now. Given the feature is experimental anyawys, we can iterate on this further.
//cc @Duologic wdyt?
I'm not opossed to it, most if not all use cases of looping over environments can be covered by tk env list --json imo. Is there a request or specific reason that pushes this idea forward?
Only suggestion I can come up with: Maybe if we just replace --names with something like --identifiers to make it clear that it is not only representing the name.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
That doesn't seem related @James-Riordan, please move this to the discussions tab.