util

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 41 Imported by: 513

Documentation

Index

Constants

View Source
const (
	PolicyCachePollInterval = 100 * time.Millisecond
	PolicyCachePollTimeout  = 10 * time.Second
)

Variables

This section is empty.

Functions

func AddAdditionalAllowedRegistries

func AddAdditionalAllowedRegistries(hostPortGlobs ...string)

func CreateNamespace

func CreateNamespace(clusterAdminKubeConfig, name string) (err error)

CreateNamespace creates a namespace with the specified name using the provided kubeconfig DO NOT USE, use create project instead

func GetAdditionalAllowedRegistries

func GetAdditionalAllowedRegistries() sets.String

func GetBaseDir

func GetBaseDir() string

GetBaseDir returns the base directory used for test.

func GetClientForServiceAccount added in v1.0.7

func GetClientForServiceAccount(adminClient kubernetes.Interface, clientConfig restclient.Config, namespace, name string) (*kubernetes.Clientset, *restclient.Config, error)

func GetClientForUser

func GetClientForUser(clusterAdminConfig *restclient.Config, username string) (kubernetes.Interface, *restclient.Config, error)

func GetClusterAdminClientConfig

func GetClusterAdminClientConfig(adminKubeConfigFile string) (*restclient.Config, error)

func GetClusterAdminClientConfigOrDie

func GetClusterAdminClientConfigOrDie(adminKubeConfigFile string) *restclient.Config

GetClusterAdminClientConfigOrDie returns a REST config for the cluster admin user or panic.

func GetClusterAdminKubeClient

func GetClusterAdminKubeClient(adminKubeConfigFile string) (kubernetes.Interface, error)

func GetImageFixture added in v1.3.0

func GetImageFixture(filename string) (*imageapi.Image, error)

func GetScopedClientForUser added in v1.3.0

func GetScopedClientForUser(clusterAdminClientConfig *restclient.Config, username string, scopes []string) (kubernetes.Interface, *restclient.Config, error)

func GetTemplateFixture added in v1.0.7

func GetTemplateFixture(filename string) (*templateapi.Template, error)

func KubeConfigPath

func KubeConfigPath() string

func Namespace

func Namespace() string

Namespace returns the test namespace. The default namespace is set to 'integration-test'. You can override it by setting the 'OS_TEST_NAMESPACE' environment variable

func NewDockerClient

func NewDockerClient() (*dockerClient.Client, error)

newDockerClient creates a docker client using the env var DOCKER_ENDPOINT or, if not supplied, uses the default docker endpoint /var/run/docker.sock

func NewTestLDAPServer added in v1.0.2

func NewTestLDAPServer() *testLDAPServer

func NonProtobufConfig

func NonProtobufConfig(inConfig *rest.Config) *rest.Config

func SetAdditionalAllowedRegistries

func SetAdditionalAllowedRegistries(hostPortGlobs ...string)

func WaitForClusterPolicyUpdate added in v1.0.6

func WaitForClusterPolicyUpdate(c authorizationv1client.SelfSubjectAccessReviewsGetter, verb string, resource schema.GroupResource, allowed bool) error

WaitForClusterPolicyUpdate checks if the given client can perform the named verb and action. If PolicyCachePollTimeout is reached without the expected condition matching, an error is returned

func WaitForClusterResourceQuotaCRDAvailable

func WaitForClusterResourceQuotaCRDAvailable(clusterAdminClientConfig *rest.Config) error

func WaitForPolicyUpdate added in v1.0.1

func WaitForPolicyUpdate(c authorizationv1client.SelfSubjectAccessReviewsGetter, namespace, verb string, resource schema.GroupResource, allowed bool) error

WaitForPolicyUpdate checks if the given client can perform the named verb and action. If PolicyCachePollTimeout is reached without the expected condition matching, an error is returned

func WaitForResourceQuotaLimitSync added in v1.3.0

func WaitForResourceQuotaLimitSync(
	client corev1client.ResourceQuotaInterface,
	name string,
	hardLimit corev1.ResourceList,
	timeout time.Duration,
) error

WaitForResourceQuotaLimitSync watches given resource quota until its hard limit is updated to match the desired spec or timeout occurs.

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