Documentation ¶
Index ¶
- func CreateTypeFromPath(theType any, path string) (err error)
- func GetAppResponse(ctx context.Context, clientset *kubernetes.Clientset, pod *corev1.Pod, ...) (res http.Response, err error)
- func GetDatabaseResponse(ctx context.Context, clientset *kubernetes.Clientset, ...) (databaseResponse ndb_api.DatabaseResponse, err error)
- func GetLogger(ctx context.Context) *log.Logger
- func LoadEnv(ctx context.Context) (err error)
- func ProvisioningTestSetup(ctx context.Context, st *SetupTypes, clientset *kubernetes.Clientset, ...) (err error)
- func ProvisioningTestTeardown(ctx context.Context, st *SetupTypes, clientset *kubernetes.Clientset, ...) (err error)
- func SetupContext(ctx context.Context, logger *log.Logger) context.Context
- func SetupKubeconfig(ctx context.Context) (config *rest.Config, err error)
- func SetupLogger(path string) (*log.Logger, error)
- func SetupSchemeAndClientSet(ctx context.Context, config *rest.Config) (v1alpha1ClientSet *clientsetv1alpha1.V1alpha1Client, ...)
- type SetupTypes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTypeFromPath ¶
CreateTypeFromPath reads a file path, converts it to json, and unmarshals json to a pointer. Ensure that theType is a pointer.
func GetAppResponse ¶
func GetAppResponse(ctx context.Context, clientset *kubernetes.Clientset, pod *corev1.Pod, localPort string) (res http.Response, err error)
Tests if pod is able to connect to database
func GetDatabaseResponse ¶
func GetDatabaseResponse(ctx context.Context, clientset *kubernetes.Clientset, v1alpha1ClientSet *clientsetv1alpha1.V1alpha1Client, st *SetupTypes) (databaseResponse ndb_api.DatabaseResponse, err error)
Wrapper function called in all TestSuite TestProvisioningSuccess methods. Returns a DatabaseResponse which indicates if provison was succesful
func ProvisioningTestSetup ¶
func ProvisioningTestSetup(ctx context.Context, st *SetupTypes, clientset *kubernetes.Clientset, v1alpha1ClientSet *clientsetv1alpha1.V1alpha1Client, t *testing.T) (err error)
This function is called from the SetupSuite() function of all testsuites. It loads environment variables, instantiate resources, waits for db to be ready, and pod to start.
func ProvisioningTestTeardown ¶
func ProvisioningTestTeardown(ctx context.Context, st *SetupTypes, clientset *kubernetes.Clientset, v1alpha1ClientSet *clientsetv1alpha1.V1alpha1Client, t *testing.T) (err error)
This function is called from the TeardownSuite() function of all testsuites. Delete resources and de-provision database.
func SetupContext ¶
Setup up Context with Logger
func SetupKubeconfig ¶
Setup kubeconfig
func SetupLogger ¶
Setup a logger with a unique file path
func SetupSchemeAndClientSet ¶
func SetupSchemeAndClientSet(ctx context.Context, config *rest.Config) (v1alpha1ClientSet *clientsetv1alpha1.V1alpha1Client, clientset *kubernetes.Clientset, err error)
Setup scheme and clientsets
Types ¶
type SetupTypes ¶
type SetupTypes struct { NdbServer *ndbv1alpha1.NDBServer Database *ndbv1alpha1.Database NdbSecret *corev1.Secret DbSecret *corev1.Secret AppPod *corev1.Pod }
YAML Resource types
func SetupTypeTemplates ¶
func SetupTypeTemplates(ctx context.Context) (setupTypes *SetupTypes, err error)
Setup yaml types. Uses paths specified in automation.constants.go