github.com/verrazzano/verrazzano@v1.7.1/tests/e2e/clusterapi/capi/capiTestInterface.go (about) 1 // Copyright (c) 2023, Oracle and/or its affiliates. 2 // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 4 package capi 5 6 import ( 7 "go.uber.org/zap" 8 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" 9 "k8s.io/client-go/dynamic" 10 "k8s.io/client-go/kubernetes" 11 clusterapi "sigs.k8s.io/cluster-api/cmd/clusterctl/client" 12 ) 13 14 type CAPITestImpl struct{} 15 16 // NewCapiTestClient creates a new CAPI Test Client 17 func NewCapiTestClient() CapiTestClient { 18 return &CAPITestImpl{} 19 } 20 21 type CapiTestClient interface { 22 PrintYamlOutput(printer clusterapi.YamlPrinter, outputFile string) error 23 ClusterTemplateGenerate(clusterName, templatePath string, log *zap.SugaredLogger) (string, error) 24 GetUnstructuredData(group, version, resource, resourceName, nameSpaceName string, log *zap.SugaredLogger) (*unstructured.Unstructured, error) 25 GetCluster(namespace, clusterName string, log *zap.SugaredLogger) (*Cluster, error) 26 GetOCNEControlPlane(namespace string, log *zap.SugaredLogger) (*OCNEControlPlane, error) 27 CheckOCNEControlPlaneStatus(clusterName, expectedStatusType, expectedStatus, expectedReason string, log *zap.SugaredLogger) bool 28 GetCapiClusterKubeConfig(clusterName string, log *zap.SugaredLogger) ([]byte, error) 29 GetCapiClusterK8sClient(clusterName string, log *zap.SugaredLogger) (client *kubernetes.Clientset, err error) 30 TriggerCapiClusterCreation(clusterName, templateName string, log *zap.SugaredLogger) error 31 DeployClusterInfraClusterResourceSets(clusterName, templateName string, log *zap.SugaredLogger) error 32 DeployAnyClusterResourceSets(clusterName, templateName string, log *zap.SugaredLogger) error 33 EnsureMachinesAreProvisioned(namespace, clusterName string, log *zap.SugaredLogger) error 34 MonitorCapiClusterDeletion(clusterName string, log *zap.SugaredLogger) error 35 MonitorCapiClusterCreation(clusterName string, log *zap.SugaredLogger) error 36 TriggerCapiClusterDeletion(clusterName, nameSpaceName string, log *zap.SugaredLogger) error 37 ShowNodeInfo(client *kubernetes.Clientset, clustername string, log *zap.SugaredLogger) error 38 ShowPodInfo(client *kubernetes.Clientset, clusterName string, log *zap.SugaredLogger) error 39 ShowEvents(namespace string, log *zap.SugaredLogger) error 40 DisplayWorkloadClusterResources(clusterName string, log *zap.SugaredLogger) error 41 UpdateOCINSG(clusterName, nsgDisplayNameToUpdate, nsgDisplayNameInRule, info string, rule *SecurityRuleDetails, log *zap.SugaredLogger) error 42 UpdateOCINSGEW(clusterName, nsgDisplayNameToUpdate, info string, rule *SecurityRuleDetails, log *zap.SugaredLogger) error 43 CreateImagePullSecrets(clusterName string, log *zap.SugaredLogger) error 44 ProcessOCIPrivateKeysBase64(file, key string, log *zap.SugaredLogger) error 45 ProcessOCISSHKeys(file, key string, log *zap.SugaredLogger) error 46 ProcessOCIPrivateKeysSingleLine(file, key string, log *zap.SugaredLogger) error 47 CreateNamespace(namespace string, log *zap.SugaredLogger) error 48 SetImageID(key string, log *zap.SugaredLogger) error 49 GetCapiClusterDynamicClient(clusterName string, log *zap.SugaredLogger) (dynamic.Interface, error) 50 GetVerrazzano(clusterName, namespace, vzinstallname string, log *zap.SugaredLogger) (*unstructured.Unstructured, error) 51 EnsureVerrazzano(clusterName string, log *zap.SugaredLogger) error 52 DebugSVCOutput(clusterName string, log *zap.SugaredLogger) error 53 ToggleModules(group, version, resource, clusterName, nameSpaceName string, toggle bool, log *zap.SugaredLogger) error 54 }