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

support for custom Kubernetes cluster name shortening with regex #327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joemiller
Copy link
Contributor

@joemiller joemiller commented Sep 9, 2021

Adds two new flags:

  • -shorten-kube-names-regex-match
  • -shorten-kube-names-regex-template (defaults to ${1})

Examples:

Assume a kubernetes cluster named myorg-region-profile-cluster-01

Using the default template:

powerline-go -shorten-kube-names-regex-match '^myorg-\w+-\w+-(.*)'

result: cluster-01

Using a custom template:

powerline-go -shorten-kube-names-regex-match '^myorg-(\w+)-\w+-(.*)' -shorten-kube-names-regex-template '${1}/${2}'

result: region/cluster-01

joemiller added a commit to joemiller/dotfiles that referenced this pull request Sep 10, 2021
@joemiller
Copy link
Contributor Author

bump. anything i can do to help this PR along? tnx

@joemiller joemiller force-pushed the shorten-kube-names-regex-2 branch from a510bef to 3570f87 Compare May 6, 2022 21:32
@joemiller
Copy link
Contributor Author

fixed up merge conflicts

Adds two new flags:

* - `-shorten-kube-names-regex-match`
* - `-shorten-kube-names-regex-template` (defaults to `${1}`)

Examples:

Assume a kubernetes cluster named `myorg-region-profile-cluster-01`

Using the default template:
```console
powerline-go -shorten-kube-names-regex-match '^myorg-\w+-\w+-(.*)'
```
result: `cluster-01`

Using a custom template:
```console
powerline-go -shorten-kube-names-regex-match '^myorg-(\w+)-\w+-(.*)' -shorten-kube-names-regex-template '${1}/${2}'
```
result: `region/cluster-01`
@joemiller joemiller force-pushed the shorten-kube-names-regex-2 branch from 3570f87 to 6fe0dba Compare September 17, 2023 16:01
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.

1 participant