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

Merge option returns different output when switching order of merging files #347

Closed
codbfilip opened this issue Feb 8, 2020 · 3 comments
Milestone

Comments

@codbfilip
Copy link

yq version 3.1.0

When I merge two files with append option i got two different results based on order of files.

Input files:

first.yml

volumes:
  app: {}
  app-cache:
    driver_opts:
      type: none

second.yml

 volumes:
      backups:
        driver_opts:
          type: none

Command: yq m -a first.yml second.yml > output.yml (returns correct output)

volumes:
  app: {}
  app-cache:
    driver_opts:
      type: none
  backups:
    driver_opts:
      type: none

Command: yq m -a second.yml first.yml > output.yml

volumes:
  backups:
    driver_opts:
      type: none
  app-cache:
    driver_opts:
      type: none

Expected result: the output should contain all keys regardless of the order of the files

@mikefarah
Copy link
Owner

Looks like app gets skipped because its {}. Interestingly it works if its null or empty...

@mikefarah
Copy link
Owner

Related to #355

@mikefarah mikefarah added this to the 3.1.2 milestone Feb 13, 2020
@mikefarah
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants