chore(label): new label "values-from"
This labels allow to use some environment variables from another service and use the configMap / secret instead of the original value. This is useful to avoid duplication of values for several variables.
This commit is contained in:
@@ -113,6 +113,10 @@ func Generate(project *types.Project) (*HelmChart, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// it's now time to get "value-from", before makeing the secrets and configmaps!
|
||||
for _, s := range project.Services {
|
||||
chart.setEnvironmentValuesFrom(s, deployments)
|
||||
}
|
||||
|
||||
// generate configmaps with environment variables
|
||||
chart.generateConfigMapsAndSecrets(project)
|
||||
@@ -123,6 +127,16 @@ func Generate(project *types.Project) (*HelmChart, error) {
|
||||
chart.setSharedConf(s, deployments)
|
||||
}
|
||||
|
||||
// remove all "boundEnv" from the values
|
||||
for _, d := range deployments {
|
||||
if len(d.boundEnvVar) == 0 {
|
||||
continue
|
||||
}
|
||||
for _, e := range d.boundEnvVar {
|
||||
delete(chart.Values[d.service.Name].(*Value).Environment, e)
|
||||
}
|
||||
}
|
||||
|
||||
// generate yaml files
|
||||
for _, d := range deployments {
|
||||
y, err := d.Yaml()
|
||||
|
Reference in New Issue
Block a user