mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: bump k8s.io/kubernetes from 1.26.2 to 1.27.2
Bumps [k8s.io/kubernetes](https://github.com/kubernetes/kubernetes) from 1.26.2 to 1.27.2. - [Release notes](https://github.com/kubernetes/kubernetes/releases) - [Commits](https://github.com/kubernetes/kubernetes/compare/v1.26.2...v1.27.2) --- updated-dependencies: - dependency-name: k8s.io/kubernetes dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
0e79135419
commit
07b05616a0
28
vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go
generated
vendored
28
vendor/k8s.io/kubernetes/pkg/fieldpath/fieldpath.go
generated
vendored
@ -18,26 +18,36 @@ package fieldpath
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
)
|
||||
|
||||
// FormatMap formats map[string]string to a string.
|
||||
func FormatMap(m map[string]string) (fmtStr string) {
|
||||
// output with keys in sorted order to provide stable output
|
||||
keys := sets.NewString()
|
||||
for key := range m {
|
||||
keys.Insert(key)
|
||||
keys := make([]string, 0, len(m))
|
||||
var grow int
|
||||
for k, v := range m {
|
||||
keys = append(keys, k)
|
||||
// why add 4: (for =, \n, " and ")
|
||||
grow += len(k) + len(v) + 4
|
||||
}
|
||||
for _, key := range keys.List() {
|
||||
fmtStr += fmt.Sprintf("%v=%q\n", key, m[key])
|
||||
sort.Strings(keys)
|
||||
// allocate space to avoid expansion
|
||||
dst := make([]byte, 0, grow)
|
||||
for _, key := range keys {
|
||||
if len(dst) > 0 {
|
||||
dst = append(dst, '\n')
|
||||
}
|
||||
dst = append(dst, key...)
|
||||
dst = append(dst, '=')
|
||||
dst = strconv.AppendQuote(dst, m[key])
|
||||
}
|
||||
fmtStr = strings.TrimSuffix(fmtStr, "\n")
|
||||
|
||||
return
|
||||
return string(dst)
|
||||
}
|
||||
|
||||
// ExtractFieldPathAsString extracts the field from the given object
|
||||
|
Reference in New Issue
Block a user