Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v1.18.0 produces invalid YAML on long lines #380

Open
LukasPrediger opened this issue Dec 20, 2024 · 3 comments
Open

v1.18.0 produces invalid YAML on long lines #380

LukasPrediger opened this issue Dec 20, 2024 · 3 comments

Comments

@LukasPrediger
Copy link

Describe the bug

Take the version number with a grain of salt, we only noticed this due to the new feature of reporting labels and annotations

When producing a yaml report with KRR that contains very long lines (seems to be pretty exactly 81 columns), krr adds a line break, which often breaks the yaml format.

Example:
rewe-digital.com/scm-image-commit: <commit-hash> produces a line that's longer than 80 lines. This is being output to the yaml files as

rewe-digital.com/scm-image-commit: 
 <commit-hash>

Which is invalid yaml, so it breaks programs trying to parse the file

To Reproduce

  1. create some kubernetes resource where label + value is longer than 80 columns
  2. analyze this resource with krr and configure yaml output
  3. check the produced yaml file

Workaround
For now simply downgrading to 1.17.0 fixes the issue since the labels and annotations are not being written to the output report

@aantn
Copy link
Contributor

aantn commented Jan 1, 2025

Hi @LukasPrediger, thanks for the bug report.
I haven't been able to reproduce when running krr with a long label and the command krr simple -f yaml --quiet > out.yaml
What command are you running krr with?

@sebastianserrano
Copy link

Running into the same issue here when trying to output to a file, whether its JSON or yaml in version v1.18.0.

Commands:

  1. krr simple -p [URL] -f json --fileoutput report.json --kubeconfig [PATH]
  2. krr simple -p [URL] -f yaml --fileoutput report.yaml --kubeconfig [PATH]

@sebastianserrano
Copy link

sebastianserrano commented Jan 3, 2025

@aantn Doing it with the command you recommended

krr simple -p [URL] -f json --quiet --kubeconfig [PATH] > report.json

Did indeed get rid of the issue. It must be something related to how the file is being saved, more specifically with how the --fileoutput option is being handled

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants