cobra icon indicating copy to clipboard operation
cobra copied to clipboard

I want to achieve like `kubectl edit`,but there is no example surfing on internet,plz someone provide me some instructions!

Open mingmingshiliyu opened this issue 1 year ago • 2 comments

input kubectl edit and a vim-style screen appears,how can I do this using Cobra?there is no example on internet.and I tried govim,read kubectl opensource code,and it`s hard to write like it.

mingmingshiliyu avatar Sep 11 '23 07:09 mingmingshiliyu

Seeing as kubectl is using Cobra, what is stopping you from checking out the kubectl source to the edit command? https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/edit/edit.go

marevers avatar Sep 13 '23 09:09 marevers

Seeing as kubectl is using Cobra, what is stopping you from checking out the kubectl source to the edit command? https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/edit/edit.go

now I success,and kubectl source code makes it so complex to understand,I just read it and gave up.via chatgpt,I found a way much easier to understand

mingmingshiliyu avatar Sep 13 '23 09:09 mingmingshiliyu