mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Fresh dep ensure
This commit is contained in:
39
vendor/k8s.io/apimachinery/pkg/util/mergepatch/BUILD
generated
vendored
39
vendor/k8s.io/apimachinery/pkg/util/mergepatch/BUILD
generated
vendored
@ -1,39 +0,0 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
"go_test",
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["util_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"errors.go",
|
||||
"util.go",
|
||||
],
|
||||
importpath = "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||
deps = [
|
||||
"//vendor/github.com/davecgh/go-spew/spew:go_default_library",
|
||||
"//vendor/github.com/ghodss/yaml:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
4
vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/ghodss/yaml"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
// PreconditionFunc asserts that an incompatible change is not present within a patch.
|
||||
@ -125,7 +125,7 @@ func HasConflicts(left, right interface{}) (bool, error) {
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
case string, float64, bool, int, int64, nil:
|
||||
case string, float64, bool, int64, nil:
|
||||
return !reflect.DeepEqual(left, right), nil
|
||||
default:
|
||||
return true, fmt.Errorf("unknown type: %v", reflect.TypeOf(left))
|
||||
|
60
vendor/k8s.io/apimachinery/pkg/util/mergepatch/util_test.go
generated
vendored
60
vendor/k8s.io/apimachinery/pkg/util/mergepatch/util_test.go
generated
vendored
@ -30,82 +30,80 @@ func TestHasConflicts(t *testing.T) {
|
||||
{A: "hello", B: "hello", Ret: false},
|
||||
{A: "hello", B: "hell", Ret: true},
|
||||
{A: "hello", B: nil, Ret: true},
|
||||
{A: "hello", B: 1, Ret: true},
|
||||
{A: "hello", B: int64(1), Ret: true},
|
||||
{A: "hello", B: float64(1.0), Ret: true},
|
||||
{A: "hello", B: false, Ret: true},
|
||||
{A: 1, B: 1, Ret: false},
|
||||
{A: int64(1), B: int64(1), Ret: false},
|
||||
{A: nil, B: nil, Ret: false},
|
||||
{A: false, B: false, Ret: false},
|
||||
{A: float64(3), B: float64(3), Ret: false},
|
||||
|
||||
{A: "hello", B: []interface{}{}, Ret: true},
|
||||
{A: []interface{}{1}, B: []interface{}{}, Ret: true},
|
||||
{A: []interface{}{int64(1)}, B: []interface{}{}, Ret: true},
|
||||
{A: []interface{}{}, B: []interface{}{}, Ret: false},
|
||||
{A: []interface{}{1}, B: []interface{}{1}, Ret: false},
|
||||
{A: map[string]interface{}{}, B: []interface{}{1}, Ret: true},
|
||||
{A: []interface{}{int64(1)}, B: []interface{}{int64(1)}, Ret: false},
|
||||
{A: map[string]interface{}{}, B: []interface{}{int64(1)}, Ret: true},
|
||||
|
||||
{A: map[string]interface{}{}, B: map[string]interface{}{"a": 1}, Ret: false},
|
||||
{A: map[string]interface{}{"a": 1}, B: map[string]interface{}{"a": 1}, Ret: false},
|
||||
{A: map[string]interface{}{"a": 1}, B: map[string]interface{}{"a": 2}, Ret: true},
|
||||
{A: map[string]interface{}{"a": 1}, B: map[string]interface{}{"b": 2}, Ret: false},
|
||||
{A: map[string]interface{}{}, B: map[string]interface{}{"a": int64(1)}, Ret: false},
|
||||
{A: map[string]interface{}{"a": int64(1)}, B: map[string]interface{}{"a": int64(1)}, Ret: false},
|
||||
{A: map[string]interface{}{"a": int64(1)}, B: map[string]interface{}{"a": int64(2)}, Ret: true},
|
||||
{A: map[string]interface{}{"a": int64(1)}, B: map[string]interface{}{"b": int64(2)}, Ret: false},
|
||||
|
||||
{
|
||||
A: map[string]interface{}{"a": []interface{}{1}},
|
||||
B: map[string]interface{}{"a": []interface{}{1}},
|
||||
A: map[string]interface{}{"a": []interface{}{int64(1)}},
|
||||
B: map[string]interface{}{"a": []interface{}{int64(1)}},
|
||||
Ret: false,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": []interface{}{1}},
|
||||
A: map[string]interface{}{"a": []interface{}{int64(1)}},
|
||||
B: map[string]interface{}{"a": []interface{}{}},
|
||||
Ret: true,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": []interface{}{1}},
|
||||
B: map[string]interface{}{"a": 1},
|
||||
A: map[string]interface{}{"a": []interface{}{int64(1)}},
|
||||
B: map[string]interface{}{"a": int64(1)},
|
||||
Ret: true,
|
||||
},
|
||||
|
||||
// Maps and lists with multiple entries.
|
||||
{
|
||||
A: map[string]interface{}{"a": 1, "b": 2},
|
||||
B: map[string]interface{}{"a": 1, "b": 0},
|
||||
A: map[string]interface{}{"a": int64(1), "b": int64(2)},
|
||||
B: map[string]interface{}{"a": int64(1), "b": int64(0)},
|
||||
Ret: true,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": 1, "b": 2},
|
||||
B: map[string]interface{}{"a": 1, "b": 2},
|
||||
A: map[string]interface{}{"a": int64(1), "b": int64(2)},
|
||||
B: map[string]interface{}{"a": int64(1), "b": int64(2)},
|
||||
Ret: false,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": 1, "b": 2},
|
||||
B: map[string]interface{}{"a": 1, "b": 0, "c": 3},
|
||||
A: map[string]interface{}{"a": int64(1), "b": int64(2)},
|
||||
B: map[string]interface{}{"a": int64(1), "b": int64(0), "c": int64(3)},
|
||||
Ret: true,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": 1, "b": 2},
|
||||
B: map[string]interface{}{"a": 1, "b": 2, "c": 3},
|
||||
A: map[string]interface{}{"a": int64(1), "b": int64(2)},
|
||||
B: map[string]interface{}{"a": int64(1), "b": int64(2), "c": int64(3)},
|
||||
Ret: false,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": []interface{}{1, 2}},
|
||||
B: map[string]interface{}{"a": []interface{}{1, 0}},
|
||||
A: map[string]interface{}{"a": []interface{}{int64(1), int64(2)}},
|
||||
B: map[string]interface{}{"a": []interface{}{int64(1), int64(0)}},
|
||||
Ret: true,
|
||||
},
|
||||
{
|
||||
A: map[string]interface{}{"a": []interface{}{1, 2}},
|
||||
B: map[string]interface{}{"a": []interface{}{1, 2}},
|
||||
A: map[string]interface{}{"a": []interface{}{int64(1), int64(2)}},
|
||||
B: map[string]interface{}{"a": []interface{}{int64(1), int64(2)}},
|
||||
Ret: false,
|
||||
},
|
||||
|
||||
// Numeric types are not interchangeable.
|
||||
// Callers are expected to ensure numeric types are consistent in 'left' and 'right'.
|
||||
{A: int(0), B: int64(0), Ret: true},
|
||||
{A: int(0), B: float64(0), Ret: true},
|
||||
{A: int64(0), B: float64(0), Ret: true},
|
||||
// Other types are not interchangeable.
|
||||
{A: int(0), B: "0", Ret: true},
|
||||
{A: int(0), B: nil, Ret: true},
|
||||
{A: int(0), B: false, Ret: true},
|
||||
{A: int64(0), B: "0", Ret: true},
|
||||
{A: int64(0), B: nil, Ret: true},
|
||||
{A: int64(0), B: false, Ret: true},
|
||||
{A: "true", B: true, Ret: true},
|
||||
{A: "null", B: nil, Ret: true},
|
||||
}
|
||||
|
Reference in New Issue
Block a user