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

Layer enrichment: remove hard-coded pieces, add tests #579

Closed
wants to merge 1 commit into from

Conversation

jotak
Copy link
Member

@jotak jotak commented Jan 31, 2024

No user-facing change.

(this PR requires to update the operator for configuring FLP)

@jotak jotak added no-qe This PR doesn't necessitate QE approval no-doc This PR doesn't require documentation change on the NetObserv operator labels Jan 31, 2024
Copy link

openshift-ci bot commented Jan 31, 2024

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 55 lines in your changes are missing coverage. Please review.

Comparison is base (40b6948) 65.80% compared to head (cad6ded) 66.45%.
Report is 9 commits behind head on main.

Files Patch % Lines
pkg/pipeline/transform/kubernetes/enrich.go 75.21% 24 Missing and 5 partials ⚠️
...peline/transform/kubernetes/informers/informers.go 16.00% 21 Missing ⚠️
...e/transform/kubernetes/informers/informers-mock.go 88.00% 3 Missing ⚠️
pkg/pipeline/transform/transform_network.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
+ Coverage   65.80%   66.45%   +0.65%     
==========================================
  Files         102      103       +1     
  Lines        7445     7506      +61     
==========================================
+ Hits         4899     4988      +89     
+ Misses       2256     2225      -31     
- Partials      290      293       +3     
Flag Coverage Δ
unittests 66.45% <67.64%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +78 to +84
InfraPrefixes []string `yaml:"infra_prefixes,omitempty" json:"infra_prefixes,omitempty" doc:"Namespace prefixes that will be tagged as infra"`
InfraRefs []K8sReference `yaml:"infra_refs,omitempty" json:"infra_refs,omitempty" doc:"Additional object references to be tagged as infra"`
}

type K8sReference struct {
Name string `yaml:"name,omitempty" json:"name,omitempty" doc:"name of the object"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty" doc:"namespace of the object"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel a bit confusing having these two arrays separated.

Why not having a single filters array similar to what we have in prometheus ?

type MetricsFilter struct {
Key string `yaml:"key" json:"key" doc:"the key to match and filter by"`
Value string `yaml:"value" json:"value" doc:"the value to match and filter by"`
Type string `yaml:"type" json:"type" enum:"MetricEncodeFilterTypeEnum" doc:"the type of filter match: exact (default), presence, absence or regex"`
}

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm that would force us to have in a common struct some values (fields) that are quite different, a single prefix in a case, or a name+namespace couple in the other .. we could of course force a generic structure for having both, but I'm not sure this is cleaner than the current solution (?)

@jotak
Copy link
Member Author

jotak commented Jan 31, 2024

/hold
as @OlivierCazade started a similar work on his side

@jotak
Copy link
Member Author

jotak commented Feb 19, 2024

superseded by #580

@jotak jotak closed this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold no-doc This PR doesn't require documentation change on the NetObserv operator no-qe This PR doesn't necessitate QE approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants