mirror of
https://github.com/rancher/types.git
synced 2025-07-03 08:46:13 +00:00
generated authorization api changes
This commit is contained in:
parent
77c6089a5b
commit
8928d88e83
@ -0,0 +1,141 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ClusterRoleTemplateBinding",
|
||||
}
|
||||
ClusterRoleTemplateBindingResource = metav1.APIResource{
|
||||
Name: "clusterroletemplatebindings",
|
||||
SingularName: "clusterroletemplatebinding",
|
||||
Namespaced: false,
|
||||
Kind: ClusterRoleTemplateBindingGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ClusterRoleTemplateBindingList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterRoleTemplateBinding
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingHandlerFunc func(key string, obj *ClusterRoleTemplateBinding) error
|
||||
|
||||
type ClusterRoleTemplateBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterRoleTemplateBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingInterface interface {
|
||||
Create(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error)
|
||||
Update(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterRoleTemplateBindingController
|
||||
}
|
||||
|
||||
type clusterRoleTemplateBindingController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterRoleTemplateBindingController) AddHandler(handler ClusterRoleTemplateBindingHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ClusterRoleTemplateBinding))
|
||||
})
|
||||
}
|
||||
|
||||
type clusterRoleTemplateBindingFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterRoleTemplateBindingFactory) Object() runtime.Object {
|
||||
return &ClusterRoleTemplateBinding{}
|
||||
}
|
||||
|
||||
func (c clusterRoleTemplateBindingFactory) List() runtime.Object {
|
||||
return &ClusterRoleTemplateBindingList{}
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Controller() ClusterRoleTemplateBindingController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterRoleTemplateBindingControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterRoleTemplateBindingGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterRoleTemplateBindingController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterRoleTemplateBindingControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterRoleTemplateBindingClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ClusterRoleTemplateBindingController
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Create(o *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Update(o *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) List(opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterRoleTemplateBindingList), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterRoleTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ClusterRoleTemplate",
|
||||
}
|
||||
ClusterRoleTemplateResource = metav1.APIResource{
|
||||
Name: "clusterroletemplates",
|
||||
SingularName: "clusterroletemplate",
|
||||
Namespaced: false,
|
||||
Kind: ClusterRoleTemplateGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ClusterRoleTemplateList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterRoleTemplate
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateHandlerFunc func(key string, obj *ClusterRoleTemplate) error
|
||||
|
||||
type ClusterRoleTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterRoleTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateInterface interface {
|
||||
Create(*ClusterRoleTemplate) (*ClusterRoleTemplate, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplate, error)
|
||||
Update(*ClusterRoleTemplate) (*ClusterRoleTemplate, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterRoleTemplateList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterRoleTemplateController
|
||||
}
|
||||
|
||||
type clusterRoleTemplateController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterRoleTemplateController) AddHandler(handler ClusterRoleTemplateHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ClusterRoleTemplate))
|
||||
})
|
||||
}
|
||||
|
||||
type clusterRoleTemplateFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterRoleTemplateFactory) Object() runtime.Object {
|
||||
return &ClusterRoleTemplate{}
|
||||
}
|
||||
|
||||
func (c clusterRoleTemplateFactory) List() runtime.Object {
|
||||
return &ClusterRoleTemplateList{}
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Controller() ClusterRoleTemplateController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterRoleTemplateControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterRoleTemplateGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterRoleTemplateController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterRoleTemplateControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterRoleTemplateClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ClusterRoleTemplateController
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Create(o *ClusterRoleTemplate) (*ClusterRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Update(o *ClusterRoleTemplate) (*ClusterRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) List(opts metav1.ListOptions) (*ClusterRoleTemplateList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterRoleTemplateList), err
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -5,6 +5,141 @@ import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleTemplate) DeepCopyInto(out *ClusterRoleTemplate) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.Rules != nil {
|
||||
in, out := &in.Rules, &out.Rules
|
||||
*out = make([]rbac_v1.PolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.ClusterRoleTemplates != nil {
|
||||
in, out := &in.ClusterRoleTemplates, &out.ClusterRoleTemplates
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplate.
|
||||
func (in *ClusterRoleTemplate) DeepCopy() *ClusterRoleTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRoleTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRoleTemplate) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleTemplateBinding) DeepCopyInto(out *ClusterRoleTemplateBinding) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Subject = in.Subject
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplateBinding.
|
||||
func (in *ClusterRoleTemplateBinding) DeepCopy() *ClusterRoleTemplateBinding {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRoleTemplateBinding)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRoleTemplateBinding) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleTemplateBindingList) DeepCopyInto(out *ClusterRoleTemplateBindingList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterRoleTemplateBinding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplateBindingList.
|
||||
func (in *ClusterRoleTemplateBindingList) DeepCopy() *ClusterRoleTemplateBindingList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRoleTemplateBindingList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRoleTemplateBindingList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleTemplateList) DeepCopyInto(out *ClusterRoleTemplateList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterRoleTemplate, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplateList.
|
||||
func (in *ClusterRoleTemplateList) DeepCopy() *ClusterRoleTemplateList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRoleTemplateList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRoleTemplateList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodSecurityPolicyTemplate) DeepCopyInto(out *PodSecurityPolicyTemplate) {
|
||||
*out = *in
|
||||
@ -72,6 +207,7 @@ func (in *Project) DeepCopyInto(out *Project) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
return
|
||||
}
|
||||
|
||||
@ -129,73 +265,7 @@ func (in *ProjectList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectRoleBinding) DeepCopyInto(out *ProjectRoleBinding) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.Subjects != nil {
|
||||
in, out := &in.Subjects, &out.Subjects
|
||||
*out = make([]rbac_v1.Subject, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleBinding.
|
||||
func (in *ProjectRoleBinding) DeepCopy() *ProjectRoleBinding {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectRoleBinding)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectRoleBinding) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectRoleBindingList) DeepCopyInto(out *ProjectRoleBindingList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ProjectRoleBinding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleBindingList.
|
||||
func (in *ProjectRoleBindingList) DeepCopy() *ProjectRoleBindingList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectRoleBindingList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectRoleBindingList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RoleTemplate) DeepCopyInto(out *RoleTemplate) {
|
||||
func (in *ProjectRoleTemplate) DeepCopyInto(out *ProjectRoleTemplate) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
@ -206,26 +276,26 @@ func (in *RoleTemplate) DeepCopyInto(out *RoleTemplate) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.RoleTemplates != nil {
|
||||
in, out := &in.RoleTemplates, &out.RoleTemplates
|
||||
if in.ProjectRoleTemplates != nil {
|
||||
in, out := &in.ProjectRoleTemplates, &out.ProjectRoleTemplates
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleTemplate.
|
||||
func (in *RoleTemplate) DeepCopy() *RoleTemplate {
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplate.
|
||||
func (in *ProjectRoleTemplate) DeepCopy() *ProjectRoleTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RoleTemplate)
|
||||
out := new(ProjectRoleTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RoleTemplate) DeepCopyObject() runtime.Object {
|
||||
func (in *ProjectRoleTemplate) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
@ -234,13 +304,41 @@ func (in *RoleTemplate) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RoleTemplateList) DeepCopyInto(out *RoleTemplateList) {
|
||||
func (in *ProjectRoleTemplateBinding) DeepCopyInto(out *ProjectRoleTemplateBinding) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Subject = in.Subject
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplateBinding.
|
||||
func (in *ProjectRoleTemplateBinding) DeepCopy() *ProjectRoleTemplateBinding {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectRoleTemplateBinding)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectRoleTemplateBinding) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectRoleTemplateBindingList) DeepCopyInto(out *ProjectRoleTemplateBindingList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]RoleTemplate, len(*in))
|
||||
*out = make([]ProjectRoleTemplateBinding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@ -248,21 +346,71 @@ func (in *RoleTemplateList) DeepCopyInto(out *RoleTemplateList) {
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleTemplateList.
|
||||
func (in *RoleTemplateList) DeepCopy() *RoleTemplateList {
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplateBindingList.
|
||||
func (in *ProjectRoleTemplateBindingList) DeepCopy() *ProjectRoleTemplateBindingList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RoleTemplateList)
|
||||
out := new(ProjectRoleTemplateBindingList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RoleTemplateList) DeepCopyObject() runtime.Object {
|
||||
func (in *ProjectRoleTemplateBindingList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectRoleTemplateList) DeepCopyInto(out *ProjectRoleTemplateList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ProjectRoleTemplate, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplateList.
|
||||
func (in *ProjectRoleTemplateList) DeepCopy() *ProjectRoleTemplateList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectRoleTemplateList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectRoleTemplateList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSpec.
|
||||
func (in *ProjectSpec) DeepCopy() *ProjectSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
@ -12,19 +12,23 @@ type Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
|
||||
ProjectsGetter
|
||||
RoleTemplatesGetter
|
||||
ProjectRoleTemplatesGetter
|
||||
PodSecurityPolicyTemplatesGetter
|
||||
ProjectRoleBindingsGetter
|
||||
ProjectRoleTemplateBindingsGetter
|
||||
ClusterRoleTemplatesGetter
|
||||
ClusterRoleTemplateBindingsGetter
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
sync.Mutex
|
||||
restClient rest.Interface
|
||||
|
||||
projectControllers map[string]ProjectController
|
||||
roleTemplateControllers map[string]RoleTemplateController
|
||||
podSecurityPolicyTemplateControllers map[string]PodSecurityPolicyTemplateController
|
||||
projectRoleBindingControllers map[string]ProjectRoleBindingController
|
||||
projectControllers map[string]ProjectController
|
||||
projectRoleTemplateControllers map[string]ProjectRoleTemplateController
|
||||
podSecurityPolicyTemplateControllers map[string]PodSecurityPolicyTemplateController
|
||||
projectRoleTemplateBindingControllers map[string]ProjectRoleTemplateBindingController
|
||||
clusterRoleTemplateControllers map[string]ClusterRoleTemplateController
|
||||
clusterRoleTemplateBindingControllers map[string]ClusterRoleTemplateBindingController
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
@ -41,10 +45,12 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
return &Client{
|
||||
restClient: restClient,
|
||||
|
||||
projectControllers: map[string]ProjectController{},
|
||||
roleTemplateControllers: map[string]RoleTemplateController{},
|
||||
podSecurityPolicyTemplateControllers: map[string]PodSecurityPolicyTemplateController{},
|
||||
projectRoleBindingControllers: map[string]ProjectRoleBindingController{},
|
||||
projectControllers: map[string]ProjectController{},
|
||||
projectRoleTemplateControllers: map[string]ProjectRoleTemplateController{},
|
||||
podSecurityPolicyTemplateControllers: map[string]PodSecurityPolicyTemplateController{},
|
||||
projectRoleTemplateBindingControllers: map[string]ProjectRoleTemplateBindingController{},
|
||||
clusterRoleTemplateControllers: map[string]ClusterRoleTemplateController{},
|
||||
clusterRoleTemplateBindingControllers: map[string]ClusterRoleTemplateBindingController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -65,13 +71,13 @@ func (c *Client) Projects(namespace string) ProjectInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type RoleTemplatesGetter interface {
|
||||
RoleTemplates(namespace string) RoleTemplateInterface
|
||||
type ProjectRoleTemplatesGetter interface {
|
||||
ProjectRoleTemplates(namespace string) ProjectRoleTemplateInterface
|
||||
}
|
||||
|
||||
func (c *Client) RoleTemplates(namespace string) RoleTemplateInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &RoleTemplateResource, RoleTemplateGroupVersionKind, roleTemplateFactory{})
|
||||
return &roleTemplateClient{
|
||||
func (c *Client) ProjectRoleTemplates(namespace string) ProjectRoleTemplateInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectRoleTemplateResource, ProjectRoleTemplateGroupVersionKind, projectRoleTemplateFactory{})
|
||||
return &projectRoleTemplateClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
@ -91,13 +97,39 @@ func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyT
|
||||
}
|
||||
}
|
||||
|
||||
type ProjectRoleBindingsGetter interface {
|
||||
ProjectRoleBindings(namespace string) ProjectRoleBindingInterface
|
||||
type ProjectRoleTemplateBindingsGetter interface {
|
||||
ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface
|
||||
}
|
||||
|
||||
func (c *Client) ProjectRoleBindings(namespace string) ProjectRoleBindingInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectRoleBindingResource, ProjectRoleBindingGroupVersionKind, projectRoleBindingFactory{})
|
||||
return &projectRoleBindingClient{
|
||||
func (c *Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectRoleTemplateBindingResource, ProjectRoleTemplateBindingGroupVersionKind, projectRoleTemplateBindingFactory{})
|
||||
return &projectRoleTemplateBindingClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterRoleTemplatesGetter interface {
|
||||
ClusterRoleTemplates(namespace string) ClusterRoleTemplateInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterRoleTemplates(namespace string) ClusterRoleTemplateInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRoleTemplateResource, ClusterRoleTemplateGroupVersionKind, clusterRoleTemplateFactory{})
|
||||
return &clusterRoleTemplateClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingsGetter interface {
|
||||
ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRoleTemplateBindingResource, ClusterRoleTemplateBindingGroupVersionKind, clusterRoleTemplateBindingFactory{})
|
||||
return &clusterRoleTemplateBindingClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
|
@ -1,141 +0,0 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ProjectRoleBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ProjectRoleBinding",
|
||||
}
|
||||
ProjectRoleBindingResource = metav1.APIResource{
|
||||
Name: "projectrolebindings",
|
||||
SingularName: "projectrolebinding",
|
||||
Namespaced: false,
|
||||
Kind: ProjectRoleBindingGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ProjectRoleBindingList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ProjectRoleBinding
|
||||
}
|
||||
|
||||
type ProjectRoleBindingHandlerFunc func(key string, obj *ProjectRoleBinding) error
|
||||
|
||||
type ProjectRoleBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectRoleBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type ProjectRoleBindingInterface interface {
|
||||
Create(*ProjectRoleBinding) (*ProjectRoleBinding, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ProjectRoleBinding, error)
|
||||
Update(*ProjectRoleBinding) (*ProjectRoleBinding, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ProjectRoleBindingList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectRoleBindingController
|
||||
}
|
||||
|
||||
type projectRoleBindingController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *projectRoleBindingController) AddHandler(handler ProjectRoleBindingHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ProjectRoleBinding))
|
||||
})
|
||||
}
|
||||
|
||||
type projectRoleBindingFactory struct {
|
||||
}
|
||||
|
||||
func (c projectRoleBindingFactory) Object() runtime.Object {
|
||||
return &ProjectRoleBinding{}
|
||||
}
|
||||
|
||||
func (c projectRoleBindingFactory) List() runtime.Object {
|
||||
return &ProjectRoleBindingList{}
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Controller() ProjectRoleBindingController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.projectRoleBindingControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ProjectRoleBindingGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &projectRoleBindingController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.projectRoleBindingControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type projectRoleBindingClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ProjectRoleBindingController
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Create(o *ProjectRoleBinding) (*ProjectRoleBinding, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ProjectRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Get(name string, opts metav1.GetOptions) (*ProjectRoleBinding, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ProjectRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Update(o *ProjectRoleBinding) (*ProjectRoleBinding, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ProjectRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) List(opts metav1.ListOptions) (*ProjectRoleBindingList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ProjectRoleBindingList), err
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *projectRoleBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ProjectRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ProjectRoleTemplateBinding",
|
||||
}
|
||||
ProjectRoleTemplateBindingResource = metav1.APIResource{
|
||||
Name: "projectroletemplatebindings",
|
||||
SingularName: "projectroletemplatebinding",
|
||||
Namespaced: false,
|
||||
Kind: ProjectRoleTemplateBindingGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ProjectRoleTemplateBindingList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ProjectRoleTemplateBinding
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingHandlerFunc func(key string, obj *ProjectRoleTemplateBinding) error
|
||||
|
||||
type ProjectRoleTemplateBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectRoleTemplateBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingInterface interface {
|
||||
Create(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error)
|
||||
Update(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectRoleTemplateBindingController
|
||||
}
|
||||
|
||||
type projectRoleTemplateBindingController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *projectRoleTemplateBindingController) AddHandler(handler ProjectRoleTemplateBindingHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ProjectRoleTemplateBinding))
|
||||
})
|
||||
}
|
||||
|
||||
type projectRoleTemplateBindingFactory struct {
|
||||
}
|
||||
|
||||
func (c projectRoleTemplateBindingFactory) Object() runtime.Object {
|
||||
return &ProjectRoleTemplateBinding{}
|
||||
}
|
||||
|
||||
func (c projectRoleTemplateBindingFactory) List() runtime.Object {
|
||||
return &ProjectRoleTemplateBindingList{}
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Controller() ProjectRoleTemplateBindingController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.projectRoleTemplateBindingControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ProjectRoleTemplateBindingGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &projectRoleTemplateBindingController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.projectRoleTemplateBindingControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type projectRoleTemplateBindingClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ProjectRoleTemplateBindingController
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Create(o *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ProjectRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ProjectRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Update(o *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ProjectRoleTemplateBinding), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) List(opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ProjectRoleTemplateBindingList), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ProjectRoleTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ProjectRoleTemplate",
|
||||
}
|
||||
ProjectRoleTemplateResource = metav1.APIResource{
|
||||
Name: "projectroletemplates",
|
||||
SingularName: "projectroletemplate",
|
||||
Namespaced: false,
|
||||
Kind: ProjectRoleTemplateGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ProjectRoleTemplateList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ProjectRoleTemplate
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateHandlerFunc func(key string, obj *ProjectRoleTemplate) error
|
||||
|
||||
type ProjectRoleTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectRoleTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateInterface interface {
|
||||
Create(*ProjectRoleTemplate) (*ProjectRoleTemplate, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplate, error)
|
||||
Update(*ProjectRoleTemplate) (*ProjectRoleTemplate, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ProjectRoleTemplateList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectRoleTemplateController
|
||||
}
|
||||
|
||||
type projectRoleTemplateController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *projectRoleTemplateController) AddHandler(handler ProjectRoleTemplateHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ProjectRoleTemplate))
|
||||
})
|
||||
}
|
||||
|
||||
type projectRoleTemplateFactory struct {
|
||||
}
|
||||
|
||||
func (c projectRoleTemplateFactory) Object() runtime.Object {
|
||||
return &ProjectRoleTemplate{}
|
||||
}
|
||||
|
||||
func (c projectRoleTemplateFactory) List() runtime.Object {
|
||||
return &ProjectRoleTemplateList{}
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Controller() ProjectRoleTemplateController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.projectRoleTemplateControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ProjectRoleTemplateGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &projectRoleTemplateController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.projectRoleTemplateControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type projectRoleTemplateClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ProjectRoleTemplateController
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Create(o *ProjectRoleTemplate) (*ProjectRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ProjectRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ProjectRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Update(o *ProjectRoleTemplate) (*ProjectRoleTemplate, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ProjectRoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) List(opts metav1.ListOptions) (*ProjectRoleTemplateList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ProjectRoleTemplateList), err
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
RoleTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "RoleTemplate",
|
||||
}
|
||||
RoleTemplateResource = metav1.APIResource{
|
||||
Name: "roletemplates",
|
||||
SingularName: "roletemplate",
|
||||
Namespaced: false,
|
||||
Kind: RoleTemplateGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type RoleTemplateList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []RoleTemplate
|
||||
}
|
||||
|
||||
type RoleTemplateHandlerFunc func(key string, obj *RoleTemplate) error
|
||||
|
||||
type RoleTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler RoleTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
}
|
||||
|
||||
type RoleTemplateInterface interface {
|
||||
Create(*RoleTemplate) (*RoleTemplate, error)
|
||||
Get(name string, opts metav1.GetOptions) (*RoleTemplate, error)
|
||||
Update(*RoleTemplate) (*RoleTemplate, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*RoleTemplateList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RoleTemplateController
|
||||
}
|
||||
|
||||
type roleTemplateController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *roleTemplateController) AddHandler(handler RoleTemplateHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*RoleTemplate))
|
||||
})
|
||||
}
|
||||
|
||||
type roleTemplateFactory struct {
|
||||
}
|
||||
|
||||
func (c roleTemplateFactory) Object() runtime.Object {
|
||||
return &RoleTemplate{}
|
||||
}
|
||||
|
||||
func (c roleTemplateFactory) List() runtime.Object {
|
||||
return &RoleTemplateList{}
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Controller() RoleTemplateController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.roleTemplateControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(RoleTemplateGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &roleTemplateController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.roleTemplateControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type roleTemplateClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller RoleTemplateController
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Create(o *RoleTemplate) (*RoleTemplate, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*RoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Get(name string, opts metav1.GetOptions) (*RoleTemplate, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*RoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Update(o *RoleTemplate) (*RoleTemplate, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*RoleTemplate), err
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) List(opts metav1.ListOptions) (*RoleTemplateList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*RoleTemplateList), err
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -7,10 +7,12 @@ import (
|
||||
type Client struct {
|
||||
clientbase.APIBaseClient
|
||||
|
||||
Project ProjectOperations
|
||||
RoleTemplate RoleTemplateOperations
|
||||
PodSecurityPolicyTemplate PodSecurityPolicyTemplateOperations
|
||||
ProjectRoleBinding ProjectRoleBindingOperations
|
||||
Project ProjectOperations
|
||||
ProjectRoleTemplate ProjectRoleTemplateOperations
|
||||
PodSecurityPolicyTemplate PodSecurityPolicyTemplateOperations
|
||||
ProjectRoleTemplateBinding ProjectRoleTemplateBindingOperations
|
||||
ClusterRoleTemplate ClusterRoleTemplateOperations
|
||||
ClusterRoleTemplateBinding ClusterRoleTemplateBindingOperations
|
||||
}
|
||||
|
||||
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
@ -24,9 +26,11 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
}
|
||||
|
||||
client.Project = newProjectClient(client)
|
||||
client.RoleTemplate = newRoleTemplateClient(client)
|
||||
client.ProjectRoleTemplate = newProjectRoleTemplateClient(client)
|
||||
client.PodSecurityPolicyTemplate = newPodSecurityPolicyTemplateClient(client)
|
||||
client.ProjectRoleBinding = newProjectRoleBindingClient(client)
|
||||
client.ProjectRoleTemplateBinding = newProjectRoleTemplateBindingClient(client)
|
||||
client.ClusterRoleTemplate = newClusterRoleTemplateClient(client)
|
||||
client.ClusterRoleTemplateBinding = newClusterRoleTemplateBindingClient(client)
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ClusterRoleTemplateType = "clusterRoleTemplate"
|
||||
ClusterRoleTemplateFieldAPIVersion = "apiVersion"
|
||||
ClusterRoleTemplateFieldClusterRoleTemplates = "clusterRoleTemplates"
|
||||
ClusterRoleTemplateFieldKind = "kind"
|
||||
ClusterRoleTemplateFieldObjectMeta = "objectMeta"
|
||||
ClusterRoleTemplateFieldRules = "rules"
|
||||
)
|
||||
|
||||
type ClusterRoleTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
ClusterRoleTemplates []string `json:"clusterRoleTemplates,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
}
|
||||
type ClusterRoleTemplateCollection struct {
|
||||
types.Collection
|
||||
Data []ClusterRoleTemplate `json:"data,omitempty"`
|
||||
client *ClusterRoleTemplateClient
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateOperations interface {
|
||||
List(opts *types.ListOpts) (*ClusterRoleTemplateCollection, error)
|
||||
Create(opts *ClusterRoleTemplate) (*ClusterRoleTemplate, error)
|
||||
Update(existing *ClusterRoleTemplate, updates interface{}) (*ClusterRoleTemplate, error)
|
||||
ByID(id string) (*ClusterRoleTemplate, error)
|
||||
Delete(container *ClusterRoleTemplate) error
|
||||
}
|
||||
|
||||
func newClusterRoleTemplateClient(apiClient *Client) *ClusterRoleTemplateClient {
|
||||
return &ClusterRoleTemplateClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateClient) Create(container *ClusterRoleTemplate) (*ClusterRoleTemplate, error) {
|
||||
resp := &ClusterRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoCreate(ClusterRoleTemplateType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateClient) Update(existing *ClusterRoleTemplate, updates interface{}) (*ClusterRoleTemplate, error) {
|
||||
resp := &ClusterRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoUpdate(ClusterRoleTemplateType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateClient) List(opts *types.ListOpts) (*ClusterRoleTemplateCollection, error) {
|
||||
resp := &ClusterRoleTemplateCollection{}
|
||||
err := c.apiClient.Ops.DoList(ClusterRoleTemplateType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ClusterRoleTemplateCollection) Next() (*ClusterRoleTemplateCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ClusterRoleTemplateCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateClient) ByID(id string) (*ClusterRoleTemplate, error) {
|
||||
resp := &ClusterRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoByID(ClusterRoleTemplateType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateClient) Delete(container *ClusterRoleTemplate) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ClusterRoleTemplateType, &container.Resource)
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ClusterRoleTemplateBindingType = "clusterRoleTemplateBinding"
|
||||
ClusterRoleTemplateBindingFieldAPIVersion = "apiVersion"
|
||||
ClusterRoleTemplateBindingFieldClusterName = "clusterName"
|
||||
ClusterRoleTemplateBindingFieldClusterRoleTemplateName = "clusterRoleTemplateName"
|
||||
ClusterRoleTemplateBindingFieldKind = "kind"
|
||||
ClusterRoleTemplateBindingFieldObjectMeta = "objectMeta"
|
||||
ClusterRoleTemplateBindingFieldSubject = "subject"
|
||||
)
|
||||
|
||||
type ClusterRoleTemplateBinding struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
ClusterRoleTemplateName string `json:"clusterRoleTemplateName,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Subject Subject `json:"subject,omitempty"`
|
||||
}
|
||||
type ClusterRoleTemplateBindingCollection struct {
|
||||
types.Collection
|
||||
Data []ClusterRoleTemplateBinding `json:"data,omitempty"`
|
||||
client *ClusterRoleTemplateBindingClient
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingOperations interface {
|
||||
List(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error)
|
||||
Create(opts *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error)
|
||||
Update(existing *ClusterRoleTemplateBinding, updates interface{}) (*ClusterRoleTemplateBinding, error)
|
||||
ByID(id string) (*ClusterRoleTemplateBinding, error)
|
||||
Delete(container *ClusterRoleTemplateBinding) error
|
||||
}
|
||||
|
||||
func newClusterRoleTemplateBindingClient(apiClient *Client) *ClusterRoleTemplateBindingClient {
|
||||
return &ClusterRoleTemplateBindingClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateBindingClient) Create(container *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) {
|
||||
resp := &ClusterRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoCreate(ClusterRoleTemplateBindingType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateBindingClient) Update(existing *ClusterRoleTemplateBinding, updates interface{}) (*ClusterRoleTemplateBinding, error) {
|
||||
resp := &ClusterRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoUpdate(ClusterRoleTemplateBindingType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateBindingClient) List(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error) {
|
||||
resp := &ClusterRoleTemplateBindingCollection{}
|
||||
err := c.apiClient.Ops.DoList(ClusterRoleTemplateBindingType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ClusterRoleTemplateBindingCollection) Next() (*ClusterRoleTemplateBindingCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ClusterRoleTemplateBindingCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateBindingClient) ByID(id string) (*ClusterRoleTemplateBinding, error) {
|
||||
resp := &ClusterRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoByID(ClusterRoleTemplateBindingType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterRoleTemplateBindingClient) Delete(container *ClusterRoleTemplateBinding) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ClusterRoleTemplateBindingType, &container.Resource)
|
||||
}
|
@ -5,19 +5,19 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectType = "project"
|
||||
ProjectFieldAPIVersion = "apiVersion"
|
||||
ProjectFieldClusterName = "clusterName"
|
||||
ProjectFieldKind = "kind"
|
||||
ProjectFieldObjectMeta = "objectMeta"
|
||||
ProjectType = "project"
|
||||
ProjectFieldAPIVersion = "apiVersion"
|
||||
ProjectFieldKind = "kind"
|
||||
ProjectFieldObjectMeta = "objectMeta"
|
||||
ProjectFieldSpec = "spec"
|
||||
)
|
||||
|
||||
type Project struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Spec ProjectSpec `json:"spec,omitempty"`
|
||||
}
|
||||
type ProjectCollection struct {
|
||||
types.Collection
|
||||
|
@ -1,87 +0,0 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectRoleBindingType = "projectRoleBinding"
|
||||
ProjectRoleBindingFieldAPIVersion = "apiVersion"
|
||||
ProjectRoleBindingFieldKind = "kind"
|
||||
ProjectRoleBindingFieldObjectMeta = "objectMeta"
|
||||
ProjectRoleBindingFieldProjectName = "projectName"
|
||||
ProjectRoleBindingFieldRoleTemplateName = "roleTemplateName"
|
||||
ProjectRoleBindingFieldSubjects = "subjects"
|
||||
)
|
||||
|
||||
type ProjectRoleBinding struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
RoleTemplateName string `json:"roleTemplateName,omitempty"`
|
||||
Subjects []Subject `json:"subjects,omitempty"`
|
||||
}
|
||||
type ProjectRoleBindingCollection struct {
|
||||
types.Collection
|
||||
Data []ProjectRoleBinding `json:"data,omitempty"`
|
||||
client *ProjectRoleBindingClient
|
||||
}
|
||||
|
||||
type ProjectRoleBindingClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ProjectRoleBindingOperations interface {
|
||||
List(opts *types.ListOpts) (*ProjectRoleBindingCollection, error)
|
||||
Create(opts *ProjectRoleBinding) (*ProjectRoleBinding, error)
|
||||
Update(existing *ProjectRoleBinding, updates interface{}) (*ProjectRoleBinding, error)
|
||||
ByID(id string) (*ProjectRoleBinding, error)
|
||||
Delete(container *ProjectRoleBinding) error
|
||||
}
|
||||
|
||||
func newProjectRoleBindingClient(apiClient *Client) *ProjectRoleBindingClient {
|
||||
return &ProjectRoleBindingClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ProjectRoleBindingClient) Create(container *ProjectRoleBinding) (*ProjectRoleBinding, error) {
|
||||
resp := &ProjectRoleBinding{}
|
||||
err := c.apiClient.Ops.DoCreate(ProjectRoleBindingType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleBindingClient) Update(existing *ProjectRoleBinding, updates interface{}) (*ProjectRoleBinding, error) {
|
||||
resp := &ProjectRoleBinding{}
|
||||
err := c.apiClient.Ops.DoUpdate(ProjectRoleBindingType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleBindingClient) List(opts *types.ListOpts) (*ProjectRoleBindingCollection, error) {
|
||||
resp := &ProjectRoleBindingCollection{}
|
||||
err := c.apiClient.Ops.DoList(ProjectRoleBindingType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ProjectRoleBindingCollection) Next() (*ProjectRoleBindingCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ProjectRoleBindingCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ProjectRoleBindingClient) ByID(id string) (*ProjectRoleBinding, error) {
|
||||
resp := &ProjectRoleBinding{}
|
||||
err := c.apiClient.Ops.DoByID(ProjectRoleBindingType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleBindingClient) Delete(container *ProjectRoleBinding) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ProjectRoleBindingType, &container.Resource)
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectRoleTemplateType = "projectRoleTemplate"
|
||||
ProjectRoleTemplateFieldAPIVersion = "apiVersion"
|
||||
ProjectRoleTemplateFieldKind = "kind"
|
||||
ProjectRoleTemplateFieldObjectMeta = "objectMeta"
|
||||
ProjectRoleTemplateFieldProjectRoleTemplates = "projectRoleTemplates"
|
||||
ProjectRoleTemplateFieldRules = "rules"
|
||||
)
|
||||
|
||||
type ProjectRoleTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
ProjectRoleTemplates []string `json:"projectRoleTemplates,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
}
|
||||
type ProjectRoleTemplateCollection struct {
|
||||
types.Collection
|
||||
Data []ProjectRoleTemplate `json:"data,omitempty"`
|
||||
client *ProjectRoleTemplateClient
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateOperations interface {
|
||||
List(opts *types.ListOpts) (*ProjectRoleTemplateCollection, error)
|
||||
Create(opts *ProjectRoleTemplate) (*ProjectRoleTemplate, error)
|
||||
Update(existing *ProjectRoleTemplate, updates interface{}) (*ProjectRoleTemplate, error)
|
||||
ByID(id string) (*ProjectRoleTemplate, error)
|
||||
Delete(container *ProjectRoleTemplate) error
|
||||
}
|
||||
|
||||
func newProjectRoleTemplateClient(apiClient *Client) *ProjectRoleTemplateClient {
|
||||
return &ProjectRoleTemplateClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateClient) Create(container *ProjectRoleTemplate) (*ProjectRoleTemplate, error) {
|
||||
resp := &ProjectRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoCreate(ProjectRoleTemplateType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateClient) Update(existing *ProjectRoleTemplate, updates interface{}) (*ProjectRoleTemplate, error) {
|
||||
resp := &ProjectRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoUpdate(ProjectRoleTemplateType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateClient) List(opts *types.ListOpts) (*ProjectRoleTemplateCollection, error) {
|
||||
resp := &ProjectRoleTemplateCollection{}
|
||||
err := c.apiClient.Ops.DoList(ProjectRoleTemplateType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ProjectRoleTemplateCollection) Next() (*ProjectRoleTemplateCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ProjectRoleTemplateCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateClient) ByID(id string) (*ProjectRoleTemplate, error) {
|
||||
resp := &ProjectRoleTemplate{}
|
||||
err := c.apiClient.Ops.DoByID(ProjectRoleTemplateType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateClient) Delete(container *ProjectRoleTemplate) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ProjectRoleTemplateType, &container.Resource)
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectRoleTemplateBindingType = "projectRoleTemplateBinding"
|
||||
ProjectRoleTemplateBindingFieldAPIVersion = "apiVersion"
|
||||
ProjectRoleTemplateBindingFieldKind = "kind"
|
||||
ProjectRoleTemplateBindingFieldObjectMeta = "objectMeta"
|
||||
ProjectRoleTemplateBindingFieldProjectName = "projectName"
|
||||
ProjectRoleTemplateBindingFieldProjectRoleTemplateName = "projectRoleTemplateName"
|
||||
ProjectRoleTemplateBindingFieldSubject = "subject"
|
||||
)
|
||||
|
||||
type ProjectRoleTemplateBinding struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
ProjectRoleTemplateName string `json:"projectRoleTemplateName,omitempty"`
|
||||
Subject Subject `json:"subject,omitempty"`
|
||||
}
|
||||
type ProjectRoleTemplateBindingCollection struct {
|
||||
types.Collection
|
||||
Data []ProjectRoleTemplateBinding `json:"data,omitempty"`
|
||||
client *ProjectRoleTemplateBindingClient
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingOperations interface {
|
||||
List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error)
|
||||
Create(opts *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
|
||||
Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error)
|
||||
ByID(id string) (*ProjectRoleTemplateBinding, error)
|
||||
Delete(container *ProjectRoleTemplateBinding) error
|
||||
}
|
||||
|
||||
func newProjectRoleTemplateBindingClient(apiClient *Client) *ProjectRoleTemplateBindingClient {
|
||||
return &ProjectRoleTemplateBindingClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateBindingClient) Create(container *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) {
|
||||
resp := &ProjectRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoCreate(ProjectRoleTemplateBindingType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateBindingClient) Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error) {
|
||||
resp := &ProjectRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoUpdate(ProjectRoleTemplateBindingType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateBindingClient) List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) {
|
||||
resp := &ProjectRoleTemplateBindingCollection{}
|
||||
err := c.apiClient.Ops.DoList(ProjectRoleTemplateBindingType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ProjectRoleTemplateBindingCollection) Next() (*ProjectRoleTemplateBindingCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ProjectRoleTemplateBindingCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateBindingClient) ByID(id string) (*ProjectRoleTemplateBinding, error) {
|
||||
resp := &ProjectRoleTemplateBinding{}
|
||||
err := c.apiClient.Ops.DoByID(ProjectRoleTemplateBindingType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ProjectRoleTemplateBindingClient) Delete(container *ProjectRoleTemplateBinding) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ProjectRoleTemplateBindingType, &container.Resource)
|
||||
}
|
12
client/authorization/v1/zz_generated_project_spec.go
Normal file
12
client/authorization/v1/zz_generated_project_spec.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ProjectSpecType = "projectSpec"
|
||||
ProjectSpecFieldClusterName = "clusterName"
|
||||
ProjectSpecFieldDisplayName = "displayName"
|
||||
)
|
||||
|
||||
type ProjectSpec struct {
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
RoleTemplateType = "roleTemplate"
|
||||
RoleTemplateFieldAPIVersion = "apiVersion"
|
||||
RoleTemplateFieldKind = "kind"
|
||||
RoleTemplateFieldObjectMeta = "objectMeta"
|
||||
RoleTemplateFieldRoleTemplates = "roleTemplates"
|
||||
RoleTemplateFieldRules = "rules"
|
||||
)
|
||||
|
||||
type RoleTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
RoleTemplates []string `json:"roleTemplates,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
}
|
||||
type RoleTemplateCollection struct {
|
||||
types.Collection
|
||||
Data []RoleTemplate `json:"data,omitempty"`
|
||||
client *RoleTemplateClient
|
||||
}
|
||||
|
||||
type RoleTemplateClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type RoleTemplateOperations interface {
|
||||
List(opts *types.ListOpts) (*RoleTemplateCollection, error)
|
||||
Create(opts *RoleTemplate) (*RoleTemplate, error)
|
||||
Update(existing *RoleTemplate, updates interface{}) (*RoleTemplate, error)
|
||||
ByID(id string) (*RoleTemplate, error)
|
||||
Delete(container *RoleTemplate) error
|
||||
}
|
||||
|
||||
func newRoleTemplateClient(apiClient *Client) *RoleTemplateClient {
|
||||
return &RoleTemplateClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *RoleTemplateClient) Create(container *RoleTemplate) (*RoleTemplate, error) {
|
||||
resp := &RoleTemplate{}
|
||||
err := c.apiClient.Ops.DoCreate(RoleTemplateType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RoleTemplateClient) Update(existing *RoleTemplate, updates interface{}) (*RoleTemplate, error) {
|
||||
resp := &RoleTemplate{}
|
||||
err := c.apiClient.Ops.DoUpdate(RoleTemplateType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RoleTemplateClient) List(opts *types.ListOpts) (*RoleTemplateCollection, error) {
|
||||
resp := &RoleTemplateCollection{}
|
||||
err := c.apiClient.Ops.DoList(RoleTemplateType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *RoleTemplateCollection) Next() (*RoleTemplateCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &RoleTemplateCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *RoleTemplateClient) ByID(id string) (*RoleTemplate, error) {
|
||||
resp := &RoleTemplate{}
|
||||
err := c.apiClient.Ops.DoByID(RoleTemplateType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *RoleTemplateClient) Delete(container *RoleTemplate) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(RoleTemplateType, &container.Resource)
|
||||
}
|
Loading…
Reference in New Issue
Block a user