mock

package
v0.1.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0, MIT Imports: 13 Imported by: 0

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

View Source
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 */

)
View Source
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"
)
View Source
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

func ManipulateCluster(cluster *v1alpha1.Cluster, data map[string]interface{}) *v1alpha1.Cluster

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

func NewCluster() *v1alpha1.Cluster

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

func SetupNetworksEndpointOnMux(mux *http.ServeMux)

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

func SetupSshKeysEndpointOnMux(mux *http.ServeMux)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL