test

package
v0.0.0-...-892b39a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemberCluster1          = "cluster1"
	MemberCluster2          = "cluster2"
	TestGSLBSecret          = "gslb-config-secret"
	TestMemberClusterSecret = "tenant-clusters-secret"
	AMKOCRDs                = "../../helm/amko/crds"
	TestClustersetName      = "test-clusterset"
)
View Source
const (
	Cluster1TestSvc       = "cluster1-svc1"
	Cluster1TestNS        = "blue"
	Cluster1TestSvcPort   = 80
	Cluster1TestNodePort  = 31000
	Cluster1TestSvc2      = "cluster1-svc2"
	Cluster1TestNS2       = "red"
	Cluster1TestSvcPort2  = 443
	Cluster1TestNodePort2 = 31001
	Cluster1Node1         = "10.10.10.10"
	Cluster1Node2         = "10.10.10.11"
	Cluster1Node1Name     = "cluster1-node1"
	Cluster1Node2Name     = "cluster2-node2"
)

member cluster 1's constants:

View Source
const (
	Cluster2TestSvc       = "cluster2-svc1"
	Cluster2TestSvcPort   = 90
	Cluster2TestNS        = "green"
	Cluster2TestNodePort  = 32000
	Cluster2TestSvc2      = "cluster2-svc2"
	Cluster2TestNS2       = "yellow"
	Cluster2TestSvcPort2  = 8443
	Cluster2TestNodePort2 = 32001
	Cluster2Node1         = "10.10.20.10"
	Cluster2Node2         = "10.10.20.11"
	Cluster2Node1Name     = "cluster2-node1"
	Cluster2Node2Name     = "cluster2-node2"
)

member cluster 2's constants:

View Source
const KubeConfigData = `
apiVersion: v1
clusters: []
contexts: []
kind: Config
preferences: {}
users: []
`

Variables

This section is empty.

Functions

func AddNodesForCluster

func AddNodesForCluster(kubeClient *kubernetes.Clientset, node1IP, node2IP, node1Name, node2Name string)

func BuildAndCreateTestClusterset

func BuildAndCreateTestClusterset(mgmtAmkoClient *akov1.Clientset)

func BuildAndCreateTestKubeConfig

func BuildAndCreateTestKubeConfig(k8sClient1, k8sClient2, mgmtClient *kubernetes.Clientset)

func BuildTestNamespace

func BuildTestNamespace(name string) *corev1.Namespace

func BuildTestTenantSecretObj

func BuildTestTenantSecretObj(kubeCfgData []byte) *corev1.Secret

func CreateTestNamespacesInMemberClusters

func CreateTestNamespacesInMemberClusters(k8sClient1 *kubernetes.Clientset, k8sClient2 *kubernetes.Clientset)

func IsServiceImportExpected

func IsServiceImportExpected(ctx context.Context, mgmtClient *akov1.Clientset, svc *corev1.Service,
	cname string, nodes []string, excludePorts []int32) string

func UpdateTestSvcPort

func UpdateTestSvcPort(ctx context.Context, k8sClient *kubernetes.Clientset, ns, svcName string,
	port, nodePort int32)

func UpdateTestSvcType

func UpdateTestSvcType(ctx context.Context, k8sClient *kubernetes.Clientset, ns, svcName string,
	svcType string, nodePort int32)

func VerifyServiceImport

func VerifyServiceImport(ctx context.Context, cname string, mgmtClient *akov1.Clientset, obj *corev1.Service,
	kubeClient *kubernetes.Clientset, newMCIObj *akovmwarecomv1alpha1.MultiClusterIngress, nodes []string,
	excludePorts []int32)

func VerifyServiceImportNotExists

func VerifyServiceImportNotExists(ctx context.Context, cname string, mgmtClient *akov1.Clientset, svc *corev1.Service)

Types

type ClusterData

type ClusterData struct {
	Cluster ClusterServerData `yaml:"cluster"`
	Name    string            `yaml:"name"`
}

type ClusterServerData

type ClusterServerData struct {
	CAData string `yaml:"certificate-authority-data"`
	Server string `yaml:"server"`
}

type ClustersKubeConfig

type ClustersKubeConfig struct {
	APIVersion string            `yaml:"apiVersion"`
	Clusters   []ClusterData     `yaml:"clusters"`
	Contexts   []KubeContextData `yaml:"contexts"`
	Kind       string            `yaml:"kind"`
	Users      []UserData        `yaml:"users"`
}

type ContextData

type ContextData struct {
	Cluster string `yaml:"cluster"`
	User    string `yaml:"user"`
}

type KubeContextData

type KubeContextData struct {
	Context ContextData `yaml:"context"`
	Name    string      `yaml:"name"`
}

type UserData

type UserData struct {
	Name string `yaml:"name"`
	User UserID `yaml:"user"`
}

type UserID

type UserID struct {
	ClientCert string `yaml:"client-certificate-data"`
	ClientKey  string `yaml:"client-key-data"`
}

Jump to

Keyboard shortcuts

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