Skip to content

Refactor repeated environment-variable-aware merge logic #345

Open

Description

@coderabbitai

Summary

Extract a suitable abstraction for the repeated environment-variable-aware merge sequence in internal/deployer/config.go. The sequence saves base environment variables, merges an overlay, merges customize.envVars by name, and warns about unresolved references.

The sequence appears in MergeConfig, CentralConfig.ConfigureSpec, and SecuredClusterConfig.ConfigureSpec. Reducing duplication should make this behavior easier to maintain consistently.

Acceptance criteria

  • Reuse an appropriate abstraction across the applicable merge paths.
  • Preserve existing merge options and behavior, including replacement of generic slices and last-one-wins merging of environment variables by name.
  • Preserve component-specific behavior, contextual errors, and warnings for unresolved references.
  • Keep existing tests passing and add or update tests as needed to cover the refactored paths.

Requested by @mclasmeier.

Pull request: #339
Review: #339 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions