dapr / cli

Command-line tools for Dapr.
Apache License 2.0
315 stars 197 forks source link

Add --run-file support for stdin #1364

Closed stuartleeks closed 7 months ago

stuartleeks commented 8 months ago

Description

Update run command so that if the --run-file argument is speficied as - the config file is read from stdin.

This is the same idea as kubectl apply -f - and allows the configuration to be generated by some other means (e.g. by applying values to a template version of the file).

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

stuartleeks commented 8 months ago

NOTE: I haven't added tests to this as it wasn't clear to me how I would set up stdin in a test (although the code is pretty simple)

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ac0a3cb) 22.76% compared to head (5a04ffd) 22.76%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1364 +/- ## ======================================= Coverage 22.76% 22.76% ======================================= Files 40 40 Lines 4713 4713 ======================================= Hits 1073 1073 Misses 3562 3562 Partials 78 78 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stuartleeks commented 7 months ago

@pravinpushkar -I'm happy to look at a PR to the docs to include this

stuartleeks commented 7 months ago

I've created a PR for the related docs update: https://github.com/dapr/docs/pull/3872

Let me know if there's anything else needed to merge this PR - thanks!