@@ -84,7 +84,7 @@ func (c DeploymentProcessConverter) toHcl(resource octopus.DeploymentProcess, re
84
84
terraformResource .Step [i ] = terraform.TerraformStep {
85
85
Name : s .Name ,
86
86
PackageRequirement : s .PackageRequirement ,
87
- Properties : c .replaceFeedIds (s .Properties , dependencies ),
87
+ Properties : c .removeUnnecessaryStepFields ( c . replaceFeedIds (s .Properties , dependencies ) ),
88
88
Condition : s .Condition ,
89
89
StartTrigger : s .StartTrigger ,
90
90
Action : make ([]terraform.TerraformAction , len (s .Actions )),
@@ -117,7 +117,7 @@ func (c DeploymentProcessConverter) toHcl(resource octopus.DeploymentProcess, re
117
117
Package : make ([]terraform.TerraformPackage , len (a .Packages )),
118
118
Condition : a .Condition ,
119
119
RunOnServer : c .getRunOnServer (a .Properties ),
120
- Properties : c .removeUnnecessaryFields (c .replaceIds (c .escapeDollars (sanitizer2 .SanitizeMap (a .Properties )), dependencies )),
120
+ Properties : c .removeUnnecessaryActionFields (c .replaceIds (c .escapeDollars (sanitizer2 .SanitizeMap (a .Properties )), dependencies )),
121
121
Features : c .getFeatures (a .Properties ),
122
122
}
123
123
@@ -244,11 +244,22 @@ func (c DeploymentProcessConverter) escapeDollars(properties map[string]string)
244
244
return sanitisedProperties
245
245
}
246
246
247
- // removeUnnecessaryFields removes generic property bag values that have more specific terraform properties
248
- func (c DeploymentProcessConverter ) removeUnnecessaryFields (properties map [string ]string ) map [string ]string {
247
+ // removeUnnecessaryActionFields removes generic property bag values that have more specific terraform properties
248
+ func (c DeploymentProcessConverter ) removeUnnecessaryActionFields (properties map [string ]string ) map [string ]string {
249
249
sanitisedProperties := map [string ]string {}
250
250
for k , v := range properties {
251
- if k != "Octopus.Action.RunOnServer" && k != "Octopus.Action.EnabledFeatures" && k != "Octopus.Action.TargetRoles" {
251
+ if k != "Octopus.Action.RunOnServer" && k != "Octopus.Action.EnabledFeatures" {
252
+ sanitisedProperties [k ] = v
253
+ }
254
+ }
255
+ return sanitisedProperties
256
+ }
257
+
258
+ // removeUnnecessaryActionFields removes generic property bag values that have more specific terraform properties
259
+ func (c DeploymentProcessConverter ) removeUnnecessaryStepFields (properties map [string ]string ) map [string ]string {
260
+ sanitisedProperties := map [string ]string {}
261
+ for k , v := range properties {
262
+ if k != "Octopus.Action.TargetRoles" {
252
263
sanitisedProperties [k ] = v
253
264
}
254
265
}
0 commit comments