Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use loaded providers as definitive providers #1623

Merged
merged 2 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions engine/entrance.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
[#macro invokeEntranceMacro type ]

[#local macroOptions = []]
[#list getCLODeploymentProviders() as provider ]
[#list getLoaderProviders() as provider ]
[#local macroOptions +=
[
[ provider, "entrance", type ]
Expand All @@ -124,16 +124,16 @@
[@fatal
message="Could not find entrance macro with provided options"
context=macroOptions
enabled=false
enabled=true
stop=true
/]
[#stop "HamletFatal: Unable to find an entrance macro: ${type}" ]
[/#if]
[/#macro]

[#macro addEntranceInputSteps type ]

[#local macroOptions = []]
[#list getCLODeploymentProviders() as provider ]
[#list getLoaderProviders() as provider ]
[#local macroOptions +=
[
[ provider, "entrance", type, "inputsteps" ]
Expand Down
2 changes: 1 addition & 1 deletion engine/inputdata/blueprint.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[#-- Components --]
[@includeAllComponentDefinitionConfiguration
SHARED_PROVIDER
getCLODeploymentProviders()
getLoaderProviders()
/]

[#local componentChildren = []]
Expand Down
4 changes: 3 additions & 1 deletion engine/inputdata/inputsource.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ to filter the data returned
[#return getInputState()[LOADER_CONFIG_INPUT_CLASS]!{} ]
[/#function]

[#function getLoaderProviders ]
[#return (getLoader().Providers)![]]
[/#function]
[#--
Get the value for a point within the state
--]
Expand Down Expand Up @@ -1021,4 +1024,3 @@ as processing is typically centred around the initially provided filter values
[#assign inputStateRefreshRequired = false]
[/#if]
[/#macro]

6 changes: 3 additions & 3 deletions engine/output.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@

[#local outputMappings = getGenerationContractStepOutputMapping(
combineEntities(
getCLODeploymentProviders(),
getLoaderProviders(),
[ SHARED_PROVIDER],
UNIQUE_COMBINE_BEHAVIOUR
),
Expand All @@ -448,7 +448,7 @@
[#function getGenerationContractStepParameters subset alternative ]
[#local outputMappings = getGenerationContractStepOutputMapping(
combineEntities(
getCLODeploymentProviders(),
getLoaderProviders(),
[ SHARED_PROVIDER],
UNIQUE_COMBINE_BEHAVIOUR
),
Expand All @@ -464,7 +464,7 @@
[#return {
"entrance" : getCLOEntranceType(),
"flows" : getCLOFlows()?join(","),
"providers" : (getCLODeploymentProviders()?join(","))!SHARED_PROVIDER,
"providers" : (getLoaderProviders()?join(","))!SHARED_PROVIDER,
"deploymentFramework" : getCLODeploymentFramework(),
"outputType" : outputMappings["OutputType"],
"outputFormat" : outputMappings["OutputFormat"],
Expand Down
2 changes: 1 addition & 1 deletion engine/output_writer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
[#break]
[/#if]

[#list combineEntities( getCLODeploymentProviders(), [ SHARED_PROVIDER ], UNIQUE_COMBINE_BEHAVIOUR) as provider ]
[#list combineEntities( getLoaderProviders(), [ SHARED_PROVIDER ], UNIQUE_COMBINE_BEHAVIOUR) as provider ]
[#local handlerFunctionOptions = [
[ provider, "outputhandler", handler ]
]]
Expand Down
10 changes: 4 additions & 6 deletions engine/setContext.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[@includeSharedComponentConfiguration component="baseline" /]

[#-- Temporary AWS stuff --]
[#if getCLODeploymentProviders()?seq_contains("aws") ]
[#if getLoaderProviders()?seq_contains("aws") ]
[@includeProviderComponentDefinitionConfiguration provider="aws" component="baseline" /]
[@includeProviderComponentConfiguration provider="aws" component="baseline" services="baseline" /]
[@includeProviderComponentDefinitionConfiguration provider="aws" component="s3" /]
Expand Down Expand Up @@ -130,7 +130,7 @@
[#assign accountId = accountObject.Id ]
[#assign accountName = accountObject.Name ]

[#if getCLODeploymentProviders()?seq_contains("aws")]
[#if getLoaderProviders()?seq_contains("aws")]
[#assign credentialsBucket = getExistingReference(formatAccountS3Id("credentials"))]
[#assign credentialsBucketRegion = getExistingReference(formatAccountS3Id("credentials"), REGION_ATTRIBUTE_TYPE)]

Expand Down Expand Up @@ -204,7 +204,7 @@

[/#if]

[#if getCLODeploymentProviders()?seq_contains("aws")]
[#if getLoaderProviders()?seq_contains("aws")]
[#assign segmentSeed = getExistingReference(formatSegmentSeedId()) ]

[#assign legacyVpc = getExistingReference(formatVPCId())?has_content ]
Expand All @@ -226,7 +226,7 @@
[#assign sshEnabled = segmentObject.Bastion.Enabled ]
[#assign sshActive = sshEnabled && segmentObject.Bastion.Active ]

[#if getCLODeploymentProviders()?seq_contains("aws")]
[#if getLoaderProviders()?seq_contains("aws")]
[#assign sshFromProxySecurityGroup = getExistingReference(formatSSHFromProxySecurityGroupId())]
[/#if]

Expand Down Expand Up @@ -695,5 +695,3 @@
[/#list]
[#return codes]
[/#function]


2 changes: 1 addition & 1 deletion providers/shared/components/shared/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
[#local testCase = testCases[testCaseName] ]

[#local outputProviders = combineEntities(
getCLODeploymentProviders(),
getLoaderProviders(),
[ SHARED_PROVIDER],
UNIQUE_COMBINE_BEHAVIOUR
)]
Expand Down
2 changes: 1 addition & 1 deletion providers/shared/flows/views/flow.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
view=getCLOView()
/]

[#local primaryProvider = (getCLODeploymentProviders()[0])!SHARED_PROVIDER ]
[#local primaryProvider = (getLoaderProviders()[0])!SHARED_PROVIDER ]

[@includeProviderViewDefinitionConfiguration
provider=primaryProvider
Expand Down
2 changes: 1 addition & 1 deletion providers/shared/provider.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
deploymentUnit=resourceSet["deployment:Unit"]
deploymentGroup=deploymentGroupDetails.Name
deploymentPriority=priority?has_content?then(priority, resourceSet["deployment:Priority"])
deploymentProvider=getCLODeploymentProviders()[0]
deploymentProvider=getLoaderProviders()[0]
currentState=currentState
deploymentMode=deploymentMode
/]
Expand Down
2 changes: 1 addition & 1 deletion providers/shared/views/info/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[#macro shared_view_default_info ]

[#-- Load sections which are dynamically loaded through discovery --]
[#local providersList = asFlattenedArray( [ SHARED_PROVIDER, getCLODeploymentProviders() ] ) ]
[#local providersList = asFlattenedArray( [ SHARED_PROVIDER, getLoaderProviders() ] ) ]
[@includeAllComponentDefinitionConfiguration providersList /]
[@includeAllViewConfiguration providersList /]

Expand Down
6 changes: 3 additions & 3 deletions providers/shared/views/schema/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[#break]
[#else]

[#local schemaLayerConfig =
[#local schemaLayerConfig =
getLayerConfiguration(schema?capitalize)]

[#local schemaLayerAttributes = schemaLayerConfig.Attributes![]]
Expand Down Expand Up @@ -56,7 +56,7 @@

[@includeAllComponentDefinitionConfiguration
SHARED_PROVIDER
getCLODeploymentProviders()
getLoaderProviders()
/]
[#local configuration = componentConfiguration[schema] ]

Expand Down Expand Up @@ -199,4 +199,4 @@
/]
[/#if]

[/#macro]
[/#macro]
4 changes: 2 additions & 2 deletions providers/shared/views/schemaset/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[#case "component" ]
[@includeAllComponentDefinitionConfiguration
SHARED_PROVIDER
getCLODeploymentProviders()
getLoaderProviders()
/]
[#local schemas = componentConfiguration?keys ]
[#break]
Expand All @@ -40,7 +40,7 @@
[#local outputMappings =
getGenerationContractStepOutputMapping(
combineEntities(
getCLODeploymentProviders(),
getLoaderProviders(),
[ SHARED_PROVIDER],
UNIQUE_COMBINE_BEHAVIOUR
),
Expand Down
2 changes: 1 addition & 1 deletion providers/shared/views/unitlist/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
deploymentUnit=deploymentUnit
deploymentPriority=999
deploymentGroup=deploymentGroup
deploymentProvider=(getCLODeploymentProviders()[0])!SHARED_PROVIDER
deploymentProvider=(getLoaderProviders()[0])!SHARED_PROVIDER
currentState="orphaned"
deploymentMode="_orphan"
/]
Expand Down