Documentation
¶
Overview ¶
Package driver is a generated GoMock package.
Package driver is a generated GoMock package.
Index ¶
- Constants
- func GetGitURL(templatePath string) (*url.URL, error)
- func GetPrivateGitRepoSecretStoreID(envConfig recipes.Configuration, templatePath string) (string, error)
- type BaseOptions
- type BicepOptions
- type DeleteOptions
- type Driver
- type DriverWithSecrets
- type ExecuteOptions
- type MockDriver
- func (m *MockDriver) Delete(arg0 context.Context, arg1 DeleteOptions) error
- func (m *MockDriver) EXPECT() *MockDriverMockRecorder
- func (m *MockDriver) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error)
- func (m *MockDriver) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) (map[string]any, error)
- type MockDriverDeleteCall
- type MockDriverExecuteCall
- func (c *MockDriverExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall
- func (c *MockDriverExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall
- func (c *MockDriverExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverExecuteCall
- type MockDriverGetRecipeMetadataCall
- func (c *MockDriverGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall
- func (c *MockDriverGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall
- func (c *MockDriverGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverGetRecipeMetadataCall
- type MockDriverMockRecorder
- type MockDriverWithSecrets
- func (m *MockDriverWithSecrets) Delete(arg0 context.Context, arg1 DeleteOptions) error
- func (m *MockDriverWithSecrets) EXPECT() *MockDriverWithSecretsMockRecorder
- func (m *MockDriverWithSecrets) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error)
- func (m *MockDriverWithSecrets) FindSecretIDs(arg0 context.Context, arg1 recipes.Configuration, ...) (map[string][]string, error)
- func (m *MockDriverWithSecrets) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) (map[string]any, error)
- type MockDriverWithSecretsDeleteCall
- func (c *MockDriverWithSecretsDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall
- func (c *MockDriverWithSecretsDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall
- func (c *MockDriverWithSecretsDeleteCall) Return(arg0 error) *MockDriverWithSecretsDeleteCall
- type MockDriverWithSecretsExecuteCall
- func (c *MockDriverWithSecretsExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall
- func (c *MockDriverWithSecretsExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall
- func (c *MockDriverWithSecretsExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverWithSecretsExecuteCall
- type MockDriverWithSecretsFindSecretIDsCall
- func (c *MockDriverWithSecretsFindSecretIDsCall) Do(...) *MockDriverWithSecretsFindSecretIDsCall
- func (c *MockDriverWithSecretsFindSecretIDsCall) DoAndReturn(...) *MockDriverWithSecretsFindSecretIDsCall
- func (c *MockDriverWithSecretsFindSecretIDsCall) Return(arg0 map[string][]string, arg1 error) *MockDriverWithSecretsFindSecretIDsCall
- type MockDriverWithSecretsGetRecipeMetadataCall
- func (c *MockDriverWithSecretsGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall
- func (c *MockDriverWithSecretsGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall
- func (c *MockDriverWithSecretsGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverWithSecretsGetRecipeMetadataCall
- type MockDriverWithSecretsMockRecorder
- func (mr *MockDriverWithSecretsMockRecorder) Delete(arg0, arg1 any) *MockDriverWithSecretsDeleteCall
- func (mr *MockDriverWithSecretsMockRecorder) Execute(arg0, arg1 any) *MockDriverWithSecretsExecuteCall
- func (mr *MockDriverWithSecretsMockRecorder) FindSecretIDs(arg0, arg1, arg2 any) *MockDriverWithSecretsFindSecretIDsCall
- func (mr *MockDriverWithSecretsMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockDriverWithSecretsGetRecipeMetadataCall
- type TerraformOptions
Constants ¶
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
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 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 *secretprovider.SecretProvider, options TerraformOptions, kubernetesClients kubernetesclientprovider.KubernetesClientProvider) 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
MockDriverDeleteCall wrap *gomock.Call
func (*MockDriverDeleteCall) Do ¶ added in v0.35.0
func (c *MockDriverDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockDriverDeleteCall
Do rewrite *gomock.Call.Do
func (*MockDriverDeleteCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockDriverDeleteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverDeleteCall) Return ¶ added in v0.35.0
func (c *MockDriverDeleteCall) Return(arg0 error) *MockDriverDeleteCall
Return rewrite *gomock.Call.Return
type MockDriverExecuteCall ¶ added in v0.35.0
MockDriverExecuteCall wrap *gomock.Call
func (*MockDriverExecuteCall) Do ¶ added in v0.35.0
func (c *MockDriverExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall
Do rewrite *gomock.Call.Do
func (*MockDriverExecuteCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverExecuteCall) Return ¶ added in v0.35.0
func (c *MockDriverExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverExecuteCall
Return rewrite *gomock.Call.Return
type MockDriverGetRecipeMetadataCall ¶ added in v0.35.0
MockDriverGetRecipeMetadataCall wrap *gomock.Call
func (*MockDriverGetRecipeMetadataCall) Do ¶ added in v0.35.0
func (c *MockDriverGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall
Do rewrite *gomock.Call.Do
func (*MockDriverGetRecipeMetadataCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverGetRecipeMetadataCall) Return ¶ added in v0.35.0
func (c *MockDriverGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverGetRecipeMetadataCall
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
func (m *MockDriverWithSecrets) Delete(arg0 context.Context, arg1 DeleteOptions) error
Delete mocks base method.
func (*MockDriverWithSecrets) EXPECT ¶ added in v0.33.0
func (m *MockDriverWithSecrets) EXPECT() *MockDriverWithSecretsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDriverWithSecrets) Execute ¶ added in v0.33.0
func (m *MockDriverWithSecrets) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error)
Execute mocks base method.
func (*MockDriverWithSecrets) FindSecretIDs ¶ added in v0.33.0
func (m *MockDriverWithSecrets) FindSecretIDs(arg0 context.Context, arg1 recipes.Configuration, arg2 recipes.EnvironmentDefinition) (map[string][]string, error)
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
MockDriverWithSecretsDeleteCall wrap *gomock.Call
func (*MockDriverWithSecretsDeleteCall) Do ¶ added in v0.35.0
func (c *MockDriverWithSecretsDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall
Do rewrite *gomock.Call.Do
func (*MockDriverWithSecretsDeleteCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverWithSecretsDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverWithSecretsDeleteCall) Return ¶ added in v0.35.0
func (c *MockDriverWithSecretsDeleteCall) Return(arg0 error) *MockDriverWithSecretsDeleteCall
Return rewrite *gomock.Call.Return
type MockDriverWithSecretsExecuteCall ¶ added in v0.35.0
MockDriverWithSecretsExecuteCall wrap *gomock.Call
func (*MockDriverWithSecretsExecuteCall) Do ¶ added in v0.35.0
func (c *MockDriverWithSecretsExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall
Do rewrite *gomock.Call.Do
func (*MockDriverWithSecretsExecuteCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverWithSecretsExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverWithSecretsExecuteCall) Return ¶ added in v0.35.0
func (c *MockDriverWithSecretsExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverWithSecretsExecuteCall
Return rewrite *gomock.Call.Return
type MockDriverWithSecretsFindSecretIDsCall ¶ added in v0.35.0
MockDriverWithSecretsFindSecretIDsCall wrap *gomock.Call
func (*MockDriverWithSecretsFindSecretIDsCall) Do ¶ added in v0.35.0
func (c *MockDriverWithSecretsFindSecretIDsCall) Do(f func(context.Context, recipes.Configuration, recipes.EnvironmentDefinition) (map[string][]string, error)) *MockDriverWithSecretsFindSecretIDsCall
Do rewrite *gomock.Call.Do
func (*MockDriverWithSecretsFindSecretIDsCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverWithSecretsFindSecretIDsCall) DoAndReturn(f func(context.Context, recipes.Configuration, recipes.EnvironmentDefinition) (map[string][]string, error)) *MockDriverWithSecretsFindSecretIDsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverWithSecretsFindSecretIDsCall) Return ¶ added in v0.35.0
func (c *MockDriverWithSecretsFindSecretIDsCall) Return(arg0 map[string][]string, arg1 error) *MockDriverWithSecretsFindSecretIDsCall
Return rewrite *gomock.Call.Return
type MockDriverWithSecretsGetRecipeMetadataCall ¶ added in v0.35.0
MockDriverWithSecretsGetRecipeMetadataCall wrap *gomock.Call
func (*MockDriverWithSecretsGetRecipeMetadataCall) Do ¶ added in v0.35.0
func (c *MockDriverWithSecretsGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall
Do rewrite *gomock.Call.Do
func (*MockDriverWithSecretsGetRecipeMetadataCall) DoAndReturn ¶ added in v0.35.0
func (c *MockDriverWithSecretsGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockDriverWithSecretsGetRecipeMetadataCall) Return ¶ added in v0.35.0
func (c *MockDriverWithSecretsGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverWithSecretsGetRecipeMetadataCall
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
func (mr *MockDriverWithSecretsMockRecorder) Delete(arg0, arg1 any) *MockDriverWithSecretsDeleteCall
Delete indicates an expected call of Delete.
func (*MockDriverWithSecretsMockRecorder) Execute ¶ added in v0.33.0
func (mr *MockDriverWithSecretsMockRecorder) Execute(arg0, arg1 any) *MockDriverWithSecretsExecuteCall
Execute indicates an expected call of Execute.
func (*MockDriverWithSecretsMockRecorder) FindSecretIDs ¶ added in v0.33.0
func (mr *MockDriverWithSecretsMockRecorder) FindSecretIDs(arg0, arg1, arg2 any) *MockDriverWithSecretsFindSecretIDsCall
FindSecretIDs indicates an expected call of FindSecretIDs.
func (*MockDriverWithSecretsMockRecorder) GetRecipeMetadata ¶ added in v0.33.0
func (mr *MockDriverWithSecretsMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockDriverWithSecretsGetRecipeMetadataCall
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.