Using client-go to access a specific context, not current context

117 views
Skip to first unread message

David Karr

unread,
Feb 25, 2024, 4:52:44 PM2/25/24
to golang-nuts
I'm relatively new to golang, although I'm pretty familiar with Kubernetes.  I want to see if I can use client-go as a framework for a set of scripts that get (or set) information on a specific cluster.  I don't want to use the current context, I want to set the context name on the command line and "use" that context, but I want to avoid setting that as the current context.

I could hack this together by manually navigating through ~/.kube/config and extracting the server and token, but I'm still not familiar enough with the client-go api to know whether that will even help. In any case, I would hope that client-go would provide an easier way to do this.

I wish I could find more examples of "out-of-cluster" client applications using this api.
Reply all
Reply to author
Forward
0 new messages