Fix duplicate proto error in kubectl 1.8.0-alpha.
- Remove vendor'ed package go.pedge.io/pb/go/google/protobuf. - Update vendor'ed package github.com/libopenstorage/openstorage.
This commit is contained in:
21
vendor/github.com/libopenstorage/openstorage/pkg/parser/BUILD
generated
vendored
Normal file
21
vendor/github.com/libopenstorage/openstorage/pkg/parser/BUILD
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["labels.go"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
74
vendor/github.com/libopenstorage/openstorage/pkg/parser/labels.go
generated
vendored
Normal file
74
vendor/github.com/libopenstorage/openstorage/pkg/parser/labels.go
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
NoLabel = "NoLabel"
|
||||
)
|
||||
|
||||
func LabelsFromString(str string) (map[string]string, error) {
|
||||
if len(str) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
labels := strings.Split(str, ",")
|
||||
m := make(map[string]string, len(labels))
|
||||
for _, v := range labels {
|
||||
if strings.Contains(v, "=") {
|
||||
label := strings.SplitN(v, "=", 2)
|
||||
if len(label) != 2 {
|
||||
return m, fmt.Errorf("Malformed label: %s", v)
|
||||
}
|
||||
if _, ok := m[label[0]]; ok {
|
||||
return m, fmt.Errorf("Duplicate label: %s", v)
|
||||
}
|
||||
m[label[0]] = label[1]
|
||||
} else if len(v) != 0 {
|
||||
m[v] = ""
|
||||
}
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func LabelsToString(labels map[string]string) string {
|
||||
l := ""
|
||||
for k, v := range labels {
|
||||
if len(l) != 0 {
|
||||
l += ","
|
||||
}
|
||||
if len(v) != 0 {
|
||||
l += k + "=" + v
|
||||
} else if len(k) != 0 {
|
||||
l += k
|
||||
}
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
func MergeLabels(old map[string]string, new map[string]string) map[string]string {
|
||||
if old == nil {
|
||||
return new
|
||||
}
|
||||
if new == nil {
|
||||
return old
|
||||
}
|
||||
m := make(map[string]string, len(old)+len(new))
|
||||
for k, v := range old {
|
||||
m[k] = v
|
||||
}
|
||||
for k, v := range new {
|
||||
m[k] = v
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func HasLabels(set map[string]string, subset map[string]string) bool {
|
||||
for k, v1 := range subset {
|
||||
if v2, ok := set[k]; !ok || v1 != v2 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
20
vendor/github.com/libopenstorage/openstorage/pkg/units/units.go
generated
vendored
20
vendor/github.com/libopenstorage/openstorage/pkg/units/units.go
generated
vendored
@@ -40,16 +40,16 @@ var (
|
||||
"B": 1,
|
||||
"b": 1,
|
||||
|
||||
"KB": KB,
|
||||
"kb": KB,
|
||||
"MB": MB,
|
||||
"mb": MB,
|
||||
"GB": GB,
|
||||
"gb": GB,
|
||||
"TB": TB,
|
||||
"tb": TB,
|
||||
"PB": PB,
|
||||
"pb": PB,
|
||||
"KB": KiB,
|
||||
"kb": KiB,
|
||||
"MB": MiB,
|
||||
"mb": MiB,
|
||||
"GB": GiB,
|
||||
"gb": GiB,
|
||||
"TB": TiB,
|
||||
"tb": TiB,
|
||||
"PB": PiB,
|
||||
"pb": PiB,
|
||||
|
||||
"K": KiB,
|
||||
"k": KiB,
|
||||
|
Reference in New Issue
Block a user