netobserv / flowlogs-pipeline

Transform flow logs into metrics
Apache License 2.0
75 stars 23 forks source link

Use yaml unmarshaller instead of json's #622

Closed jotak closed 6 months ago

jotak commented 6 months ago

Description

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

openshift-ci[bot] commented 6 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from jotak. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/netobserv/flowlogs-pipeline/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.30%. Comparing base (24bf8ce) to head (873e42c).

Files Patch % Lines
pkg/confgen/extract.go 50.00% 1 Missing :warning:
pkg/config/config.go 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #622 +/- ## ========================================== + Coverage 67.22% 67.30% +0.07% ========================================== Files 104 104 Lines 7459 7416 -43 ========================================== - Hits 5014 4991 -23 + Misses 2143 2126 -17 + Partials 302 299 -3 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/622/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/622/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `67.30% <85.71%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jotak commented 6 months ago

Attempt fails, cf https://github.com/netobserv/flowlogs-pipeline/pull/623 We'd need to get rid of viper if we want to use yaml rather than json. I don't think viper brings anything super useful here, anyway.

KalmanMeth commented 6 months ago

@eranra I think viper was originally used to allow passing in command line configuration parameters. We need to decide whether we still need this.

jotak commented 6 months ago

@KalmanMeth yes it allows using various sources for parameters, but comes with this limitation of not being case sensitive which is annoying for yaml. Do you have any idea if the other parameter sources (such as ENV or command line) are actually used out in the wild?

eranra commented 6 months ago

@KalmanMeth yes it allows using various sources for parameters, but comes with this limitation of not being case sensitive which is annoying for yaml. Do you have any idea if the other parameter sources (such as ENV or command line) are actually used out in the wild?

@jotak @KalmanMeth In past projects we used cobra https://github.com/spf13/cobra - I do not know if this is better in compared with viper. In any event, I think that for the completeness and simplicity of a "stand-alone" tool such as FLP it does make sense to keep the option to provide command-line parameters