diff --git a/modules/common/configmap/configmap.go b/modules/common/configmap/configmap.go index 1d81787c..d4cc0aa4 100644 --- a/modules/common/configmap/configmap.go +++ b/modules/common/configmap/configmap.go @@ -85,7 +85,13 @@ func createOrPatchConfigMap( // Note: this can overwrite data rendered from GetTemplateData() if key is same if len(cm.CustomData) > 0 { for k, v := range cm.CustomData { - configMap.Data[k] = v + vExpanded, err := util.ExecuteTemplateData(v, cm.ConfigOptions) + if err == nil { + configMap.Data[k] = vExpanded + } else { + h.GetLogger().Info(fmt.Sprintf("Skipped customData expansion due to: %s", err)) + configMap.Data[k] = v + } } } diff --git a/modules/common/secret/secret.go b/modules/common/secret/secret.go index be4f418b..df28f8d2 100644 --- a/modules/common/secret/secret.go +++ b/modules/common/secret/secret.go @@ -165,7 +165,13 @@ func createOrUpdateSecret( // Note: this can overwrite data rendered from GetTemplateData() if key is same if len(st.CustomData) > 0 { for k, v := range st.CustomData { - dataString[k] = v + vExpanded, err := util.ExecuteTemplateData(v, st.ConfigOptions) + if err == nil { + dataString[k] = vExpanded + } else { + h.GetLogger().Info(fmt.Sprintf("Skipped customData expansion due to: %s", err)) + dataString[k] = v + } } }