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

Added support for YAML as an output format #1401

Conversation

VaibhavMalik4187
Copy link
Contributor

This commit adds the support for using yaml as an output format to store the reports.

For Example: kubescape scan image nginx -f yaml

The report will be stored in the "report.yaml" file.

Fixes: #1395

Screenshot

image

@ghost
Copy link

ghost commented Sep 30, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@dwertent
Copy link
Contributor

dwertent commented Oct 1, 2023

@craigbox this YAML output will not be aligned with the Kubescape-Operator YAML format, is this ok by you?

@craigbox
Copy link
Contributor

craigbox commented Oct 1, 2023 via email

@dwertent
Copy link
Contributor

dwertent commented Oct 1, 2023

@VaibhavMalik4187 Thank you for contributing :)
It seems like the issue was not clear enough, so I added here some more details of how we visioned the solution.
Please let me know if it is more clear.

This commit adds the support for using yaml as an output format to store
the reports.

For Example: kubescape scan image nginx -f yaml

The report will be stored in the "report.yaml" file.

Fixes: kubescape#1395

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
@VaibhavMalik4187
Copy link
Contributor Author

VaibhavMalik4187 commented Oct 1, 2023

@VaibhavMalik4187 Thank you for contributing :) It seems like the issue was not clear enough, so I added here some more details of how we visioned the solution. Please let me know if it is more clear.

I tried looking for instances of yaml in the Kubescape-Operator codebase using the following command:
git grep -r yaml "*.go"

Didn't get a lot of data but I noticed that mainhandler/cronjobhandler.go is using "sigs.k8s.io/yaml" and I was using "gopkg.in/yaml.v3". I've updated the code to use "sigs.k8s.io/yaml". Now the yaml files are indented by 2 spaces instead of 4.

@VaibhavMalik4187
Copy link
Contributor Author

@dwertent @craigbox ...

@matthyx
Copy link
Contributor

matthyx commented Mar 5, 2024

just converting the JSON to a yaml doesn't bring any value to the user
what would make sense would be to generate a real CRD as yaml

@matthyx matthyx closed this Mar 5, 2024
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.

Support yaml as an output format
4 participants