Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.47k stars 947 forks source link

[Enhancement] Adding the ability to strip cluster name from AWS ARN if using EKS #1237

Open Thutm opened 5 years ago

Thutm commented 5 years ago

This is an enhancement to the existing kubecontext segment. While using AWS EKS kubeconfig's this will strip the cluster name out of the ARN to stop bloating your command line.

Before: Before

After: image

Thutm commented 5 years ago

For testing, I need to add a mock AWS ARN string to be returned on by kubectl. Should I add to the existing tests or just duplicate all the current tests referencing "minikube"? I can't think of any reasons for additional mock strings to test against and didn't want to unnecessarily update all existing tests.

dritter commented 5 years ago

Hi @Thutm ,

Thanks for the PR. I am a fan of one test per use-case, so please add some new tests. I think it will be enough to add a positive and a negative test.

Thutm commented 5 years ago

Thanks all, I actually ended up using: cur_ctx=${cur_ctx#*:*:*:*:*:}; cur_ctx=${cur_ctx:8}

and then updated it to dritters suggestion. Let me know if that works.

Thutm commented 5 years ago

Screen Shot 2019-04-16 at 2 00 52 PM

Attached segment screenshot. No terraform specific icon that I could find. Used a globe instead for now.