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

EndpointSlice resources tracked by Graph #1432

Merged

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Dec 29, 2023

Proposed changes

Problem: EndpointSlice resources are currently being tracked by the relationship capturer, but to reduce the number of components we would like to track the resources in the Graph.

Solution: Enable Graph to track EndpointSlice resources and Services. In addition, this PR refactors backend_refs to store the NamespacedName of a Service and a ServicePort instead of the actual Service. This is done to track non-existing referenced services. Also, refactors and removes the alwaysTruePredicate introduced in this PR. Removes RelationshipCapturer.

Testing: Wrote new unit tests and refactored existing ones.

Closes #1264

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • [] I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@github-actions github-actions bot added the tech-debt Short-term pain, long-term benefit label Dec 29, 2023
@bjee19
Copy link
Contributor Author

bjee19 commented Dec 30, 2023

Had a few questions / checks on the logic of the changes I would like to have looked at before completing the changes and adding tests, Thanks!

internal/mode/static/state/graph/graph.go Show resolved Hide resolved
internal/mode/static/state/graph/service.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/graph.go Show resolved Hide resolved
internal/mode/static/state/change_processor.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/graph.go Outdated Show resolved Hide resolved
internal/mode/static/state/changed_predicate.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/backend_refs.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/backend_refs.go Outdated Show resolved Hide resolved
internal/mode/static/state/resolver/resolver.go Outdated Show resolved Hide resolved
@bjee19 bjee19 marked this pull request as ready for review January 12, 2024 23:58
@bjee19 bjee19 requested a review from a team as a code owner January 12, 2024 23:58
@bjee19 bjee19 changed the title Draft: EndpointSlice resources tracked by Graph EndpointSlice resources tracked by Graph Jan 12, 2024
internal/mode/static/state/graph/backend_refs.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/graph.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/service.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/service.go Outdated Show resolved Hide resolved
internal/mode/static/state/store.go Show resolved Hide resolved
internal/mode/static/state/graph/backend_refs.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/backend_refs.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/graph_test.go Outdated Show resolved Hide resolved
internal/mode/static/state/resolver/resolver.go Outdated Show resolved Hide resolved
@bjee19 bjee19 force-pushed the debt/endpointslice-resources-tracked-by-graph branch 2 times, most recently from dbb211a to 583738a Compare January 18, 2024 23:13
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

Really nice job, @bjee19! This makes our code much simpler 🚀

internal/mode/static/state/changed_predicate.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/service.go Outdated Show resolved Hide resolved
internal/mode/static/state/graph/service.go Outdated Show resolved Hide resolved
internal/mode/static/state/store.go Outdated Show resolved Hide resolved
internal/mode/static/state/store.go Show resolved Hide resolved
@bjee19 bjee19 requested a review from pleshakov January 23, 2024 19:12
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

👍

@bjee19 bjee19 force-pushed the debt/endpointslice-resources-tracked-by-graph branch from c129995 to 635178b Compare January 23, 2024 23:37
@bjee19 bjee19 merged commit 73f7918 into nginx:main Jan 24, 2024
27 checks passed
@bjee19 bjee19 deleted the debt/endpointslice-resources-tracked-by-graph branch May 7, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Short-term pain, long-term benefit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EndpointSlice resources are tracked by Graph
4 participants