backends

package
v0.28.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 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]interface{}, 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 MockBackendMockRecorder

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

MockBackendMockRecorder is the mock recorder for MockBackend.

func (*MockBackendMockRecorder) BuildBackend

func (mr *MockBackendMockRecorder) BuildBackend(arg0 interface{}) *gomock.Call

BuildBackend indicates an expected call of BuildBackend.

func (*MockBackendMockRecorder) ValidateBackendExists added in v0.26.0

func (mr *MockBackendMockRecorder) ValidateBackendExists(arg0, arg1 interface{}) *gomock.Call

ValidateBackendExists indicates an expected call of ValidateBackendExists.

Jump to

Keyboard shortcuts

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