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 a wildcard in identifying a name (shown with an example) #4982

Open
mpattani opened this issue Nov 26, 2024 · 1 comment
Open

Allow a wildcard in identifying a name (shown with an example) #4982

mpattani opened this issue Nov 26, 2024 · 1 comment
Labels
needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.

Comments

@mpattani
Copy link

Enhancement Description

Allow a wildcard (* OR %) for long podnames for those who do not like to do copy/paste

Here is my example i am talking about:

I only have two pods, but they have long names. Instead of doing copy/paste of the whole podname, I would like
to have to get the whole name by using a wild card-

Here is my scenerio

++++++++++++

[sysadmin@localhost mp_k8s_exercise]$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
helloworld-cc47658f5-zs9nq 1/1 Running 0 17d 10.1.102.152 localhost.localdomain
nginx-webserver-7fc8bbdbb7-twmhg 1/1 Running 0 18d 10.1.102.148 localhost.localdomain
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx* -- cat /etc/hosts
Error from server (NotFound): pods "nginx*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-* -- cat /etc/hosts
Error from server (NotFound): pods "nginx-webserver-*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-7fc8bbdbb7-twmhg -- cat /etc/hosts

Kubernetes-managed hosts file.

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.1.102.148 nginx-webserver-7fc8bbdbb7-twmhg
[sysadmin@localhost mp_k8s_exercise]$ pwd
/home/sysadmin/mp_k8s_exercise
[sysadmin@localhost mp_k8s_exercise]$

+++++++++++++

What I would have liked to see is if i could what i was trying to do earlier:


[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx* -- cat /etc/hosts (* for all chars following nginx*) (% for single char )
Error from server (NotFound): pods "nginx*" not found
[sysadmin@localhost mp_k8s_exercise]$
[sysadmin@localhost mp_k8s_exercise]$ kubectl exec nginx-webserver-* -- cat /etc/hosts
Error from server (NotFound): pods "nginx-webserver-*" not found
[sysadmin@localhost mp_k8s_exercise]$


I should be able to use a wild card like (* for all chars - and % for single char) to get the rest of the podname -

As far as there is no conflict, kubectl should be able to give me and identify long podnames by using wildcard.

I believe this will be beneficial to all kubectl users - not just me who is not always comfortable doing copy/paste.

I hope this reaches to the right team.

Regards
MPattani

@k8s-ci-robot
Copy link
Contributor

There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants