Description of problem (please be detailed as possible and provide log snippests): Passing the valid YAML file, the script produces an ERROR: anielosypenko@dosypenk-mac comparealerts % ./comparealerts ../prometheus-ocs-rules.yaml ../prometheus_alerts.yml [ERROR] 2023/03/21 13:38:09 main.go:122: Alert file2: "../prometheus_alerts.yml" error: corrupted yaml or json file: ../prometheus_alerts.yml same error appeared with valid JSON file danielosypenko@dosypenk-mac comparealerts % ./comparealerts -of pp ../prometheus-ocs-rules.json ../prometheus_alerts.json [ERROR] 2023/03/21 14:24:29 main.go:122: Alert file2: "../prometheus_alerts.json" error: corrupted yaml or json file: ../prometheus_alerts.json Version of all relevant components (if applicable): The monitoring-tool from the repo https://github.com/red-hat-storage/odf-monitoring-tools, last commit beef0905efc172c77f0446398b2eed24d5a3c3ab from Feb 22, 2023 go version go1.20.2 darwin/arm64 Does this issue impact your ability to continue to work with the product (please explain in detail what is the user impact)? yes Is there any workaround available to the best of your knowledge? -- Rate from 1 - 5 the complexity of the scenario you performed that caused this bug (1 - very simple, 5 - very complex)? 2 Can this issue reproducible? yes Can this issue reproduce from the UI? no If this is a regression, please provide more details to justify this: not a regression. Issue found within Happy Path validation Steps to Reproduce: 1. git clone https://github.com/red-hat-storage/odf-monitoring-tools.git 2. cd into comparealerts directory of the project 3. go build 3.a a binary executable, named: comparealerts , will be created 4. download upstream and downstream prometheus rules yaml files https://github.com/red-hat-storage/ocs-operator/blob/main/metrics/deploy/prometheus-ocs-rules.yaml and https://github.com/ceph/ceph/blob/main/monitoring/ceph-mixin/prometheus_alerts.yml 5. run cmd ./comparealerts -of pp <path_to_file>/prometheus-ocs-rules.yaml <path_to_file>/prometheus_alerts.yml 6. convert <path_to_file>/prometheus-ocs-rules.yaml and <path_to_file>/prometheus_alerts.yml to JSON files, insure that files contain valid JSONs and run step 5 with JSON files instead of YAML Actual results: [ERROR] 2023/03/21 13:39:09 main.go:122: Alert file2: "../prometheus_alerts.yml" error: corrupted yaml or json file: ../prometheus_alerts.yml Expected results: differences between prometheus rules Pretty Printed to standard output Additional info: Feature ticket - https://issues.redhat.com/browse/RHSTOR-3803
This is fixed with this change PR: https://github.com/red-hat-storage/odf-monitoring-tools/pull/3/files and it is merged now. Please check.
https://github.com/red-hat-storage/odf-monitoring-tools with latest merged commit a65719edaff0ef038498d1bb13affd50f073fe25 passes the test
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat OpenShift Data Foundation 4.13.0 enhancement and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:3742