Skip to content

Add output flag to diki run#194

Merged
dimityrmirchev merged 4 commits intogardener:mainfrom
AleksandarSavchev:add-output-flag-diki-run
Mar 26, 2024
Merged

Add output flag to diki run#194
dimityrmirchev merged 4 commits intogardener:mainfrom
AleksandarSavchev:add-output-flag-diki-run

Conversation

@AleksandarSavchev
Copy link
Copy Markdown
Member

@AleksandarSavchev AleksandarSavchev commented Mar 22, 2024

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Setting `output.path` in the diki configuration file is now deprecated. Users are advised to use the `--output` flag instead.
The `diki run` command now accepts an `--output` flag. If set diki will write a report summary to the file path location.

@gardener-robot gardener-robot added needs/review size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 22, 2024
@AleksandarSavchev AleksandarSavchev marked this pull request as ready for review March 25, 2024 07:27
@AleksandarSavchev AleksandarSavchev requested a review from a team as a code owner March 25, 2024 07:27
@ghost ghost removed the reviewed/ok-to-test label Mar 25, 2024
@AleksandarSavchev AleksandarSavchev changed the title Add output and min-status flags to diki run Add output flag to diki run Mar 25, 2024
Comment thread README.md Outdated

- Run all known rulesets for all known providers and create a summary json report file
```bash
diki run --config=config.yaml --all --output=/tmp/report.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
diki run --config=config.yaml --all --output=/tmp/report.json
diki run --config=config.yaml --all --output=./report.json

Comment thread cmd/diki/app/app.go Outdated
}

func addRunFlags(cmd *cobra.Command, opts *runOptions) {
cmd.PersistentFlags().StringVar(&opts.outputPath, "output", "", "If set diki creates an summary json report at the given path.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cmd.PersistentFlags().StringVar(&opts.outputPath, "output", "", "If set diki creates an summary json report at the given path.")
cmd.PersistentFlags().StringVar(&opts.outputPath, "output", "", "If set diki writes a summary json report to the given file path.")

Copy link
Copy Markdown
Member

@dimityrmirchev dimityrmirchev left a comment

Choose a reason for hiding this comment

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

/lgtm

@dimityrmirchev dimityrmirchev merged commit af53735 into gardener:main Mar 26, 2024
@ghost ghost added the reviewed/ok-to-test label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants