Skip to content

test: Verify pod-level chart values are plumbed into workloads - #757

Open
miconeilaws wants to merge 2 commits into
mainfrom
feat/pod-level-values-e2e
Open

test: Verify pod-level chart values are plumbed into workloads#757
miconeilaws wants to merge 2 commits into
mainfrom
feat/pod-level-values-e2e

Conversation

@miconeilaws

Copy link
Copy Markdown
Collaborator

Description

The amazon-cloudwatch-observability chart is gaining five top-level pod-level configuration values — podLabels, podAnnotations, topologySpreadConstraints, priorityClassName, podDisruptionBudget (aws-observability/helm-charts#367). This PR adds e2e coverage that the chart plumbs those values into the workloads without validation errors.

Scope: plumbing verification, not re-testing Kubernetes. We don't exercise the space of possible values — we assert that setting each toggle results in the expected fields on the running pods / expected objects in the cluster.

How it works

  • applyHelmResources (the shared helm install used by the test/e2e/* suites) now always sets all five values. The values are deliberately inert so they can ride along with any suite without affecting its assertions:
    • labels/annotations are pure metadata with test-unique keys
    • the topology constraint is whenUnsatisfiable: ScheduleAnyway (advisory only)
    • the PDB is the chart-default maxUnavailable: 1, which never blocks normal DaemonSet operation
    • priorityClassName: system-cluster-critical is valid outside kube-system since k8s 1.17
  • New VerifyPodLevelValues in test/e2e asserts, per workload:
    • operator pod: label, annotation, priorityClassName, topology spread constraint all present
    • fluent-bit pod: label + annotation present; component-level system-node-critical priorityClassName not overridden by the root value (precedence check)
    • cloudwatch-agent pod: annotation plumbed through the AmazonCloudWatchAgent CR
    • PDBs: amazon-cloudwatch-observability-controller-manager-pdb and fluent-bit-pdb exist with the default maxUnavailable
  • Registered in the JMX suite's testResourcesRegistry — runs on every e2e execution, zero new infrastructure.
  • Install values and assertions share one source of truth (PodLevelValuesHelmValues()), so they can't drift.

Known limitations / sequencing

Testing

  • go build ./test/e2e/... and go vet ./test/e2e/... clean, gofmt clean.
  • go test -run NO_MATCH ./test/e2e/jmx/ compiles and exits cleanly (sentinel used by the harness).

The amazon-cloudwatch-observability chart is gaining top-level
podLabels, podAnnotations, topologySpreadConstraints,
priorityClassName, and podDisruptionBudget values
(aws-observability/helm-charts#367). Add e2e coverage that the chart
plumbs these values into the workloads without validation errors.

The goal is plumbing verification, not re-testing Kubernetes
semantics: the base helm install in applyHelmResources now always
sets all five values (with deliberately inert choices — advisory-only
topology constraint, opt-in PDB with the chart-default maxUnavailable,
metadata-only labels/annotations) and a new VerifyPodLevelValues
assertion checks they landed:

  * operator pod: label, annotation, priorityClassName, and topology
    spread constraint all present
  * fluent-bit pod: label + annotation present; component-level
    system-node-critical priorityClassName NOT overridden by the root
    value (override precedence check)
  * cloudwatch-agent pod: annotation plumbed through the
    AmazonCloudWatchAgent CR (podLabels and DaemonSet topology spread
    constraints need operator-side support; tracked separately in
    aws/amazon-cloudwatch-agent-operator#410)
  * PodDisruptionBudgets: chart-created objects exist with the default
    maxUnavailable

Wired into the JMX suite's testResourcesRegistry so it runs on every
e2e execution with no new infrastructure. The EKS addon path skips
the verification — the addon schema does not expose these fields yet.

Because values are shared between install and verification through
PodLevelValuesHelmValues(), the install and the assertions cannot
drift apart.
@miconeilaws
miconeilaws requested a review from a team as a code owner September 7, 2026 15:31
Reconciliation review of the chart and operator PRs established that
the operator never emits a PodDisruptionBudget for daemonset-mode
AmazonCloudWatchAgent CRs, by design (the collector defaulting webhook
populates spec.podDisruptionBudget on every CR, so daemonset emission
would create surprise PDB objects on operator upgrade).

Update the comment in VerifyPodLevelValues so a future contributor
doesn't try to 'complete' the test with a CWA PDB assertion that can
never pass for the default daemonset agent, and be precise about which
deferred assertions unlock at operator v3.8.0 (podLabels, daemonset
topologySpreadConstraints).

Comment-only change.
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.

1 participant