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

Add generic objects to the topology #8

Merged
merged 12 commits into from
Jul 22, 2024
Merged

Add generic objects to the topology #8

merged 12 commits into from
Jul 22, 2024

Conversation

guicassolato
Copy link
Contributor

@guicassolato guicassolato commented Jul 11, 2024

Refactoring of the Topology struct (mainly) to better support generic objects added to the graph.

In general, allows creating and navigating topologies such as the following:

Screenshot 2024-07-19 at 17 31 26



  • Changes the topology functions so the graph can be searched and navigated for generic objects:
    • Listing functions Targetables(filters...) and Policies(filters...) have been modified to now return pointers to collections of that type, that can be navigated through the graph methods Roots(), Parents(), Children(), and Paths()
    • Navigation can be inflected from one type to another – e.g. topology.Objects().Children(gateway) to return all generic objects that are children of the gateway (targetable)
  • Make policy kinds generically linkable – useful to associate them to generic objects
  • Changes the shape, style and colors used to represent objects in the topology in Graphviz DOT language – now:
    • Targetables → colored square boxes
    • Policies → white dashed notes
    • Other objects → white solid ellipses
  • Add/export controller types/functions (useful for implementing reconcilers)
    • Object struct (previously genericObject) – for easy wrapping of any runtime object kind
    • New function Destruct - to create and and update objects from concrete types
    • Restructure function – for consistency with Destruct (also public)
    • Cache Store – so access to the objects can be given to build runtime link functions
  • Adds new examples of the Kuadrant custom controller working alongside with Envoy Gateway and Istio (to demo reconciliation of other generic objects appended to the topology)

…avigated for generic objects

The listing functions Targetables(filters...) and Policies(filters...) have been modified to now return pointers to collections of that type, that can be navigated through the graph methods Roots(), Parents(), Children(), and Paths().

+ makes policies linkable.
@guicassolato guicassolato marked this pull request as ready for review July 15, 2024 15:01
Copy link
Contributor

@KevFan KevFan left a comment

Choose a reason for hiding this comment

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

Verified envoy-gateway.md and multiple-gateway-providers.md and both are working as expected.

Looks good to me! 🎖️

examples/kuadrant/reconciler.go Outdated Show resolved Hide resolved
@guicassolato guicassolato merged commit a7167c7 into main Jul 22, 2024
3 checks passed
@guicassolato guicassolato deleted the topology-objects branch July 22, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants