helpers

package
v0.0.0-...-a5289b6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 16 Imported by: 0

README

helpers

import "github.com/eclipse-symphony/symphony/packages/testutils/helpers"

testhelpers contains helpers for tests

Index

Variables

var (
    TargetGVK      = GVK("fabric.symphony", "v1", "Target")
    InstanceGVK    = GVK("solution.symphony", "v1", "Instance")
    SolutionGVK    = GVK("solution.symphony", "v1", "Solution")
    ConfigMapGVK   = GVK("", "v1", "ConfigMap")
    PodGVK         = GVK("", "v1", "Pod")
    NamespaceGVK   = GVK("", "v1", "Namespace")
    ClusterRoleGVK = GVK("rbac.authorization.k8s.io", "v1", "ClusterRole")
)

func DiscoveryClient

func DiscoveryClient() (discovery.DiscoveryInterface, error)

DiscoveryClient returns the discovery client from the default kube config

func DynamicClient

func DynamicClient() (dynamic.Interface, error)

DynamicClient returns the dynamic client from the default kube config

func EnsureNamespace

func EnsureNamespace(ctx context.Context, client kubernetes.Interface, namespace string) error

EnsureNamespace ensures that the namespace exists. If it does not exist, it creates it.

func Eventually

func Eventually(ctx context.Context, condition func(ctx context.Context) error, tick time.Duration, msg string, args ...interface{}) error

func GVK

func GVK(group, version, kind string) schema.GroupVersionKind

GVK creates a GroupVersionKind

func KubeClient

func KubeClient() (kubernetes.Interface, error)

KubeClient returns the kubectl client from the default kube config

func RestConfig

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

RestConfig returns the default kube config

Generated by gomarkdoc

Documentation

Overview

testhelpers contains helpers for tests

Index

Constants

This section is empty.

Variables

View Source
var (
	TargetGVK      = GVK("fabric.symphony", "v1", "Target")
	InstanceGVK    = GVK("solution.symphony", "v1", "Instance")
	SolutionGVK    = GVK("solution.symphony", "v1", "Solution")
	ConfigMapGVK   = GVK("", "v1", "ConfigMap")
	PodGVK         = GVK("", "v1", "Pod")
	NamespaceGVK   = GVK("", "v1", "Namespace")
	ClusterRoleGVK = GVK("rbac.authorization.k8s.io", "v1", "ClusterRole")
)

Functions

func DiscoveryClient

func DiscoveryClient() (discovery.DiscoveryInterface, error)

DiscoveryClient returns the discovery client from the default kube config

func DynamicClient

func DynamicClient() (dynamic.Interface, error)

DynamicClient returns the dynamic client from the default kube config

func EnsureNamespace

func EnsureNamespace(ctx context.Context, client kubernetes.Interface, namespace string) error

EnsureNamespace ensures that the namespace exists. If it does not exist, it creates it.

func Eventually

func Eventually(ctx context.Context, condition func(ctx context.Context) error, tick time.Duration, msg string, args ...interface{}) error

func GVK

func GVK(group, version, kind string) schema.GroupVersionKind

GVK creates a GroupVersionKind

func KubeClient

func KubeClient() (kubernetes.Interface, error)

KubeClient returns the kubectl client from the default kube config

func RestConfig

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

RestConfig returns the default kube config

Types

This section is empty.

Jump to

Keyboard shortcuts

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