-
Notifications
You must be signed in to change notification settings - Fork 575
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
[WIP] feat: add constructor for full event lineage graph #7921
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
/cc @pierDipi |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707 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 |
apiServerSources, err := eventingClient.SourcesV1().ApiServerSources("").List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, apiServerSource := range apiServerSources.Items { | ||
if filterFunc(apiServerSource) { | ||
g.AddSource(duckv1.Source{ | ||
ObjectMeta: apiServerSource.ObjectMeta, | ||
TypeMeta: apiServerSource.TypeMeta, | ||
Spec: apiServerSource.Spec.SourceSpec, | ||
Status: apiServerSource.Status.SourceStatus, | ||
}) | ||
} | ||
} | ||
|
||
containerSources, err := eventingClient.SourcesV1().ContainerSources("").List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, containerSource := range containerSources.Items { | ||
if filterFunc(containerSource) { | ||
g.AddSource(duckv1.Source{ | ||
ObjectMeta: containerSource.ObjectMeta, | ||
TypeMeta: containerSource.TypeMeta, | ||
Spec: containerSource.Spec.SourceSpec, | ||
Status: containerSource.Status.SourceStatus, | ||
}) | ||
} | ||
} | ||
|
||
pingSources, err := eventingClient.SourcesV1().PingSources("").List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, pingSource := range pingSources.Items { | ||
if filterFunc(pingSource) { | ||
g.AddSource(duckv1.Source{ | ||
ObjectMeta: pingSource.ObjectMeta, | ||
TypeMeta: pingSource.TypeMeta, | ||
Spec: pingSource.Spec.SourceSpec, | ||
Status: pingSource.Status.SourceStatus, | ||
}) | ||
} | ||
} | ||
|
||
sinkBindings, err := eventingClient.SourcesV1().SinkBindings("").List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, sinkBinding := range sinkBindings.Items { | ||
if filterFunc(sinkBinding) { | ||
g.AddSource(duckv1.Source{ | ||
ObjectMeta: sinkBinding.ObjectMeta, | ||
TypeMeta: sinkBinding.TypeMeta, | ||
Spec: sinkBinding.Spec.SourceSpec, | ||
Status: sinkBinding.Status.SourceStatus, | ||
}) | ||
} | ||
} |
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.
@pierDipi do you have any ideas how we could get the sources (& in the duckv1.Source struct) more easily? This process is rather manual, and would not detect any sources not in eventing core :(
This is WIP because I want feedback on the approach before adding unit tests |
Signed-off-by: Calum Murray <cmurray@redhat.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7921 +/- ##
==========================================
- Coverage 69.22% 69.08% -0.14%
==========================================
Files 339 344 +5
Lines 19494 16069 -3425
==========================================
- Hits 13494 11101 -2393
+ Misses 5337 4286 -1051
- Partials 663 682 +19 ☔ View full report in Codecov by Sentry. |
Fixes #7694
Proposed Changes