Skip to content

Commit 03a8358

Browse files
Allow in-cluster config for oc
Because we set the default env value to empty, we can't use the default in cluster config for 'oc' (when you run inside a container, oc works). It's really important for container integration scenarios that oc uses the service account token by default, just like kubeconfig.
1 parent d512cd0 commit 03a8358

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/cmd/util/clientcmd/factory.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ import (
3636
// New creates a default Factory for commands that should share identical server
3737
// connection behavior. Most commands should use this method to get a factory.
3838
func New(flags *pflag.FlagSet) *Factory {
39-
// Override global default to "" so we force the client to ask for user input
4039
// TODO refactor this upstream:
4140
// DefaultCluster should not be a global
4241
// A call to ClientConfig() should always return the best clientCfg possible
4342
// even if an error was returned, and let the caller decide what to do
44-
kclientcmd.DefaultCluster.Server = ""
43+
kclientcmd.DefaultCluster.Server = "https://localhost:8443"
4544

4645
// TODO: there should be two client configs, one for OpenShift, and one for Kubernetes
4746
clientConfig := DefaultClientConfig(flags)

0 commit comments

Comments
 (0)