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

[internal/patch/logr] Add funcr package #11152

Merged
merged 5 commits into from
Mar 7, 2022
Merged

[internal/patch/logr] Add funcr package #11152

merged 5 commits into from
Mar 7, 2022

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Mar 4, 2022

What does this PR do?

Add funcr patch module to use the funcr package in logr v0.4.0. See https://github.com/DataDog/datadog-agent/blob/main/internal/patch/logr/funcr/README.md for further details.

Motivation

Be able to bump the OpenTelemetry Collector.

Additional Notes

This is terribly hacky and it only works because a logr.Logger was an interface on v0.4.0 but.. it works:

  • The behavior should be the same as with logger v1.2.2 because we are just using the v1.2.2 logger under the hood
  • If something fails it will fail to compile, not fail at runtime
  • Whenever we don't need this we will get an 'ambiguous import' error which can be fixed.

Possible Drawbacks / Trade-offs

Maybe there is some difference in behavior that I am not aware of that makes this package malfunction. I think this is unlikely, but the possibility is there.

Describe how to test/QA your changes

To be tested as part of the Collector bump.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • The appropriate team/.. label has been applied, if known.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the config template has been updated.

@mx-psi mx-psi force-pushed the mx-psi/patch-logr branch from 667fefd to 199415e Compare March 4, 2022 13:09
@mx-psi mx-psi added changelog/no-changelog [deprecated] team/agent-platform [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card labels Mar 4, 2022
@mx-psi mx-psi added this to the 7.36.0 milestone Mar 4, 2022
@mx-psi mx-psi requested a review from a team March 4, 2022 16:22
@mx-psi mx-psi marked this pull request as ready for review March 4, 2022 16:22
Copy link
Contributor

@KSerrania KSerrania left a comment

Choose a reason for hiding this comment

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

LGTM but it's sad that we have to resort to this 😢

internal/patch/logr/funcr/README.md Outdated Show resolved Hide resolved
Co-authored-by: Kylian Serrania <kylian.serrania@datadoghq.com>
@mx-psi
Copy link
Member Author

mx-psi commented Mar 7, 2022

LGTM but it's sad that we have to resort to this 😢

Yes :( If everything goes well and kubernetes/kubernetes#106536 gets fixed, we could potentially remove this in April or August, depending on the Kubernetes release.

@mx-psi mx-psi merged commit 7609154 into main Mar 7, 2022
@mx-psi mx-psi deleted the mx-psi/patch-logr branch March 7, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card [deprecated] team/agent-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants