mirror of
https://github.com/containers/podman.git
synced 2025-10-20 20:54:45 +08:00
Vendor in latests containers/storage and opencontainers/runtime-tools
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
1
vendor/github.com/containers/common/libimage/filters.go
generated
vendored
1
vendor/github.com/containers/common/libimage/filters.go
generated
vendored
@ -159,7 +159,6 @@ func (r *Runtime) compileImageFilters(ctx context.Context, options *ListImagesOp
|
||||
|
||||
case "label":
|
||||
filter = filterLabel(ctx, value)
|
||||
|
||||
case "readonly":
|
||||
readOnly, err := r.bool(duplicate, key, value)
|
||||
if err != nil {
|
||||
|
5
vendor/github.com/containers/common/libnetwork/util/filters.go
generated
vendored
5
vendor/github.com/containers/common/libnetwork/util/filters.go
generated
vendored
@ -65,7 +65,10 @@ func createPruneFilterFuncs(key string, filterValues []string) (types.FilterFunc
|
||||
return func(net types.Network) bool {
|
||||
return filters.MatchLabelFilters(filterValues, net.Labels)
|
||||
}, nil
|
||||
|
||||
case "label!":
|
||||
return func(net types.Network) bool {
|
||||
return !filters.MatchLabelFilters(filterValues, net.Labels)
|
||||
}, nil
|
||||
case "until":
|
||||
until, err := filters.ComputeUntilTimestamp(filterValues)
|
||||
if err != nil {
|
||||
|
6
vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go
generated
vendored
6
vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go
generated
vendored
@ -201,7 +201,11 @@ func resourcesToProps(res *configs.Resources, v2 bool) (map[string]uint64, map[s
|
||||
|
||||
// Blkio
|
||||
if res.BlkioWeight > 0 {
|
||||
uMap["BlockIOWeight"] = uint64(res.BlkioWeight)
|
||||
if v2 {
|
||||
uMap["IOWeight"] = uint64(res.BlkioWeight)
|
||||
} else {
|
||||
uMap["BlockIOWeight"] = uint64(res.BlkioWeight)
|
||||
}
|
||||
}
|
||||
|
||||
// systemd requires the paths to be in the form /dev/{block, char}/major:minor
|
||||
|
18
vendor/github.com/containers/common/pkg/filters/filters.go
generated
vendored
18
vendor/github.com/containers/common/pkg/filters/filters.go
generated
vendored
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -111,11 +112,24 @@ outer:
|
||||
filterValue = ""
|
||||
}
|
||||
for labelKey, labelValue := range labels {
|
||||
if labelKey == filterKey && (filterValue == "" || labelValue == filterValue) {
|
||||
continue outer
|
||||
if filterValue == "" || labelValue == filterValue {
|
||||
if labelKey == filterKey || matchPattern(filterKey, labelKey) {
|
||||
continue outer
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func matchPattern(pattern string, value string) bool {
|
||||
if strings.Contains(pattern, "*") {
|
||||
filter := fmt.Sprintf("*%s*", pattern)
|
||||
filter = strings.ReplaceAll(filter, string(filepath.Separator), "|")
|
||||
newName := strings.ReplaceAll(value, string(filepath.Separator), "|")
|
||||
match, _ := filepath.Match(filter, newName)
|
||||
return match
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user