oc

package
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportFlag added in v1.1.0

func SupportFlag(flag string, ocPath string, runner util.Runner) bool

Types

type OcRunner

type OcRunner struct {
	OcPath         string
	KubeConfigPath string
	Runner         util.Runner
}

func NewOcRunner

func NewOcRunner(ocPath string, kubeConfigPath string) (*OcRunner, error)

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

func (oc *OcRunner) AddSudoerRoleForUser(user string) error

AddSudoerRoleForUser gives the specified user the sudoer role See also https://docs.openshift.org/latest/architecture/additional_concepts/authentication.html#authentication-impersonation

func (*OcRunner) AddSystemAdminEntryToKubeConfig added in v1.20.0

func (oc *OcRunner) AddSystemAdminEntryToKubeConfig(ocPath string) error

AddSystemAdminEntrytoKubeConfig adds the system:admin certs to ~/.kube/config This function actually mimic the KUBECONFIG magical power of merging different kubeconfig file. KUBECONFIG=~config1:config2 oc config view --flatten https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable

func (*OcRunner) Run

func (oc *OcRunner) Run(command string, stdOut io.Writer, stdErr io.Writer) int

func (*OcRunner) RunAsUser

func (oc *OcRunner) RunAsUser(command string, stdOut io.Writer, stdErr io.Writer) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL