Skip to content

Refactor Apache/Nginx auto-instrumentation init containers#381

Merged
movence merged 2 commits into
mainfrom
httpd-nginx-autoinst
May 27, 2026
Merged

Refactor Apache/Nginx auto-instrumentation init containers#381
movence merged 2 commits into
mainfrom
httpd-nginx-autoinst

Conversation

@movence
Copy link
Copy Markdown
Contributor

@movence movence commented May 26, 2026

Issue #, if available:
Apache/Nginx auto-instrumentation init containers built their command line by concatenating user-supplied configuration paths into a shell string, and the corresponding CRD fields had no character or length constraints.

Description of changes:
Cherry-picks the upstream init container refactor from opentelemetry-operator (PR #4942, v0.151.0) and regenerates the Instrumentation CRD.

  • Move init container logic from inline shell strings to embedded scripts under pkg/instrumentation/scripts/, invoked with positional arguments
  • Add length and pattern validation to Instrumentation.spec.{apacheHttpd.configPath, nginx.configFile}
  • Regenerate CRDs via make manifests

Tests

Component Test Result
pkg/instrumentation/{apachehttpd,nginx}.go + scripts/*.sh Runtime check on init container Command/Args shape — confirmed positional argument layout ✅ Pass
pkg/instrumentation/{apachehttpd,nginx}.go + scripts/*.sh Shell semantics check — script body executed as expected with the user-supplied value as $1 ✅ Pass
apis/v1alpha1/instrumentation_types.go (new pattern marker) make manifests regenerated CRD with the marker propagated ✅ Pass
config/crd/bases/cloudwatch.aws.amazon.com_instrumentations.yaml kind cluster + kubectl apply --dry-run=server: 4 inputs containing disallowed characters rejected, 2 standard paths accepted ✅ 6/6
Build go build ./..., go vet ./... ✅ Pass

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@movence movence merged commit 499126d into main May 27, 2026
10 checks passed
@movence movence deleted the httpd-nginx-autoinst branch May 27, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants