Skip to content

Commit 7abb3e7

Browse files
committed
Fixed up removal of unnecessary properties
1 parent 58bfa5f commit 7abb3e7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/internal/converters/deployment_process_converter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (c DeploymentProcessConverter) toHcl(resource octopus.DeploymentProcess, re
121121
Package: make([]terraform.TerraformPackage, len(a.Packages)),
122122
Condition: a.Condition,
123123
RunOnServer: c.getRunOnServer(a.Properties),
124-
Properties: c.removeUnnecessaryActionFields(c.replaceIds(c.escapeDollars(sanitizer2.SanitizeMap(a.Properties)), dependencies)),
124+
Properties: nil,
125125
Features: c.getFeatures(a.Properties),
126126
}
127127

@@ -144,7 +144,7 @@ func (c DeploymentProcessConverter) toHcl(resource octopus.DeploymentProcess, re
144144

145145
for i, s := range resource.Steps {
146146
for j, a := range s.Actions {
147-
hcl.WriteActionProperties(block, i, j, a.Properties)
147+
hcl.WriteActionProperties(block, i, j, c.removeUnnecessaryActionFields(c.replaceIds(c.escapeDollars(sanitizer2.SanitizeMap(a.Properties)), dependencies)))
148148
}
149149
}
150150

cmd/internal/hcl/unquoted_attribute_writer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ func WriteUnquotedAttribute(block *hclwrite.Block, attrName string, attrValue st
1717

1818
// WriteActionProperties is used to pretty print the properties of an action, writing a multiline map for the properties,
1919
// and extracting JSON blobs as maps for easy reading.
20-
func WriteActionProperties(block *hclwrite.Block, step int, action int, properties map[string]any) {
20+
func WriteActionProperties(block *hclwrite.Block, step int, action int, properties map[string]string) {
2121
block.Body().Blocks()[step].Body().Blocks()[action].Body().SetAttributeTraversal("properties", hcl.Traversal{
2222
hcl.TraverseRoot{Name: extractJsonAsMap(properties)},
2323
})
2424
}
2525

26-
func extractJsonAsMap(properties map[string]any) string {
26+
func extractJsonAsMap(properties map[string]string) string {
2727
output := "{"
2828

2929
for key, value := range properties {

wasm/convert_project.wasm

745 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)