Plugins: Fix Azure token provider cache panic and auth param nil value (#34252)
* More tests for token cache * Safeguarding from panic and concurrency fixes * Update Azure dependencies * Fix interpolation of empty plugin data
This commit is contained in:
1 parent
63b2dd06a5
commit
c1b8a10f41
8 files changed
+363
-86
No files matched your search
@@ -14,7 +14,16 @@ import (
|
||||
|
||||
// interpolateString accepts template data and return a string with substitutions
|
||||
func interpolateString(text string, data templateData) (string, error) {
|
||||
t, err := template.New("content").Parse(text)
|
||||
extraFuncs := map[string]interface{}{
|
||||
"orEmpty": func(v interface{}) interface{} {
|
||||
if v == nil {
|
||||
return ""
|
||||
}
|
||||
return v
|
||||
},
|
||||
}
|
||||
|
||||
t, err := template.New("content").Funcs(extraFuncs).Parse(text)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not parse template %s", text)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user