Documentation ¶
Overview ¶
Package mock provides all methods required to simulate a HCloud provider environment
Package mock provides all methods required to simulate a HCloud provider environment ¶
Package mock provides all methods required to simulate a HCloud provider environment ¶
Package mock provides all methods required to simulate a HCloud provider environment ¶
Package mock provides all methods required to simulate a HCloud provider environment ¶
Package mock provides all methods required to simulate a HCloud 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 SetupImagesEndpointOnMux(mux *http.ServeMux)
- func SetupNetworksEndpointOnMux(mux *http.ServeMux)
- func SetupSshKeysEndpointOnMux(mux *http.ServeMux)
- type MockTestEnv
Constants ¶
const ( TestClusterCloudProfile = `` /* 487-byte string literal not displayed */ TestClusterName = "xyz" TestClusterSeed = `{ "apiVersion": "core.gardener.cloud/v1alpha1", "kind": "Seed" }` TestClusterShoot = `` /* 253-byte string literal not displayed */ )
const ( TestControlPlaneInfrastructureProviderStatus = `` /* 142-byte string literal not displayed */ TestControlPlaneName = "xyz" TestControlPlaneProviderConfig = `{ "apiVersion": "hcloud.provider.extensions.gardener.cloud/v1alpha1", "kind": "ControlPlaneConfig" }` TestControlPlaneSecretName = "cloudprovider" )
const ( TestInfrastructureName = "abc" TestInfrastructureProviderConfig = `` /* 193-byte string literal not displayed */ TestInfrastructureSecretName = "cloudprovider" TestInfrastructureWorkersNetworkName = "test-namespace-workers" )
const ( TestFloatingPoolName = "MY-FLOATING-POOL" TestNamespace = "test-namespace" TestRegion = "hel1" TestSSHFingerprint = "b0:aa:73:08:9e:4f:6b:d1:3f:12:eb:66:78:61:63:08" TestSSHPublicKey = "" /* 204-byte string literal not displayed */ TestZone = "hel1-dc2" )
const ( TestWorkerInfrastructureProviderStatusTemplate = `` /* 173-byte string literal not displayed */ TestWorkerMachineImageName = "ubuntu" TestWorkerMachineImageVersion = "20.04" TestWorkerMachineType = "cx11" TestWorkerName = "hcloud" TestWorkerPoolName = "hcloud-pool-1" TestWorkerSecretName = "secret" TestWorkerUserData = "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo=" )
Variables ¶
This section is empty.
Functions ¶
func DecodeCluster ¶ added in v0.1.3
func DecodeCluster(cluster *v1alpha1.Cluster) (*extensions.Cluster, error)
DecodeCluster returns a decoded cluster structure.
PARAMETERS cluster *v1alpha1.Cluster Cluster specification
func ManipulateCluster ¶ added in v0.1.3
ManipulateCluster changes given provider specification.
PARAMETERS cluster *v1alpha1.Cluster Cluster specification data map[string]interface{} Members to change
func ManipulateControlPlane ¶ added in v0.3.4
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 ¶ added in v0.1.3
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 ¶ added in v0.3.2
ManipulateWorker changes given provider specification.
PARAMETERS Worker *v1alpha1.Worker Worker specification data map[string]interface{} Members to change
func NewCluster ¶ added in v0.1.3
NewCluster generates a new provider specification for testing purposes.
func NewControlPlane ¶ added in v0.3.4
func NewControlPlane() *v1alpha1.ControlPlane
NewControlPlane generates a new provider specification for testing purposes.
func NewInfrastructure ¶ added in v0.1.3
func NewInfrastructure() *v1alpha1.Infrastructure
NewInfrastructure generates a new provider specification for testing purposes.
func NewInfrastructureConfigSpec ¶ added in v0.2.0
func NewInfrastructureConfigSpec() *apis.InfrastructureConfig
NewInfrastructureConfigSpec generates a new infrastructure config specification for testing purposes.
func NewWorker ¶ added in v0.3.2
NewWorker generates a new provider specification for testing purposes.
func SetupImagesEndpointOnMux ¶ added in v0.3.2
SetupImagesEndpointOnMux configures a "/images" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupNetworksEndpointOnMux ¶ added in v0.1.3
SetupNetworksEndpointOnMux configures a "/ssh_keys" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupSshKeysEndpointOnMux ¶ added in v0.1.3
SetupSshKeysEndpointOnMux configures a "/ssh_keys" endpoint 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 HcloudClient *hcloud.Client }
MockTestEnv represents the test environment for testing HCloud 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