-
Notifications
You must be signed in to change notification settings - Fork 41
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
[CORE] Port all edges from original POC #49
Conversation
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, smalls suggestion/nits
) | ||
|
||
// GremlinInputProcessor transform a graph model object to a map suitable for consumption by a gremllin traversal. | ||
func GremlinInputProcessor[T any](_ context.Context, entry interface{}) (map[string]any, error) { |
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.
func GremlinInputProcessor[T any](_ context.Context, entry interface{}) (map[string]any, error) { | |
func GremlinInputProcessor[T any](_ context.Context, entry any) (map[string]any, error) { |
} | ||
|
||
// structToMap creates a map from a simple input struct. | ||
func structToMap(in interface{}) (map[string]any, error) { |
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.
func structToMap(in interface{}) (map[string]any, error) { | |
func structToMap(in any) (map[string]any, error) { |
} | ||
|
||
// Traversal expects a list of podPatchGroup serialized as mapstructure for injection into the graph. | ||
// Fo each podPatchGroup, the traversal will: 1) find the role vertex with matching storeID, 2) find the |
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.
// Fo each podPatchGroup, the traversal will: 1) find the role vertex with matching storeID, 2) find the | |
// For each podPatchGroup, the traversal will: 1) find the role vertex with matching storeID, 2) find the |
} | ||
|
||
// Traversal expects a list of containerAttachGroup serialized as mapstructure for injection into the graph. | ||
// Fo each containerAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the |
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.
// Fo each containerAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the | |
// For each containerAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the |
} | ||
|
||
// containerEscapeTraversal expects a list of containerEscapeGroup serialized as mapstructure for injection into the graph. | ||
// Fo each containerEscapeGroup, the traversal will: 1) find the container with matching storeID, 2) find the |
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.
// Fo each containerEscapeGroup, the traversal will: 1) find the container with matching storeID, 2) find the | |
// For each containerEscapeGroup, the traversal will: 1) find the container with matching storeID, 2) find the |
} | ||
|
||
// Traversal expects a list of identityGroup serialized as mapstructure for injection into the graph. | ||
// Fo each identityGroup, the traversal will: 1) find the container with matching storeID, 2) find the |
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.
// Fo each identityGroup, the traversal will: 1) find the container with matching storeID, 2) find the | |
// For each identityGroup, the traversal will: 1) find the container with matching storeID, 2) find the |
} | ||
|
||
// Traversal expects a list of podAttachGroup serialized as mapstructure for injection into the graph. | ||
// Fo each podAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the |
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.
// Fo each podAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the | |
// For each podAttachGroup, the traversal will: 1) find the pod vertex with matching storeID, 2) find the |
// Traversal expects a list of podPatchGroup serialized as mapstructure for injection into the graph. | ||
// Fo each podPatchGroup, the traversal will: 1) find the role vertex with matching storeID, 2) find the | ||
// pod vertices for each matching storeID, and 3) add a POD_PATCH edge between the two vertices. | ||
// TODO this only handles the same namespace case. What do we do if its all namespaces to avoid edge count blowing up? |
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.
hmm if the namespace aren't a security boundary in this case, shouldn't we do "too many edge but we don't missing something obvious" rather than "we lack visibility but we have a nice graph" approach (at least at first?)
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're right but its gonna be a tricky gremlin query. going to leave it as is for this PR and add this case in a subequent one (ASAP)
This PR adds all the edges from the original POC