utils

package
v0.0.0-...-5f1e80b Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig() (*rest.Config, error)

GetConfig creates a *rest.Config for talking to a Kubernetes apiserver. Otherwise will assume running in cluster and use the cluster provided kubeconfig.

Config precedence

* KUBECONFIG environment variable pointing at a file

* In-cluster config if running in cluster

* $HOME/.kube/config if exists

Note that if you have done `oc login...` the `current-context` will be used. this means that the test will run as whatever user is currently logged in. kube:admin has a token, but no certs. - kube:admin is an oauth user, this is why it has tokens. system:admin has certs, but no token. - system:admin is a cert based user only. other users, your mileage may vary.

func NewClientConfigForTest

func NewClientConfigForTest() (*rest.Config, error)

authn operator approach to getting config. choose func as needed. https://github.com/openshift/cluster-authentication-operator/blob/master/test/library/client.go NewClientConfigForTest returns a config configured to connect to the api server

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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