atmos icon indicating copy to clipboard operation
atmos copied to clipboard

Feature Request: Relative Path Imports

Open osterman opened this issue 3 years ago • 0 comments

Describe the Feature

Instead of requring the full path relative to the top-level, support relative paths to the current file.

Today, we have to write:

# orgs/acme/mgmt/auto/network.yaml
import:
  - orgs/acme/mgmt/auto/_defaults

Instead, we should be able to write:

# orgs/acme/mgmt/auto/network.yaml
import:
  - _defaults

Expected Behavior

A clear and concise description of what you expected to happen.

Where by _default resolves to orgs/acme/mgmt/auto/_default.yaml;

Use Case

Make configurations easier to templatize without knowing the full path to the current working file.

Describe Ideal Solution

Basically, take the dirname('orgs/acme/mgmt/auto/network.yaml') and concatenate it with /_default.yaml

Alternatives Considered

Explain what alternative solutions or features you've considered.

Today, we're using cookie-cutter when generating the files:

import:
  - orgs/{{ cookiecutter.namespace }}/mgmt/auto/_defaults

osterman avatar Jan 06 '23 17:01 osterman