mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-09 19:09:30 +00:00
Generated files
Kubernetes-commit: 06c49423edf0cae626e5e8d9cd7c3f8cce07ae03
This commit is contained in:
committed by
Kubernetes Publisher
parent
823af6a262
commit
1820c423c9
@@ -34,6 +34,7 @@ go_library(
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/networking/v1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1:go_default_library",
|
||||
@@ -74,6 +75,7 @@ filegroup(
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1:all-srcs",
|
||||
"//staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1:all-srcs",
|
||||
|
@@ -35,6 +35,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1"
|
||||
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
|
||||
policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
|
||||
rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
|
||||
rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1"
|
||||
@@ -85,9 +86,10 @@ type Interface interface {
|
||||
PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Policy() policyv1beta1.PolicyV1beta1Interface
|
||||
RbacV1beta1() rbacv1beta1.RbacV1beta1Interface
|
||||
RbacV1() rbacv1.RbacV1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Rbac() rbacv1beta1.RbacV1beta1Interface
|
||||
Rbac() rbacv1.RbacV1Interface
|
||||
RbacV1beta1() rbacv1beta1.RbacV1beta1Interface
|
||||
RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface
|
||||
SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
@@ -121,6 +123,7 @@ type Clientset struct {
|
||||
extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client
|
||||
networkingV1 *networkingv1.NetworkingV1Client
|
||||
policyV1beta1 *policyv1beta1.PolicyV1beta1Client
|
||||
rbacV1 *rbacv1.RbacV1Client
|
||||
rbacV1beta1 *rbacv1beta1.RbacV1beta1Client
|
||||
rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client
|
||||
schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client
|
||||
@@ -275,14 +278,19 @@ func (c *Clientset) Policy() policyv1beta1.PolicyV1beta1Interface {
|
||||
return c.policyV1beta1
|
||||
}
|
||||
|
||||
// RbacV1beta1 retrieves the RbacV1beta1Client
|
||||
func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface {
|
||||
return c.rbacV1beta1
|
||||
// RbacV1 retrieves the RbacV1Client
|
||||
func (c *Clientset) RbacV1() rbacv1.RbacV1Interface {
|
||||
return c.rbacV1
|
||||
}
|
||||
|
||||
// Deprecated: Rbac retrieves the default version of RbacClient.
|
||||
// Please explicitly pick a version.
|
||||
func (c *Clientset) Rbac() rbacv1beta1.RbacV1beta1Interface {
|
||||
func (c *Clientset) Rbac() rbacv1.RbacV1Interface {
|
||||
return c.rbacV1
|
||||
}
|
||||
|
||||
// RbacV1beta1 retrieves the RbacV1beta1Client
|
||||
func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface {
|
||||
return c.rbacV1beta1
|
||||
}
|
||||
|
||||
@@ -409,6 +417,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.rbacV1, err = rbacv1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.rbacV1beta1, err = rbacv1beta1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -462,6 +474,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.extensionsV1beta1 = extensionsv1beta1.NewForConfigOrDie(c)
|
||||
cs.networkingV1 = networkingv1.NewForConfigOrDie(c)
|
||||
cs.policyV1beta1 = policyv1beta1.NewForConfigOrDie(c)
|
||||
cs.rbacV1 = rbacv1.NewForConfigOrDie(c)
|
||||
cs.rbacV1beta1 = rbacv1beta1.NewForConfigOrDie(c)
|
||||
cs.rbacV1alpha1 = rbacv1alpha1.NewForConfigOrDie(c)
|
||||
cs.schedulingV1alpha1 = schedulingv1alpha1.NewForConfigOrDie(c)
|
||||
@@ -492,6 +505,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.extensionsV1beta1 = extensionsv1beta1.New(c)
|
||||
cs.networkingV1 = networkingv1.New(c)
|
||||
cs.policyV1beta1 = policyv1beta1.New(c)
|
||||
cs.rbacV1 = rbacv1.New(c)
|
||||
cs.rbacV1beta1 = rbacv1beta1.New(c)
|
||||
cs.rbacV1alpha1 = rbacv1alpha1.New(c)
|
||||
cs.schedulingV1alpha1 = schedulingv1alpha1.New(c)
|
||||
|
@@ -32,6 +32,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/extensions/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/networking/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
@@ -78,6 +79,8 @@ go_library(
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1:go_default_library",
|
||||
|
@@ -54,6 +54,8 @@ import (
|
||||
fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake"
|
||||
policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
|
||||
fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake"
|
||||
rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
|
||||
fakerbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1/fake"
|
||||
rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
|
||||
fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake"
|
||||
rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
|
||||
@@ -237,13 +239,18 @@ func (c *Clientset) Policy() policyv1beta1.PolicyV1beta1Interface {
|
||||
return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// RbacV1beta1 retrieves the RbacV1beta1Client
|
||||
func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface {
|
||||
return &fakerbacv1beta1.FakeRbacV1beta1{Fake: &c.Fake}
|
||||
// RbacV1 retrieves the RbacV1Client
|
||||
func (c *Clientset) RbacV1() rbacv1.RbacV1Interface {
|
||||
return &fakerbacv1.FakeRbacV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Rbac retrieves the RbacV1beta1Client
|
||||
func (c *Clientset) Rbac() rbacv1beta1.RbacV1beta1Interface {
|
||||
// Rbac retrieves the RbacV1Client
|
||||
func (c *Clientset) Rbac() rbacv1.RbacV1Interface {
|
||||
return &fakerbacv1.FakeRbacV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// RbacV1beta1 retrieves the RbacV1beta1Client
|
||||
func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface {
|
||||
return &fakerbacv1beta1.FakeRbacV1beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
|
@@ -33,6 +33,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
@@ -85,6 +86,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
||||
extensionsv1beta1.AddToScheme(scheme)
|
||||
networkingv1.AddToScheme(scheme)
|
||||
policyv1beta1.AddToScheme(scheme)
|
||||
rbacv1.AddToScheme(scheme)
|
||||
rbacv1beta1.AddToScheme(scheme)
|
||||
rbacv1alpha1.AddToScheme(scheme)
|
||||
schedulingv1alpha1.AddToScheme(scheme)
|
||||
|
@@ -31,6 +31,7 @@ go_library(
|
||||
"//vendor/k8s.io/api/extensions/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/networking/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/api/rbac/v1beta1:go_default_library",
|
||||
"//vendor/k8s.io/api/scheduling/v1alpha1:go_default_library",
|
||||
|
@@ -33,6 +33,7 @@ import (
|
||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
@@ -85,6 +86,7 @@ func AddToScheme(scheme *runtime.Scheme) {
|
||||
extensionsv1beta1.AddToScheme(scheme)
|
||||
networkingv1.AddToScheme(scheme)
|
||||
policyv1beta1.AddToScheme(scheme)
|
||||
rbacv1.AddToScheme(scheme)
|
||||
rbacv1beta1.AddToScheme(scheme)
|
||||
rbacv1alpha1.AddToScheme(scheme)
|
||||
schedulingv1alpha1.AddToScheme(scheme)
|
||||
|
47
kubernetes/typed/rbac/v1/BUILD
Normal file
47
kubernetes/typed/rbac/v1/BUILD
Normal file
@@ -0,0 +1,47 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"clusterrole.go",
|
||||
"clusterrolebinding.go",
|
||||
"doc.go",
|
||||
"generated_expansion.go",
|
||||
"rbac_client.go",
|
||||
"role.go",
|
||||
"rolebinding.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//vendor/k8s.io/api/rbac/v1:go_default_library",
|
||||
"//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/kubernetes/scheme:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest: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/client-go/kubernetes/typed/rbac/v1/fake:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
)
|
145
kubernetes/typed/rbac/v1/clusterrole.go
Normal file
145
kubernetes/typed/rbac/v1/clusterrole.go
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ClusterRolesGetter has a method to return a ClusterRoleInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClusterRolesGetter interface {
|
||||
ClusterRoles() ClusterRoleInterface
|
||||
}
|
||||
|
||||
// ClusterRoleInterface has methods to work with ClusterRole resources.
|
||||
type ClusterRoleInterface interface {
|
||||
Create(*v1.ClusterRole) (*v1.ClusterRole, error)
|
||||
Update(*v1.ClusterRole) (*v1.ClusterRole, 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.ClusterRole, error)
|
||||
List(opts meta_v1.ListOptions) (*v1.ClusterRoleList, error)
|
||||
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRole, err error)
|
||||
ClusterRoleExpansion
|
||||
}
|
||||
|
||||
// clusterRoles implements ClusterRoleInterface
|
||||
type clusterRoles struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newClusterRoles returns a ClusterRoles
|
||||
func newClusterRoles(c *RbacV1Client) *clusterRoles {
|
||||
return &clusterRoles{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any.
|
||||
func (c *clusterRoles) Get(name string, options meta_v1.GetOptions) (result *v1.ClusterRole, err error) {
|
||||
result = &v1.ClusterRole{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterroles").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
|
||||
func (c *clusterRoles) List(opts meta_v1.ListOptions) (result *v1.ClusterRoleList, err error) {
|
||||
result = &v1.ClusterRoleList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusterRoles.
|
||||
func (c *clusterRoles) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any.
|
||||
func (c *clusterRoles) Create(clusterRole *v1.ClusterRole) (result *v1.ClusterRole, err error) {
|
||||
result = &v1.ClusterRole{}
|
||||
err = c.client.Post().
|
||||
Resource("clusterroles").
|
||||
Body(clusterRole).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any.
|
||||
func (c *clusterRoles) Update(clusterRole *v1.ClusterRole) (result *v1.ClusterRole, err error) {
|
||||
result = &v1.ClusterRole{}
|
||||
err = c.client.Put().
|
||||
Resource("clusterroles").
|
||||
Name(clusterRole.Name).
|
||||
Body(clusterRole).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs.
|
||||
func (c *clusterRoles) Delete(name string, options *meta_v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterroles").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusterRoles) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterRole.
|
||||
func (c *clusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRole, err error) {
|
||||
result = &v1.ClusterRole{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clusterroles").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
145
kubernetes/typed/rbac/v1/clusterrolebinding.go
Normal file
145
kubernetes/typed/rbac/v1/clusterrolebinding.go
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClusterRoleBindingsGetter interface {
|
||||
ClusterRoleBindings() ClusterRoleBindingInterface
|
||||
}
|
||||
|
||||
// ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources.
|
||||
type ClusterRoleBindingInterface interface {
|
||||
Create(*v1.ClusterRoleBinding) (*v1.ClusterRoleBinding, error)
|
||||
Update(*v1.ClusterRoleBinding) (*v1.ClusterRoleBinding, 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.ClusterRoleBinding, error)
|
||||
List(opts meta_v1.ListOptions) (*v1.ClusterRoleBindingList, error)
|
||||
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRoleBinding, err error)
|
||||
ClusterRoleBindingExpansion
|
||||
}
|
||||
|
||||
// clusterRoleBindings implements ClusterRoleBindingInterface
|
||||
type clusterRoleBindings struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newClusterRoleBindings returns a ClusterRoleBindings
|
||||
func newClusterRoleBindings(c *RbacV1Client) *clusterRoleBindings {
|
||||
return &clusterRoleBindings{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any.
|
||||
func (c *clusterRoleBindings) Get(name string, options meta_v1.GetOptions) (result *v1.ClusterRoleBinding, err error) {
|
||||
result = &v1.ClusterRoleBinding{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterrolebindings").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
|
||||
func (c *clusterRoleBindings) List(opts meta_v1.ListOptions) (result *v1.ClusterRoleBindingList, err error) {
|
||||
result = &v1.ClusterRoleBindingList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusterRoleBindings.
|
||||
func (c *clusterRoleBindings) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any.
|
||||
func (c *clusterRoleBindings) Create(clusterRoleBinding *v1.ClusterRoleBinding) (result *v1.ClusterRoleBinding, err error) {
|
||||
result = &v1.ClusterRoleBinding{}
|
||||
err = c.client.Post().
|
||||
Resource("clusterrolebindings").
|
||||
Body(clusterRoleBinding).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any.
|
||||
func (c *clusterRoleBindings) Update(clusterRoleBinding *v1.ClusterRoleBinding) (result *v1.ClusterRoleBinding, err error) {
|
||||
result = &v1.ClusterRoleBinding{}
|
||||
err = c.client.Put().
|
||||
Resource("clusterrolebindings").
|
||||
Name(clusterRoleBinding.Name).
|
||||
Body(clusterRoleBinding).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *clusterRoleBindings) Delete(name string, options *meta_v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterrolebindings").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusterRoleBindings) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterRoleBinding.
|
||||
func (c *clusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRoleBinding, err error) {
|
||||
result = &v1.ClusterRoleBinding{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clusterrolebindings").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
20
kubernetes/typed/rbac/v1/doc.go
Normal file
20
kubernetes/typed/rbac/v1/doc.go
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
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
|
45
kubernetes/typed/rbac/v1/fake/BUILD
Normal file
45
kubernetes/typed/rbac/v1/fake/BUILD
Normal file
@@ -0,0 +1,45 @@
|
||||
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_clusterrole.go",
|
||||
"fake_clusterrolebinding.go",
|
||||
"fake_rbac_client.go",
|
||||
"fake_role.go",
|
||||
"fake_rolebinding.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//vendor/k8s.io/api/rbac/v1:go_default_library",
|
||||
"//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/kubernetes/typed/rbac/v1:go_default_library",
|
||||
"//vendor/k8s.io/client-go/rest:go_default_library",
|
||||
"//vendor/k8s.io/client-go/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
20
kubernetes/typed/rbac/v1/fake/doc.go
Normal file
20
kubernetes/typed/rbac/v1/fake/doc.go
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
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
|
118
kubernetes/typed/rbac/v1/fake/fake_clusterrole.go
Normal file
118
kubernetes/typed/rbac/v1/fake/fake_clusterrole.go
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
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 (
|
||||
rbac_v1 "k8s.io/api/rbac/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeClusterRoles implements ClusterRoleInterface
|
||||
type FakeClusterRoles struct {
|
||||
Fake *FakeRbacV1
|
||||
}
|
||||
|
||||
var clusterrolesResource = schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterroles"}
|
||||
|
||||
var clusterrolesKind = schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole"}
|
||||
|
||||
// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any.
|
||||
func (c *FakeClusterRoles) Get(name string, options v1.GetOptions) (result *rbac_v1.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(clusterrolesResource, name), &rbac_v1.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRole), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
|
||||
func (c *FakeClusterRoles) List(opts v1.ListOptions) (result *rbac_v1.ClusterRoleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), &rbac_v1.ClusterRoleList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac_v1.ClusterRoleList{}
|
||||
for _, item := range obj.(*rbac_v1.ClusterRoleList).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 clusterRoles.
|
||||
func (c *FakeClusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(clusterrolesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any.
|
||||
func (c *FakeClusterRoles) Create(clusterRole *rbac_v1.ClusterRole) (result *rbac_v1.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), &rbac_v1.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRole), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any.
|
||||
func (c *FakeClusterRoles) Update(clusterRole *rbac_v1.ClusterRole) (result *rbac_v1.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), &rbac_v1.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRole), err
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusterRoles) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(clusterrolesResource, name), &rbac_v1.ClusterRole{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusterRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac_v1.ClusterRoleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterRole.
|
||||
func (c *FakeClusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *rbac_v1.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, data, subresources...), &rbac_v1.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRole), err
|
||||
}
|
118
kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go
Normal file
118
kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
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 (
|
||||
rbac_v1 "k8s.io/api/rbac/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeClusterRoleBindings implements ClusterRoleBindingInterface
|
||||
type FakeClusterRoleBindings struct {
|
||||
Fake *FakeRbacV1
|
||||
}
|
||||
|
||||
var clusterrolebindingsResource = schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrolebindings"}
|
||||
|
||||
var clusterrolebindingsKind = schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBinding"}
|
||||
|
||||
// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any.
|
||||
func (c *FakeClusterRoleBindings) Get(name string, options v1.GetOptions) (result *rbac_v1.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), &rbac_v1.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
|
||||
func (c *FakeClusterRoleBindings) List(opts v1.ListOptions) (result *rbac_v1.ClusterRoleBindingList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), &rbac_v1.ClusterRoleBindingList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac_v1.ClusterRoleBindingList{}
|
||||
for _, item := range obj.(*rbac_v1.ClusterRoleBindingList).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 clusterRoleBindings.
|
||||
func (c *FakeClusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(clusterrolebindingsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any.
|
||||
func (c *FakeClusterRoleBindings) Create(clusterRoleBinding *rbac_v1.ClusterRoleBinding) (result *rbac_v1.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &rbac_v1.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any.
|
||||
func (c *FakeClusterRoleBindings) Update(clusterRoleBinding *rbac_v1.ClusterRoleBinding) (result *rbac_v1.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &rbac_v1.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusterRoleBindings) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(clusterrolebindingsResource, name), &rbac_v1.ClusterRoleBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac_v1.ClusterRoleBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterRoleBinding.
|
||||
func (c *FakeClusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *rbac_v1.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, data, subresources...), &rbac_v1.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.ClusterRoleBinding), err
|
||||
}
|
50
kubernetes/typed/rbac/v1/fake/fake_rbac_client.go
Normal file
50
kubernetes/typed/rbac/v1/fake/fake_rbac_client.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
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/client-go/kubernetes/typed/rbac/v1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeRbacV1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeRbacV1) ClusterRoles() v1.ClusterRoleInterface {
|
||||
return &FakeClusterRoles{c}
|
||||
}
|
||||
|
||||
func (c *FakeRbacV1) ClusterRoleBindings() v1.ClusterRoleBindingInterface {
|
||||
return &FakeClusterRoleBindings{c}
|
||||
}
|
||||
|
||||
func (c *FakeRbacV1) Roles(namespace string) v1.RoleInterface {
|
||||
return &FakeRoles{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeRbacV1) RoleBindings(namespace string) v1.RoleBindingInterface {
|
||||
return &FakeRoleBindings{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeRbacV1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
126
kubernetes/typed/rbac/v1/fake/fake_role.go
Normal file
126
kubernetes/typed/rbac/v1/fake/fake_role.go
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
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 (
|
||||
rbac_v1 "k8s.io/api/rbac/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeRoles implements RoleInterface
|
||||
type FakeRoles struct {
|
||||
Fake *FakeRbacV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var rolesResource = schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "roles"}
|
||||
|
||||
var rolesKind = schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role"}
|
||||
|
||||
// Get takes name of the role, and returns the corresponding role object, and an error if there is any.
|
||||
func (c *FakeRoles) Get(name string, options v1.GetOptions) (result *rbac_v1.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(rolesResource, c.ns, name), &rbac_v1.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.Role), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Roles that match those selectors.
|
||||
func (c *FakeRoles) List(opts v1.ListOptions) (result *rbac_v1.RoleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), &rbac_v1.RoleList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac_v1.RoleList{}
|
||||
for _, item := range obj.(*rbac_v1.RoleList).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 roles.
|
||||
func (c *FakeRoles) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(rolesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any.
|
||||
func (c *FakeRoles) Create(role *rbac_v1.Role) (result *rbac_v1.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(rolesResource, c.ns, role), &rbac_v1.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.Role), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any.
|
||||
func (c *FakeRoles) Update(role *rbac_v1.Role) (result *rbac_v1.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), &rbac_v1.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.Role), err
|
||||
}
|
||||
|
||||
// Delete takes name of the role and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeRoles) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(rolesResource, c.ns, name), &rbac_v1.Role{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac_v1.RoleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched role.
|
||||
func (c *FakeRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *rbac_v1.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, data, subresources...), &rbac_v1.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.Role), err
|
||||
}
|
126
kubernetes/typed/rbac/v1/fake/fake_rolebinding.go
Normal file
126
kubernetes/typed/rbac/v1/fake/fake_rolebinding.go
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
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 (
|
||||
rbac_v1 "k8s.io/api/rbac/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeRoleBindings implements RoleBindingInterface
|
||||
type FakeRoleBindings struct {
|
||||
Fake *FakeRbacV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var rolebindingsResource = schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "rolebindings"}
|
||||
|
||||
var rolebindingsKind = schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"}
|
||||
|
||||
// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any.
|
||||
func (c *FakeRoleBindings) Get(name string, options v1.GetOptions) (result *rbac_v1.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), &rbac_v1.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.RoleBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of RoleBindings that match those selectors.
|
||||
func (c *FakeRoleBindings) List(opts v1.ListOptions) (result *rbac_v1.RoleBindingList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), &rbac_v1.RoleBindingList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac_v1.RoleBindingList{}
|
||||
for _, item := range obj.(*rbac_v1.RoleBindingList).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 roleBindings.
|
||||
func (c *FakeRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(rolebindingsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any.
|
||||
func (c *FakeRoleBindings) Create(roleBinding *rbac_v1.RoleBinding) (result *rbac_v1.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), &rbac_v1.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.RoleBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any.
|
||||
func (c *FakeRoleBindings) Update(roleBinding *rbac_v1.RoleBinding) (result *rbac_v1.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), &rbac_v1.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.RoleBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeRoleBindings) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(rolebindingsResource, c.ns, name), &rbac_v1.RoleBinding{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac_v1.RoleBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched roleBinding.
|
||||
func (c *FakeRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *rbac_v1.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, data, subresources...), &rbac_v1.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac_v1.RoleBinding), err
|
||||
}
|
25
kubernetes/typed/rbac/v1/generated_expansion.go
Normal file
25
kubernetes/typed/rbac/v1/generated_expansion.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
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 ClusterRoleExpansion interface{}
|
||||
|
||||
type ClusterRoleBindingExpansion interface{}
|
||||
|
||||
type RoleExpansion interface{}
|
||||
|
||||
type RoleBindingExpansion interface{}
|
103
kubernetes/typed/rbac/v1/rbac_client.go
Normal file
103
kubernetes/typed/rbac/v1/rbac_client.go
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type RbacV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClusterRolesGetter
|
||||
ClusterRoleBindingsGetter
|
||||
RolesGetter
|
||||
RoleBindingsGetter
|
||||
}
|
||||
|
||||
// RbacV1Client is used to interact with features provided by the rbac.authorization.k8s.io group.
|
||||
type RbacV1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *RbacV1Client) ClusterRoles() ClusterRoleInterface {
|
||||
return newClusterRoles(c)
|
||||
}
|
||||
|
||||
func (c *RbacV1Client) ClusterRoleBindings() ClusterRoleBindingInterface {
|
||||
return newClusterRoleBindings(c)
|
||||
}
|
||||
|
||||
func (c *RbacV1Client) Roles(namespace string) RoleInterface {
|
||||
return newRoles(c, namespace)
|
||||
}
|
||||
|
||||
func (c *RbacV1Client) RoleBindings(namespace string) RoleBindingInterface {
|
||||
return newRoleBindings(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new RbacV1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*RbacV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RbacV1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new RbacV1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *RbacV1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new RbacV1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *RbacV1Client {
|
||||
return &RbacV1Client{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 *RbacV1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
155
kubernetes/typed/rbac/v1/role.go
Normal file
155
kubernetes/typed/rbac/v1/role.go
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// RolesGetter has a method to return a RoleInterface.
|
||||
// A group's client should implement this interface.
|
||||
type RolesGetter interface {
|
||||
Roles(namespace string) RoleInterface
|
||||
}
|
||||
|
||||
// RoleInterface has methods to work with Role resources.
|
||||
type RoleInterface interface {
|
||||
Create(*v1.Role) (*v1.Role, error)
|
||||
Update(*v1.Role) (*v1.Role, 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.Role, error)
|
||||
List(opts meta_v1.ListOptions) (*v1.RoleList, error)
|
||||
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Role, err error)
|
||||
RoleExpansion
|
||||
}
|
||||
|
||||
// roles implements RoleInterface
|
||||
type roles struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newRoles returns a Roles
|
||||
func newRoles(c *RbacV1Client, namespace string) *roles {
|
||||
return &roles{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the role, and returns the corresponding role object, and an error if there is any.
|
||||
func (c *roles) Get(name string, options meta_v1.GetOptions) (result *v1.Role, err error) {
|
||||
result = &v1.Role{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Roles that match those selectors.
|
||||
func (c *roles) List(opts meta_v1.ListOptions) (result *v1.RoleList, err error) {
|
||||
result = &v1.RoleList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested roles.
|
||||
func (c *roles) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any.
|
||||
func (c *roles) Create(role *v1.Role) (result *v1.Role, err error) {
|
||||
result = &v1.Role{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
Body(role).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any.
|
||||
func (c *roles) Update(role *v1.Role) (result *v1.Role, err error) {
|
||||
result = &v1.Role{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
Name(role.Name).
|
||||
Body(role).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the role and deletes it. Returns an error if one occurs.
|
||||
func (c *roles) Delete(name string, options *meta_v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *roles) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched role.
|
||||
func (c *roles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Role, err error) {
|
||||
result = &v1.Role{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
155
kubernetes/typed/rbac/v1/rolebinding.go
Normal file
155
kubernetes/typed/rbac/v1/rolebinding.go
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// RoleBindingsGetter has a method to return a RoleBindingInterface.
|
||||
// A group's client should implement this interface.
|
||||
type RoleBindingsGetter interface {
|
||||
RoleBindings(namespace string) RoleBindingInterface
|
||||
}
|
||||
|
||||
// RoleBindingInterface has methods to work with RoleBinding resources.
|
||||
type RoleBindingInterface interface {
|
||||
Create(*v1.RoleBinding) (*v1.RoleBinding, error)
|
||||
Update(*v1.RoleBinding) (*v1.RoleBinding, 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.RoleBinding, error)
|
||||
List(opts meta_v1.ListOptions) (*v1.RoleBindingList, error)
|
||||
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RoleBinding, err error)
|
||||
RoleBindingExpansion
|
||||
}
|
||||
|
||||
// roleBindings implements RoleBindingInterface
|
||||
type roleBindings struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newRoleBindings returns a RoleBindings
|
||||
func newRoleBindings(c *RbacV1Client, namespace string) *roleBindings {
|
||||
return &roleBindings{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any.
|
||||
func (c *roleBindings) Get(name string, options meta_v1.GetOptions) (result *v1.RoleBinding, err error) {
|
||||
result = &v1.RoleBinding{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of RoleBindings that match those selectors.
|
||||
func (c *roleBindings) List(opts meta_v1.ListOptions) (result *v1.RoleBindingList, err error) {
|
||||
result = &v1.RoleBindingList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested roleBindings.
|
||||
func (c *roleBindings) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any.
|
||||
func (c *roleBindings) Create(roleBinding *v1.RoleBinding) (result *v1.RoleBinding, err error) {
|
||||
result = &v1.RoleBinding{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
Body(roleBinding).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any.
|
||||
func (c *roleBindings) Update(roleBinding *v1.RoleBinding) (result *v1.RoleBinding, err error) {
|
||||
result = &v1.RoleBinding{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
Name(roleBinding.Name).
|
||||
Body(roleBinding).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *roleBindings) Delete(name string, options *meta_v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *roleBindings) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched roleBinding.
|
||||
func (c *roleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RoleBinding, err error) {
|
||||
result = &v1.RoleBinding{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user