Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active July 3, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/8d268c714e2e0a7893289b63821e3ef9 to your computer and use it in GitHub Desktop.
Save velotiotech/8d268c714e2e0a7893289b63821e3ef9 to your computer and use it in GitHub Desktop.
var (
// Set during build
version string
proxyURL = flag.String("proxy", "",
`If specified, it is assumed that a kubctl proxy server is running on the
given url and creates a proxy client. In case it is not given InCluster
kubernetes setup will be used`)
)
if *proxyURL != "" {
config, err = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
&clientcmd.ClientConfigLoadingRules{},
&clientcmd.ConfigOverrides{
ClusterInfo: clientcmdapi.Cluster{
Server: *proxyURL,
},
}).ClientConfig()
if err != nil {
glog.Fatalf("error creating client configuration: %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment