Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Conversation

@rafiramadhana
Copy link
Contributor

Why this matters

Resolves #75

Solution

Validate that all layers[*].dependencies exist.

How to test it

Run make test.

Otherwise, we can also reproduce the issue by doing what mentioned in #75.

Here is the result in my local using a similar layerform.json

➜  layerform git:(75-validate-all-dep-exist) ✗ cat layerform.json
{
  "layers": [
    {
      "name": "foo",
      "files": ["foo.tf"]
    },
    {
      "name"  : "bar",
      "files": ["bar.tf"],
      "dependencies": ["foo", "this_layer_does_not_exist"]
    },
    {
      "name"  : "baz",
      "files": ["baz.tf"],
      "dependencies": ["foo"]
    }
  ]
}%                                                                                                                                                                                                                                                                                                                                  
➜  layerform git:(75-validate-all-dep-exist) ✗ ./layerform configure --file layerform.json
✗ Loading layer definitions from "layerform.json"
fail to load layers from layerform layers definitions file: fail to validate layers dependencies: this_layer_does_not_exist: dependency does not exist

Note to reviewers

Add layer dependencies validation.
Add more test cases.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure should validate that all dependecies exists

1 participant