Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooling/templatize: fix some typos #879

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aro-hcp-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
steps:
- name: Fail if PR submitted from fork
if: ${{ github.event.pull_request.head.repo.full_name != 'Azure/ARO-HCP' }}
run: core.setFailed('Expected source repository to be Azure/ARO-HCP, re-create PR as a branch of Azure/ARO-HCP')
run: core.setFailed('Expected source repository to be Azure/ARO-HCP, not ${{ github.event.pull_request.head.repo.full_name }}, re-create PR as a branch of Azure/ARO-HCP')

deploy_global_rg:
name: 'Deploy global resources'
Expand Down
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
Loading