mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
regenerate all
This commit is contained in:
parent
323e804f39
commit
36ecec58f0
110
api/swagger-spec/rbac.authorization.k8s.io.json
Normal file
110
api/swagger-spec/rbac.authorization.k8s.io.json
Normal file
@ -0,0 +1,110 @@
|
||||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:443",
|
||||
"resourcePath": "/apis/rbac.authorization.k8s.io",
|
||||
"apis": [
|
||||
{
|
||||
"path": "/apis/rbac.authorization.k8s.io",
|
||||
"description": "get information of a group",
|
||||
"operations": [
|
||||
{
|
||||
"type": "unversioned.APIGroup",
|
||||
"method": "GET",
|
||||
"summary": "get information of a group",
|
||||
"nickname": "getAPIGroup",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"unversioned.APIGroup": {
|
||||
"id": "unversioned.APIGroup",
|
||||
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
|
||||
"required": [
|
||||
"name",
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "name is the name of the group."
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "unversioned.GroupVersionForDiscovery"
|
||||
},
|
||||
"description": "versions are the versions supported in this group."
|
||||
},
|
||||
"preferredVersion": {
|
||||
"$ref": "unversioned.GroupVersionForDiscovery",
|
||||
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "unversioned.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"unversioned.GroupVersionForDiscovery": {
|
||||
"id": "unversioned.GroupVersionForDiscovery",
|
||||
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensiblity.",
|
||||
"required": [
|
||||
"groupVersion",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"groupVersion": {
|
||||
"type": "string",
|
||||
"description": "groupVersion specifies the API group and version in the form \"group/version\""
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
|
||||
}
|
||||
}
|
||||
},
|
||||
"unversioned.ServerAddressByClientCIDR": {
|
||||
"id": "unversioned.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
3289
api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json
Normal file
3289
api/swagger-spec/rbac.authorization.k8s.io_v1alpha1.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,14 @@
|
||||
{
|
||||
"path": "/apis/apps",
|
||||
"description": "get information of a group"
|
||||
},
|
||||
{
|
||||
"path": "/apis/rbac.authorization.k8s.io/v1alpha1",
|
||||
"description": "API at /apis/rbac.authorization.k8s.io/v1alpha1"
|
||||
},
|
||||
{
|
||||
"path": "/apis/rbac.authorization.k8s.io",
|
||||
"description": "get information of a group"
|
||||
}
|
||||
],
|
||||
"apiVersion": "",
|
||||
|
@ -58,8 +58,9 @@ kube-apiserver
|
||||
--apiserver-count=1: The number of apiservers running in the cluster
|
||||
--authentication-token-webhook-cache-ttl=2m0s: The duration to cache responses from the webhook token authenticator. Default is 2m
|
||||
--authentication-token-webhook-config-file="": File with webhook configuration for token authentication in kubeconfig format. The API server will query the remote service to determine authentication for bearer tokens.
|
||||
--authorization-mode="AlwaysAllow": Ordered list of plug-ins to do authorization on secure port. Comma-delimited list of: AlwaysAllow,AlwaysDeny,ABAC,Webhook
|
||||
--authorization-mode="AlwaysAllow": Ordered list of plug-ins to do authorization on secure port. Comma-delimited list of: AlwaysAllow,AlwaysDeny,ABAC,Webhook,RBAC
|
||||
--authorization-policy-file="": File with authorization policy in csv format, used with --authorization-mode=ABAC, on the secure port.
|
||||
--authorization-rbac-super-user="": If specified, a username which avoids RBAC authorization checks and role binding privilege escalation checks, to be used with --authorization-mode=RBAC.
|
||||
--authorization-webhook-cache-authorized-ttl=5m0s: The duration to cache 'authorized' responses from the webhook authorizer. Default is 5m.
|
||||
--authorization-webhook-cache-unauthorized-ttl=30s: The duration to cache 'unauthorized' responses from the webhook authorizer. Default is 30s.
|
||||
--authorization-webhook-config-file="": File with webhook configuration in kubeconfig format, used with --authorization-mode=Webhook. The API server will query the remote service to determine access on the API server's secure port.
|
||||
@ -115,7 +116,7 @@ kube-apiserver
|
||||
--ssh-user="": If non-empty, use secure SSH proxy to the nodes, using this user name
|
||||
--storage-backend="": The storage backend for persistence. Options: 'etcd2' (default), 'etcd3'.
|
||||
--storage-media-type="application/json": The media type to use to store objects in storage. Defaults to application/json. Some resources may only support a specific media type and will ignore this setting.
|
||||
--storage-versions="apps/v1alpha1,authentication.k8s.io/v1beta1,authorization.k8s.io/v1beta1,autoscaling/v1,batch/v1,componentconfig/v1alpha1,extensions/v1beta1,metrics/v1alpha1,policy/v1alpha1,v1": The per-group version to store resources in. Specified in the format "group1/version1,group2/version2,...". In the case where objects are moved from one group to the other, you may specify the format "group1=group2/v1beta1,group3/v1beta1,...". You only need to pass the groups you wish to change from the defaults. It defaults to a list of preferred versions of all registered groups, which is derived from the KUBE_API_VERSIONS environment variable.
|
||||
--storage-versions="apps/v1alpha1,authentication.k8s.io/v1beta1,authorization.k8s.io/v1beta1,autoscaling/v1,batch/v1,componentconfig/v1alpha1,extensions/v1beta1,metrics/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1,v1": The per-group version to store resources in. Specified in the format "group1/version1,group2/version2,...". In the case where objects are moved from one group to the other, you may specify the format "group1=group2/v1beta1,group3/v1beta1,...". You only need to pass the groups you wish to change from the defaults. It defaults to a list of preferred versions of all registered groups, which is derived from the KUBE_API_VERSIONS environment variable.
|
||||
--tls-cert-file="": File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If HTTPS serving is enabled, and --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to /var/run/kubernetes.
|
||||
--tls-private-key-file="": File containing x509 private key matching --tls-cert-file.
|
||||
--token-auth-file="": If set, the file that will be used to secure the secure port of the API server via token authentication.
|
||||
@ -123,7 +124,7 @@ kube-apiserver
|
||||
--watch-cache-sizes=[]: List of watch cache sizes for every resource (pods, nodes, etc.), comma separated. The individual override format: resource#size, where size is a number. It takes effect when watch-cache is enabled.
|
||||
```
|
||||
|
||||
###### Auto generated by spf13/cobra on 18-May-2016
|
||||
###### Auto generated by spf13/cobra on 23-May-2016
|
||||
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
|
||||
unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned"
|
||||
unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned"
|
||||
unversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
||||
@ -33,6 +34,7 @@ type Interface interface {
|
||||
Extensions() unversionedextensions.ExtensionsInterface
|
||||
Autoscaling() unversionedautoscaling.AutoscalingInterface
|
||||
Batch() unversionedbatch.BatchInterface
|
||||
Rbac() unversionedrbac.RbacInterface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
@ -43,6 +45,7 @@ type Clientset struct {
|
||||
*unversionedextensions.ExtensionsClient
|
||||
*unversionedautoscaling.AutoscalingClient
|
||||
*unversionedbatch.BatchClient
|
||||
*unversionedrbac.RbacClient
|
||||
}
|
||||
|
||||
// Core retrieves the CoreClient
|
||||
@ -77,6 +80,14 @@ func (c *Clientset) Batch() unversionedbatch.BatchInterface {
|
||||
return c.BatchClient
|
||||
}
|
||||
|
||||
// Rbac retrieves the RbacClient
|
||||
func (c *Clientset) Rbac() unversionedrbac.RbacInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RbacClient
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return c.DiscoveryClient
|
||||
@ -106,6 +117,10 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return &clientset, err
|
||||
}
|
||||
clientset.RbacClient, err = unversionedrbac.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return &clientset, err
|
||||
}
|
||||
|
||||
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
@ -122,6 +137,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
clientset.ExtensionsClient = unversionedextensions.NewForConfigOrDie(c)
|
||||
clientset.AutoscalingClient = unversionedautoscaling.NewForConfigOrDie(c)
|
||||
clientset.BatchClient = unversionedbatch.NewForConfigOrDie(c)
|
||||
clientset.RbacClient = unversionedrbac.NewForConfigOrDie(c)
|
||||
|
||||
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &clientset
|
||||
@ -134,6 +150,7 @@ func New(c *restclient.RESTClient) *Clientset {
|
||||
clientset.ExtensionsClient = unversionedextensions.New(c)
|
||||
clientset.AutoscalingClient = unversionedautoscaling.New(c)
|
||||
clientset.BatchClient = unversionedbatch.New(c)
|
||||
clientset.RbacClient = unversionedrbac.New(c)
|
||||
|
||||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &clientset
|
||||
|
@ -28,6 +28,8 @@ import (
|
||||
fakeunversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/fake"
|
||||
unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned"
|
||||
fakeunversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/fake"
|
||||
unversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned"
|
||||
fakeunversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/fake"
|
||||
"k8s.io/kubernetes/pkg/client/testing/core"
|
||||
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake"
|
||||
@ -84,3 +86,8 @@ func (c *Clientset) Autoscaling() unversionedautoscaling.AutoscalingInterface {
|
||||
func (c *Clientset) Batch() unversionedbatch.BatchInterface {
|
||||
return &fakeunversionedbatch.FakeBatch{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Rbac retrieves the RbacClient
|
||||
func (c *Clientset) Rbac() unversionedrbac.RbacInterface {
|
||||
return &fakeunversionedrbac.FakeRbac{Fake: &c.Fake}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/metrics/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// 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(*rbac.ClusterRole) (*rbac.ClusterRole, error)
|
||||
Update(*rbac.ClusterRole) (*rbac.ClusterRole, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*rbac.ClusterRole, error)
|
||||
List(opts api.ListOptions) (*rbac.ClusterRoleList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
ClusterRoleExpansion
|
||||
}
|
||||
|
||||
// clusterRoles implements ClusterRoleInterface
|
||||
type clusterRoles struct {
|
||||
client *RbacClient
|
||||
}
|
||||
|
||||
// newClusterRoles returns a ClusterRoles
|
||||
func newClusterRoles(c *RbacClient) *clusterRoles {
|
||||
return &clusterRoles{
|
||||
client: c,
|
||||
}
|
||||
}
|
||||
|
||||
// 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 *rbac.ClusterRole) (result *rbac.ClusterRole, err error) {
|
||||
result = &rbac.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 *rbac.ClusterRole) (result *rbac.ClusterRole, err error) {
|
||||
result = &rbac.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 *api.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 *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// 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) (result *rbac.ClusterRole, err error) {
|
||||
result = &rbac.ClusterRole{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterroles").
|
||||
Name(name).
|
||||
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 api.ListOptions) (result *rbac.ClusterRoleList, err error) {
|
||||
result = &rbac.ClusterRoleList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusterRoles.
|
||||
func (c *clusterRoles) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Resource("clusterroles").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// 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(*rbac.ClusterRoleBinding) (*rbac.ClusterRoleBinding, error)
|
||||
Update(*rbac.ClusterRoleBinding) (*rbac.ClusterRoleBinding, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*rbac.ClusterRoleBinding, error)
|
||||
List(opts api.ListOptions) (*rbac.ClusterRoleBindingList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
ClusterRoleBindingExpansion
|
||||
}
|
||||
|
||||
// clusterRoleBindings implements ClusterRoleBindingInterface
|
||||
type clusterRoleBindings struct {
|
||||
client *RbacClient
|
||||
}
|
||||
|
||||
// newClusterRoleBindings returns a ClusterRoleBindings
|
||||
func newClusterRoleBindings(c *RbacClient) *clusterRoleBindings {
|
||||
return &clusterRoleBindings{
|
||||
client: c,
|
||||
}
|
||||
}
|
||||
|
||||
// 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 *rbac.ClusterRoleBinding) (result *rbac.ClusterRoleBinding, err error) {
|
||||
result = &rbac.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 *rbac.ClusterRoleBinding) (result *rbac.ClusterRoleBinding, err error) {
|
||||
result = &rbac.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 *api.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 *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// 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) (result *rbac.ClusterRoleBinding, err error) {
|
||||
result = &rbac.ClusterRoleBinding{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterrolebindings").
|
||||
Name(name).
|
||||
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 api.ListOptions) (result *rbac.ClusterRoleBindingList, err error) {
|
||||
result = &rbac.ClusterRoleBindingList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusterRoleBindings.
|
||||
func (c *clusterRoleBindings) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Resource("clusterrolebindings").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 the default arguments.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package unversioned
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 the default arguments.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeClusterRoles implements ClusterRoleInterface
|
||||
type FakeClusterRoles struct {
|
||||
Fake *FakeRbac
|
||||
}
|
||||
|
||||
var clusterrolesResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "", Resource: "clusterroles"}
|
||||
|
||||
func (c *FakeClusterRoles) Create(clusterRole *rbac.ClusterRole) (result *rbac.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootCreateAction(clusterrolesResource, clusterRole), &rbac.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRole), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoles) Update(clusterRole *rbac.ClusterRole) (result *rbac.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateAction(clusterrolesResource, clusterRole), &rbac.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRole), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoles) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewRootDeleteAction(clusterrolesResource, name), &rbac.ClusterRole{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoles) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewRootDeleteCollectionAction(clusterrolesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac.ClusterRoleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoles) Get(name string) (result *rbac.ClusterRole, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootGetAction(clusterrolesResource, name), &rbac.ClusterRole{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRole), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoles) List(opts api.ListOptions) (result *rbac.ClusterRoleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootListAction(clusterrolesResource, opts), &rbac.ClusterRoleList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label := opts.LabelSelector
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac.ClusterRoleList{}
|
||||
for _, item := range obj.(*rbac.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 api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewRootWatchAction(clusterrolesResource, opts))
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeClusterRoleBindings implements ClusterRoleBindingInterface
|
||||
type FakeClusterRoleBindings struct {
|
||||
Fake *FakeRbac
|
||||
}
|
||||
|
||||
var clusterrolebindingsResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "", Resource: "clusterrolebindings"}
|
||||
|
||||
func (c *FakeClusterRoleBindings) Create(clusterRoleBinding *rbac.ClusterRoleBinding) (result *rbac.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &rbac.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoleBindings) Update(clusterRoleBinding *rbac.ClusterRoleBinding) (result *rbac.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &rbac.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoleBindings) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewRootDeleteAction(clusterrolebindingsResource, name), &rbac.ClusterRoleBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoleBindings) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac.ClusterRoleBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoleBindings) Get(name string) (result *rbac.ClusterRoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootGetAction(clusterrolebindingsResource, name), &rbac.ClusterRoleBinding{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.ClusterRoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeClusterRoleBindings) List(opts api.ListOptions) (result *rbac.ClusterRoleBindingList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootListAction(clusterrolebindingsResource, opts), &rbac.ClusterRoleBindingList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label := opts.LabelSelector
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac.ClusterRoleBindingList{}
|
||||
for _, item := range obj.(*rbac.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 api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewRootWatchAction(clusterrolebindingsResource, opts))
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 (
|
||||
unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
type FakeRbac struct {
|
||||
*core.Fake
|
||||
}
|
||||
|
||||
func (c *FakeRbac) ClusterRoles() unversioned.ClusterRoleInterface {
|
||||
return &FakeClusterRoles{c}
|
||||
}
|
||||
|
||||
func (c *FakeRbac) ClusterRoleBindings() unversioned.ClusterRoleBindingInterface {
|
||||
return &FakeClusterRoleBindings{c}
|
||||
}
|
||||
|
||||
func (c *FakeRbac) Roles(namespace string) unversioned.RoleInterface {
|
||||
return &FakeRoles{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeRbac) RoleBindings(namespace string) unversioned.RoleBindingInterface {
|
||||
return &FakeRoleBindings{c, namespace}
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeRbac) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeRoles implements RoleInterface
|
||||
type FakeRoles struct {
|
||||
Fake *FakeRbac
|
||||
ns string
|
||||
}
|
||||
|
||||
var rolesResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "", Resource: "roles"}
|
||||
|
||||
func (c *FakeRoles) Create(role *rbac.Role) (result *rbac.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(rolesResource, c.ns, role), &rbac.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.Role), err
|
||||
}
|
||||
|
||||
func (c *FakeRoles) Update(role *rbac.Role) (result *rbac.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(rolesResource, c.ns, role), &rbac.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.Role), err
|
||||
}
|
||||
|
||||
func (c *FakeRoles) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(rolesResource, c.ns, name), &rbac.Role{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeRoles) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(rolesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac.RoleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeRoles) Get(name string) (result *rbac.Role, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(rolesResource, c.ns, name), &rbac.Role{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.Role), err
|
||||
}
|
||||
|
||||
func (c *FakeRoles) List(opts api.ListOptions) (result *rbac.RoleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(rolesResource, c.ns, opts), &rbac.RoleList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label := opts.LabelSelector
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac.RoleList{}
|
||||
for _, item := range obj.(*rbac.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 api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(rolesResource, c.ns, opts))
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeRoleBindings implements RoleBindingInterface
|
||||
type FakeRoleBindings struct {
|
||||
Fake *FakeRbac
|
||||
ns string
|
||||
}
|
||||
|
||||
var rolebindingsResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "", Resource: "rolebindings"}
|
||||
|
||||
func (c *FakeRoleBindings) Create(roleBinding *rbac.RoleBinding) (result *rbac.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(rolebindingsResource, c.ns, roleBinding), &rbac.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.RoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeRoleBindings) Update(roleBinding *rbac.RoleBinding) (result *rbac.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), &rbac.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.RoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeRoleBindings) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(rolebindingsResource, c.ns, name), &rbac.RoleBinding{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeRoleBindings) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &rbac.RoleBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeRoleBindings) Get(name string) (result *rbac.RoleBinding, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(rolebindingsResource, c.ns, name), &rbac.RoleBinding{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*rbac.RoleBinding), err
|
||||
}
|
||||
|
||||
func (c *FakeRoleBindings) List(opts api.ListOptions) (result *rbac.RoleBindingList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(rolebindingsResource, c.ns, opts), &rbac.RoleBindingList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label := opts.LabelSelector
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &rbac.RoleBindingList{}
|
||||
for _, item := range obj.(*rbac.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 api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(rolebindingsResource, c.ns, opts))
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
type ClusterRoleExpansion interface{}
|
||||
|
||||
type ClusterRoleBindingExpansion interface{}
|
||||
|
||||
type RoleExpansion interface{}
|
||||
|
||||
type RoleBindingExpansion interface{}
|
@ -0,0 +1,116 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
registered "k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
type RbacInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
ClusterRolesGetter
|
||||
ClusterRoleBindingsGetter
|
||||
RolesGetter
|
||||
RoleBindingsGetter
|
||||
}
|
||||
|
||||
// RbacClient is used to interact with features provided by the Rbac group.
|
||||
type RbacClient struct {
|
||||
*restclient.RESTClient
|
||||
}
|
||||
|
||||
func (c *RbacClient) ClusterRoles() ClusterRoleInterface {
|
||||
return newClusterRoles(c)
|
||||
}
|
||||
|
||||
func (c *RbacClient) ClusterRoleBindings() ClusterRoleBindingInterface {
|
||||
return newClusterRoleBindings(c)
|
||||
}
|
||||
|
||||
func (c *RbacClient) Roles(namespace string) RoleInterface {
|
||||
return newRoles(c, namespace)
|
||||
}
|
||||
|
||||
func (c *RbacClient) RoleBindings(namespace string) RoleBindingInterface {
|
||||
return newRoleBindings(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new RbacClient for the given config.
|
||||
func NewForConfig(c *restclient.Config) (*RbacClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := restclient.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RbacClient{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new RbacClient for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *restclient.Config) *RbacClient {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new RbacClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *RbacClient {
|
||||
return &RbacClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *restclient.Config) error {
|
||||
// if rbac group is not registered, return an error
|
||||
g, err := registered.Group("rbac.authorization.k8s.io")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.APIPath = "/apis"
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = restclient.DefaultKubernetesUserAgent()
|
||||
}
|
||||
// TODO: Unconditionally set the config.Version, until we fix the config.
|
||||
//if config.Version == "" {
|
||||
copyGroupVersion := g.GroupVersion
|
||||
config.GroupVersion = ©GroupVersion
|
||||
//}
|
||||
|
||||
config.NegotiatedSerializer = api.Codecs
|
||||
|
||||
if config.QPS == 0 {
|
||||
config.QPS = 5
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *RbacClient) GetRESTClient() *restclient.RESTClient {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// 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(*rbac.Role) (*rbac.Role, error)
|
||||
Update(*rbac.Role) (*rbac.Role, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*rbac.Role, error)
|
||||
List(opts api.ListOptions) (*rbac.RoleList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
RoleExpansion
|
||||
}
|
||||
|
||||
// roles implements RoleInterface
|
||||
type roles struct {
|
||||
client *RbacClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newRoles returns a Roles
|
||||
func newRoles(c *RbacClient, namespace string) *roles {
|
||||
return &roles{
|
||||
client: c,
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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 *rbac.Role) (result *rbac.Role, err error) {
|
||||
result = &rbac.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 *rbac.Role) (result *rbac.Role, err error) {
|
||||
result = &rbac.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 *api.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 *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// 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) (result *rbac.Role, err error) {
|
||||
result = &rbac.Role{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
Name(name).
|
||||
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 api.ListOptions) (result *rbac.RoleList, err error) {
|
||||
result = &rbac.RoleList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested roles.
|
||||
func (c *roles) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("roles").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
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 unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// 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(*rbac.RoleBinding) (*rbac.RoleBinding, error)
|
||||
Update(*rbac.RoleBinding) (*rbac.RoleBinding, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*rbac.RoleBinding, error)
|
||||
List(opts api.ListOptions) (*rbac.RoleBindingList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
RoleBindingExpansion
|
||||
}
|
||||
|
||||
// roleBindings implements RoleBindingInterface
|
||||
type roleBindings struct {
|
||||
client *RbacClient
|
||||
ns string
|
||||
}
|
||||
|
||||
// newRoleBindings returns a RoleBindings
|
||||
func newRoleBindings(c *RbacClient, namespace string) *roleBindings {
|
||||
return &roleBindings{
|
||||
client: c,
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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 *rbac.RoleBinding) (result *rbac.RoleBinding, err error) {
|
||||
result = &rbac.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 *rbac.RoleBinding) (result *rbac.RoleBinding, err error) {
|
||||
result = &rbac.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 *api.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 *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// 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) (result *rbac.RoleBinding, err error) {
|
||||
result = &rbac.RoleBinding{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
Name(name).
|
||||
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 api.ListOptions) (result *rbac.RoleBindingList, err error) {
|
||||
result = &rbac.RoleBindingList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested roleBindings.
|
||||
func (c *roleBindings) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("rolebindings").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
Loading…
Reference in New Issue
Block a user