-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/k8sattributes] Support name:tag@digest image name format #36145
base: main
Are you sure you want to change the base?
Conversation
8a9c1bd
to
90d3a08
Compare
09323ed
to
828a728
Compare
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.
Thank's for working on this @spiffyy99!
I think the fix is in the right direction but I left some concerns.
thanks for the review christos. |
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.
Overall looks good. Could we add a section in the docs describing the logic from https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36145/files#r1832085419?
Already referenced it here: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36145/files#diff-f9652f665e3a05f0768f863df6d7543c56b7cf671e4d2be1d7086c5d73e7cc3dR12 any other section you think it would be good to mention this? |
a51981f
to
6b95457
Compare
@@ -4,33 +4,33 @@ | |||
|
|||
## Resource Attributes | |||
|
|||
| Name | Description | Values | Enabled | | |||
| ---- | ----------- | ------ | ------- | | |||
| Name | Description | Values | Enabled | |
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.
That file is automatically generated by the metadata.yaml
. Please apply the edits at
container.image.tag: |
make generate
to update the documentation.md
properly.
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.
done!
6b95457
to
3859c70
Compare
e09c207
to
25d7678
Compare
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.
LGTM. Thank's @spiffyy99!
@TylerHelmuth please take a look
d9ee59f
to
35b2a0b
Compare
@dmitryax @fatsheep9146 @TylerHelmuth could one of you take a look at this? thanks! |
// parseAttributesFromImage parses the image name and tag for differently-formatted image names. | ||
// returns "latest" as the default if tag not present. also checks if the image contains a digest. | ||
// if it does, no latest tag is assumed. | ||
func parseNameAndTagFromImage(image string) (name, tag string, err error) { |
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.
Should we use the already available internal docker.ParseImageName function instead?
I would prefer to all components use the same strategy for common functionalities. Note that the shared function cannot parse images with digest at the moment and should be fixed beforehand: #36279
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.
Having a single implementation makes sense.
Also I think the package should be renamed to container
and not docker
since it doesn't only cover docker.
Description
Fixed issue with
k8sattributesprocessor
where digest is not properly separated from tag if both are present. used official docker library to perform parsing.Link to tracking issue
Fixes #36131
Testing
unit tests
integration/e2e tests
Documentation
N/A. Fields are already described correctly, this is simply fixing parsing logic