-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break dependencies on pkg/cmd/util/clientcmd
This patch is a part of pull/17356 - it aims to break all dependencies between packages outside of `pkg/oc` and the `clientcmd` package. To achieve this, this patch creates a new package containing only the functions and objects found in `clientcmd` that are needed by its dependents outside of the `pkg/oc` subtree. Once this is done, all of the remaining logic (which should only be used by packages within `pkg/oc` is moved to `pkg/oc/cli/util/clientcmd` by pull/17356). This change acknowledges the possibility of having dependents for `pkg/cmd/util/clientconfig` within the `pkg/oc` subtree.
- Loading branch information
1 parent
e16fc4a
commit 6bb3e85
Showing
12 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package clientconfig | ||
|
||
import ( | ||
"k8s.io/kubernetes/pkg/api" | ||
) | ||
|
||
func EnvVars(host string, caData []byte, insecure bool, bearerTokenFile string) []api.EnvVar { | ||
envvars := []api.EnvVar{ | ||
{Name: "KUBERNETES_MASTER", Value: host}, | ||
{Name: "OPENSHIFT_MASTER", Value: host}, | ||
} | ||
|
||
if len(bearerTokenFile) > 0 { | ||
envvars = append(envvars, api.EnvVar{Name: "BEARER_TOKEN_FILE", Value: bearerTokenFile}) | ||
} | ||
|
||
if len(caData) > 0 { | ||
envvars = append(envvars, api.EnvVar{Name: "OPENSHIFT_CA_DATA", Value: string(caData)}) | ||
} else if insecure { | ||
envvars = append(envvars, api.EnvVar{Name: "OPENSHIFT_INSECURE", Value: "true"}) | ||
} | ||
|
||
return envvars | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.