feat(filter): support envFrom for ConfigMap/Secret env injection#63
feat(filter): support envFrom for ConfigMap/Secret env injection#63nikitos wants to merge 6 commits into
Conversation
lucasmundim
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The change is clean and the generated artifacts (deepcopy + both CRD YAMLs) are properly in sync.
A few asks before merging — left inline. Summary: please add unit tests for the new field on both the batch and streaming paths, and consider documenting the precedence interaction with env.
lucasmundim
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback — docstring is clear, the precedence note is in place, and both the batch and streaming paths now have unit tests. Looks good to merge.
shingonoide
left a comment
There was a problem hiding this comment.
Thanks for the contribution, @nikitos. This is a clean, well-scoped addition. We verified that the new EnvFrom reaches the container on both the batch (buildJob) and streaming (buildStreamingDeployment) paths, which are the only two filter-to-container build sites, so nothing is missed. The generated deepcopy and both CRD YAMLs are in sync, and the precedence note (controller-injected env wins over envFrom, regardless of order) is an accurate description of kubelet behavior. Tests for both paths pass locally. Looks good to us.
Summary
Adds support for the standard Kubernetes
envFrommechanism on filters, so a filter can populate its container environment variables in bulk from ConfigMaps and/or Secrets, in addition to the existing per-variableenvfield.What changed
EnvFrom []corev1.EnvFromSourcefield on theFilterspec (api/v1alpha1/pipeline_types.go), using the standard KubernetesEnvFromSourcetype for full compatibility (ConfigMap refs, Secret refs, and prefix).filter.EnvFromis propagated to the container on both filter build paths: batch jobs (buildJob) and streaming deployments (buildStreamingDeployment).zz_generated.deepcopy.goand both CRD YAMLs (config/crd/bases/...anddeployment/.../crds/...), which stay in sync.Precedence
Values defined in
env(including those injected by the controller) take precedence over values sourced throughenvFrom, regardless of ordering. This follows standard kubelet behavior, where a container's explicitenventries override any matching variables brought in byenvFrom.Testing
Added unit tests verifying that
envFromentries (a ConfigMap ref and a Secret ref) are propagated to the resulting container on both paths:TestBuildJob_EnvFrom_Propagated(batch)TestBuildStreamingDeployment_EnvFrom_Propagated(streaming)