Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3cb93f72
Commit
3cb93f72
authored
Jul 26, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update generated files
parent
4b709e84
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
2447 additions
and
92 deletions
+2447
-92
BUILD
staging/BUILD
+8
-0
BUILD
...s.io/apimachinery/third_party/forked/golang/reflect/BUILD
+1
-4
Godeps.json
staging/src/k8s.io/kube-gen/Godeps/Godeps.json
+8
-0
BUILD
staging/src/k8s.io/kube-gen/cmd/client-gen/BUILD
+0
-2
BUILD
...g/src/k8s.io/kube-gen/cmd/conversion-gen/generators/BUILD
+0
-1
BUILD
...ing/src/k8s.io/kube-gen/cmd/go-to-protobuf/protobuf/BUILD
+1
-1
BUILD
staging/src/k8s.io/kube-gen/test/apis/testgroup/BUILD
+2
-2
BUILD
...ing/src/k8s.io/kube-gen/test/apis/testgroup/install/BUILD
+2
-2
BUILD
staging/src/k8s.io/kube-gen/test/clientset/internal/BUILD
+4
-16
clientset_test.go
...k8s.io/kube-gen/test/clientset/internal/clientset_test.go
+0
-43
BUILD
...ng/src/k8s.io/kube-gen/test/clientset/internal/fake/BUILD
+4
-4
BUILD
.../src/k8s.io/kube-gen/test/clientset/internal/scheme/BUILD
+1
-1
BUILD
.../clientset/internal/typed/testgroup/internalversion/BUILD
+3
-3
BUILD
...ntset/internal/typed/testgroup/internalversion/fake/BUILD
+2
-2
BUILD
staging/src/k8s.io/kube-gen/test/clientset/versioned/BUILD
+42
-0
clientset.go
...src/k8s.io/kube-gen/test/clientset/versioned/clientset.go
+98
-0
doc.go
staging/src/k8s.io/kube-gen/test/clientset/versioned/doc.go
+20
-0
BUILD
...g/src/k8s.io/kube-gen/test/clientset/versioned/fake/BUILD
+45
-0
clientset_generated.go
...-gen/test/clientset/versioned/fake/clientset_generated.go
+71
-0
doc.go
.../src/k8s.io/kube-gen/test/clientset/versioned/fake/doc.go
+20
-0
register.go
...k8s.io/kube-gen/test/clientset/versioned/fake/register.go
+53
-0
BUILD
...src/k8s.io/kube-gen/test/clientset/versioned/scheme/BUILD
+37
-0
doc.go
...rc/k8s.io/kube-gen/test/clientset/versioned/scheme/doc.go
+20
-0
register.go
...s.io/kube-gen/test/clientset/versioned/scheme/register.go
+53
-0
BUILD
...ube-gen/test/clientset/versioned/typed/testgroup/v1/BUILD
+44
-0
doc.go
...be-gen/test/clientset/versioned/typed/testgroup/v1/doc.go
+20
-0
BUILD
...en/test/clientset/versioned/typed/testgroup/v1/fake/BUILD
+42
-0
doc.go
...n/test/clientset/versioned/typed/testgroup/v1/fake/doc.go
+20
-0
fake_testgroup_client.go
...ersioned/typed/testgroup/v1/fake/fake_testgroup_client.go
+38
-0
fake_testtype.go
...entset/versioned/typed/testgroup/v1/fake/fake_testtype.go
+138
-0
generated_expansion.go
...ntset/versioned/typed/testgroup/v1/generated_expansion.go
+19
-0
testgroup_client.go
...lientset/versioned/typed/testgroup/v1/testgroup_client.go
+88
-0
testtype.go
...n/test/clientset/versioned/typed/testgroup/v1/testtype.go
+172
-0
BUILD
...src/k8s.io/kube-gen/test/informers/externalversions/BUILD
+43
-0
factory.go
...8s.io/kube-gen/test/informers/externalversions/factory.go
+118
-0
generic.go
...8s.io/kube-gen/test/informers/externalversions/generic.go
+61
-0
BUILD
.../test/informers/externalversions/internalinterfaces/BUILD
+32
-0
factory_interfaces.go
...externalversions/internalinterfaces/factory_interfaces.go
+34
-0
BUILD
.../kube-gen/test/informers/externalversions/testgroup/BUILD
+34
-0
interface.go
...en/test/informers/externalversions/testgroup/interface.go
+44
-0
BUILD
...be-gen/test/informers/externalversions/testgroup/v1/BUILD
+40
-0
interface.go
...test/informers/externalversions/testgroup/v1/interface.go
+43
-0
testtype.go
.../test/informers/externalversions/testgroup/v1/testtype.go
+73
-0
BUILD
.../src/k8s.io/kube-gen/test/informers/internalversion/BUILD
+43
-0
factory.go
...k8s.io/kube-gen/test/informers/internalversion/factory.go
+118
-0
generic.go
...k8s.io/kube-gen/test/informers/internalversion/generic.go
+61
-0
BUILD
...n/test/informers/internalversion/internalinterfaces/BUILD
+32
-0
factory_interfaces.go
.../internalversion/internalinterfaces/factory_interfaces.go
+34
-0
BUILD
...o/kube-gen/test/informers/internalversion/testgroup/BUILD
+34
-0
interface.go
...gen/test/informers/internalversion/testgroup/interface.go
+44
-0
BUILD
...informers/internalversion/testgroup/internalversion/BUILD
+40
-0
interface.go
...rs/internalversion/testgroup/internalversion/interface.go
+43
-0
testtype.go
...ers/internalversion/testgroup/internalversion/testtype.go
+73
-0
BUILD
....io/kube-gen/test/listers/testgroup/internalversion/BUILD
+36
-0
expansion_generated.go
.../listers/testgroup/internalversion/expansion_generated.go
+27
-0
testtype.go
...be-gen/test/listers/testgroup/internalversion/testtype.go
+94
-0
BUILD
staging/src/k8s.io/kube-gen/test/listers/testgroup/v1/BUILD
+36
-0
expansion_generated.go
...kube-gen/test/listers/testgroup/v1/expansion_generated.go
+27
-0
testtype.go
...src/k8s.io/kube-gen/test/listers/testgroup/v1/testtype.go
+94
-0
BUILD
...c/k8s.io/kube-gen/third_party/forked/golang/reflect/BUILD
+13
-11
No files found.
staging/BUILD
View file @
3cb93f72
...
...
@@ -204,6 +204,14 @@ filegroup(
"//staging/src/k8s.io/kube-gen/cmd/lister-gen:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/openapi-gen:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/set-gen:all-srcs",
"//staging/src/k8s.io/kube-gen/test/apis/testgroup:all-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/internal:all-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/versioned:all-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/externalversions:all-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/internalversion:all-srcs",
"//staging/src/k8s.io/kube-gen/test/listers/testgroup/internalversion:all-srcs",
"//staging/src/k8s.io/kube-gen/test/listers/testgroup/v1:all-srcs",
"//staging/src/k8s.io/kube-gen/third_party/forked/golang/reflect:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/custom_metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/apis/metrics:all-srcs",
"//staging/src/k8s.io/metrics/pkg/client/clientset_generated/clientset:all-srcs",
...
...
staging/src/k8s.io/apimachinery/third_party/forked/golang/reflect/BUILD
View file @
3cb93f72
...
...
@@ -17,10 +17,7 @@ go_test(
go_library(
name = "go_default_library",
srcs = [
"deep_equal.go",
"type.go",
],
srcs = ["deep_equal.go"],
tags = ["automanaged"],
)
...
...
staging/src/k8s.io/kube-gen/Godeps/Godeps.json
View file @
3cb93f72
...
...
@@ -191,6 +191,14 @@
"Rev"
:
"0c5108395e2debce0d731cf0287ddf7242066aba"
},
{
"ImportPath"
:
"github.com/hashicorp/golang-lru"
,
"Rev"
:
"a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4"
},
{
"ImportPath"
:
"github.com/hashicorp/golang-lru/simplelru"
,
"Rev"
:
"a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4"
},
{
"ImportPath"
:
"github.com/juju/ratelimit"
,
"Rev"
:
"5b9ff866471762aa2ab2dced63c9fb6f53921342"
},
...
...
staging/src/k8s.io/kube-gen/cmd/client-gen/BUILD
View file @
3cb93f72
...
...
@@ -42,8 +42,6 @@ filegroup(
"//staging/src/k8s.io/kube-gen/cmd/client-gen/args:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/client-gen/generators:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/client-gen/path:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/client-gen/test_apis/testgroup:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/client-gen/testoutput/clientset_generated/test_internalclientset:all-srcs",
"//staging/src/k8s.io/kube-gen/cmd/client-gen/types:all-srcs",
],
tags = ["automanaged"],
...
...
staging/src/k8s.io/kube-gen/cmd/conversion-gen/generators/BUILD
View file @
3cb93f72
...
...
@@ -13,7 +13,6 @@ go_library(
tags = ["automanaged"],
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/gengo/args:go_default_library",
"//vendor/k8s.io/gengo/generator:go_default_library",
"//vendor/k8s.io/gengo/namer:go_default_library",
...
...
staging/src/k8s.io/kube-gen/cmd/go-to-protobuf/protobuf/BUILD
View file @
3cb93f72
...
...
@@ -23,12 +23,12 @@ go_library(
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/k8s.io/apimachinery/third_party/forked/golang/reflect:go_default_library",
"//vendor/k8s.io/gengo/args:go_default_library",
"//vendor/k8s.io/gengo/generator:go_default_library",
"//vendor/k8s.io/gengo/namer:go_default_library",
"//vendor/k8s.io/gengo/parser:go_default_library",
"//vendor/k8s.io/gengo/types:go_default_library",
"//vendor/k8s.io/kube-gen/third_party/forked/golang/reflect:go_default_library",
],
)
...
...
staging/src/k8s.io/kube-gen/test/apis/testgroup/BUILD
View file @
3cb93f72
...
...
@@ -35,8 +35,8 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup/install:all-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup/v1:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/
apis/testgroup/install:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/
apis/testgroup/v1:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/apis/testgroup/install/BUILD
View file @
3cb93f72
...
...
@@ -15,8 +15,8 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup/v1:go_default_library",
],
)
...
...
staging/src/k8s.io/kube-gen/test/clientset/internal/BUILD
View file @
3cb93f72
...
...
@@ -5,7 +5,6 @@ licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
...
...
@@ -20,18 +19,7 @@ go_library(
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/util/flowcontrol:go_default_library",
"//vendor/k8s.io/kube-gen/cmd/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion:go_default_library",
],
)
go_test(
name = "go_default_test",
srcs = ["clientset_test.go"],
library = ":go_default_library",
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/util/flowcontrol:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/internal/typed/testgroup/internalversion:go_default_library",
],
)
...
...
@@ -46,9 +34,9 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/fake:all-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/scheme:all-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/typed/testgroup/internalversion:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/clientset/internal
/fake:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/clientset/internal
/scheme:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/clientset/internal
/typed/testgroup/internalversion:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/internal/clientset_test.go
deleted
100644 → 0
View file @
4b709e84
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
internal
import
(
"testing"
restclient
"k8s.io/client-go/rest"
"k8s.io/client-go/util/flowcontrol"
)
func
ClientSetRateLimiterTest
(
t
*
testing
.
T
)
{
rateLimiter
:=
flowcontrol
.
NewTokenBucketRateLimiter
(
1.0
,
10
)
config
:=
restclient
.
Config
{
RateLimiter
:
rateLimiter
,
}
if
err
:=
restclient
.
SetKubernetesDefaults
(
&
config
);
err
!=
nil
{
t
.
Errorf
(
"setting defaults failed for %#v: %v"
,
config
,
err
)
}
clientSet
,
err
:=
NewForConfig
(
&
config
)
if
err
!=
nil
{
t
.
Errorf
(
"creating clientset for config %v failed: %v"
,
config
,
err
)
}
testGroupThrottler
:=
clientSet
.
Testgroup
()
.
RESTClient
()
.
GetRateLimiter
()
if
rateLimiter
!=
testGroupThrottler
{
t
.
Errorf
(
"Clients in client set should use rateLimiter passed in config:
\n
original: %v
\n
testGroup: %v"
,
rateLimiter
,
testGroupThrottler
)
}
}
staging/src/k8s.io/kube-gen/test/clientset/internal/fake/BUILD
View file @
3cb93f72
...
...
@@ -24,10 +24,10 @@ go_library(
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/discovery/fake:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/typed/testgroup/internalversion:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/typed/testgroup/internalversion/fake:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
test/clientset/internal
:go_default_library",
"//vendor/k8s.io/kube-gen/
test/clientset/internal
/typed/testgroup/internalversion:go_default_library",
"//vendor/k8s.io/kube-gen/
test/clientset/internal
/typed/testgroup/internalversion/fake:go_default_library",
],
)
...
...
staging/src/k8s.io/kube-gen/test/clientset/internal/scheme/BUILD
View file @
3cb93f72
...
...
@@ -21,7 +21,7 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup/install:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup/install:go_default_library",
],
)
...
...
staging/src/k8s.io/kube-gen/test/clientset/internal/typed/testgroup/internalversion/BUILD
View file @
3cb93f72
...
...
@@ -21,8 +21,8 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/scheme:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
test/clientset/internal
/scheme:go_default_library",
],
)
...
...
@@ -37,7 +37,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/typed/testgroup/internalversion/fake:all-srcs",
"//staging/src/k8s.io/kube-gen/
test/clientset/internal
/typed/testgroup/internalversion/fake:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/internal/typed/testgroup/internalversion/fake/BUILD
View file @
3cb93f72
...
...
@@ -23,8 +23,8 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/test_
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
cmd/client-gen/testoutput/clientset_generated/test_internalclientset
/typed/testgroup/internalversion:go_default_library",
"//vendor/k8s.io/kube-gen/
test/
apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/
test/clientset/internal
/typed/testgroup/internalversion:go_default_library",
],
)
...
...
staging/src/k8s.io/kube-gen/test/clientset/versioned/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"clientset.go",
"doc.go",
],
tags = ["automanaged"],
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/util/flowcontrol:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/versioned/fake:all-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/versioned/scheme:all-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/versioned/clientset.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
versioned
import
(
glog
"github.com/golang/glog"
discovery
"k8s.io/client-go/discovery"
rest
"k8s.io/client-go/rest"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
testgroupv1
"k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1"
)
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
TestgroupV1
()
testgroupv1
.
TestgroupV1Interface
// Deprecated: please explicitly pick a version if possible.
Testgroup
()
testgroupv1
.
TestgroupV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type
Clientset
struct
{
*
discovery
.
DiscoveryClient
*
testgroupv1
.
TestgroupV1Client
}
// TestgroupV1 retrieves the TestgroupV1Client
func
(
c
*
Clientset
)
TestgroupV1
()
testgroupv1
.
TestgroupV1Interface
{
return
c
.
TestgroupV1Client
}
// Deprecated: Testgroup retrieves the default version of TestgroupClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
Testgroup
()
testgroupv1
.
TestgroupV1Interface
{
return
c
.
TestgroupV1Client
}
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
return
nil
}
return
c
.
DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
func
NewForConfig
(
c
*
rest
.
Config
)
(
*
Clientset
,
error
)
{
configShallowCopy
:=
*
c
if
configShallowCopy
.
RateLimiter
==
nil
&&
configShallowCopy
.
QPS
>
0
{
configShallowCopy
.
RateLimiter
=
flowcontrol
.
NewTokenBucketRateLimiter
(
configShallowCopy
.
QPS
,
configShallowCopy
.
Burst
)
}
var
cs
Clientset
var
err
error
cs
.
TestgroupV1Client
,
err
=
testgroupv1
.
NewForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
return
nil
,
err
}
cs
.
DiscoveryClient
,
err
=
discovery
.
NewDiscoveryClientForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
glog
.
Errorf
(
"failed to create the DiscoveryClient: %v"
,
err
)
return
nil
,
err
}
return
&
cs
,
nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
var
cs
Clientset
cs
.
TestgroupV1Client
=
testgroupv1
.
NewForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
return
&
cs
}
// New creates a new Clientset for the given RESTClient.
func
New
(
c
rest
.
Interface
)
*
Clientset
{
var
cs
Clientset
cs
.
TestgroupV1Client
=
testgroupv1
.
New
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
return
&
cs
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/doc.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with custom arguments.
// This package has the automatically generated clientset.
package
versioned
staging/src/k8s.io/kube-gen/test/clientset/versioned/fake/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"clientset_generated.go",
"doc.go",
"register.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/discovery/fake:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/versioned/fake/clientset_generated.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
fake
import
(
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery
"k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset
"k8s.io/kube-gen/test/clientset/versioned"
testgroupv1
"k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1"
faketestgroupv1
"k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func
NewSimpleClientset
(
objects
...
runtime
.
Object
)
*
Clientset
{
o
:=
testing
.
NewObjectTracker
(
scheme
,
codecs
.
UniversalDecoder
())
for
_
,
obj
:=
range
objects
{
if
err
:=
o
.
Add
(
obj
);
err
!=
nil
{
panic
(
err
)
}
}
fakePtr
:=
testing
.
Fake
{}
fakePtr
.
AddReactor
(
"*"
,
"*"
,
testing
.
ObjectReaction
(
o
))
fakePtr
.
AddWatchReactor
(
"*"
,
testing
.
DefaultWatchReactor
(
watch
.
NewFake
(),
nil
))
return
&
Clientset
{
fakePtr
}
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type
Clientset
struct
{
testing
.
Fake
}
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
return
&
fakediscovery
.
FakeDiscovery
{
Fake
:
&
c
.
Fake
}
}
var
_
clientset
.
Interface
=
&
Clientset
{}
// TestgroupV1 retrieves the TestgroupV1Client
func
(
c
*
Clientset
)
TestgroupV1
()
testgroupv1
.
TestgroupV1Interface
{
return
&
faketestgroupv1
.
FakeTestgroupV1
{
Fake
:
&
c
.
Fake
}
}
// Testgroup retrieves the TestgroupV1Client
func
(
c
*
Clientset
)
Testgroup
()
testgroupv1
.
TestgroupV1Interface
{
return
&
faketestgroupv1
.
FakeTestgroupV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/fake/doc.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with custom arguments.
// This package has the automatically generated fake clientset.
package
fake
staging/src/k8s.io/kube-gen/test/clientset/versioned/fake/register.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
fake
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
testgroupv1
"k8s.io/kube-gen/test/apis/testgroup/v1"
)
var
scheme
=
runtime
.
NewScheme
()
var
codecs
=
serializer
.
NewCodecFactory
(
scheme
)
var
parameterCodec
=
runtime
.
NewParameterCodec
(
scheme
)
func
init
()
{
v1
.
AddToGroupVersion
(
scheme
,
schema
.
GroupVersion
{
Version
:
"v1"
})
AddToScheme
(
scheme
)
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
testgroupv1
.
AddToScheme
(
scheme
)
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/scheme/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"register.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/versioned/scheme/doc.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with custom arguments.
// This package contains the scheme of the automatically generated clientset.
package
scheme
staging/src/k8s.io/kube-gen/test/clientset/versioned/scheme/register.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
scheme
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
testgroupv1
"k8s.io/kube-gen/test/apis/testgroup/v1"
)
var
Scheme
=
runtime
.
NewScheme
()
var
Codecs
=
serializer
.
NewCodecFactory
(
Scheme
)
var
ParameterCodec
=
runtime
.
NewParameterCodec
(
Scheme
)
func
init
()
{
v1
.
AddToGroupVersion
(
Scheme
,
schema
.
GroupVersion
{
Version
:
"v1"
})
AddToScheme
(
Scheme
)
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
testgroupv1
.
AddToScheme
(
scheme
)
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"generated_expansion.go",
"testgroup_client.go",
"testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned/scheme:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/doc.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with custom arguments.
// This package has the automatically generated typed clients.
package
v1
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"fake_testgroup_client.go",
"fake_testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake/doc.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with custom arguments.
// Package fake has the automatically generated clients.
package
fake
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake/fake_testgroup_client.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
fake
import
(
rest
"k8s.io/client-go/rest"
testing
"k8s.io/client-go/testing"
v1
"k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1"
)
type
FakeTestgroupV1
struct
{
*
testing
.
Fake
}
func
(
c
*
FakeTestgroupV1
)
TestTypes
(
namespace
string
)
v1
.
TestTypeInterface
{
return
&
FakeTestTypes
{
c
,
namespace
}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
FakeTestgroupV1
)
RESTClient
()
rest
.
Interface
{
var
ret
*
rest
.
RESTClient
return
ret
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/fake/fake_testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
fake
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
labels
"k8s.io/apimachinery/pkg/labels"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
testing
"k8s.io/client-go/testing"
testgroup_v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
)
// FakeTestTypes implements TestTypeInterface
type
FakeTestTypes
struct
{
Fake
*
FakeTestgroupV1
ns
string
}
var
testtypesResource
=
schema
.
GroupVersionResource
{
Group
:
"testgroup.k8s.io"
,
Version
:
"v1"
,
Resource
:
"testtypes"
}
var
testtypesKind
=
schema
.
GroupVersionKind
{
Group
:
"testgroup.k8s.io"
,
Version
:
"v1"
,
Kind
:
"TestType"
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
FakeTestTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
testgroup_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewGetAction
(
testtypesResource
,
c
.
ns
,
name
),
&
testgroup_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
testgroup_v1
.
TestType
),
err
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
FakeTestTypes
)
List
(
opts
v1
.
ListOptions
)
(
result
*
testgroup_v1
.
TestTypeList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewListAction
(
testtypesResource
,
testtypesKind
,
c
.
ns
,
opts
),
&
testgroup_v1
.
TestTypeList
{})
if
obj
==
nil
{
return
nil
,
err
}
label
,
_
,
_
:=
testing
.
ExtractFromListOptions
(
opts
)
if
label
==
nil
{
label
=
labels
.
Everything
()
}
list
:=
&
testgroup_v1
.
TestTypeList
{}
for
_
,
item
:=
range
obj
.
(
*
testgroup_v1
.
TestTypeList
)
.
Items
{
if
label
.
Matches
(
labels
.
Set
(
item
.
Labels
))
{
list
.
Items
=
append
(
list
.
Items
,
item
)
}
}
return
list
,
err
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
FakeTestTypes
)
Watch
(
opts
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
testing
.
NewWatchAction
(
testtypesResource
,
c
.
ns
,
opts
))
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Create
(
testType
*
testgroup_v1
.
TestType
)
(
result
*
testgroup_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewCreateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
testgroup_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
testgroup_v1
.
TestType
),
err
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Update
(
testType
*
testgroup_v1
.
TestType
)
(
result
*
testgroup_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
testgroup_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
testgroup_v1
.
TestType
),
err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
FakeTestTypes
)
UpdateStatus
(
testType
*
testgroup_v1
.
TestType
)
(
*
testgroup_v1
.
TestType
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateSubresourceAction
(
testtypesResource
,
"status"
,
c
.
ns
,
testType
),
&
testgroup_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
testgroup_v1
.
TestType
),
err
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
FakeTestTypes
)
Delete
(
name
string
,
options
*
v1
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewDeleteAction
(
testtypesResource
,
c
.
ns
,
name
),
&
testgroup_v1
.
TestType
{})
return
err
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
FakeTestTypes
)
DeleteCollection
(
options
*
v1
.
DeleteOptions
,
listOptions
v1
.
ListOptions
)
error
{
action
:=
testing
.
NewDeleteCollectionAction
(
testtypesResource
,
c
.
ns
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
testgroup_v1
.
TestTypeList
{})
return
err
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
FakeTestTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
testgroup_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewPatchSubresourceAction
(
testtypesResource
,
c
.
ns
,
name
,
data
,
subresources
...
),
&
testgroup_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
testgroup_v1
.
TestType
),
err
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/generated_expansion.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1
type
TestTypeExpansion
interface
{}
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/testgroup_client.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1
import
(
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
rest
"k8s.io/client-go/rest"
v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
"k8s.io/kube-gen/test/clientset/versioned/scheme"
)
type
TestgroupV1Interface
interface
{
RESTClient
()
rest
.
Interface
TestTypesGetter
}
// TestgroupV1Client is used to interact with features provided by the testgroup.k8s.io group.
type
TestgroupV1Client
struct
{
restClient
rest
.
Interface
}
func
(
c
*
TestgroupV1Client
)
TestTypes
(
namespace
string
)
TestTypeInterface
{
return
newTestTypes
(
c
,
namespace
)
}
// NewForConfig creates a new TestgroupV1Client for the given config.
func
NewForConfig
(
c
*
rest
.
Config
)
(
*
TestgroupV1Client
,
error
)
{
config
:=
*
c
if
err
:=
setConfigDefaults
(
&
config
);
err
!=
nil
{
return
nil
,
err
}
client
,
err
:=
rest
.
RESTClientFor
(
&
config
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
TestgroupV1Client
{
client
},
nil
}
// NewForConfigOrDie creates a new TestgroupV1Client for the given config and
// panics if there is an error in the config.
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
TestgroupV1Client
{
client
,
err
:=
NewForConfig
(
c
)
if
err
!=
nil
{
panic
(
err
)
}
return
client
}
// New creates a new TestgroupV1Client for the given RESTClient.
func
New
(
c
rest
.
Interface
)
*
TestgroupV1Client
{
return
&
TestgroupV1Client
{
c
}
}
func
setConfigDefaults
(
config
*
rest
.
Config
)
error
{
gv
:=
v1
.
SchemeGroupVersion
config
.
GroupVersion
=
&
gv
config
.
APIPath
=
"/apis"
config
.
NegotiatedSerializer
=
serializer
.
DirectCodecFactory
{
CodecFactory
:
scheme
.
Codecs
}
if
config
.
UserAgent
==
""
{
config
.
UserAgent
=
rest
.
DefaultKubernetesUserAgent
()
}
return
nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
TestgroupV1Client
)
RESTClient
()
rest
.
Interface
{
if
c
==
nil
{
return
nil
}
return
c
.
restClient
}
staging/src/k8s.io/kube-gen/test/clientset/versioned/typed/testgroup/v1/testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1
import
(
meta_v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
rest
"k8s.io/client-go/rest"
v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
scheme
"k8s.io/kube-gen/test/clientset/versioned/scheme"
)
// TestTypesGetter has a method to return a TestTypeInterface.
// A group's client should implement this interface.
type
TestTypesGetter
interface
{
TestTypes
(
namespace
string
)
TestTypeInterface
}
// TestTypeInterface has methods to work with TestType resources.
type
TestTypeInterface
interface
{
Create
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
Update
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
UpdateStatus
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
Delete
(
name
string
,
options
*
meta_v1
.
DeleteOptions
)
error
DeleteCollection
(
options
*
meta_v1
.
DeleteOptions
,
listOptions
meta_v1
.
ListOptions
)
error
Get
(
name
string
,
options
meta_v1
.
GetOptions
)
(
*
v1
.
TestType
,
error
)
List
(
opts
meta_v1
.
ListOptions
)
(
*
v1
.
TestTypeList
,
error
)
Watch
(
opts
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
v1
.
TestType
,
err
error
)
TestTypeExpansion
}
// testTypes implements TestTypeInterface
type
testTypes
struct
{
client
rest
.
Interface
ns
string
}
// newTestTypes returns a TestTypes
func
newTestTypes
(
c
*
TestgroupV1Client
,
namespace
string
)
*
testTypes
{
return
&
testTypes
{
client
:
c
.
RESTClient
(),
ns
:
namespace
,
}
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
testTypes
)
Get
(
name
string
,
options
meta_v1
.
GetOptions
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
VersionedParams
(
&
options
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
testTypes
)
List
(
opts
meta_v1
.
ListOptions
)
(
result
*
v1
.
TestTypeList
,
err
error
)
{
result
=
&
v1
.
TestTypeList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
testTypes
)
Watch
(
opts
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
opts
.
Watch
=
true
return
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Watch
()
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Create
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Update
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
testTypes
)
UpdateStatus
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
SubResource
(
"status"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
testTypes
)
Delete
(
name
string
,
options
*
meta_v1
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
testTypes
)
DeleteCollection
(
options
*
meta_v1
.
DeleteOptions
,
listOptions
meta_v1
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
listOptions
,
scheme
.
ParameterCodec
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
testTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Patch
(
pt
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
SubResource
(
subresources
...
)
.
Name
(
name
)
.
Body
(
data
)
.
Do
()
.
Into
(
result
)
return
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"factory.go",
"generic.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/externalversions/testgroup:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces:all-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/externalversions/factory.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
externalversions
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
versioned
"k8s.io/kube-gen/test/clientset/versioned"
internalinterfaces
"k8s.io/kube-gen/test/informers/externalversions/internalinterfaces"
testgroup
"k8s.io/kube-gen/test/informers/externalversions/testgroup"
reflect
"reflect"
sync
"sync"
time
"time"
)
type
sharedInformerFactory
struct
{
client
versioned
.
Interface
lock
sync
.
Mutex
defaultResync
time
.
Duration
informers
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
// startedInformers is used for tracking which informers have been started.
// This allows Start() to be called multiple times safely.
startedInformers
map
[
reflect
.
Type
]
bool
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
func
NewSharedInformerFactory
(
client
versioned
.
Interface
,
defaultResync
time
.
Duration
)
SharedInformerFactory
{
return
&
sharedInformerFactory
{
client
:
client
,
defaultResync
:
defaultResync
,
informers
:
make
(
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
),
startedInformers
:
make
(
map
[
reflect
.
Type
]
bool
),
}
}
// Start initializes all requested informers.
func
(
f
*
sharedInformerFactory
)
Start
(
stopCh
<-
chan
struct
{})
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
for
informerType
,
informer
:=
range
f
.
informers
{
if
!
f
.
startedInformers
[
informerType
]
{
go
informer
.
Run
(
stopCh
)
f
.
startedInformers
[
informerType
]
=
true
}
}
}
// WaitForCacheSync waits for all started informers' cache were synced.
func
(
f
*
sharedInformerFactory
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
{
informers
:=
func
()
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
informers
:=
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{}
for
informerType
,
informer
:=
range
f
.
informers
{
if
f
.
startedInformers
[
informerType
]
{
informers
[
informerType
]
=
informer
}
}
return
informers
}()
res
:=
map
[
reflect
.
Type
]
bool
{}
for
informType
,
informer
:=
range
informers
{
res
[
informType
]
=
cache
.
WaitForCacheSync
(
stopCh
,
informer
.
HasSynced
)
}
return
res
}
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
// client.
func
(
f
*
sharedInformerFactory
)
InformerFor
(
obj
runtime
.
Object
,
newFunc
internalinterfaces
.
NewInformerFunc
)
cache
.
SharedIndexInformer
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
informerType
:=
reflect
.
TypeOf
(
obj
)
informer
,
exists
:=
f
.
informers
[
informerType
]
if
exists
{
return
informer
}
informer
=
newFunc
(
f
.
client
,
f
.
defaultResync
)
f
.
informers
[
informerType
]
=
informer
return
informer
}
// SharedInformerFactory provides shared informers for resources in all known
// API group versions.
type
SharedInformerFactory
interface
{
internalinterfaces
.
SharedInformerFactory
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
Testgroup
()
testgroup
.
Interface
}
func
(
f
*
sharedInformerFactory
)
Testgroup
()
testgroup
.
Interface
{
return
testgroup
.
New
(
f
)
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/generic.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
externalversions
import
(
"fmt"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// sharedInformers based on type
type
GenericInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
cache
.
GenericLister
}
type
genericInformer
struct
{
informer
cache
.
SharedIndexInformer
resource
schema
.
GroupResource
}
// Informer returns the SharedIndexInformer.
func
(
f
*
genericInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
informer
}
// Lister returns the GenericLister.
func
(
f
*
genericInformer
)
Lister
()
cache
.
GenericLister
{
return
cache
.
NewGenericLister
(
f
.
Informer
()
.
GetIndexer
(),
f
.
resource
)
}
// ForResource gives generic access to a shared informer of the matching type
// TODO extend this to unknown resources with a client pool
func
(
f
*
sharedInformerFactory
)
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
{
switch
resource
{
// Group=Testgroup, Version=V1
case
v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Testgroup
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
}
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["factory_interfaces.go"],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces/factory_interfaces.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalinterfaces
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
cache
"k8s.io/client-go/tools/cache"
versioned
"k8s.io/kube-gen/test/clientset/versioned"
time
"time"
)
type
NewInformerFunc
func
(
versioned
.
Interface
,
time
.
Duration
)
cache
.
SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type
SharedInformerFactory
interface
{
Start
(
stopCh
<-
chan
struct
{})
InformerFor
(
obj
runtime
.
Object
,
newFunc
NewInformerFunc
)
cache
.
SharedIndexInformer
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["interface.go"],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/externalversions/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/v1:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/interface.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
testgroup
import
(
internalinterfaces
"k8s.io/kube-gen/test/informers/externalversions/internalinterfaces"
v1
"k8s.io/kube-gen/test/informers/externalversions/testgroup/v1"
)
// Interface provides access to each of this group's versions.
type
Interface
interface
{
// V1 provides access to shared informers for resources in V1.
V1
()
v1
.
Interface
}
type
group
struct
{
internalinterfaces
.
SharedInformerFactory
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
)
Interface
{
return
&
group
{
f
}
}
// V1 returns a new v1.Interface.
func
(
g
*
group
)
V1
()
v1
.
Interface
{
return
v1
.
New
(
g
.
SharedInformerFactory
)
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/v1/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"interface.go",
"testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/versioned:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/externalversions/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/listers/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/v1/interface.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
v1
import
(
internalinterfaces
"k8s.io/kube-gen/test/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type
Interface
interface
{
// TestTypes returns a TestTypeInformer.
TestTypes
()
TestTypeInformer
}
type
version
struct
{
internalinterfaces
.
SharedInformerFactory
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
)
Interface
{
return
&
version
{
f
}
}
// TestTypes returns a TestTypeInformer.
func
(
v
*
version
)
TestTypes
()
TestTypeInformer
{
return
&
testTypeInformer
{
factory
:
v
.
SharedInformerFactory
}
}
staging/src/k8s.io/kube-gen/test/informers/externalversions/testgroup/v1/testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
v1
import
(
meta_v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
watch
"k8s.io/apimachinery/pkg/watch"
cache
"k8s.io/client-go/tools/cache"
testgroup_v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
versioned
"k8s.io/kube-gen/test/clientset/versioned"
internalinterfaces
"k8s.io/kube-gen/test/informers/externalversions/internalinterfaces"
v1
"k8s.io/kube-gen/test/listers/testgroup/v1"
time
"time"
)
// TestTypeInformer provides access to a shared informer and lister for
// TestTypes.
type
TestTypeInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
v1
.
TestTypeLister
}
type
testTypeInformer
struct
{
factory
internalinterfaces
.
SharedInformerFactory
}
// NewTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewTestTypeInformer
(
client
versioned
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
)
cache
.
SharedIndexInformer
{
return
cache
.
NewSharedIndexInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
meta_v1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
client
.
TestgroupV1
()
.
TestTypes
(
namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
client
.
TestgroupV1
()
.
TestTypes
(
namespace
)
.
Watch
(
options
)
},
},
&
testgroup_v1
.
TestType
{},
resyncPeriod
,
indexers
,
)
}
func
defaultTestTypeInformer
(
client
versioned
.
Interface
,
resyncPeriod
time
.
Duration
)
cache
.
SharedIndexInformer
{
return
NewTestTypeInformer
(
client
,
meta_v1
.
NamespaceAll
,
resyncPeriod
,
cache
.
Indexers
{
cache
.
NamespaceIndex
:
cache
.
MetaNamespaceIndexFunc
})
}
func
(
f
*
testTypeInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
factory
.
InformerFor
(
&
testgroup_v1
.
TestType
{},
defaultTestTypeInformer
)
}
func
(
f
*
testTypeInformer
)
Lister
()
v1
.
TestTypeLister
{
return
v1
.
NewTestTypeLister
(
f
.
Informer
()
.
GetIndexer
())
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"factory.go",
"generic.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/internal:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/internalversion/testgroup:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces:all-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/internalversion/factory.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
internal
"k8s.io/kube-gen/test/clientset/internal"
internalinterfaces
"k8s.io/kube-gen/test/informers/internalversion/internalinterfaces"
testgroup
"k8s.io/kube-gen/test/informers/internalversion/testgroup"
reflect
"reflect"
sync
"sync"
time
"time"
)
type
sharedInformerFactory
struct
{
client
internal
.
Interface
lock
sync
.
Mutex
defaultResync
time
.
Duration
informers
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
// startedInformers is used for tracking which informers have been started.
// This allows Start() to be called multiple times safely.
startedInformers
map
[
reflect
.
Type
]
bool
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
func
NewSharedInformerFactory
(
client
internal
.
Interface
,
defaultResync
time
.
Duration
)
SharedInformerFactory
{
return
&
sharedInformerFactory
{
client
:
client
,
defaultResync
:
defaultResync
,
informers
:
make
(
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
),
startedInformers
:
make
(
map
[
reflect
.
Type
]
bool
),
}
}
// Start initializes all requested informers.
func
(
f
*
sharedInformerFactory
)
Start
(
stopCh
<-
chan
struct
{})
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
for
informerType
,
informer
:=
range
f
.
informers
{
if
!
f
.
startedInformers
[
informerType
]
{
go
informer
.
Run
(
stopCh
)
f
.
startedInformers
[
informerType
]
=
true
}
}
}
// WaitForCacheSync waits for all started informers' cache were synced.
func
(
f
*
sharedInformerFactory
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
{
informers
:=
func
()
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
informers
:=
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{}
for
informerType
,
informer
:=
range
f
.
informers
{
if
f
.
startedInformers
[
informerType
]
{
informers
[
informerType
]
=
informer
}
}
return
informers
}()
res
:=
map
[
reflect
.
Type
]
bool
{}
for
informType
,
informer
:=
range
informers
{
res
[
informType
]
=
cache
.
WaitForCacheSync
(
stopCh
,
informer
.
HasSynced
)
}
return
res
}
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
// client.
func
(
f
*
sharedInformerFactory
)
InformerFor
(
obj
runtime
.
Object
,
newFunc
internalinterfaces
.
NewInformerFunc
)
cache
.
SharedIndexInformer
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
informerType
:=
reflect
.
TypeOf
(
obj
)
informer
,
exists
:=
f
.
informers
[
informerType
]
if
exists
{
return
informer
}
informer
=
newFunc
(
f
.
client
,
f
.
defaultResync
)
f
.
informers
[
informerType
]
=
informer
return
informer
}
// SharedInformerFactory provides shared informers for resources in all known
// API group versions.
type
SharedInformerFactory
interface
{
internalinterfaces
.
SharedInformerFactory
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
Testgroup
()
testgroup
.
Interface
}
func
(
f
*
sharedInformerFactory
)
Testgroup
()
testgroup
.
Interface
{
return
testgroup
.
New
(
f
)
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/generic.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
"fmt"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
testgroup
"k8s.io/kube-gen/test/apis/testgroup"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// sharedInformers based on type
type
GenericInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
cache
.
GenericLister
}
type
genericInformer
struct
{
informer
cache
.
SharedIndexInformer
resource
schema
.
GroupResource
}
// Informer returns the SharedIndexInformer.
func
(
f
*
genericInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
informer
}
// Lister returns the GenericLister.
func
(
f
*
genericInformer
)
Lister
()
cache
.
GenericLister
{
return
cache
.
NewGenericLister
(
f
.
Informer
()
.
GetIndexer
(),
f
.
resource
)
}
// ForResource gives generic access to a shared informer of the matching type
// TODO extend this to unknown resources with a client pool
func
(
f
*
sharedInformerFactory
)
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
{
switch
resource
{
// Group=Testgroup, Version=InternalVersion
case
testgroup
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Testgroup
()
.
InternalVersion
()
.
TestTypes
()
.
Informer
()},
nil
}
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["factory_interfaces.go"],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/internal:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces/factory_interfaces.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalinterfaces
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
cache
"k8s.io/client-go/tools/cache"
internal
"k8s.io/kube-gen/test/clientset/internal"
time
"time"
)
type
NewInformerFunc
func
(
internal
.
Interface
,
time
.
Duration
)
cache
.
SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type
SharedInformerFactory
interface
{
Start
(
stopCh
<-
chan
struct
{})
InformerFor
(
obj
runtime
.
Object
,
newFunc
NewInformerFunc
)
cache
.
SharedIndexInformer
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["interface.go"],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion:all-srcs",
],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/interface.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
testgroup
import
(
internalinterfaces
"k8s.io/kube-gen/test/informers/internalversion/internalinterfaces"
internalversion
"k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion"
)
// Interface provides access to each of this group's versions.
type
Interface
interface
{
// InternalVersion provides access to shared informers for resources in InternalVersion.
InternalVersion
()
internalversion
.
Interface
}
type
group
struct
{
internalinterfaces
.
SharedInformerFactory
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
)
Interface
{
return
&
group
{
f
}
}
// InternalVersion returns a new internalversion.Interface.
func
(
g
*
group
)
InternalVersion
()
internalversion
.
Interface
{
return
internalversion
.
New
(
g
.
SharedInformerFactory
)
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"interface.go",
"testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup:go_default_library",
"//vendor/k8s.io/kube-gen/test/clientset/internal:go_default_library",
"//vendor/k8s.io/kube-gen/test/informers/internalversion/internalinterfaces:go_default_library",
"//vendor/k8s.io/kube-gen/test/listers/testgroup/internalversion:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion/interface.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
internalinterfaces
"k8s.io/kube-gen/test/informers/internalversion/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type
Interface
interface
{
// TestTypes returns a TestTypeInformer.
TestTypes
()
TestTypeInformer
}
type
version
struct
{
internalinterfaces
.
SharedInformerFactory
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
)
Interface
{
return
&
version
{
f
}
}
// TestTypes returns a TestTypeInformer.
func
(
v
*
version
)
TestTypes
()
TestTypeInformer
{
return
&
testTypeInformer
{
factory
:
v
.
SharedInformerFactory
}
}
staging/src/k8s.io/kube-gen/test/informers/internalversion/testgroup/internalversion/testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
watch
"k8s.io/apimachinery/pkg/watch"
cache
"k8s.io/client-go/tools/cache"
testgroup
"k8s.io/kube-gen/test/apis/testgroup"
internal
"k8s.io/kube-gen/test/clientset/internal"
internalinterfaces
"k8s.io/kube-gen/test/informers/internalversion/internalinterfaces"
internalversion
"k8s.io/kube-gen/test/listers/testgroup/internalversion"
time
"time"
)
// TestTypeInformer provides access to a shared informer and lister for
// TestTypes.
type
TestTypeInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
internalversion
.
TestTypeLister
}
type
testTypeInformer
struct
{
factory
internalinterfaces
.
SharedInformerFactory
}
// NewTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewTestTypeInformer
(
client
internal
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
)
cache
.
SharedIndexInformer
{
return
cache
.
NewSharedIndexInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
v1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
return
client
.
Testgroup
()
.
TestTypes
(
namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
client
.
Testgroup
()
.
TestTypes
(
namespace
)
.
Watch
(
options
)
},
},
&
testgroup
.
TestType
{},
resyncPeriod
,
indexers
,
)
}
func
defaultTestTypeInformer
(
client
internal
.
Interface
,
resyncPeriod
time
.
Duration
)
cache
.
SharedIndexInformer
{
return
NewTestTypeInformer
(
client
,
v1
.
NamespaceAll
,
resyncPeriod
,
cache
.
Indexers
{
cache
.
NamespaceIndex
:
cache
.
MetaNamespaceIndexFunc
})
}
func
(
f
*
testTypeInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
factory
.
InformerFor
(
&
testgroup
.
TestType
{},
defaultTestTypeInformer
)
}
func
(
f
*
testTypeInformer
)
Lister
()
internalversion
.
TestTypeLister
{
return
internalversion
.
NewTestTypeLister
(
f
.
Informer
()
.
GetIndexer
())
}
staging/src/k8s.io/kube-gen/test/listers/testgroup/internalversion/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"expansion_generated.go",
"testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/listers/testgroup/internalversion/expansion_generated.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by lister-gen
package
internalversion
// TestTypeListerExpansion allows custom methods to be added to
// TestTypeLister.
type
TestTypeListerExpansion
interface
{}
// TestTypeNamespaceListerExpansion allows custom methods to be added to
// TestTypeNamespaceLister.
type
TestTypeNamespaceListerExpansion
interface
{}
staging/src/k8s.io/kube-gen/test/listers/testgroup/internalversion/testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by lister-gen
package
internalversion
import
(
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
testgroup
"k8s.io/kube-gen/test/apis/testgroup"
)
// TestTypeLister helps list TestTypes.
type
TestTypeLister
interface
{
// List lists all TestTypes in the indexer.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
testgroup
.
TestType
,
err
error
)
// TestTypes returns an object that can list and get TestTypes.
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
TestTypeListerExpansion
}
// testTypeLister implements the TestTypeLister interface.
type
testTypeLister
struct
{
indexer
cache
.
Indexer
}
// NewTestTypeLister returns a new TestTypeLister.
func
NewTestTypeLister
(
indexer
cache
.
Indexer
)
TestTypeLister
{
return
&
testTypeLister
{
indexer
:
indexer
}
}
// List lists all TestTypes in the indexer.
func
(
s
*
testTypeLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
testgroup
.
TestType
,
err
error
)
{
err
=
cache
.
ListAll
(
s
.
indexer
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
testgroup
.
TestType
))
})
return
ret
,
err
}
// TestTypes returns an object that can list and get TestTypes.
func
(
s
*
testTypeLister
)
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
{
return
testTypeNamespaceLister
{
indexer
:
s
.
indexer
,
namespace
:
namespace
}
}
// TestTypeNamespaceLister helps list and get TestTypes.
type
TestTypeNamespaceLister
interface
{
// List lists all TestTypes in the indexer for a given namespace.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
testgroup
.
TestType
,
err
error
)
// Get retrieves the TestType from the indexer for a given namespace and name.
Get
(
name
string
)
(
*
testgroup
.
TestType
,
error
)
TestTypeNamespaceListerExpansion
}
// testTypeNamespaceLister implements the TestTypeNamespaceLister
// interface.
type
testTypeNamespaceLister
struct
{
indexer
cache
.
Indexer
namespace
string
}
// List lists all TestTypes in the indexer for a given namespace.
func
(
s
testTypeNamespaceLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
testgroup
.
TestType
,
err
error
)
{
err
=
cache
.
ListAllByNamespace
(
s
.
indexer
,
s
.
namespace
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
testgroup
.
TestType
))
})
return
ret
,
err
}
// Get retrieves the TestType from the indexer for a given namespace and name.
func
(
s
testTypeNamespaceLister
)
Get
(
name
string
)
(
*
testgroup
.
TestType
,
error
)
{
obj
,
exists
,
err
:=
s
.
indexer
.
GetByKey
(
s
.
namespace
+
"/"
+
name
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
exists
{
return
nil
,
errors
.
NewNotFound
(
testgroup
.
Resource
(
"testtype"
),
name
)
}
return
obj
.
(
*
testgroup
.
TestType
),
nil
}
staging/src/k8s.io/kube-gen/test/listers/testgroup/v1/BUILD
0 → 100644
View file @
3cb93f72
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"expansion_generated.go",
"testtype.go",
],
tags = ["automanaged"],
deps = [
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/kube-gen/test/apis/testgroup/v1:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
staging/src/k8s.io/kube-gen/test/listers/testgroup/v1/expansion_generated.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by lister-gen
package
v1
// TestTypeListerExpansion allows custom methods to be added to
// TestTypeLister.
type
TestTypeListerExpansion
interface
{}
// TestTypeNamespaceListerExpansion allows custom methods to be added to
// TestTypeNamespaceLister.
type
TestTypeNamespaceListerExpansion
interface
{}
staging/src/k8s.io/kube-gen/test/listers/testgroup/v1/testtype.go
0 → 100644
View file @
3cb93f72
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was automatically generated by lister-gen
package
v1
import
(
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1
"k8s.io/kube-gen/test/apis/testgroup/v1"
)
// TestTypeLister helps list TestTypes.
type
TestTypeLister
interface
{
// List lists all TestTypes in the indexer.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
// TestTypes returns an object that can list and get TestTypes.
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
TestTypeListerExpansion
}
// testTypeLister implements the TestTypeLister interface.
type
testTypeLister
struct
{
indexer
cache
.
Indexer
}
// NewTestTypeLister returns a new TestTypeLister.
func
NewTestTypeLister
(
indexer
cache
.
Indexer
)
TestTypeLister
{
return
&
testTypeLister
{
indexer
:
indexer
}
}
// List lists all TestTypes in the indexer.
func
(
s
*
testTypeLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
{
err
=
cache
.
ListAll
(
s
.
indexer
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
v1
.
TestType
))
})
return
ret
,
err
}
// TestTypes returns an object that can list and get TestTypes.
func
(
s
*
testTypeLister
)
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
{
return
testTypeNamespaceLister
{
indexer
:
s
.
indexer
,
namespace
:
namespace
}
}
// TestTypeNamespaceLister helps list and get TestTypes.
type
TestTypeNamespaceLister
interface
{
// List lists all TestTypes in the indexer for a given namespace.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
// Get retrieves the TestType from the indexer for a given namespace and name.
Get
(
name
string
)
(
*
v1
.
TestType
,
error
)
TestTypeNamespaceListerExpansion
}
// testTypeNamespaceLister implements the TestTypeNamespaceLister
// interface.
type
testTypeNamespaceLister
struct
{
indexer
cache
.
Indexer
namespace
string
}
// List lists all TestTypes in the indexer for a given namespace.
func
(
s
testTypeNamespaceLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
{
err
=
cache
.
ListAllByNamespace
(
s
.
indexer
,
s
.
namespace
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
v1
.
TestType
))
})
return
ret
,
err
}
// Get retrieves the TestType from the indexer for a given namespace and name.
func
(
s
testTypeNamespaceLister
)
Get
(
name
string
)
(
*
v1
.
TestType
,
error
)
{
obj
,
exists
,
err
:=
s
.
indexer
.
GetByKey
(
s
.
namespace
+
"/"
+
name
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
exists
{
return
nil
,
errors
.
NewNotFound
(
v1
.
Resource
(
"testtype"
),
name
)
}
return
obj
.
(
*
v1
.
TestType
),
nil
}
staging/src/k8s.io/kube-gen/third_party/forked/golang/reflect/BUILD
View file @
3cb93f72
...
...
@@ -5,21 +5,23 @@ licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_test(
name = "go_default_test",
srcs = ["deep_equal_test.go"],
library = ":go_default_library",
go_library(
name = "go_default_library",
srcs = ["type.go"],
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = [
"deep_equal.go",
"type.go",
],
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment