Documentation
¶
Index ¶
- func GetKubeClientFromRESTConfig(config *rest.Config) (*kubernetes.Clientset, error)
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) CleanUp()
- func (f *Framework) EnsureSampleConfig(configName string) (*v1alpha1.SampleConfig, error)
- func (f *Framework) GetKubeClient() (*kubernetes.Clientset, error)
- func (f *Framework) GetSampleConfig(configName string) (*v1alpha1.SampleConfig, error)
- func (f *Framework) GetSampleConfigClient() (*versioned.Clientset, error)
- func (f *Framework) GetSampleConfigPhase(configName string) (sdkapi.Phase, error)
- func (f *Framework) LoadConfig() (*rest.Config, error)
- func (f *Framework) RunKubectlCommand(args ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKubeClientFromRESTConfig ¶
func GetKubeClientFromRESTConfig(config *rest.Config) (*kubernetes.Clientset, error)
GetKubeClientFromRESTConfig provides a function to get a K8s client using the REST config
Types ¶
type Framework ¶
type Framework struct {
// NsPrefix is a prefix for generated namespace
NsPrefix string
// k8sClient provides our k8s client pointer
K8sClient *kubernetes.Clientset
//SampleConfigCLient provides SampleConfig client pointer
SampleConfigCLient *versioned.Clientset
// RestConfig provides a pointer to our REST client config.
RestConfig *rest.Config
// KubectlPath is a test run-time flag so we can find kubectl
KubectlPath string
// KubeConfig is a test run-time flag to store the location of our test setup kubeconfig
KubeConfig string
// Master is a test run-time flag to store the id of our master node
Master string
// OperatorInstallNamespace namespace where KubeVirt is installed
OperatorInstallNamespace string
}
Framework supports common operations used by functional/e2e tests. This package is based on https://kubevirt.io/containerized-data-importer/blob/master/tests/framework/framework.go
func NewFramework ¶
NewFramework makes a new framework and sets up the global BeforeEach/AfterEach's. Test run-time flags are parsed and added to the Framework struct.
func NewFrameworkOrDie ¶
NewFrameworkOrDie calls NewFramework and handles errors by calling Fail. Config is optional, but if passed there can only be one.
func (*Framework) AfterEach ¶
func (f *Framework) AfterEach()
AfterEach provides a set of operations to run after each test
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach provides a set of operations to run before each test
func (*Framework) CleanUp ¶
func (f *Framework) CleanUp()
CleanUp provides a set of operations clean the namespace
func (*Framework) EnsureSampleConfig ¶
func (f *Framework) EnsureSampleConfig(configName string) (*v1alpha1.SampleConfig, error)
EnsureSampleConfig creates Sample Config if it does not exist
func (*Framework) GetKubeClient ¶
func (f *Framework) GetKubeClient() (*kubernetes.Clientset, error)
GetKubeClient returns a Kubernetes rest client
func (*Framework) GetSampleConfig ¶
func (f *Framework) GetSampleConfig(configName string) (*v1alpha1.SampleConfig, error)
GetSampleConfig retrieves SampleConfig instance
func (*Framework) GetSampleConfigClient ¶
GetSampleConfigClient gets an instance of a Sample Config client
func (*Framework) GetSampleConfigPhase ¶
GetSampleConfigPhase returns phase of the SampleConfig
func (*Framework) LoadConfig ¶
LoadConfig loads our specified kubeconfig