Skip to content

Improve import file extension handling #21

Closed

Description

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

import:
  - ue1-globals
  - catalog/eks.yaml

Note the incidental .yaml here.

Error:

Error: Error in function call

  on /modules/utils/stack-config.variant line 71:
  (source code not available)

with opt.config-dir as "./stacks",
     opt.stack as "ue1-auto".

Call to function "import" failed: /modules/utils/stack-config.variant:12,13-20: Error in function
call; Call to function "import" failed: /modules/utils/stack-config.variant:10,43-50: Invalid
function argument; Invalid value for "path" parameter: no file exists at
stacks/catalog/eks.yaml.yaml; this function works only with files that are distributed as part of
the configuration source code, so if this file will be created by a resource in this configuration
you must instead obtain this result from an attribute of that resource...

Error: Error in function call

  on /modules/utils/stack-config.variant line 71:
  (source code not available)

with opt.config-dir as "./stacks",
     opt.stack as "ue1-auto".

Call to function "import" failed: /modules/utils/stack-config.variant:12,13-20: Error in function
call; Call to function "import" failed: /modules/utils/stack-config.variant:10,43-50: Invalid
function argument; Invalid value for "path" parameter: no file exists at
stacks/catalog/eks.yaml.yaml; this function works only with files that are distributed as part of
the configuration source code, so if this file will be created by a resource in this configuration
you must instead obtain this result from an attribute of that resource...

Error: 1 error occurred:
        * step "write varfile": job "terraform write varfile": config "config-component": source 0: job "stack config": /modules/utils/stack-config.variant:71,13-20: Error in function call; Call to function "import" failed: /modules/utils/stack-config.variant:12,13-20: Error in function call; Call to function "import" failed: /modules/utils/stack-config.variant:10,43-50: Invalid function argument; Invalid value for "path" parameter: no file exists at stacks/catalog/eks.yaml.yaml; this function works only with files that are distributed as part of the configuration source code, so if this file will be created by a resource in this configuration you must instead obtain this result from an attribute of that resource...

Expected Behavior

A clean error/warning or just allow the extension.

Use Case

It seems reasonable some people may choose to add an extension; ex: yaml vs yml.

Describe Ideal Solution

Allow an extension or default to yaml.

Alternatives Considered

Require no extension, but provide a clean error.

Additional Context

Activity

  1. aknysh commented on Feb 15, 2021

    @aknysh
    Member

    thanks John C. Bland II (@johncblandii)
    note that Erik Osterman (Cloud Posse) (@osterman) did not want to use extensions in stack names on purpose and be opinionated

  2. johncblandii commented on Feb 15, 2021

    @johncblandii
    ContributorAuthor

    That's cool. Then let's handle it if someone does use one on an import with a clean error.

  3. aknysh commented on Dec 17, 2021

    @aknysh
    Member

    closing since this is updated (and new functionality added) in the new version of atmos starting with 1.0.0.
    Extension can be anything now, if no extension is specified, .yaml is assumed by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions