Skip to content

Commit 3ecd6c6

Browse files
committed
Enabled features through the dedicated field
1 parent 467b073 commit 3ecd6c6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

cmd/internal/converters/deployment_process_converter.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (c DeploymentProcessConverter) toHcl(resource octopus.DeploymentProcess, re
117117
Condition: a.Condition,
118118
RunOnServer: c.getRunOnServer(a.Properties),
119119
Properties: c.removeUnnecessaryFields(c.replaceIds(c.escapeDollars(sanitizer2.SanitizeMap(a.Properties)), dependencies)),
120+
Features: c.getFeatures(a.Properties),
120121
}
121122

122123
for k, p := range a.Packages {
@@ -246,7 +247,7 @@ func (c DeploymentProcessConverter) escapeDollars(properties map[string]string)
246247
func (c DeploymentProcessConverter) removeUnnecessaryFields(properties map[string]string) map[string]string {
247248
sanitisedProperties := map[string]string{}
248249
for k, v := range properties {
249-
if k != "Octopus.Action.RunOnServer" {
250+
if k != "Octopus.Action.RunOnServer" && k != "Octopus.Action.EnabledFeatures" {
250251
sanitisedProperties[k] = v
251252
}
252253
}
@@ -289,3 +290,12 @@ func (c DeploymentProcessConverter) replaceAccountIds(properties map[string]stri
289290

290291
return properties
291292
}
293+
294+
func (c DeploymentProcessConverter) getFeatures(properties map[string]any) []string {
295+
f, ok := properties["Octopus.Action.EnabledFeatures"]
296+
if ok {
297+
return strings.Split(fmt.Sprint(f), ",")
298+
}
299+
300+
return []string{}
301+
}

cmd/internal/model/terraform/terraform_deployment_process.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type TerraformAction struct {
3434
Channels []string `hcl:"channels"`
3535
TenantTags []string `hcl:"tenant_tags"`
3636
Package []TerraformPackage `hcl:"package,block"`
37+
Features []string `hcl:"features"`
3738
}
3839

3940
type TerraformContainer struct {

wasm/convert_project.wasm

1.92 KB
Binary file not shown.

0 commit comments

Comments
 (0)