-
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 |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
hi, I’m currently working on a related issue that appears to depend on the progress of this one. could you kindly share the current status of this task? If there’s anything I can assist with to help move it forward, please let me know. |
Hey @LZiHaN! My proposal would be to check what k8sclusterreceiver and k8sattributesprocessor do in regard with the container image's name, tag and digest and try to unify their implementations into 1 common one. Possibly through #36418 (I'm not 100% if this would be the best way to implement this but we need to evaluate this anyways). |
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: