-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[receiver/k8scluster] Invalid image name and tag attributes when containing a digest #36279
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
The following commit makes the receiver's tests fail: e47aa1a What do you think if instead of using our custom image parser we use the K8s one? Similar to what I am proposing in this draft PR: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36281/files |
I also just had a look and it seems like the current regex expects the sha256 digest to consist of digits only. I tried to adapt the existing regex to handle this, as well as images containing no tags, as included in the draft PR, so something like the following may be worth a try to use instead of the previous regex:
This may be an alternative to consider if the code owners would like to avoid adding a new dependency for this. However I do see the value of having an established library doing the parsing, as it may be easy to miss certain cases with an own regex. Pinging the code owners (@dmitryax @TylerHelmuth @povilasv) - which approach would you say is the best in this case? |
There is a related PR fixing the Could we apply a similar logic here? |
Is there any reasoning behind a new function to parse the image in the |
Component(s)
receiver/k8scluster
What happened?
Description
If a container that is being instrumented using the
k8scluster
receiver has been deployed using a container image that contains a cryptographic digest, the receiver produces invalid attributes. The regex used to parse the container does not apply to images with a digest.Steps to Reproduce
Expected Result
Actual Result
Collector version
v0.112.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: