Skip to content

Commit

Permalink
redo gomain
Browse files Browse the repository at this point in the history
  • Loading branch information
kubasobon committed Oct 24, 2024
1 parent 79a66d8 commit cf92240
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions deploy/asset-inventory-cloudformation/gomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
// specific language governing permissions and limitations
// under the License.

// Config is put into a different package to prevent cyclic imports in case
// it is needed in several locations

package main

import (
Expand Down Expand Up @@ -118,10 +121,6 @@ func generateProdTemplate(prodTemplatePath string, devTemplatePath string) error
"Key": "project",
"Value": "cloudformation"
}
.Resources.ElasticAgentEc2Instance.Properties.Tags += {
"Key": "deployment-type",
"Value": "asset-inventory"
}
`
return generateTemplate(prodTemplatePath, devTemplatePath, yqExpression)
}
Expand All @@ -132,14 +131,10 @@ func generateTemplate(sourcePath string, targetPath string, yqExpression string)
return err
}

preferences := yqlib.NewDefaultYamlPreferences()
preferences.Indent = 2
preferences.ColorsEnabled = false

generatedTemplateString, err := yqlib.NewStringEvaluator().Evaluate(
yqExpression,
string(inputBytes),
yqlib.NewYamlEncoder(preferences),
yqlib.NewYamlEncoder(2, false, yqlib.NewDefaultYamlPreferences()),
yqlib.NewYamlDecoder(yqlib.NewDefaultYamlPreferences()),
)
if err != nil {
Expand Down

0 comments on commit cf92240

Please sign in to comment.