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 an introspection endpoint for container metadata #1614

Conversation

Molter73
Copy link
Collaborator

@Molter73 Molter73 commented Mar 27, 2024

Description

Add an introspection endpoint to collector which can be used to retrieve container metadata by providing it with a container ID. At the time, the only data that is returned by the endpoint is the same container ID that was provided and the k8s namespace the container belongs to. This endpoint will enable testing of the #1606 PR without need for changes to our communication with sensor.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

Manually tested the new endpoint.

@Molter73 Molter73 requested a review from a team as a code owner March 27, 2024 17:38
@Molter73 Molter73 force-pushed the mauro/k8s-metadata-introspection-endpoint branch from df4679f to af350d6 Compare April 1, 2024 10:50
Copy link
Contributor

@ovalenti ovalenti left a comment

Choose a reason for hiding this comment

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

Looks good, and thanks for extracting the IntrospectionEndpoint common functions !

My only concern is with the underlying concurrent access via GetNamespace(). I left a comment in the other PR.

Comment on lines +14 to +15
static QueryParams ParseParameters(const char* queryString);
static std::optional<std::string> GetParameter(const QueryParams& params, const std::string& paramName);
Copy link
Contributor

Choose a reason for hiding this comment

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

These methods are not used in the PR. However, I think they will be soon, as we add more endpoints.

@Molter73 Molter73 force-pushed the mauro/k8s-metadata-introspection-endpoint branch from af350d6 to 6476c65 Compare April 2, 2024 15:29
docs/troubleshooting.md Outdated Show resolved Hide resolved
docs/troubleshooting.md Show resolved Hide resolved
Copy link
Contributor

@ovalenti ovalenti left a comment

Choose a reason for hiding this comment

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

Still looks good to me 👍

@Molter73 Molter73 merged commit 7f838e7 into mauro/k8s-metadata-from-falco Apr 12, 2024
51 checks passed
@Molter73 Molter73 deleted the mauro/k8s-metadata-introspection-endpoint branch April 12, 2024 11:19
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