Skip to content

fix: use Key instead of OwnKey in rawEnvVars to properly reference existing defaults in complex structs#412

Open
AndrewChubatiuk wants to merge 1 commit intocaarlos0:mainfrom
AndrewChubatiuk:fix-raw-env-vars-key
Open

fix: use Key instead of OwnKey in rawEnvVars to properly reference existing defaults in complex structs#412
AndrewChubatiuk wants to merge 1 commit intocaarlos0:mainfrom
AndrewChubatiuk:fix-raw-env-vars-key

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown

currently it's impossible to expand variable from other struct field, if configuration struct is not plain
in a given below example Config.Component.Endpoint.Value can be only obtained from env variable, but not from default value of Config.Component.Host

type Config struct {
  Name string `env:"NAME" envDefault:"some-name"`
  Component struct {
    Host string `env:"HOST" envDefault:"localhost"`
    Endpoint struct {
      Value string `env:"VALUE,expand" envDefault:"${COMPONENT_HOST}"`
    }
  } `envPrefix:"COMPONENT_"`
}

AndrewChubatiuk added a commit to endesapt/operator that referenced this pull request Mar 2, 2026
- temporary replaced caarlos0/env with fork till caarlos0/env#412 is merged
- consolidate all functions for cluster defaults population
- merged CommonDefaultableParams and CommonApplicationDeploymentParams into CommonAppsParams
- moved setting terminationGracePeriodSeconds to defaults management
AndrewChubatiuk added a commit to endesapt/operator that referenced this pull request Mar 2, 2026
- temporary replaced caarlos0/env with fork till caarlos0/env#412 is merged
- consolidate all functions for cluster defaults population
- merged CommonDefaultableParams and CommonApplicationDeploymentParams into CommonAppsParams
- moved setting terminationGracePeriodSeconds to defaults management
AndrewChubatiuk added a commit to endesapt/operator that referenced this pull request Mar 2, 2026
- temporary replaced caarlos0/env with fork till caarlos0/env#412 is merged
- consolidate all functions for cluster defaults population
- merged CommonDefaultableParams and CommonApplicationDeploymentParams into CommonAppsParams
- moved setting terminationGracePeriodSeconds to defaults management
AndrewChubatiuk added a commit to endesapt/operator that referenced this pull request Mar 2, 2026
- temporary replaced caarlos0/env with fork till caarlos0/env#412 is merged
- consolidate all functions for cluster defaults population
- merged CommonDefaultableParams and CommonApplicationDeploymentParams into CommonAppsParams
- moved setting terminationGracePeriodSeconds to defaults management
AndrewChubatiuk added a commit to endesapt/operator that referenced this pull request Mar 2, 2026
- temporary replaced caarlos0/env with fork till caarlos0/env#412 is merged
- consolidate all functions for cluster defaults population
- merged CommonDefaultableParams and CommonApplicationDeploymentParams into CommonAppsParams
- moved setting terminationGracePeriodSeconds to defaults management
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1ff55e6) to head (fe53c87).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #412   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          532       532           
=========================================
  Hits           532       532           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants