Commit 0e2ea84
committed
fix(fluentd): propagate sidecarContainers to the configcheck pod
Motivation:
FluentdSpec.SidecarContainers is added to the Fluentd StatefulSet pod
but was never propagated to the transient fluentd-configcheck-* pod
that dry-runs the rendered config before rollout. Users who need a
sidecar to run before the aggregator starts (e.g. to refresh a
GeoIP database via extraVolumes, as reported) only got it on the
StatefulSet, not on the config check.
Approach:
Mirror the existing statefulset.go pattern in containerCheckPod
(pkg/resources/fluentd/appconfigmap.go): append
fluentdSpec.SidecarContainers to the check pod's container list when
non-empty. The fluentd container that other code paths index at
Containers[0] (e.g. the TLS volume mount) is unaffected since
sidecars are appended after it.
Validation:
- go build ./... and go vet ./pkg/resources/fluentd/... pass.
- Added TestNewCheckPodSidecarContainers to appconfigmap_test.go,
which asserts the configcheck pod's container list contains a
configured sidecar. Confirmed it fails without the fix (stashing
only appconfigmap.go reproduces the reported bug) and passes with
it: go test ./pkg/resources/fluentd/... -run TestNewCheckPod -v
- make lint reports 0 issues across all three modules.
- make test passes across the full suite with no failures.
- make license-check fails, but identically on unmodified master
(verified via git stash), so it is a pre-existing environment
issue unrelated to this change.
User-visible behaviour of the main Fluentd StatefulSet is unchanged;
this only fixes the config check pod, whose config validation
previously ran without any configured sidecars.
Report: #2103
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>1 parent 04e6f77 commit 0e2ea84
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
433 | 437 | | |
434 | 438 | | |
435 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
0 commit comments