Skip to content

Commit

Permalink
Allow in-cluster config for oc
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smarterclayton committed Nov 5, 2015
1 parent d512cd0 commit 03a8358
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/cmd/util/clientcmd/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ import (
// New creates a default Factory for commands that should share identical server
// connection behavior. Most commands should use this method to get a factory.
func New(flags *pflag.FlagSet) *Factory {
// Override global default to "" so we force the client to ask for user input
// TODO refactor this upstream:
// DefaultCluster should not be a global
// A call to ClientConfig() should always return the best clientCfg possible
// even if an error was returned, and let the caller decide what to do
kclientcmd.DefaultCluster.Server = ""
kclientcmd.DefaultCluster.Server = "https://localhost:8443"

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

0 comments on commit 03a8358

Please sign in to comment.