-
Notifications
You must be signed in to change notification settings - Fork 24
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
NETOBSERV-1407 - Loki labels for deduper merge #529
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #529 +/- ##
==========================================
- Coverage 57.73% 57.67% -0.07%
==========================================
Files 70 71 +1
Lines 9446 9452 +6
==========================================
- Hits 5454 5451 -3
- Misses 3659 3667 +8
- Partials 333 334 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Rebased without changes |
New images:
They will expire after two weeks. To deploy this build: # Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:0ed9d9d make deploy
# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-0ed9d9d Or as a Catalog Source: apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: netobserv-dev
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-0ed9d9d
displayName: NetObserv development catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 1m |
As a followup, we should try to entirely get rid of
|
EBPF: flowslatest.FlowCollectorEBPF{ | ||
Advanced: &flowslatest.AdvancedAgentConfig{ | ||
Env: map[string]string{ | ||
"DEDUPER_JUST_MARK": "true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't that the default ? why need to set it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the default indeed !
However removing it seems to affect the reconcile loop and makes the test fail. As far as I remember it says the CR failed to update because it's not up to date (probably from status update code). It would require a dummy update in the tests to make it work.
Everything seems to work fine on a real cluster 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is just test code
indexFields = append(indexFields, constants.ClusterNameLabelName) | ||
} | ||
|
||
if helper.UseEBPF(desired) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you are using justMark bool as indication if dupMerge or not ? why not check dupMerge directly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/!\ This file only manages loki labels !
For now, I only add / remove FlowDirection
and Duplicate
labels according to justMark
flag:
var LokiDeduperMarkIndexFields = []string{"FlowDirection", "Duplicate"}
For merge
flag, we don't need label on related arrays since there is no deduplication on plugin side. That means queries are running straight forward without making any fancy filtering on these 😎
While double checking console flags, I figured out that the defaults values were not correctly set in current code when I fixed that in 894cf30 but that doesn't solve the |
@@ -365,14 +362,10 @@ func (b *builder) setFrontendConfig(fconf *config.FrontendConfig) { | |||
if b.desired.Agent.EBPF.Advanced != nil { | |||
if v, ok := b.desired.Agent.EBPF.Advanced.Env[ebpf.EnvDedupeJustMark]; ok { | |||
dedupJustMark, _ = strconv.ParseBool(v) | |||
} else { | |||
dedupJustMark, _ = strconv.ParseBool(ebpf.DedupeJustMarkDefault) | |||
} | |||
|
|||
if v, ok := b.desired.Agent.EBPF.Advanced.Env[ebpf.EnvDedupeMerge]; ok { | |||
dedupMerge, _ = strconv.ParseBool(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to recent changes but why we ignore errors from ParseBool
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These booleans are constants from agent_controller.go
. We are not supposed to have errors here right ?
If you prefer we can make reconcile loop crash 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do u mean ParseBool is what we will get from FC object for the constants u are referring to someone could set the env var to something bad which will trigger
https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/strconv/atob.go;l=17
specially we have no API validation for this envvar try setting to "foo" and see what will happen :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I thought we were talking about defaults values here; that's right, I should manage parse error from Env
input !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpinsonneau: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/test e2e-operator |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fe8ae8c
into
netobserv:main
Description
This PR removes
FlowDirection
andDuplicate
labels when deduper merge mode is enabled.It also centralize labels array in a single function (
K8S_ClusterName
was not sent to console plugin).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.