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

Add --run-file support for stdin #1364

Merged
merged 1 commit into from Nov 22, 2023

Conversation

stuartleeks
Copy link
Contributor

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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@stuartleeks stuartleeks requested review from a team as code owners November 3, 2023 15:28
@stuartleeks
Copy link
Contributor Author

stuartleeks commented Nov 3, 2023

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)

Copy link
Collaborator

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.

utils/utils.go Outdated Show resolved Hide resolved
If the run-file argument is speficied as '-', read the config file from stdin

Signed-off-by: Stuart Leeks <stuartle@microsoft.com>
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

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
@@           Coverage Diff           @@
##           master    #1364   +/-   ##
=======================================
  Coverage   22.76%   22.76%           
=======================================
  Files          40       40           
  Lines        4713     4713           
=======================================
  Hits         1073     1073           
  Misses       3562     3562           
  Partials       78       78           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@pravinpushkar pravinpushkar left a comment

Choose a reason for hiding this comment

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

LGTM

@stuartleeks We might want to include this way of running in our docs too.

@stuartleeks
Copy link
Contributor Author

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

@stuartleeks
Copy link
Contributor Author

I've created a PR for the related docs update: dapr/docs#3872

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

Copy link
Collaborator

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

lgtm.

@mukundansundar mukundansundar added this to the v1.13 milestone Nov 22, 2023
@mukundansundar mukundansundar merged commit 668bab4 into dapr:master Nov 22, 2023
28 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants