driver

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: 45 Imported by: 0

Documentation

Overview

Package driver is a generated GoMock package.

Package driver is a generated GoMock package.

Index

Constants

View Source
const (
	TerraformAzureProvider            = "registry.terraform.io/hashicorp/azurerm"
	TerraformAWSProvider              = "registry.terraform.io/hashicorp/aws"
	TerraformKubernetesProvider       = "registry.terraform.io/hashicorp/kubernetes"
	PrivateRegistrySecretKey_Pat      = "pat"
	PrivateRegistrySecretKey_Username = "username"
)

Variables

This section is empty.

Functions

func GetGitURL added in v0.35.0

func GetGitURL(templatePath string) (*url.URL, error)

GetGitURL returns git url from generic git module source. git::https://exmaple.com/project/module -> https://exmaple.com/project/module

func GetPrivateGitRepoSecretStoreID added in v0.36.0

func GetPrivateGitRepoSecretStoreID(envConfig recipes.Configuration, templatePath string) (string, error)

GetPrivateGitRepoSecretStoreID returns secretstore resource ID associated with git private terraform repository source.

Types

type BaseOptions

type BaseOptions struct {
	// Configuration is the configuration for the recipe.
	Configuration recipes.Configuration

	// Recipe is the recipe metadata.
	Recipe recipes.ResourceMetadata

	// Definition is the environment definition for the recipe.
	Definition recipes.EnvironmentDefinition

	// Secrets represents a map of secrets required for recipe execution.
	// The outer map's key represents the secretStoreIDs while
	// while the inner map's key-value pairs represent the [secretKey]secretValue.
	// Example:
	// Secrets{
	//     "secretStoreID1": {
	//         "apiKey": "value1",
	//         "apiSecret": "value2",
	//     },
	//     "secretStoreID2": {
	//         "accessKey": "accessKey123",
	//         "secretKey": "secretKeyXYZ",
	//     },
	// }
	Secrets map[string]recipes.SecretData
}

BaseOptions is the base options for the driver operations.

type BicepOptions added in v0.26.0

type BicepOptions struct {
	DeleteRetryCount        int
	DeleteRetryDelaySeconds int
}

type DeleteOptions

type DeleteOptions struct {
	BaseOptions

	// OutputResources is the list of output resources for the recipe.
	OutputResources []rpv1.OutputResource
}

DeleteOptions is the options for the Delete method.

type Driver

type Driver interface {
	// Execute fetches the recipe contents and deploys the recipe and returns deployed resources, secrets and values.
	Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error)

	// Delete handles deletion of output resources for the recipe deployment.
	Delete(ctx context.Context, opts DeleteOptions) error

	// Gets the Recipe metadata and parameters from Recipe's template path
	GetRecipeMetadata(ctx context.Context, opts BaseOptions) (map[string]any, error)
}

Driver is an interface to implement recipe deployment and recipe resources deletion.

func NewBicepDriver

func NewBicepDriver(armOptions *arm.ClientOptions, deploymentClient *clients.ResourceDeploymentsClient, client processors.ResourceClient, options BicepOptions) Driver

NewBicepDriver creates a new bicep driver instance with the given ARM client options, deployment client, resource client, and options.

func NewTerraformDriver

func NewTerraformDriver(ucpConn sdk.Connection, secretProvider *ucp_provider.SecretProvider, options TerraformOptions, k8sClientSet kubernetes.Interface) Driver

NewTerraformDriver creates a new instance of driver to execute a Terraform recipe.

type DriverWithSecrets added in v0.33.0

type DriverWithSecrets interface {
	// Driver is an interface to implement recipe deployment and recipe resources deletion.
	Driver

	// FindSecretIDs retrieves a map of secret store resource IDs and their corresponding secret keys for secrets required for recipe deployment.
	FindSecretIDs(ctx context.Context, config recipes.Configuration, definition recipes.EnvironmentDefinition) (secretIDs map[string][]string, err error)
}

DriverWithSecrets is an optional interface and used when the driver needs to load secrets for recipe deployment.

type ExecuteOptions

type ExecuteOptions struct {
	BaseOptions
	// Previously deployed state of output resource IDs.
	PrevState []string
}

ExecuteOptions is the options for the Execute method.

type MockDriver

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

MockDriver is a mock of Driver interface.

func NewMockDriver

func NewMockDriver(ctrl *gomock.Controller) *MockDriver

NewMockDriver creates a new mock instance.

func (*MockDriver) Delete

func (m *MockDriver) Delete(arg0 context.Context, arg1 DeleteOptions) error

Delete mocks base method.

func (*MockDriver) EXPECT

func (m *MockDriver) EXPECT() *MockDriverMockRecorder

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

func (*MockDriver) Execute

func (m *MockDriver) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error)

Execute mocks base method.

func (*MockDriver) GetRecipeMetadata

func (m *MockDriver) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) (map[string]any, error)

GetRecipeMetadata mocks base method.

type MockDriverDeleteCall added in v0.35.0

type MockDriverDeleteCall struct {
	*gomock.Call
}

MockDriverDeleteCall wrap *gomock.Call

func (*MockDriverDeleteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverDeleteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverDeleteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverExecuteCall added in v0.35.0

type MockDriverExecuteCall struct {
	*gomock.Call
}

MockDriverExecuteCall wrap *gomock.Call

func (*MockDriverExecuteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverExecuteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverExecuteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverGetRecipeMetadataCall added in v0.35.0

type MockDriverGetRecipeMetadataCall struct {
	*gomock.Call
}

MockDriverGetRecipeMetadataCall wrap *gomock.Call

func (*MockDriverGetRecipeMetadataCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverGetRecipeMetadataCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverGetRecipeMetadataCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverMockRecorder

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

MockDriverMockRecorder is the mock recorder for MockDriver.

func (*MockDriverMockRecorder) Delete

func (mr *MockDriverMockRecorder) Delete(arg0, arg1 any) *MockDriverDeleteCall

Delete indicates an expected call of Delete.

func (*MockDriverMockRecorder) Execute

func (mr *MockDriverMockRecorder) Execute(arg0, arg1 any) *MockDriverExecuteCall

Execute indicates an expected call of Execute.

func (*MockDriverMockRecorder) GetRecipeMetadata

func (mr *MockDriverMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockDriverGetRecipeMetadataCall

GetRecipeMetadata indicates an expected call of GetRecipeMetadata.

type MockDriverWithSecrets added in v0.33.0

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

MockDriverWithSecrets is a mock of DriverWithSecrets interface.

func NewMockDriverWithSecrets added in v0.33.0

func NewMockDriverWithSecrets(ctrl *gomock.Controller) *MockDriverWithSecrets

NewMockDriverWithSecrets creates a new mock instance.

func (*MockDriverWithSecrets) Delete added in v0.33.0

Delete mocks base method.

func (*MockDriverWithSecrets) EXPECT added in v0.33.0

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

func (*MockDriverWithSecrets) Execute added in v0.33.0

Execute mocks base method.

func (*MockDriverWithSecrets) FindSecretIDs added in v0.33.0

FindSecretIDs mocks base method.

func (*MockDriverWithSecrets) GetRecipeMetadata added in v0.33.0

func (m *MockDriverWithSecrets) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) (map[string]any, error)

GetRecipeMetadata mocks base method.

type MockDriverWithSecretsDeleteCall added in v0.35.0

type MockDriverWithSecretsDeleteCall struct {
	*gomock.Call
}

MockDriverWithSecretsDeleteCall wrap *gomock.Call

func (*MockDriverWithSecretsDeleteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverWithSecretsDeleteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverWithSecretsDeleteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverWithSecretsExecuteCall added in v0.35.0

type MockDriverWithSecretsExecuteCall struct {
	*gomock.Call
}

MockDriverWithSecretsExecuteCall wrap *gomock.Call

func (*MockDriverWithSecretsExecuteCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverWithSecretsExecuteCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverWithSecretsExecuteCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverWithSecretsFindSecretIDsCall added in v0.35.0

type MockDriverWithSecretsFindSecretIDsCall struct {
	*gomock.Call
}

MockDriverWithSecretsFindSecretIDsCall wrap *gomock.Call

func (*MockDriverWithSecretsFindSecretIDsCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverWithSecretsFindSecretIDsCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverWithSecretsFindSecretIDsCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverWithSecretsGetRecipeMetadataCall added in v0.35.0

type MockDriverWithSecretsGetRecipeMetadataCall struct {
	*gomock.Call
}

MockDriverWithSecretsGetRecipeMetadataCall wrap *gomock.Call

func (*MockDriverWithSecretsGetRecipeMetadataCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockDriverWithSecretsGetRecipeMetadataCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockDriverWithSecretsGetRecipeMetadataCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

type MockDriverWithSecretsMockRecorder added in v0.33.0

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

MockDriverWithSecretsMockRecorder is the mock recorder for MockDriverWithSecrets.

func (*MockDriverWithSecretsMockRecorder) Delete added in v0.33.0

Delete indicates an expected call of Delete.

func (*MockDriverWithSecretsMockRecorder) Execute added in v0.33.0

Execute indicates an expected call of Execute.

func (*MockDriverWithSecretsMockRecorder) FindSecretIDs added in v0.33.0

FindSecretIDs indicates an expected call of FindSecretIDs.

func (*MockDriverWithSecretsMockRecorder) GetRecipeMetadata added in v0.33.0

GetRecipeMetadata indicates an expected call of GetRecipeMetadata.

type TerraformOptions

type TerraformOptions struct {
	// Path is the path to the directory mounted to the container where terraform can be installed and executed.
	Path string
}

Options represents the options required for execution of Terraform driver.

Jump to

Keyboard shortcuts

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