-
Notifications
You must be signed in to change notification settings - Fork 15
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-1927 scopes config #634
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=c527049 make set-plugin-image |
Co-authored-by: Joel Takvorian <joel.takvorian@homeblocks.net>
pkg/config/config.go
Outdated
"dnsRCode": {"DnsFlagsResponseCode"}, | ||
} | ||
for i := range c.Scopes { | ||
keyLabels[c.Scopes[i].ID] = sc.Labels |
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.
oops .. compile error, my bad!
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.
Ahah yeah we need an IDE integration in github !
If you want, you can use GitHub Pull Requests
extension in vscode
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
It allows you to pull a PR, do the changes you want and create suggestions directly from your IDE
web/src/model/flow-query.ts
Outdated
@@ -8,7 +8,7 @@ export type PacketLoss = 'dropped' | 'hasDrops' | 'sent' | 'all'; | |||
export type MetricFunction = 'count' | 'sum' | 'avg' | 'min' | 'max' | 'p90' | 'p99' | 'rate'; | |||
export type StatFunction = MetricFunction | 'last'; | |||
export type MetricType = 'Flows' | 'DnsFlows' | Field; | |||
export type FlowScope = 'app' | 'cluster' | 'zone' | 'host' | 'namespace' | 'owner' | 'resource'; | |||
export type FlowScope = 'app' | 'cluster' | 'zone' | 'host' | 'namespace' | 'owner' | 'resource' | string; |
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.
since it's now config based maybe just FlowScope = string
is enough? (or is there still any good benefit from typing some of known scopes?)
same remark for groups below.
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.
there are some specific cases indeed especially for owner
& resource
but I will remove the ones not used
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.
code lgtm (beside one or two comments) |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=14cd831 make set-plugin-image |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #634 +/- ##
==========================================
+ Coverage 55.38% 55.73% +0.35%
==========================================
Files 193 195 +2
Lines 10088 10058 -30
Branches 1215 1199 -16
==========================================
+ Hits 5587 5606 +19
+ Misses 4124 4083 -41
+ Partials 377 369 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
web/src/model/topology.ts
Outdated
return next; | ||
const index = scopes.findIndex(sc => sc.id === current); | ||
if (index >= 0 && index < scopes.length) { | ||
next = scopes[index].id; |
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.
step into doesn't work and I believe there's something missing here? (should it be next = scopes[index + 1].id;
?)
But that said, in this PR I made the "scope graph" not linear on purpose (because the next logical step after node is pod, not namespace) .. so how to represent that with the new model? Should we add a new next
field in the scopes definition?
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 I wanted to avoid that but I guess we don't have the choice if it's not linear there
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.
done in 0c65c7f
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=63a469a make set-plugin-image |
); | ||
}; | ||
|
||
export const getStepIntoNext = (current: FlowScope, allowedScopes: FlowScope[]): FlowScope | undefined => { |
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.
I think you need to reintroduce this function (with a few changes), because it was a recursive function that would continue looking for "next" step in case the current found one is not allowed.
This allows to "jump" over disabled scopes. Two examples:
- When you enable multi-clusters but not zones: stepping into cluster should bring you directly to nodes, by-passing zones
- When disabling Loki, stepping into a Owner should not bring you to Resource (it should be disallowed)
The current implementation breaks these use cases
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.
Restored recursive behavior + added tests
00e7f3b
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.
thanks for the tests, indeed that was missing
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=d02b8f5 make set-plugin-image |
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.
LGTM
Description
Allow topology scope and groups configurations
Dependencies
netobserv/network-observability-operator#834
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.