Skip to content

Commit

Permalink
tooling/templatize: fix some typos
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Nov 22, 2024
1 parent 1597c37 commit 81137b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tooling/templatize/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ func (cp *configProviderImpl) GetRegionOverrides(cloud, deployEnv, region string
func (cp *configProviderImpl) loadConfig(configReplacements *ConfigReplacements) (VariableOverrides, error) {
// TODO validate that field names are unique regardless of casing
// parse, execute and unmarshal the config file as a template to generate the final config file
bytes, err := PreprocessFile(cp.config, configReplacements.AsMap())
rawContent, err := PreprocessFile(cp.config, configReplacements.AsMap())
if err != nil {
return nil, err
}

currentVariableOverrides := NewVariableOverrides()
if err := yaml.Unmarshal(bytes, currentVariableOverrides); err == nil {
if err := yaml.Unmarshal(rawContent, currentVariableOverrides); err == nil {
return currentVariableOverrides, nil
} else {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions tooling/templatize/pkg/ev2/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestMapping(t *testing.T) {
"__PARENT_NESTED__": "parent.nested",
"__PARENT_DEEPER_DEEPEST__": "parent.deeper.deepest",
}
expecetedReplace := map[string]interface{}{
expectedReplace := map[string]interface{}{
"key1": "__KEY1__",
"key2": "__KEY2__",
"key3": "__KEY3__",
Expand All @@ -40,7 +40,7 @@ func TestMapping(t *testing.T) {
if diff := cmp.Diff(expectedFlattened, flattened); diff != "" {
t.Errorf("got incorrect flattened: %v", diff)
}
if diff := cmp.Diff(expecetedReplace, replace); diff != "" {
if diff := cmp.Diff(expectedReplace, replace); diff != "" {
t.Errorf("got incorrect replace: %v", diff)
}
}
4 changes: 2 additions & 2 deletions tooling/templatize/pkg/ev2/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ func PrecompilePipelineForEV2(pipelineFilePath string, vars config.Variables) (s
}

func processPipelineForEV2(p *pipeline.Pipeline, vars config.Variables) error {
_, scopeBindedVars := EV2Mapping(vars, []string{})
_, scopeBoundVars := EV2Mapping(vars, []string{})
for _, rg := range p.ResourceGroups {
for _, step := range rg.Steps {
if step.Parameters != "" {
newParameterFilePath, err := precompileFileAndStore(step.Parameters, scopeBindedVars)
newParameterFilePath, err := precompileFileAndStore(step.Parameters, scopeBoundVars)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion tooling/templatize/pkg/ev2/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func PreprocessFileForEV2SystemVars(configProvider config.ConfigProvider, cloud,
return config.PreprocessFile(templateFile, vars)
}

// PreprocessFileForEV2ScopeBinding processes an arbitrary gotemplate fileand replaces all config.yaml references
// PreprocessFileForEV2ScopeBinding processes an arbitrary gotemplate file and replaces all config.yaml references
// with __VAR__ scope binding find/replace references.
// This function is useful to process bicepparam files so that they can be used within EV2 together
// with scopebinding.
Expand Down

0 comments on commit 81137b0

Please sign in to comment.