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

[CORE] Port all edges from original POC #49

Merged
merged 35 commits into from
Jun 21, 2023
Merged

[CORE] Port all edges from original POC #49

merged 35 commits into from
Jun 21, 2023

Conversation

d0g0x01
Copy link
Contributor

@d0g0x01 d0g0x01 commented Jun 16, 2023

This PR adds all the edges from the original POC

Base automatically changed from jeremy/janusgraph-data-model to main June 16, 2023 18:14
@d0g0x01 d0g0x01 changed the title WIP [CORE] Port all edges from original POC Jun 20, 2023
@d0g0x01 d0g0x01 marked this pull request as ready for review June 20, 2023 17:18
@d0g0x01 d0g0x01 requested a review from a team as a code owner June 20, 2023 17:18
Copy link
Contributor

@edznux-dd edznux-dd left a 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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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?
Copy link
Contributor

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?)

Copy link
Contributor Author

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)

@d0g0x01 d0g0x01 merged commit 8fae70e into main Jun 21, 2023
1 check passed
@d0g0x01 d0g0x01 deleted the jeremy/poc-edge-port branch June 21, 2023 17:22
@d0g0x01 d0g0x01 restored the jeremy/poc-edge-port branch August 11, 2023 12:55
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.

3 participants