Skip to content

Commit 7c21035

Browse files
committed
Removed some more redundant properties
1 parent 72cc13e commit 7c21035

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.idea/OctopusTerraformExport.iml

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/internal/converters/deployment_process_converter.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/mcasperson/OctopusTerraformExport/cmd/internal/model/octopus"
1010
"github.com/mcasperson/OctopusTerraformExport/cmd/internal/model/terraform"
1111
sanitizer2 "github.com/mcasperson/OctopusTerraformExport/cmd/internal/sanitizer"
12+
"github.com/mcasperson/OctopusTerraformExport/cmd/internal/sliceutil"
1213
"github.com/mcasperson/OctopusTerraformExport/cmd/internal/strutil"
1314
"regexp"
1415
"strings"
@@ -280,9 +281,14 @@ func (c DeploymentProcessConverter) escapePercents(properties map[string]string)
280281

281282
// removeUnnecessaryActionFields removes generic property bag values that have more specific terraform properties
282283
func (c DeploymentProcessConverter) removeUnnecessaryActionFields(properties map[string]string) map[string]string {
284+
unnecessaryFields := []string{"Octopus.Action.Package.PackageId",
285+
"Octopus.Action.RunOnServer",
286+
"Octopus.Action.EnabledFeatures",
287+
"Octopus.Action.Aws.CloudFormationTemplateParametersRaw",
288+
"Octopus.Action.Package.FeedId"}
283289
sanitisedProperties := map[string]string{}
284290
for k, v := range properties {
285-
if k != "Octopus.Action.RunOnServer" && k != "Octopus.Action.EnabledFeatures" {
291+
if !sliceutil.Contains(unnecessaryFields, k) {
286292
sanitisedProperties[k] = v
287293
}
288294
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package sliceutil
2+
3+
func Contains(a []string, x string) bool {
4+
for _, n := range a {
5+
if x == n {
6+
return true
7+
}
8+
}
9+
return false
10+
}

wasm/convert_project.wasm

-444 KB
Binary file not shown.

0 commit comments

Comments
 (0)