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

Schema files are merged out-of-order when in different sub-directories #589

Closed
pivotaljohn opened this issue Jan 19, 2022 · 1 comment · Fixed by #613
Closed

Schema files are merged out-of-order when in different sub-directories #589

pivotaljohn opened this issue Jan 19, 2022 · 1 comment · Fixed by #613
Assignees
Labels
bug This issue describes a defect or unexpected behavior

Comments

@pivotaljohn
Copy link
Contributor

What steps did you take:

$ tree .
.
├── add-schema.yml
└── config
    └── values
        └── schema.yml

2 directories, 2 files

$ cat config/values/schema.yml
#@data/values-schema
---
foo: 1

$ cat add-schema.yml
#@data/values-schema
---
#@overlay/match missing_ok=True
bar: 2

$ ytt -f config/ -f add-schema.yml

What happened:

$ ytt -f config/ -f add-schema.yml
ytt: Error: Document on line values/schema.yml:2:
  Map item (key 'foo') on line values/schema.yml:3:
    Expected number of matched nodes to be 1, but was 0

What did you expect:
That they would be merged identically that they are for data values (i.e. respecting the order of the -f params).

Anything else you would like to add:
NOTE: This defect was fixed in 8e6cf37.

Placing the add-on schema file in the same path restores the expectation.

$ ytt -f config/ -f add-schema.yml --file-mark=add-schema.yml:path=values/add-schema.yml --data-values-inspect
foo: 1
bar: 2

or

$ mkdir -p custom/values
$ mv add-schema.yml custom/values/
$ ytt -f config/ -f add-schema.yml --data-values-inspect
foo: 1
bar: 2

Environment:

  • ytt version (use ytt --version): 0.38.0
@pivotaljohn pivotaljohn added the bug This issue describes a defect or unexpected behavior label Jan 19, 2022
pivotaljohn pushed a commit that referenced this issue Jan 19, 2022
@aaronshurley aaronshurley self-assigned this Feb 7, 2022
pivotaljohn pushed a commit that referenced this issue Feb 25, 2022
@pivotaljohn
Copy link
Contributor Author

Fixed in v0.39.0.
Backported to v0.37.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants