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

Implement label selectors for 'tk env list' #295

Merged
merged 3 commits into from
Jun 17, 2020
Merged

Conversation

captncraig
Copy link
Contributor

This should allow more advanced selection of environments to do bulk operations on.

I am imagining some workflow like:

tk env list --l cluster=dev-eu-west --json | (jq) | (xargs) | tk export

to do operations across multiple environments at once.

This uses k8s.io/apimachinery/pkg/labels to parse and match labels, so it should have the exact same semantics as using -l in kubectl.

One small unrelated feature I added is the ability to set TANKA_ROOT env var to help when running locally with a working directory outside the tanka tree. I found it very convenient.

Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

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

Loving this idea!

PTAL at my suggestions around label parsing :)

go.mod Show resolved Hide resolved
cmd/tk/env.go Outdated Show resolved Hide resolved
cmd/tk/other.go Outdated Show resolved Hide resolved
cmd/tk/env.go Outdated Show resolved Hide resolved
cmd/tk/env.go Outdated Show resolved Hide resolved
Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

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

Looking good! One small nit on the help text for the flag :)

cmd/tk/env.go Outdated Show resolved Hide resolved
Co-authored-by: sh0rez <me@shorez.de>
@captncraig captncraig merged commit 5bbbed3 into master Jun 17, 2020
@captncraig captncraig deleted the labelSelectors branch June 17, 2020 14:56
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.

None yet

2 participants