Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openstack-k8s-operators/lib-common
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb86b5e8c8e73db4aeea437420e6222969a064e0
Choose a base ref
..
head repository: openstack-k8s-operators/lib-common
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: eb060f93569adf7a9c36a66bace05548341e0ba6
Choose a head ref
Showing with 12 additions and 6 deletions.
  1. +6 −3 modules/common/configmap/configmap.go
  2. +6 −3 modules/common/secret/secret.go
9 changes: 6 additions & 3 deletions modules/common/configmap/configmap.go
Original file line number Diff line number Diff line change
@@ -85,9 +85,12 @@ 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], err = util.ExecuteTemplateData(v, cm.ConfigOptions)
if err != nil {
return err
v_expanded, err := util.ExecuteTemplateData(v, cm.ConfigOptions)
if err == nil {
configMap.Data[k] = v_expanded
} else {
h.GetLogger().Info(fmt.Sprintf("Skipped customData expansion due to: %s", err))
configMap.Data[k] = v
}
}
}
9 changes: 6 additions & 3 deletions modules/common/secret/secret.go
Original file line number Diff line number Diff line change
@@ -165,9 +165,12 @@ 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], err = util.ExecuteTemplateData(v, st.ConfigOptions)
if err != nil {
return err
v_expanded, err := util.ExecuteTemplateData(v, st.ConfigOptions)
if err == nil {
dataString[k] = v_expanded
} else {
h.GetLogger().Info(fmt.Sprintf("Skipped customData expansion due to: %s", err))
dataString[k] = v
}
}
}