utils

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SERVICE_ACCOUNT_NAME              = "hoh-e2e-test-sa"
	SERVICE_ACCOUNT_ROLE_BINDING_NAME = "hoh-e2e-test-crb"
)

Variables

This section is empty.

Functions

func CreateClusterRoleBinding

func CreateClusterRoleBinding(opt Options, crb *rbacv1.ClusterRoleBinding) error

func CreateServiceAccount

func CreateServiceAccount(opt Options, sa *v1.ServiceAccount) error

func CreateTestingRBAC

func CreateTestingRBAC(opt Options) error

func DeleteTestingRBAC

func DeleteTestingRBAC(opt Options) error

func FetchBearerToken

func FetchBearerToken(opt Options) (string, error)

func LoadConfig

func LoadConfig(url, kubeconfig, context string) (*rest.Config, error)

func NewHoHConfigMapGVR

func NewHoHConfigMapGVR() schema.GroupVersionResource

func NewManagedClustersGVR

func NewManagedClustersGVR() schema.GroupVersionResource

func NewPlacementRule

func NewPlacementRule() schema.GroupVersionResource

func NewPolicyGVR

func NewPolicyGVR() schema.GroupVersionResource

func NewRouteGVR

func NewRouteGVR() schema.GroupVersionResource

func NewSubscriptionreportsGVR

func NewSubscriptionreportsGVR() schema.GroupVersionResource

func NewTestClient

func NewTestClient(opt Options) *client

Types

type Client

type Client interface {
	KubeClient() kubernetes.Interface
	KubeDynamicClient() dynamic.Interface
	ControllerRuntimeClient(clusterName string, scheme *runtime.Scheme) (runClient.Client, error)
	Kubectl(clusterName string, args ...string) (string, error)
	RestConfig(clusterName string) (*rest.Config, error)
}

type HOHCluster

type HOHCluster struct {
	Name            string `yaml:"name,omitempty"`
	Namespace       string `yaml:"namespace,omitempty"`
	ApiServer       string `yaml:"apiServer,omitempty"`
	KubeConfig      string `yaml:"kubeconfig,omitempty"`
	KubeContext     string `yaml:"kubecontext,omitempty"`
	Nonk8sApiServer string `yaml:"nonk8sApiServer,omitempty"`
	DatabaseURI     string `yaml:"databaseURI,omitempty"`
}

Define the shape of clusters that may be added under management

type ManagedCluster

type ManagedCluster struct {
	Name        string `yaml:"name,omitempty"`
	LeafHubName string `yaml:"leafhubname,omitempty"`
	KubeConfig  string `yaml:"kubeconfig,omitempty"`
	KubeContext string `yaml:"kubecontext,omitempty"`
}

type Options

type Options struct {
	HubCluster      HOHCluster       `yaml:"hub"`
	ManagedClusters []ManagedCluster `yaml:"clusters"`
}

Define options available for Tests to consume

type OptionsContainer

type OptionsContainer struct {
	Options Options `yaml:"options"`
}

Jump to

Keyboard shortcuts

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