-
Notifications
You must be signed in to change notification settings - Fork 10
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 probe for Kubernetes ingress #78
Add probe for Kubernetes ingress #78
Conversation
It implements openrca#28 Signed-off-by: Aleksandra Galara <a.galara@samsung.com>
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.
A few cosmetic remarks. Good job!
def _extract_rules(self, entity): | ||
rules = [] | ||
for rule in entity.spec.rules: | ||
properties = {} |
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.
Let's add rule host
property as well.
orca/topology/infra/k8s/extractor.py
Outdated
rules.append(properties) | ||
return rules | ||
|
||
def _extract_values(self, rule): |
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 suggest renaming the method to _extract_paths
.
def _extract_values(self, rule): | ||
values = [] | ||
for path in rule.http.paths: | ||
properties = {} |
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.
Let's add path
property as well.
orca/topology/infra/k8s/matcher.py
Outdated
@@ -218,6 +218,23 @@ def are_linked(self, obj, namespace): | |||
return namespace.properties.name == obj.properties.namespace | |||
|
|||
|
|||
class IngressToServiceMatcher(Matcher): | |||
|
|||
"""Generic matcher for links between Ingress and Service entities.""" |
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.
It's not a "generic" linker (e.g. for links between a namespace and ANY resource). It's a linker for links between concrete entity types: ingress and service. Remove the generic
keyword from the docstring.
orca/topology/infra/k8s/matcher.py
Outdated
matched_service = self._match_service(ingress, service) | ||
return matched_namespace and matched_service | ||
|
||
def _match_service(self, ingress, service): |
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.
Since we're matching rules here, I suggest renaming the method to _match_rules
.
Signed-off-by: Aleksandra Galara <a.galara@samsung.com>
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.
Looks good to me 😄 Ready for merge!
It implements #28
Signed-off-by: Aleksandra Galara a.galara@samsung.com