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

Support loading Data Values files in the same ways "ordinary" files are loaded #670

Merged
merged 3 commits into from
May 24, 2022

Conversation

pivotaljohn
Copy link
Contributor

@pivotaljohn pivotaljohn commented May 14, 2022

Reusing the strategy by which a filepath from --file is used to resolve to the contents of the file(s) for loading Data Values.

All types of inputs are now supported (and handled identically) across --file, --data-value-file, and --data-values-file: 🎉

  • ordinary file
  • filesystem directories
  • named pipes
  • HTTP/HTTPS URLs
  • standard input

@pivotaljohn pivotaljohn changed the title Generalize shape of files.File content Support loading Data Values files in the same ways "ordinary" files are loaded May 19, 2022
@pivotaljohn pivotaljohn marked this pull request as ready for review May 20, 2022 12:26
@pivotaljohn pivotaljohn linked an issue May 23, 2022 that may be closed by this pull request
... so that data values can be loaded via all the strategies that files
are loaded from `--file`

Also:
- update the starting example to illustrate that all values are plain
  merged.
- Share symlink options between files and DV options structs so that
  when the configuration is set, it's available to both
  RegularilesSourceOpts code and DataValuesFlag code.
- Update help text with more broadly used file input formats.
- Adjust some other help text to be more helpful.
... so that as a contributor, when I read this list of tests, I can
focus my attention to a section of the test file, rather than having to
comprehend the whole thing at once.

- group and sort by purpose
  - feature-specific tests, first
  - input/output mechanism verification, next
  - groups of examples-based tests for verifying the examples, last
- add the "Overlay" Playground example group (currently untested)
- add missing expectations for Overlay examples
Copy link
Contributor

@gcheadle-vmware gcheadle-vmware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've enjoyed watching this feature evolve into something that uses existing mechanisms in ytt of reading files from a Dir. Nothing stood out to me that was alarming + naming & godocs really helped me understand these changes. 🎊

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

Successfully merging this pull request may close these issues.

data-values-file should accept an entire directory
5 participants