backends

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package backends is a generated GoMock package.

Index

Constants

View Source
const (
	RadiusNamespace   = "radius-system"
	BackendKubernetes = "kubernetes"

	// KubernetesBackendNamePrefix is the default prefix added by Terraform to the generated Kubernetes secret name.
	// Terraform generates the secret name in the format "tfstate-{workspace}-{secret_suffix}". Default terraform workspace
	// is used for recipes deployment.
	// https://developer.hashicorp.com/terraform/language/settings/backends/kubernetes
	// https://developer.hashicorp.com/terraform/language/state/workspaces
	KubernetesBackendNamePrefix = "tfstate-default-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// BuildBackend generates the Terraform backend configuration for the backend.
	// Returns a map of Terraform backend name to values representing the backend configuration.
	// Returns an error if the backend configuration cannot be generated.
	BuildBackend(resourceRecipe *recipes.ResourceMetadata) (map[string]any, error)

	// ValidateBackendExists checks if the Terraform state file backend source exists.
	// For example, for Kubernetes backend, it checks if the Kubernetes secret for Terraform state file exists.
	// returns true if backend is found, false otherwise.
	ValidateBackendExists(ctx context.Context, name string) (bool, error)
}

Backend is an interface for generating Terraform backend configurations.

func NewKubernetesBackend

func NewKubernetesBackend(k8sClientSet kubernetes.Interface) Backend

type MockBackend

type MockBackend struct {
	// contains filtered or unexported fields
}

MockBackend is a mock of Backend interface.

func NewMockBackend

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance.

func (*MockBackend) BuildBackend

func (m *MockBackend) BuildBackend(arg0 *recipes.ResourceMetadata) (map[string]any, error)

BuildBackend mocks base method.

func (*MockBackend) EXPECT

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBackend) ValidateBackendExists added in v0.26.0

func (m *MockBackend) ValidateBackendExists(arg0 context.Context, arg1 string) (bool, error)

ValidateBackendExists mocks base method.

type MockBackendBuildBackendCall added in v0.35.0

type MockBackendBuildBackendCall struct {
	*gomock.Call
}

MockBackendBuildBackendCall wrap *gomock.Call

func (*MockBackendBuildBackendCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockBackendBuildBackendCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockBackendBuildBackendCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockBackendMockRecorder

type MockBackendMockRecorder struct {
	// contains filtered or unexported fields
}

MockBackendMockRecorder is the mock recorder for MockBackend.

func (*MockBackendMockRecorder) BuildBackend

BuildBackend indicates an expected call of BuildBackend.

func (*MockBackendMockRecorder) ValidateBackendExists added in v0.26.0

func (mr *MockBackendMockRecorder) ValidateBackendExists(arg0, arg1 any) *MockBackendValidateBackendExistsCall

ValidateBackendExists indicates an expected call of ValidateBackendExists.

type MockBackendValidateBackendExistsCall added in v0.35.0

type MockBackendValidateBackendExistsCall struct {
	*gomock.Call
}

MockBackendValidateBackendExistsCall wrap *gomock.Call

func (*MockBackendValidateBackendExistsCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockBackendValidateBackendExistsCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockBackendValidateBackendExistsCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

Jump to

Keyboard shortcuts

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