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

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
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.

1 participant