tdiesler commented on code in PR #5639: URL: https://github.com/apache/camel-k/pull/5639#discussion_r1642803092
########## pkg/trait/environment.go: ########## @@ -99,12 +101,81 @@ func (t *environmentTrait) Apply(e *Environment) error { } } - if t.Vars != nil { - for _, env := range t.Vars { - k, v := property.SplitPropertyFileEntry(env) + for _, env := range t.Vars { + k, v := property.SplitPropertyFileEntry(env) + switch { + case strings.HasPrefix(v, "configmap:"): + path := strings.TrimPrefix(v, "configmap:") + setValFromConfigMapKeySelector(&e.EnvVars, k, path) + case strings.HasPrefix(v, "secret:"): + path := strings.TrimPrefix(v, "secret:") + setValFromSecretKeySelector(&e.EnvVars, k, path) + default: envvar.SetVal(&e.EnvVars, k, v) } } - return nil } + +func setValFromConfigMapKeySelector(vars *[]corev1.EnvVar, envName string, path string) { Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org