mirror of
https://github.com/rancher/os.git
synced 2025-09-02 15:24:32 +00:00
Bump libcompose and its dependencies
This commit is contained in:
21
vendor/github.com/docker/libcompose/utils/util.go
generated
vendored
21
vendor/github.com/docker/libcompose/utils/util.go
generated
vendored
@@ -2,7 +2,6 @@ package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
@@ -17,7 +16,7 @@ type InParallel struct {
|
||||
pool sync.Pool
|
||||
}
|
||||
|
||||
// Add adds runs the specified task in parallel and add it to the waitGroup.
|
||||
// Add runs the specified task in parallel and adds it to the waitGroup.
|
||||
func (i *InParallel) Add(task func() error) {
|
||||
i.wg.Add(1)
|
||||
|
||||
@@ -30,7 +29,7 @@ func (i *InParallel) Add(task func() error) {
|
||||
}()
|
||||
}
|
||||
|
||||
// Wait waits for all tasks to complete and returns the latests error encountered if any.
|
||||
// Wait waits for all tasks to complete and returns the latest error encountered if any.
|
||||
func (i *InParallel) Wait() error {
|
||||
i.wg.Wait()
|
||||
obj := i.pool.Get()
|
||||
@@ -112,22 +111,6 @@ func FilterString(data map[string][]string) string {
|
||||
return string(bytes)
|
||||
}
|
||||
|
||||
// LabelFilterString returns a label json string representation of the specifed couple (key,value)
|
||||
// that is used as filter for docker.
|
||||
func LabelFilterString(key, value string) string {
|
||||
return FilterString(map[string][]string{
|
||||
"label": {fmt.Sprintf("%s=%s", key, value)},
|
||||
})
|
||||
}
|
||||
|
||||
// LabelFilter returns a label map representation of the specifed couple (key,value)
|
||||
// that is used as filter for docker.
|
||||
func LabelFilter(key, value string) map[string][]string {
|
||||
return map[string][]string{
|
||||
"label": {fmt.Sprintf("%s=%s", key, value)},
|
||||
}
|
||||
}
|
||||
|
||||
// Contains checks if the specified string (key) is present in the specified collection.
|
||||
func Contains(collection []string, key string) bool {
|
||||
for _, value := range collection {
|
||||
|
Reference in New Issue
Block a user