Documentation ¶
Index ¶
- func Validate(tfRun types.DeploymentRun) error
- type PrerequisiteData
- func (data *PrerequisiteData) AddAndCheckCloudCredential(provider common.ID, credential *service.CredentialModel) error
- func (data *PrerequisiteData) CheckConsistency() error
- func (data *PrerequisiteData) SetAndCheckGitCredential(credential *service.CredentialModel) error
- func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplate(template service.Template) error
- func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplateVersion(version service.TemplateVersion) error
- func (data *PrerequisiteData) SetAndCheckProvider(provider *service.ProviderModel) error
- func (data *PrerequisiteData) SetAndCheckRequest(request deploymentevents.StartRunRequest) (shouldIgnore bool, err error)
- func (data *PrerequisiteData) SetAndCheckTemplate(template service.Template) error
- func (data *PrerequisiteData) SetAndCheckTemplateVersion(version service.TemplateVersion) error
- type PrerequisiteGatherer
- type RunFactory
- type TemplateParameterGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrerequisiteData ¶
type PrerequisiteData struct { Request deploymentevents.StartRunRequest PrerequisiteTemplate service.Template PrerequisiteTemplateVersion service.TemplateVersion Template service.Template TemplateVersion service.TemplateVersion PrimaryProvider *service.ProviderModel CloudCreds []types.ProviderCredentialPair GitCred *service.CredentialModel CACAOSSHKey string WhitelistCIDRs []string }
PrerequisiteData is prerequisite for creating a Terraform run.
func (*PrerequisiteData) AddAndCheckCloudCredential ¶
func (data *PrerequisiteData) AddAndCheckCloudCredential(provider common.ID, credential *service.CredentialModel) error
AddAndCheckCloudCredential validates and adds cloud credential
func (*PrerequisiteData) CheckConsistency ¶
func (data *PrerequisiteData) CheckConsistency() error
CheckConsistency checks if the objects required have been set, and whether the objects are consistent with the ones specified in the request.
func (*PrerequisiteData) SetAndCheckGitCredential ¶
func (data *PrerequisiteData) SetAndCheckGitCredential(credential *service.CredentialModel) error
SetAndCheckGitCredential ...
func (*PrerequisiteData) SetAndCheckPrerequisiteTemplate ¶
func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplate(template service.Template) error
SetAndCheckPrerequisiteTemplate validates and sets prerequisite template.
func (*PrerequisiteData) SetAndCheckPrerequisiteTemplateVersion ¶
func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplateVersion(version service.TemplateVersion) error
SetAndCheckPrerequisiteTemplateVersion validates and sets prerequisite template snapshot.
func (*PrerequisiteData) SetAndCheckProvider ¶
func (data *PrerequisiteData) SetAndCheckProvider(provider *service.ProviderModel) error
SetAndCheckProvider validates and sets provider. Note this only checks for existence of metadata, not the validity of its content.
func (*PrerequisiteData) SetAndCheckRequest ¶
func (data *PrerequisiteData) SetAndCheckRequest(request deploymentevents.StartRunRequest) (shouldIgnore bool, err error)
SetAndCheckRequest validates and set request, it returns true if the request should be ignored by this microservice.
func (*PrerequisiteData) SetAndCheckTemplate ¶
func (data *PrerequisiteData) SetAndCheckTemplate(template service.Template) error
SetAndCheckTemplate validates and sets execution template.
func (*PrerequisiteData) SetAndCheckTemplateVersion ¶
func (data *PrerequisiteData) SetAndCheckTemplateVersion(version service.TemplateVersion) error
SetAndCheckTemplateVersion validates and sets execution template.
type PrerequisiteGatherer ¶
type PrerequisiteGatherer struct {
// contains filtered or unexported fields
}
PrerequisiteGatherer simply gathers the prerequisite data for the Terraform run
func NewPrerequisiteGatherer ¶
func NewPrerequisiteGatherer(templateMS ports.TemplateMicroservice, providerMS ports.ProviderMicroservice, credMS ports.CredentialMicroservice, sshKeySrc ports.SSHKeySrc, whitelistCIDRs []string) PrerequisiteGatherer
NewPrerequisiteGatherer ...
func (PrerequisiteGatherer) Gather ¶
func (g PrerequisiteGatherer) Gather(request deploymentevents.StartRunRequest) (PrerequisiteData, error)
Gather gathers prerequisite for Terraform Run
type RunFactory ¶
type RunFactory struct { }
RunFactory is a factory that creates Terraform objects from prerequisite data. Note: the credMS is used to fetch ssh key credentials for potential cloud-init script.
func (RunFactory) NewRun ¶
func (fac RunFactory) NewRun(requestTID common.TransactionID, data PrerequisiteData, paramGenerator TemplateParameterGenerator) (types.DeploymentRun, error)
NewRun creates a new Terraform Run object
type TemplateParameterGenerator ¶
type TemplateParameterGenerator func(PrerequisiteData) ([]deploymentcommon.DeploymentParameter, error)
TemplateParameterGenerator is a function that generates parameters from PrerequisiteData for template.
func NewTemplateParameterGenerator ¶
func NewTemplateParameterGenerator(credMS ports.CredentialMicroservice) TemplateParameterGenerator
NewTemplateParameterGenerator creates a new generator for execution template.