Skip to content

Commit

Permalink
fix relationships and add support for annotations eval
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Aug 21, 2024
1 parent 5d4955c commit 35b1ce3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ perform_eval(
design_file,
relationship,
) := patched_declarations if {
applicable_on_rels := [{"hierarchical": "parent"}, {"edge": "network"}]
applicable_on_rels := [
{"kind": "hierarchical", "type": "parent"},
{"kind": "edge", "type": "non-binding"},
]

{lower(relationship.kind): lower(relationship.type)} in applicable_on_rels
{"kind": lower(relationship.kind), "type": lower(relationship.type)} in applicable_on_rels

patched_declarations := [result |
mutator_object := extract_mutator_config_from_patch(relationship.selectors[0].allow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ is_feasible(from, to, resource1, resource2) if {
formatted_to_path = format_json_path(to_path)

val1 := object.get(resource1, formatted_from_path, "")
val2 := object.get(resource2, formatted_to_path, null)
val2 := object.get(resource2, formatted_to_path, "")

val1 == val2
} else := false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ identify_relationship(
design_file,
relationship,
) := evaluation_results if {
applicable_on_rels := [{"hierarchical": "parent"}, {"edge": "network"}]
applicable_on_rels := [
{"kind": "hierarchical", "type": "parent"},
{"kind": "edge", "type": "non-binding"},
]

{lower(relationship.kind): lower(relationship.type)} in applicable_on_rels
{"kind": lower(relationship.kind), "type": lower(relationship.type)} in applicable_on_rels

selector_set := relationship.selectors[_]
from_selectors := {kind: selectors |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"configuration",
"spec",
"containers",
"_",
"0",
"ports",
"_",
"containerPort"
Expand All @@ -104,7 +104,7 @@
"configuration",
"spec",
"containers",
"_",
"0",
"ports",
"_",
"protocol"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"line-color": "#00B39F",
"target-arrow-color": "#00B39F",
"targetArrowShape": "triangle"
},
}
},
"model": {
"schemaVersion": "core.meshery.io/v1beta1",
Expand Down

0 comments on commit 35b1ce3

Please sign in to comment.