forked from LaconicNetwork/kompose
Updated Vendoring
It resolves issues #474 and #589 which were coming from libcompose, as well as resolves #440 and #437 partially as `group_add` & `stop_grace_period` are supported by libcompose now.
This commit is contained in:
+9
@@ -237,6 +237,11 @@ func newError(err ResultError, context *jsonContext, value interface{}, locale l
|
||||
err.SetValue(value)
|
||||
err.SetDetails(details)
|
||||
details["field"] = err.Field()
|
||||
|
||||
if _, exists := details["context"]; !exists && context != nil {
|
||||
details["context"] = context.String()
|
||||
}
|
||||
|
||||
err.SetDescription(formatErrorDescription(d, details))
|
||||
}
|
||||
|
||||
@@ -257,6 +262,10 @@ func formatErrorDescription(s string, details ErrorDetails) string {
|
||||
errorTemplates.Lock()
|
||||
tpl = errorTemplates.New(s)
|
||||
|
||||
if ErrorTemplateFuncs != nil {
|
||||
tpl.Funcs(ErrorTemplateFuncs)
|
||||
}
|
||||
|
||||
tpl, err = tpl.Parse(s)
|
||||
errorTemplates.Unlock()
|
||||
|
||||
|
||||
+4
@@ -31,6 +31,7 @@ import (
|
||||
"errors"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"text/template"
|
||||
|
||||
"github.com/xeipuuv/gojsonreference"
|
||||
)
|
||||
@@ -39,6 +40,9 @@ var (
|
||||
// Locale is the default locale to use
|
||||
// Library users can overwrite with their own implementation
|
||||
Locale locale = DefaultLocale{}
|
||||
|
||||
// ErrorTemplateFuncs allows you to define custom template funcs for use in localization.
|
||||
ErrorTemplateFuncs template.FuncMap
|
||||
)
|
||||
|
||||
func NewSchema(l JSONLoader) (*Schema, error) {
|
||||
|
||||
Reference in New Issue
Block a user