Skip to content

Commit

Permalink
Add fake client, informer factory, and lister to metadata client
Browse files Browse the repository at this point in the history
These will be used by the garbage collector controller and others that
use higher level primitives.
  • Loading branch information
smarterclayton committed Jul 10, 2019
1 parent baf091e commit bc89c37
Show file tree
Hide file tree
Showing 14 changed files with 1,586 additions and 1 deletion.
1 change: 1 addition & 0 deletions hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ staging/src/k8s.io/client-go/kubernetes/typed/core/v1
staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake
staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake
staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake
staging/src/k8s.io/client-go/metadata/fake
staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc
staging/src/k8s.io/client-go/rest
staging/src/k8s.io/client-go/rest/fake
Expand Down
7 changes: 6 additions & 1 deletion staging/src/k8s.io/client-go/metadata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ filegroup(

filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
srcs = [
":package-srcs",
"//staging/src/k8s.io/client-go/metadata/fake:all-srcs",
"//staging/src/k8s.io/client-go/metadata/metadatainformer:all-srcs",
"//staging/src/k8s.io/client-go/metadata/metadatalister:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
53 changes: 53 additions & 0 deletions staging/src/k8s.io/client-go/metadata/fake/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package(default_visibility = ["//visibility:public"])

load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)

go_library(
name = "go_default_library",
srcs = ["simple.go"],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/metadata/fake",
importpath = "k8s.io/client-go/metadata/fake",
deps = [
"//staging/src/k8s.io/apimachinery/pkg/api/meta:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
"//staging/src/k8s.io/client-go/metadata:go_default_library",
"//staging/src/k8s.io/client-go/testing:go_default_library",
],
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)

filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)

go_test(
name = "go_default_test",
srcs = ["simple_test.go"],
embed = [":go_default_library"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
],
)
Loading

0 comments on commit bc89c37

Please sign in to comment.