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

feat(injector): allow configuring injector version #1614

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

betterengineering
Copy link
Member

What does this PR do?

This commit allows users to optionally pin the injector version to a specific image tag for the Single Step APM Instrumentation in Kubernetes.

Motivation

Both internally during development of SSI and externally for our customers, it's useful to be able to pin the injector version. We already support this in the datadog Helm chart and this expands the functionality for customers using the operator.

Additional Notes

This is my first change to this repo! Let me know if I missed anything.

Minimum Agent Versions

  • Cluster Agent: 7.57.0+

Describe your test plan

I setup minikube locally with a registry. I ran the following to install my operator based on the docs:

# Build
make IMG=localhost:5000/test/operator:test IMG_CHECK=localhost:5000/test/operator-check:test docker-build

# Push
make IMG=localhost:5000/test/operator:test IMG_CHECK=localhost:5000/test/operator-check:test docker-push

# Deploy
make IMG=localhost:5000/test/operator:test IMG_CHECK=localhost:5000/test/operator-check:test deploy

I then added the following config to examples/datadogagent/datadog-agent-minimum.yaml and ran the script for a DatadogAgent resource:

  features:
    apm:
      instrumentation:
        enabled: true
        injector:
          imageTag: "0.25.0"
        enabledNamespaces:
          - "test-1"
        libVersions:
          java: "1"
          dotnet: "3"
          python: "2"
          js: "5"

Finally, I deployed an example JS app to the test-1 namespace and ensured it got the old injector version:

gcr.io/datadoghq/apm-inject:0.25.0

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

This commit allows users to optionally pin the injector version to a
specifc image tag.
pkg/testutils/builder.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.33%. Comparing base (d49f7c2) to head (d8e3892).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1614      +/-   ##
==========================================
+ Coverage   49.28%   49.33%   +0.04%     
==========================================
  Files         216      216              
  Lines       20662    20680      +18     
==========================================
+ Hits        10184    10202      +18     
  Misses       9942     9942              
  Partials      536      536              
Flag Coverage Δ
unittests 49.33% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ller/datadogagent/defaults/datadogagent_default.go 91.17% <100.00%> (+0.07%) ⬆️
...nal/controller/datadogagent/feature/apm/feature.go 65.51% <100.00%> (+1.48%) ⬆️
pkg/testutils/builder.go 91.56% <100.00%> (+0.03%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d49f7c2...d8e3892. Read the comment docs.

@levan-m levan-m added this to the v1.13.0 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request qa/skip-qa
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants