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
Index ¶
- Constants
- func DecodeCluster(cluster *v1alpha1.Cluster) (*extensions.Cluster, error)
- func ManipulateCluster(cluster *v1alpha1.Cluster, data map[string]interface{}) *v1alpha1.Cluster
- func ManipulateInfrastructure(infrastructure *v1alpha1.Infrastructure, data map[string]interface{}) *v1alpha1.Infrastructure
- func NewCluster() *v1alpha1.Cluster
- func NewInfrastructure() *v1alpha1.Infrastructure
- func SetupNetworksEndpointOnMux(mux *http.ServeMux)
- func SetupSshKeysEndpointOnMux(mux *http.ServeMux)
- type MockTestEnv
Constants ¶
const ( TestClusterName = "xyz" TestClusterSpecCloudProfile = `` /* 462-byte string literal not displayed */ TestClusterSpecSeed = `{ "apiVersion": "core.gardener.cloud/v1alpha1", "kind": "Seed" }` TestClusterSpecShoot = `` /* 257-byte string literal not displayed */ )
const ( TestInfrastructureName = "abc" TestInfrastructureRegion = "hel1-dc2" TestInfrastructureSecretName = "cloudprovider" TestInfrastructureSpecProviderConfig = `` /* 193-byte string literal not displayed */ TestInfrastructureSSHFingerprint = "b0:aa:73:08:9e:4f:6b:d1:3f:12:eb:66:78:61:63:08" TestInfrastructureWorkersNetworkName = "test-namespace-workers" )
const (
TestNamespace = "test-namespace"
)
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 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 NewCluster ¶ added in v0.1.3
NewCluster 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 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