utils

package
v0.0.0-...-276d643 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 19 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"
)
View Source
const HUB_OF_HUB_CLUSTER_NAME = "hub-of-hub-cluster"

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 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
	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"`
	BaseDomain     string `yaml:"baseDomain,omitempty"`
	KubeConfig     string `yaml:"kubeconfig,omitempty"`
	KubeContext    string `yaml:"kubecontext,omitempty"`
	MasterURL      string `yaml:"masterURL,omitempty"`
	DatabaseSecret string `yaml:"databaseSecret,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