forked from LaconicNetwork/kompose
Update vendoring as well as libcompose
This commit updates libcompose in order to merge in https://github.com/docker/libcompose/pull/423 which affected https://github.com/kubernetes-incubator/kompose/issues/92 by not erroring out when an image name wasn't provided. Closes https://github.com/kubernetes-incubator/kompose/issues/92 As well as knocks out the last required milestone for a 0.2.1 release https://github.com/kubernetes-incubator/kompose/milestone/2
This commit is contained in:
+16
-5
@@ -2,10 +2,18 @@ package gojsonschema
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"sync"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var errorTemplates *template.Template
|
||||
var errorTemplates errorTemplate = errorTemplate{template.New("errors-new"),sync.RWMutex{}}
|
||||
|
||||
// template.Template is not thread-safe for writing, so some locking is done
|
||||
// sync.RWMutex is used for efficiently locking when new templates are created
|
||||
type errorTemplate struct {
|
||||
*template.Template
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
type (
|
||||
// RequiredError. ErrorDetails: property string
|
||||
@@ -241,14 +249,17 @@ func formatErrorDescription(s string, details ErrorDetails) string {
|
||||
var descrAsBuffer bytes.Buffer
|
||||
var err error
|
||||
|
||||
if errorTemplates == nil {
|
||||
errorTemplates = template.New("all-errors")
|
||||
}
|
||||
|
||||
errorTemplates.RLock()
|
||||
tpl = errorTemplates.Lookup(s)
|
||||
errorTemplates.RUnlock()
|
||||
|
||||
if tpl == nil {
|
||||
errorTemplates.Lock()
|
||||
tpl = errorTemplates.New(s)
|
||||
|
||||
tpl, err = tpl.Parse(s)
|
||||
errorTemplates.Unlock()
|
||||
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
+3
-1
@@ -101,7 +101,9 @@ func (l *jsonReferenceLoader) JsonReference() (gojsonreference.JsonReference, er
|
||||
}
|
||||
|
||||
func (l *jsonReferenceLoader) LoaderFactory() JSONLoaderFactory {
|
||||
return &DefaultJSONLoaderFactory{}
|
||||
return &FileSystemJSONLoaderFactory{
|
||||
fs: l.fs,
|
||||
}
|
||||
}
|
||||
|
||||
// NewReferenceLoader returns a JSON reference loader using the given source and the local OS file system.
|
||||
|
||||
Reference in New Issue
Block a user