Documentation ¶
Overview ¶
Package mock provides all methods required to simulate a IONOS provider environment
Package mock provides all methods required to simulate a IONOS provider environment ¶
Package mock provides all methods required to simulate a IONOS provider environment ¶
Package mock provides all methods required to simulate a IONOS provider environment ¶
Package mock provides all methods required to simulate a IONOS provider environment ¶
Package mock provides all methods required to simulate a IONOS provider environment
Index ¶
- Constants
- func DecodeCluster(cluster *v1alpha1.Cluster) (*extensions.Cluster, error)
- func ManipulateCluster(cluster *v1alpha1.Cluster, data map[string]interface{}) *v1alpha1.Cluster
- func ManipulateControlPlane(cp *v1alpha1.ControlPlane, data map[string]interface{}) *v1alpha1.ControlPlane
- func ManipulateInfrastructure(infrastructure *v1alpha1.Infrastructure, data map[string]interface{}) *v1alpha1.Infrastructure
- func ManipulateWorker(worker *v1alpha1.Worker, data map[string]interface{}) *v1alpha1.Worker
- func NewCluster() *v1alpha1.Cluster
- func NewControlPlane() *v1alpha1.ControlPlane
- func NewInfrastructure() *v1alpha1.Infrastructure
- func NewInfrastructureConfigSpec() *apis.InfrastructureConfig
- func NewWorker() *v1alpha1.Worker
- func SetupDatacentersEndpointOnMux(mux *http.ServeMux)
- func SetupImagesEndpointOnMux(mux *http.ServeMux)
- func SetupServersEndpointOnMux(mux *http.ServeMux)
- func SetupTestDatacenterEndpointOnMux(mux *http.ServeMux)
- func SetupTestImageEndpointOnMux(mux *http.ServeMux)
- func SetupTestInfrastructureServerEndpointOnMux(mux *http.ServeMux)
- type MockTestEnv
Constants ¶
const ( TestClusterCloudProfile = `` /* 519-byte string literal not displayed */ TestClusterName = "xyz" TestClusterSeed = `{ "apiVersion": "core.gardener.cloud/v1beta1", "kind": "Seed" }` TestClusterShoot = `` /* 437-byte string literal not displayed */ )
const ( TestControlPlaneInfrastructureProviderStatus = `` /* 199-byte string literal not displayed */ TestControlPlaneName = "xyz" TestControlPlaneProviderConfig = `{ "apiVersion": "ionos.provider.extensions.gardener.cloud/v1alpha1", "kind": "ControlPlaneConfig", "zone": "us-las" }` TestControlPlaneSecretName = "cloudprovider" )
const ( TestInfrastructureName = "abc" TestInfrastructureProviderConfig = `` /* 348-byte string literal not displayed */ TestInfrastructureSecretName = "cloudprovider" TestInfrastructureServerID = "6789abcd-ef01-4345-6789-abcdef012325" TestInfrastructureServerNameTemplate = "machine-%s" TestInfrastructureServerNicID = "23456789-abcd-4f01-23e5-6789abcdef01" TestInfrastructureWorkersNetworkName = "test-namespace-workers" )
const ( TestDatacenterID = "01234567-89ab-4def-0123-c56789abcdef" TestFloatingPoolName = "MY-FLOATING-POOL" TestImageID = "01234567-89ab-4def-0123-c56789abcdef" TestImageName = "ubuntu" TestImageVersion = "1.0" TestNamespace = "test-namespace" TestRegion = "us" TestVolumeID = "3456789a-bcde-4012-3f56-789abcdef012" TestSSHPublicKey = "" /* 204-byte string literal not displayed */ TestZone = "us-las" )
const ( TestWorkerInfrastructureProviderStatus = `` /* 184-byte string literal not displayed */ TestWorkerMachineCPUs = 1 TestWorkerMachineMemoryInMB = 1024 TestWorkerMachineType = "small" TestWorkerName = "ionos" TestWorkerPoolName = "ionos-pool-1" TestWorkerSecretName = "secret" TestWorkerUserData = "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo=" )
Variables ¶
This section is empty.
Functions ¶
func DecodeCluster ¶
func DecodeCluster(cluster *v1alpha1.Cluster) (*extensions.Cluster, error)
DecodeCluster returns a decoded cluster structure.
PARAMETERS cluster *v1alpha1.Cluster Cluster specification
func ManipulateCluster ¶
ManipulateCluster changes given provider specification.
PARAMETERS cluster *v1alpha1.Cluster Cluster specification data map[string]interface{} Members to change
func ManipulateControlPlane ¶
func ManipulateControlPlane(cp *v1alpha1.ControlPlane, data map[string]interface{}) *v1alpha1.ControlPlane
ManipulateControlPlane changes given provider specification.
PARAMETERS cp *v1alpha1.ControlPlane ControlPlane specification data map[string]interface{} Members to change
func ManipulateInfrastructure ¶
func ManipulateInfrastructure(infrastructure *v1alpha1.Infrastructure, data map[string]interface{}) *v1alpha1.Infrastructure
ManipulateInfrastructure changes given provider specification.
PARAMETERS infrastructure *extensions.Infrastructure Infrastructure specification data map[string]interface{} Members to change
func ManipulateWorker ¶
ManipulateWorker changes given provider specification.
PARAMETERS Worker *v1alpha1.Worker Worker specification data map[string]interface{} Members to change
func NewCluster ¶
NewCluster generates a new provider specification for testing purposes.
func NewControlPlane ¶
func NewControlPlane() *v1alpha1.ControlPlane
NewControlPlane generates a new provider specification for testing purposes.
func NewInfrastructure ¶
func NewInfrastructure() *v1alpha1.Infrastructure
NewInfrastructure generates a new provider specification for testing purposes.
func NewInfrastructureConfigSpec ¶
func NewInfrastructureConfigSpec() *apis.InfrastructureConfig
NewInfrastructureConfigSpec generates a new infrastructure config specification for testing purposes.
func SetupDatacentersEndpointOnMux ¶
SetupDatacentersEndpointOnMux configures a "/datacenters" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupImagesEndpointOnMux ¶
SetupImagesEndpointOnMux configures a "/images" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupServersEndpointOnMux ¶ added in v0.0.2
SetupServersEndpointOnMux configures a "/datacenters/<id>/servers" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupTestDatacenterEndpointOnMux ¶
SetupTestDatacenterEndpointOnMux configures "/datacenters/<dcid>/*" endpoints on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupTestImageEndpointOnMux ¶ added in v0.0.2
SetupTestImageEndpointOnMux configures a "/images" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupTestInfrastructureServerEndpointOnMux ¶ added in v0.0.2
SetupTestInfrastructureServerEndpointOnMux configures "/datacenters/<dcid>/servers/<sid>/*" endpoints on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
Types ¶
type MockTestEnv ¶
type MockTestEnv struct { ChartApplier *mockkubernetes.MockChartApplier Client *mockclient.MockClient MockController *gomock.Controller StatusWriter *mockclient.MockStatusWriter Server *httptest.Server Mux *http.ServeMux IonosClient *ionossdk.APIClient }
MockTestEnv represents the test environment for testing ionos API calls
func NewMockTestEnv ¶
func NewMockTestEnv() MockTestEnv
NewMockTestEnv generates a new, unconfigured test environment for testing purposes.
func (*MockTestEnv) Teardown ¶
func (env *MockTestEnv) Teardown()
Teardown shuts down the test environment