Skip to content

Add pattern validation to Instrumentation CRD config fields - #314

Merged
movence merged 2 commits into
mainfrom
inst-regex-val
Jun 4, 2026
Merged

Add pattern validation to Instrumentation CRD config fields#314
movence merged 2 commits into
mainfrom
inst-regex-val

Conversation

@movence

@movence movence commented May 26, 2026

Copy link
Copy Markdown
Contributor

Issue
bundled Instrumentation CRD allowed arbitrary character and length values for configPath and configFile, leaving validation entirely to the operator.

Description of changes:
Adds length and pattern constraints to configPath and configFile in the bundled Instrumentation CRD to align with the upstream operator change.

Test

Component Test Result
charts/amazon-cloudwatch-observability/crds/cloudwatch.aws.amazon.com_instrumentations.yaml kind cluster admission via kubectl apply --dry-run=server: disallowed-character inputs rejected, standard paths accepted ✅ Pass
Chart helm lint ✅ Pass

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

sky333999
sky333999 previously approved these changes May 26, 2026
mitali-salvi
mitali-salvi previously approved these changes May 27, 2026
Copy all 4 CRDs from amazon-cloudwatch-agent-operator
config/crd/bases/ (branch httpd-nginx-autoinst). Changes:
- configPath/configFile: pattern ^[A-Za-z0-9._/-]*$ + maxLength 256
- x-kubernetes-list-type: atomic on all list fields
- appArmorProfile added to securityContext
- metricsConfig required enforcement for dcgmexporters
- 21 new field defaults (protocol: TCP, etc.)

Validated on live cluster test-perm (server-side apply + CR tests).
@movence
movence dismissed stale reviews from mitali-salvi and sky333999 via 409bbd9 June 3, 2026 13:06
@movence
movence merged commit 8362873 into main Jun 4, 2026
20 checks passed
@movence
movence deleted the inst-regex-val branch June 4, 2026 13:36
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.

4 participants