Documentation ¶
Index ¶
- func GetGlobalKubeConfigPath() (string, error)
- func SupportFlag(flag string, ocPath string, runner util.Runner) bool
- type OcRunner
- func (oc *OcRunner) AddCliContext(context string, ip string, username string, namespace string, ...) error
- func (oc *OcRunner) AddSudoerRoleForUser(user string) error
- func (oc *OcRunner) AddSystemAdminEntryToKubeConfig(ocPath string) error
- func (oc *OcRunner) Run(command string, stdOut io.Writer, stdErr io.Writer) int
- func (oc *OcRunner) RunAsUser(command string, stdOut io.Writer, stdErr io.Writer) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGlobalKubeConfigPath ¶ added in v1.29.0
GetGlobalKubeConfigPath returns the path to the first entry in KUBECONFIG environment variable or if KUBECONFIG not set then $HOME/.kube/config
Types ¶
type OcRunner ¶
func NewOcRunner ¶
NewOcRunner creates a new OcRunner which uses the oc binary specified via the ocPath parameter. An error is returned in case the oc binary does not exist or is not executable.
func (*OcRunner) AddCliContext ¶
func (oc *OcRunner) AddCliContext(context string, ip string, username string, namespace string, runner util.Runner, ocPath string) error
AddCliContext adds a CLI context for the user and namespace for the current OpenShift cluster. See also https://docs.openshift.com/enterprise/3.0/cli_reference/manage_cli_profiles.html
func (*OcRunner) AddSudoerRoleForUser ¶
AddSudoerRoleForUser gives the specified user the sudoer role See also https://docs.okd.io/latest/architecture/additional_concepts/authentication.html#authentication-impersonation
func (*OcRunner) AddSystemAdminEntryToKubeConfig ¶ added in v1.20.0
AddSystemAdminEntrytoKubeConfig adds the system:admin certs to ~/.kube/config