Skip to content

Ensure that files with the template name prefix are populated

Lucas Li requested to merge fix-chilld-template-name into main

What does this MR do?

  • Ensure that child templates with the template name prefix are populated
  • A test case is added to highlight the issue.

Before

Before this MR, we would (wrongly) remove the prefix from the child template names, if they are prefixed with the template name.

For example:

# migration is the template name, which has a child template migration.job.yaml
templates/migration/migration.job.yaml

The child template name would be .job.yaml

I assume it is a wrong use of the WalkDir to remove the dir/ prefix:

// The path argument contains the argument to [WalkDir] as a prefix.

// That is, if WalkDir is called with root argument "dir" and finds a file

// named "a" in that directory, the walk function will be called with

// argument "dir/a".

When we call fs.WalkDir(dir, ".", ...), we are already inside the template directory, all files will be walked without the template/ prefix.

After

After the MR, the child template name from the example above would be migration.job.yaml.

A test case is added.

Author's Checklist

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Ensure a release milestone is set.
  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline on GitLab.com.
  • When ready for review, MR is labeled workflowready for review per the MR workflow.

Expected

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation is created or updated.
  • Tests are added.

Related issues

Edited by Hossein Pursultani

Merge request reports