mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Fresh dep ensure
This commit is contained in:
39
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/BUILD
generated
vendored
39
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/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_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"convert.go",
|
||||
"doc.go",
|
||||
],
|
||||
importpath = "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_xtest",
|
||||
srcs = ["convert_test.go"],
|
||||
deps = [
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/conversion/queryparams:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
3
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go
generated
vendored
3
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go
generated
vendored
@ -174,6 +174,9 @@ func convertStruct(result url.Values, st reflect.Type, sv reflect.Value) {
|
||||
kind = ft.Kind()
|
||||
if !field.IsNil() {
|
||||
field = reflect.Indirect(field)
|
||||
// If the field is non-nil, it should be added to params
|
||||
// and the omitempty should be overwite to false
|
||||
omitempty = false
|
||||
}
|
||||
}
|
||||
|
||||
|
6
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert_test.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert_test.go
generated
vendored
@ -70,6 +70,7 @@ type childStructs struct {
|
||||
Follow bool `json:"follow,omitempty"`
|
||||
Previous bool `json:"previous,omitempty"`
|
||||
SinceSeconds *int64 `json:"sinceSeconds,omitempty"`
|
||||
TailLines *int64 `json:"tailLines,omitempty"`
|
||||
SinceTime *metav1.Time `json:"sinceTime,omitempty"`
|
||||
EmptyTime *metav1.Time `json:"emptyTime"`
|
||||
NonPointerTime metav1.Time `json:"nonPointerTime"`
|
||||
@ -99,6 +100,7 @@ func validateResult(t *testing.T, input interface{}, actual, expected url.Values
|
||||
|
||||
func TestConvert(t *testing.T) {
|
||||
sinceSeconds := int64(123)
|
||||
tailLines := int64(0)
|
||||
sinceTime := metav1.Date(2000, 1, 1, 12, 34, 56, 0, time.UTC)
|
||||
|
||||
tests := []struct {
|
||||
@ -182,6 +184,7 @@ func TestConvert(t *testing.T) {
|
||||
Follow: true,
|
||||
Previous: true,
|
||||
SinceSeconds: &sinceSeconds,
|
||||
TailLines: nil,
|
||||
SinceTime: &sinceTime, // test a custom marshaller
|
||||
EmptyTime: nil, // test a nil custom marshaller without omitempty
|
||||
NonPointerTime: sinceTime,
|
||||
@ -194,10 +197,11 @@ func TestConvert(t *testing.T) {
|
||||
Follow: true,
|
||||
Previous: true,
|
||||
SinceSeconds: &sinceSeconds,
|
||||
TailLines: &tailLines,
|
||||
SinceTime: nil, // test a nil custom marshaller with omitempty
|
||||
NonPointerTime: sinceTime,
|
||||
},
|
||||
expected: url.Values{"container": {"mycontainer"}, "follow": {"true"}, "previous": {"true"}, "sinceSeconds": {"123"}, "emptyTime": {""}, "nonPointerTime": {"2000-01-01T12:34:56Z"}},
|
||||
expected: url.Values{"container": {"mycontainer"}, "follow": {"true"}, "previous": {"true"}, "sinceSeconds": {"123"}, "tailLines": {"0"}, "emptyTime": {""}, "nonPointerTime": {"2000-01-01T12:34:56Z"}},
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user