mirror of
https://github.com/rancher/rke.git
synced 2025-06-30 09:12:55 +00:00
vendor bump
This commit is contained in:
parent
5ba7a9face
commit
04a137b097
@ -20,5 +20,5 @@ k8s.io/client-go v5.0.0 transitive=true
|
||||
github.com/gorilla/websocket v1.2.0
|
||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||
|
||||
github.com/rancher/norman 8c0d4bfe2e63a801e4e21906d6b37a5173dadcbb
|
||||
github.com/rancher/types a2625e8dc81780f5e4cfc05f771fe4bb1516fd44
|
||||
github.com/rancher/norman 2825fdb9c375682be8d35355be2c1047be5e7f16
|
||||
github.com/rancher/types 0d582f634ee71cf977333f9bebd6d0cf436c9ae9
|
||||
|
22
vendor/github.com/rancher/norman/clientbase/object_client.go
generated
vendored
22
vendor/github.com/rancher/norman/clientbase/object_client.go
generated
vendored
@ -6,6 +6,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
@ -18,6 +19,17 @@ type ObjectFactory interface {
|
||||
List() runtime.Object
|
||||
}
|
||||
|
||||
type UnstructuredObjectFactory struct {
|
||||
}
|
||||
|
||||
func (u *UnstructuredObjectFactory) Object() runtime.Object {
|
||||
return &unstructured.Unstructured{}
|
||||
}
|
||||
|
||||
func (u *UnstructuredObjectFactory) List() runtime.Object {
|
||||
return &unstructured.UnstructuredList{}
|
||||
}
|
||||
|
||||
type ObjectClient struct {
|
||||
restClient rest.Interface
|
||||
resource *metav1.APIResource
|
||||
@ -36,6 +48,16 @@ func NewObjectClient(namespace string, restClient rest.Interface, apiResource *m
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ObjectClient) UnstructuredClient() *ObjectClient {
|
||||
return &ObjectClient{
|
||||
restClient: p.restClient,
|
||||
resource: p.resource,
|
||||
gvk: p.gvk,
|
||||
ns: p.ns,
|
||||
Factory: &UnstructuredObjectFactory{},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ObjectClient) getAPIPrefix() string {
|
||||
if p.gvk.Group == "" {
|
||||
return "api"
|
||||
|
154
vendor/github.com/rancher/norman/condition/condition.go
generated
vendored
Normal file
154
vendor/github.com/rancher/norman/condition/condition.go
generated
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
package condition
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type Cond string
|
||||
|
||||
func (c Cond) True(obj runtime.Object) {
|
||||
setStatus(obj, string(c), "True")
|
||||
}
|
||||
|
||||
func (c Cond) IsTrue(obj runtime.Object) bool {
|
||||
return getStatus(obj, string(c)) == "True"
|
||||
}
|
||||
|
||||
func (c Cond) False(obj runtime.Object) {
|
||||
setStatus(obj, string(c), "False")
|
||||
}
|
||||
|
||||
func (c Cond) IsFalse(obj runtime.Object) bool {
|
||||
return getStatus(obj, string(c)) == "False"
|
||||
}
|
||||
|
||||
func (c Cond) Unknown(obj runtime.Object) {
|
||||
setStatus(obj, string(c), "Unknown")
|
||||
}
|
||||
|
||||
func (c Cond) IsUnknown(obj runtime.Object) bool {
|
||||
return getStatus(obj, string(c)) == "Unknown"
|
||||
}
|
||||
|
||||
func (c Cond) Reason(obj runtime.Object, reason string) {
|
||||
cond := findOrCreateCond(obj, string(c))
|
||||
getFieldValue(cond, "Reason").SetString(reason)
|
||||
touchTS(cond)
|
||||
}
|
||||
|
||||
func (c Cond) GetReason(obj runtime.Object) string {
|
||||
cond := findOrCreateCond(obj, string(c))
|
||||
return getFieldValue(cond, "Reason").String()
|
||||
}
|
||||
|
||||
func (c Cond) Once(obj runtime.Object, f func() (runtime.Object, error)) (runtime.Object, error) {
|
||||
if c.IsFalse(obj) {
|
||||
return obj, &controller.ForgetError{
|
||||
Err: errors.New(c.GetReason(obj)),
|
||||
}
|
||||
}
|
||||
|
||||
if c.IsTrue(obj) {
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
c.Unknown(obj)
|
||||
newObj, err := f()
|
||||
if newObj != nil {
|
||||
obj = newObj
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
c.False(obj)
|
||||
c.Reason(obj, err.Error())
|
||||
return obj, err
|
||||
}
|
||||
c.True(obj)
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
func (c Cond) Do(obj runtime.Object, f func() (runtime.Object, error)) error {
|
||||
c.Unknown(obj)
|
||||
newObj, err := f()
|
||||
if newObj != nil {
|
||||
obj = newObj
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
c.False(obj)
|
||||
c.Reason(obj, err.Error())
|
||||
return err
|
||||
}
|
||||
c.True(obj)
|
||||
return nil
|
||||
}
|
||||
|
||||
func touchTS(value reflect.Value) {
|
||||
now := time.Now().Format(time.RFC3339)
|
||||
getFieldValue(value, "LastUpdateTime").SetString(now)
|
||||
}
|
||||
|
||||
func getStatus(obj interface{}, condName string) string {
|
||||
cond := findOrCreateCond(obj, condName)
|
||||
return getFieldValue(cond, "Status").String()
|
||||
}
|
||||
|
||||
func setStatus(obj interface{}, condName, status string) {
|
||||
cond := findOrCreateCond(obj, condName)
|
||||
getFieldValue(cond, "Status").SetString(status)
|
||||
touchTS(cond)
|
||||
}
|
||||
|
||||
func findOrCreateCond(obj interface{}, condName string) reflect.Value {
|
||||
condSlice := getValue(obj, "Status", "Conditions")
|
||||
cond := findCond(condSlice, condName)
|
||||
if cond != nil {
|
||||
return *cond
|
||||
}
|
||||
|
||||
newCond := reflect.New(condSlice.Type().Elem()).Elem()
|
||||
newCond.FieldByName("Type").SetString(condName)
|
||||
newCond.FieldByName("Status").SetString("Unknown")
|
||||
condSlice.Set(reflect.Append(condSlice, newCond))
|
||||
return newCond
|
||||
}
|
||||
|
||||
func findCond(val reflect.Value, name string) *reflect.Value {
|
||||
for i := 0; i < val.Len(); i++ {
|
||||
cond := val.Index(i)
|
||||
typeVal := getFieldValue(cond, "Type")
|
||||
if typeVal.String() == name {
|
||||
return &cond
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getValue(obj interface{}, name ...string) reflect.Value {
|
||||
v := reflect.ValueOf(obj)
|
||||
t := v.Type()
|
||||
if t.Kind() == reflect.Ptr {
|
||||
v = v.Elem()
|
||||
t = v.Type()
|
||||
}
|
||||
|
||||
field := v.FieldByName(name[0])
|
||||
if len(name) == 1 {
|
||||
return field
|
||||
}
|
||||
return getFieldValue(field, name[1:]...)
|
||||
}
|
||||
|
||||
func getFieldValue(v reflect.Value, name ...string) reflect.Value {
|
||||
field := v.FieldByName(name[0])
|
||||
if len(name) == 1 {
|
||||
return field
|
||||
}
|
||||
return getFieldValue(field, name[1:]...)
|
||||
}
|
9
vendor/github.com/rancher/norman/controller/error.go
generated
vendored
Normal file
9
vendor/github.com/rancher/norman/controller/error.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package controller
|
||||
|
||||
type ForgetError struct {
|
||||
Err error
|
||||
}
|
||||
|
||||
func (f *ForgetError) Error() string {
|
||||
return f.Err.Error()
|
||||
}
|
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
@ -162,7 +162,7 @@ func (g *genericController) processNextWorkItem() bool {
|
||||
|
||||
// do your work on the key. This method will contains your "do stuff" logic
|
||||
err := g.syncHandler(key.(string))
|
||||
if err == nil {
|
||||
if _, ok := err.(*ForgetError); err == nil || ok {
|
||||
g.queue.Forget(key)
|
||||
return true
|
||||
}
|
||||
|
59
vendor/github.com/rancher/norman/lifecycle/object.go
generated
vendored
59
vendor/github.com/rancher/norman/lifecycle/object.go
generated
vendored
@ -51,7 +51,11 @@ func (o *objectLifecycleAdapter) sync(key string, obj runtime.Object) error {
|
||||
return err
|
||||
}
|
||||
|
||||
obj = obj.DeepCopyObject()
|
||||
if newObj, err := o.lifecycle.Updated(obj); err != nil {
|
||||
if newObj != nil {
|
||||
o.objectClient.Update(metadata.GetName(), newObj)
|
||||
}
|
||||
return err
|
||||
} else if newObj != nil {
|
||||
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
||||
@ -72,29 +76,39 @@ func (o *objectLifecycleAdapter) finalize(metadata metav1.Object, obj runtime.Ob
|
||||
}
|
||||
|
||||
obj = obj.DeepCopyObject()
|
||||
if newObj, err := o.lifecycle.Finalize(obj); err != nil {
|
||||
if newObj != nil {
|
||||
o.objectClient.Update(metadata.GetName(), newObj)
|
||||
}
|
||||
return false, err
|
||||
} else if newObj != nil {
|
||||
obj = newObj
|
||||
}
|
||||
|
||||
if err := removeFinalizer(o.name, obj); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
_, err := o.objectClient.Update(metadata.GetName(), obj)
|
||||
return false, err
|
||||
}
|
||||
|
||||
func removeFinalizer(name string, obj runtime.Object) error {
|
||||
metadata, err := meta.Accessor(obj)
|
||||
if err != nil {
|
||||
return false, err
|
||||
return err
|
||||
}
|
||||
|
||||
var finalizers []string
|
||||
for _, finalizer := range metadata.GetFinalizers() {
|
||||
if finalizer == o.name {
|
||||
if finalizer == name {
|
||||
continue
|
||||
}
|
||||
finalizers = append(finalizers, finalizer)
|
||||
}
|
||||
metadata.SetFinalizers(finalizers)
|
||||
|
||||
if newObj, err := o.lifecycle.Finalize(obj); err != nil {
|
||||
return false, err
|
||||
} else if newObj != nil {
|
||||
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
||||
} else {
|
||||
_, err = o.objectClient.Update(metadata.GetName(), obj)
|
||||
}
|
||||
|
||||
return false, err
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *objectLifecycleAdapter) createKey() string {
|
||||
@ -104,28 +118,31 @@ func (o *objectLifecycleAdapter) createKey() string {
|
||||
func (o *objectLifecycleAdapter) create(metadata metav1.Object, obj runtime.Object) (bool, error) {
|
||||
initialized := o.createKey()
|
||||
|
||||
if metadata.GetLabels()[initialized] == "true" {
|
||||
if metadata.GetAnnotations()[initialized] == "true" {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
obj = obj.DeepCopyObject()
|
||||
if newObj, err := o.lifecycle.Create(obj); err != nil {
|
||||
if newObj != nil {
|
||||
o.objectClient.Update(metadata.GetName(), newObj)
|
||||
}
|
||||
return false, err
|
||||
} else if newObj != nil {
|
||||
obj = newObj
|
||||
}
|
||||
|
||||
metadata, err := meta.Accessor(obj)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if metadata.GetLabels() == nil {
|
||||
metadata.SetLabels(map[string]string{})
|
||||
if metadata.GetAnnotations() == nil {
|
||||
metadata.SetAnnotations(map[string]string{})
|
||||
}
|
||||
|
||||
metadata.SetFinalizers(append(metadata.GetFinalizers(), o.name))
|
||||
metadata.GetLabels()[initialized] = "true"
|
||||
if newObj, err := o.lifecycle.Create(obj); err != nil {
|
||||
return false, err
|
||||
} else if newObj != nil {
|
||||
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
||||
return false, err
|
||||
}
|
||||
metadata.GetAnnotations()[initialized] = "true"
|
||||
|
||||
_, err = o.objectClient.Update(metadata.GetName(), obj)
|
||||
return false, err
|
||||
|
206
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
206
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"sync"
|
||||
|
||||
"github.com/rancher/norman/name"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
"github.com/rancher/norman/types/definition"
|
||||
@ -14,7 +16,9 @@ type SchemaCollection struct {
|
||||
Data []Schema
|
||||
}
|
||||
|
||||
type SchemaInitFunc func(*Schemas) *Schemas
|
||||
type SchemasInitFunc func(*Schemas) *Schemas
|
||||
|
||||
type SchemaHook func(*Schema)
|
||||
|
||||
type MappersFactory func() []Mapper
|
||||
|
||||
@ -24,14 +28,17 @@ type BackReference struct {
|
||||
}
|
||||
|
||||
type Schemas struct {
|
||||
sync.Mutex
|
||||
schemasByPath map[string]map[string]*Schema
|
||||
schemasBySubContext map[string]*Schema
|
||||
mappers map[string]map[string][]Mapper
|
||||
references map[string][]BackReference
|
||||
embedded map[string]*Schema
|
||||
DefaultMappers MappersFactory
|
||||
DefaultPostMappers MappersFactory
|
||||
versions []APIVersion
|
||||
schemas []*Schema
|
||||
AddHook SchemaHook
|
||||
errors []error
|
||||
}
|
||||
|
||||
@ -41,10 +48,11 @@ func NewSchemas() *Schemas {
|
||||
schemasBySubContext: map[string]*Schema{},
|
||||
mappers: map[string]map[string][]Mapper{},
|
||||
references: map[string][]BackReference{},
|
||||
embedded: map[string]*Schema{},
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Schemas) Init(initFunc SchemaInitFunc) *Schemas {
|
||||
func (s *Schemas) Init(initFunc SchemasInitFunc) *Schemas {
|
||||
return initFunc(s)
|
||||
}
|
||||
|
||||
@ -53,13 +61,11 @@ func (s *Schemas) Err() error {
|
||||
}
|
||||
|
||||
func (s *Schemas) SubContext(subContext string) *Schema {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.schemasBySubContext[subContext]
|
||||
}
|
||||
|
||||
func (s *Schemas) SubContextSchemas() map[string]*Schema {
|
||||
return s.schemasBySubContext
|
||||
}
|
||||
|
||||
func (s *Schemas) AddSchemas(schema *Schemas) *Schemas {
|
||||
for _, schema := range schema.Schemas() {
|
||||
s.AddSchema(*schema)
|
||||
@ -67,27 +73,58 @@ func (s *Schemas) AddSchemas(schema *Schemas) *Schemas {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Schemas) RemoveSchema(schema Schema) *Schemas {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.doRemoveSchema(schema)
|
||||
}
|
||||
|
||||
func (s *Schemas) doRemoveSchema(schema Schema) *Schemas {
|
||||
delete(s.schemasByPath[schema.Version.Path], schema.ID)
|
||||
|
||||
s.removeReferences(&schema)
|
||||
|
||||
delete(s.schemasBySubContext, schema.SubContext)
|
||||
|
||||
if schema.Embed {
|
||||
s.removeEmbed(&schema)
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Schemas) removeReferences(schema *Schema) {
|
||||
fullType := convert.ToFullReference(schema.Version.Path, schema.ID)
|
||||
delete(s.references, fullType)
|
||||
|
||||
for name, values := range s.references {
|
||||
changed := false
|
||||
var modified []BackReference
|
||||
for _, value := range values {
|
||||
if value.Schema.ID == schema.ID && value.Schema.Version.Path == schema.Version.Path {
|
||||
changed = true
|
||||
continue
|
||||
}
|
||||
modified = append(modified, value)
|
||||
}
|
||||
|
||||
if changed {
|
||||
s.references[name] = modified
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Schemas) AddSchema(schema Schema) *Schemas {
|
||||
schema.Type = "/meta/schemas/schema"
|
||||
if schema.ID == "" {
|
||||
s.errors = append(s.errors, fmt.Errorf("ID is not set on schema: %v", schema))
|
||||
return s
|
||||
}
|
||||
if schema.Version.Path == "" || schema.Version.Version == "" {
|
||||
s.errors = append(s.errors, fmt.Errorf("version is not set on schema: %s", schema.ID))
|
||||
return s
|
||||
}
|
||||
if schema.PluralName == "" {
|
||||
schema.PluralName = name.GuessPluralName(schema.ID)
|
||||
}
|
||||
if schema.CodeName == "" {
|
||||
schema.CodeName = convert.Capitalize(schema.ID)
|
||||
}
|
||||
if schema.CodeNamePlural == "" {
|
||||
schema.CodeNamePlural = name.GuessPluralName(schema.CodeName)
|
||||
}
|
||||
if schema.BaseType == "" {
|
||||
schema.BaseType = schema.ID
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.doAddSchema(schema)
|
||||
}
|
||||
|
||||
func (s *Schemas) doAddSchema(schema Schema) *Schemas {
|
||||
s.setupDefaults(&schema)
|
||||
|
||||
if s.AddHook != nil {
|
||||
s.AddHook(&schema)
|
||||
}
|
||||
|
||||
schemas, ok := s.schemasByPath[schema.Version.Path]
|
||||
@ -101,20 +138,8 @@ func (s *Schemas) AddSchema(schema Schema) *Schemas {
|
||||
schemas[schema.ID] = &schema
|
||||
s.schemas = append(s.schemas, &schema)
|
||||
|
||||
for name, field := range schema.ResourceFields {
|
||||
if !definition.IsReferenceType(field.Type) {
|
||||
continue
|
||||
}
|
||||
|
||||
refType := definition.SubType(field.Type)
|
||||
if !strings.HasPrefix(refType, "/") {
|
||||
refType = convert.ToFullReference(schema.Version.Path, refType)
|
||||
}
|
||||
|
||||
s.references[refType] = append(s.references[refType], BackReference{
|
||||
FieldName: name,
|
||||
Schema: &schema,
|
||||
})
|
||||
if !schema.Embed {
|
||||
s.addReferences(&schema)
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,11 +147,100 @@ func (s *Schemas) AddSchema(schema Schema) *Schemas {
|
||||
s.schemasBySubContext[schema.SubContext] = &schema
|
||||
}
|
||||
|
||||
if schema.Embed {
|
||||
s.embed(&schema)
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Schemas) removeEmbed(schema *Schema) {
|
||||
target := s.doSchema(&schema.Version, schema.EmbedType, false)
|
||||
if target == nil {
|
||||
return
|
||||
}
|
||||
|
||||
newSchema := *target
|
||||
newSchema.ResourceFields = map[string]Field{}
|
||||
|
||||
for k, v := range target.ResourceFields {
|
||||
newSchema.ResourceFields[k] = v
|
||||
}
|
||||
|
||||
for k := range schema.ResourceFields {
|
||||
delete(newSchema.ResourceFields, k)
|
||||
}
|
||||
|
||||
s.doRemoveSchema(*target)
|
||||
s.doAddSchema(newSchema)
|
||||
}
|
||||
|
||||
func (s *Schemas) embed(schema *Schema) {
|
||||
target := s.doSchema(&schema.Version, schema.EmbedType, false)
|
||||
if target == nil {
|
||||
return
|
||||
}
|
||||
|
||||
newSchema := *target
|
||||
newSchema.ResourceFields = map[string]Field{}
|
||||
|
||||
for k, v := range target.ResourceFields {
|
||||
newSchema.ResourceFields[k] = v
|
||||
}
|
||||
for k, v := range schema.ResourceFields {
|
||||
newSchema.ResourceFields[k] = v
|
||||
}
|
||||
|
||||
s.doRemoveSchema(*target)
|
||||
s.doAddSchema(newSchema)
|
||||
}
|
||||
|
||||
func (s *Schemas) addReferences(schema *Schema) {
|
||||
for name, field := range schema.ResourceFields {
|
||||
if !definition.IsReferenceType(field.Type) {
|
||||
continue
|
||||
}
|
||||
|
||||
refType := definition.SubType(field.Type)
|
||||
if !strings.HasPrefix(refType, "/") {
|
||||
refType = convert.ToFullReference(schema.Version.Path, refType)
|
||||
}
|
||||
|
||||
s.references[refType] = append(s.references[refType], BackReference{
|
||||
FieldName: name,
|
||||
Schema: schema,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Schemas) setupDefaults(schema *Schema) {
|
||||
schema.Type = "/meta/schemas/schema"
|
||||
if schema.ID == "" {
|
||||
s.errors = append(s.errors, fmt.Errorf("ID is not set on schema: %v", schema))
|
||||
return
|
||||
}
|
||||
if schema.Version.Path == "" || schema.Version.Version == "" {
|
||||
s.errors = append(s.errors, fmt.Errorf("version is not set on schema: %s", schema.ID))
|
||||
return
|
||||
}
|
||||
if schema.PluralName == "" {
|
||||
schema.PluralName = name.GuessPluralName(schema.ID)
|
||||
}
|
||||
if schema.CodeName == "" {
|
||||
schema.CodeName = convert.Capitalize(schema.ID)
|
||||
}
|
||||
if schema.CodeNamePlural == "" {
|
||||
schema.CodeNamePlural = name.GuessPluralName(schema.CodeName)
|
||||
}
|
||||
if schema.BaseType == "" {
|
||||
schema.BaseType = schema.ID
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Schemas) References(schema *Schema) []BackReference {
|
||||
refType := convert.ToFullReference(schema.Version.Path, schema.ID)
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.references[refType]
|
||||
}
|
||||
|
||||
@ -142,6 +256,8 @@ func (s *Schemas) AddMapper(version *APIVersion, schemaID string, mapper Mapper)
|
||||
}
|
||||
|
||||
func (s *Schemas) SchemasForVersion(version APIVersion) map[string]*Schema {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.schemasByPath[version.Path]
|
||||
}
|
||||
|
||||
@ -182,6 +298,10 @@ func (s *Schemas) mapper(version *APIVersion, name string) []Mapper {
|
||||
}
|
||||
|
||||
func (s *Schemas) Schema(version *APIVersion, name string) *Schema {
|
||||
return s.doSchema(version, name, true)
|
||||
}
|
||||
|
||||
func (s *Schemas) doSchema(version *APIVersion, name string, lock bool) *Schema {
|
||||
var (
|
||||
path string
|
||||
)
|
||||
@ -196,7 +316,13 @@ func (s *Schemas) Schema(version *APIVersion, name string) *Schema {
|
||||
path = "core"
|
||||
}
|
||||
|
||||
if lock {
|
||||
s.Lock()
|
||||
}
|
||||
schemas, ok := s.schemasByPath[path]
|
||||
if lock {
|
||||
s.Unlock()
|
||||
}
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
13
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
13
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
@ -61,8 +61,13 @@ type ResponseWriter interface {
|
||||
}
|
||||
|
||||
type AccessControl interface {
|
||||
CanCreate(schema *Schema) bool
|
||||
CanList(schema *Schema) bool
|
||||
CanCreate(apiContext *APIContext, schema *Schema) bool
|
||||
CanList(apiContext *APIContext, schema *Schema) bool
|
||||
CanUpdate(apiContext *APIContext, schema *Schema) bool
|
||||
CanDelete(apiContext *APIContext, schema *Schema) bool
|
||||
|
||||
Filter(apiContext *APIContext, obj map[string]interface{}, context map[string]string) map[string]interface{}
|
||||
FilterList(apiContext *APIContext, obj []map[string]interface{}, context map[string]string) []map[string]interface{}
|
||||
}
|
||||
|
||||
type APIContext struct {
|
||||
@ -148,6 +153,8 @@ type URLBuilder interface {
|
||||
Sort(field string) string
|
||||
SetSubContext(subContext string)
|
||||
FilterLink(schema *Schema, fieldName string, value string) string
|
||||
Action(action string, resource *RawResource) string
|
||||
ResourceLinkByID(schema *Schema, id string) string
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
@ -155,6 +162,6 @@ type Store interface {
|
||||
List(apiContext *APIContext, schema *Schema, opt QueryOptions) ([]map[string]interface{}, error)
|
||||
Create(apiContext *APIContext, schema *Schema, data map[string]interface{}) (map[string]interface{}, error)
|
||||
Update(apiContext *APIContext, schema *Schema, data map[string]interface{}, id string) (map[string]interface{}, error)
|
||||
Delete(apiContext *APIContext, schema *Schema, id string) error
|
||||
Delete(apiContext *APIContext, schema *Schema, id string) (map[string]interface{}, error)
|
||||
Watch(apiContext *APIContext, schema *Schema, opt QueryOptions) (chan map[string]interface{}, error)
|
||||
}
|
||||
|
2
vendor/github.com/rancher/norman/types/types.go
generated
vendored
2
vendor/github.com/rancher/norman/types/types.go
generated
vendored
@ -79,6 +79,8 @@ type TypeScope string
|
||||
|
||||
type Schema struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Embed bool `json:"embed,omitempty"`
|
||||
EmbedType string `json:"embedType,omitempty"`
|
||||
CodeName string `json:"-"`
|
||||
CodeNamePlural string `json:"-"`
|
||||
PkgName string `json:"-"`
|
||||
|
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/authn_types.go
generated
vendored
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/authn_types.go
generated
vendored
@ -8,42 +8,44 @@ type Token struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
TokenID string `json:"tokenId,omitempty"`
|
||||
UserIdentity Identity `json:"userIdentity,omitempty"`
|
||||
GroupIdentities []Identity `json:"groupIdentities,omitempty"`
|
||||
ProviderInfo map[string]string `json:"providerInfo,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
AuthProvider string `json:"authProvider,omitempty"`
|
||||
TTLMillis string `json:"ttl,omitempty"`
|
||||
IdentityRefreshTTLMillis string `json:"identityRefreshTTL,omitempty"`
|
||||
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
|
||||
IsDerived bool `json:"isDerived,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
UserPrincipal Principal `json:"userPrincipal" norman:"type=reference[Principal]"`
|
||||
GroupPrincipals []Principal `json:"groupPrincipals" norman:"type=array[reference[Principal]]"`
|
||||
ProviderInfo map[string]string `json:"providerInfo,omitempty"`
|
||||
UserID string `json:"userId" norman:"type=reference[User]"`
|
||||
AuthProvider string `json:"authProvider"`
|
||||
TTLMillis int `json:"ttl"`
|
||||
LastUpdateTime string `json:"lastUpdateTime"`
|
||||
IsDerived bool `json:"isDerived"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Secret string `json:"secret,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
UserName string `json:"userName,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
MustChangePassword bool `json:"mustChangePassword,omitempty"`
|
||||
PrincipalIDs []string `json:"principalIds,omitempty" norman:"type=array[reference[Principal]]"`
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
}
|
||||
|
||||
type GroupMember struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
GroupName string `json:"groupName,omitempty" norman:"type=reference[group]"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
GroupName string `json:"groupName,omitempty" norman:"type=reference[group]"`
|
||||
PrincipalID string `json:"principalId,omitempty" norman:"type=reference[Principal]"`
|
||||
}
|
||||
|
||||
type Identity struct {
|
||||
type Principal struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@ -59,12 +61,11 @@ type Identity struct {
|
||||
|
||||
//LoginInput structure defines all properties that can be sent by client to create a token
|
||||
type LoginInput struct {
|
||||
TTLMillis string `json:"ttl,omitempty"`
|
||||
IdentityRefreshTTLMillis string `json:"identityRefreshTTL,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ResponseType string `json:"responseType,omitempty"` //json or cookie
|
||||
LocalCredential LocalCredential `json:"localCredential, omitempty"`
|
||||
GithubCredential GithubCredential `json:"githubCredential, omitempty"`
|
||||
TTLMillis int `json:"ttl,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ResponseType string `json:"responseType,omitempty"` //json or cookie
|
||||
LocalCredential LocalCredential `json:"localCredential, omitempty"`
|
||||
GithubCredential GithubCredential `json:"githubCredential, omitempty"`
|
||||
}
|
||||
|
||||
//LocalCredential stores the local auth creds
|
||||
@ -77,3 +78,7 @@ type LocalCredential struct {
|
||||
type GithubCredential struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
type ChangePasswordInput struct {
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
21
vendor/github.com/rancher/types/apis/management.cattle.io/v3/authz_types.go
generated
vendored
21
vendor/github.com/rancher/types/apis/management.cattle.io/v3/authz_types.go
generated
vendored
@ -19,14 +19,31 @@ type ProjectSpec struct {
|
||||
PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateName,omitempty" norman:"type=reference[podSecurityPolicyTemplate]"`
|
||||
}
|
||||
|
||||
type RoleTemplate struct {
|
||||
type GlobalRole struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
}
|
||||
|
||||
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
|
||||
type GlobalRoleBinding struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Subject rbacv1.Subject `json:"subject,omitempty"`
|
||||
GlobalRoleName string `json:"globalRoleName,omitempty" norman:"type=reference[globalRole]"`
|
||||
}
|
||||
|
||||
type RoleTemplate struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
External bool `json:"external"`
|
||||
Hidden bool `json:"hidden"`
|
||||
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
|
||||
}
|
||||
|
||||
type PodSecurityPolicyTemplate struct {
|
||||
|
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go
generated
vendored
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go
generated
vendored
@ -22,7 +22,8 @@ type CatalogSpec struct {
|
||||
}
|
||||
|
||||
type CatalogStatus struct {
|
||||
Commit string `json:"commit,omitempty"`
|
||||
LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty"`
|
||||
Commit string `json:"commit,omitempty"`
|
||||
}
|
||||
|
||||
type Template struct {
|
||||
|
184
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
184
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
@ -1,6 +1,7 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/condition"
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
@ -36,13 +37,10 @@ type MachineTemplateCondition struct {
|
||||
}
|
||||
|
||||
type MachineTemplateSpec struct {
|
||||
DisplayName string `json:"displayName"`
|
||||
Description string `json:"description"`
|
||||
FlavorPrefix string `json:"flavorPrefix"`
|
||||
Driver string `json:"driver"`
|
||||
SecretValues map[string]string `json:"secretValues"`
|
||||
SecretName string `json:"secretName"`
|
||||
PublicValues map[string]string `json:"publicValues"`
|
||||
DisplayName string `json:"displayName"`
|
||||
Description string `json:"description"`
|
||||
Driver string `json:"driver"`
|
||||
MachineCommonParams `json:",inline"`
|
||||
}
|
||||
|
||||
type Machine struct {
|
||||
@ -59,22 +57,27 @@ type Machine struct {
|
||||
}
|
||||
|
||||
type MachineStatus struct {
|
||||
Conditions []MachineCondition `json:"conditions"`
|
||||
NodeStatus v1.NodeStatus `json:"nodeStatus"`
|
||||
NodeName string `json:"nodeName"`
|
||||
Requested v1.ResourceList `json:"requested,omitempty"`
|
||||
Limits v1.ResourceList `json:"limits,omitempty"`
|
||||
Provisioned bool `json:"provisioned,omitempty"`
|
||||
SSHUser string `json:"sshUser,omitempty"`
|
||||
SSHPrivateKey string `json:"sshPrivateKey,omitempty"`
|
||||
ExtractedConfig string `json:"extractedConfig,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
NodeConfig *RKEConfigNode `json:"nodeConfig,omitempty"`
|
||||
Conditions []MachineCondition `json:"conditions"`
|
||||
NodeStatus v1.NodeStatus `json:"nodeStatus"`
|
||||
NodeName string `json:"nodeName"`
|
||||
Requested v1.ResourceList `json:"requested,omitempty"`
|
||||
Limits v1.ResourceList `json:"limits,omitempty"`
|
||||
MachineTemplateSpec *MachineTemplateSpec `json:"machineTemplateSpec"`
|
||||
NodeConfig *RKEConfigNode `json:"rkeNode"`
|
||||
SSHUser string `json:"sshUser"`
|
||||
MachineDriverConfig string `json:"machineDriverConfig"`
|
||||
}
|
||||
|
||||
var (
|
||||
MachineConditionInitialized condition.Cond = "Initialized"
|
||||
MachineConditionProvisioned condition.Cond = "Provisioned"
|
||||
MachineConditionConfigSaved condition.Cond = "Saved"
|
||||
MachineConditionConfigReady condition.Cond = "Ready"
|
||||
)
|
||||
|
||||
type MachineCondition struct {
|
||||
// Type of cluster condition.
|
||||
Type string `json:"type"`
|
||||
Type condition.Cond `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// The last time this condition was updated.
|
||||
@ -87,149 +90,11 @@ type MachineCondition struct {
|
||||
|
||||
type MachineSpec struct {
|
||||
NodeSpec v1.NodeSpec `json:"nodeSpec"`
|
||||
DisplayName string `json:"displayName"`
|
||||
ClusterName string `json:"clusterName" norman:"type=reference[cluster]"`
|
||||
Roles []string `json:"roles"`
|
||||
MachineTemplateName string `json:"machineTemplateName" norman:"type=reference[machineTemplate]"`
|
||||
Description string `json:"description"`
|
||||
Driver string `json:"driver"`
|
||||
|
||||
MachineCommonParams `json:",inline"`
|
||||
AmazonEC2Config AmazonEC2Config `json:"amazonEc2Config"`
|
||||
AzureConfig AzureConfig `json:"azureConfig"`
|
||||
DigitalOceanConfig DigitalOceanConfig `json:"digitalOceanConfig"`
|
||||
}
|
||||
|
||||
type AmazonEC2Config struct {
|
||||
AccessKey string `json:"accessKey,omitempty"`
|
||||
|
||||
Ami string `json:"ami,omitempty"`
|
||||
|
||||
BlockDurationMinutes string `json:"blockDurationMinutes,omitempty"`
|
||||
|
||||
DeviceName string `json:"deviceName,omitempty"`
|
||||
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
|
||||
IamInstanceProfile string `json:"iamInstanceProfile,omitempty"`
|
||||
|
||||
InsecureTransport bool `json:"insecureTransport,omitempty"`
|
||||
|
||||
InstanceType string `json:"instanceType,omitempty"`
|
||||
|
||||
KeypairName string `json:"keypairName,omitempty"`
|
||||
|
||||
Monitoring bool `json:"monitoring,omitempty"`
|
||||
|
||||
OpenPort []string `json:"openPort,omitempty"`
|
||||
|
||||
PrivateAddressOnly bool `json:"privateAddressOnly,omitempty"`
|
||||
|
||||
Region string `json:"region,omitempty"`
|
||||
|
||||
RequestSpotInstance bool `json:"requestSpotInstance,omitempty"`
|
||||
|
||||
Retries string `json:"retries,omitempty"`
|
||||
|
||||
RootSize string `json:"rootSize,omitempty"`
|
||||
|
||||
SecretKey string `json:"secretKey,omitempty"`
|
||||
|
||||
SecurityGroup []string `json:"securityGroup,omitempty"`
|
||||
|
||||
SessionToken string `json:"sessionToken,omitempty"`
|
||||
|
||||
SpotPrice string `json:"spotPrice,omitempty"`
|
||||
|
||||
SSHKeypath string `json:"sshKeypath,omitempty"`
|
||||
|
||||
SSHUser string `json:"sshUser,omitempty"`
|
||||
|
||||
SubnetID string `json:"subnetId,omitempty"`
|
||||
|
||||
Tags string `json:"tags,omitempty"`
|
||||
|
||||
UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty"`
|
||||
|
||||
UsePrivateAddress bool `json:"usePrivateAddress,omitempty"`
|
||||
|
||||
Userdata string `json:"userdata,omitempty"`
|
||||
|
||||
VolumeType string `json:"volumeType,omitempty"`
|
||||
|
||||
VpcID string `json:"vpcId,omitempty"`
|
||||
|
||||
Zone string `json:"zone,omitempty"`
|
||||
}
|
||||
|
||||
type AzureConfig struct {
|
||||
AvailabilitySet string `json:"availabilitySet,omitempty"`
|
||||
|
||||
ClientID string `json:"clientId,omitempty"`
|
||||
|
||||
ClientSecret string `json:"clientSecret,omitempty"`
|
||||
|
||||
CustomData string `json:"customData,omitempty"`
|
||||
|
||||
DNS string `json:"dns,omitempty"`
|
||||
|
||||
DockerPort string `json:"dockerPort,omitempty"`
|
||||
|
||||
Environment string `json:"environment,omitempty"`
|
||||
|
||||
Image string `json:"image,omitempty"`
|
||||
|
||||
Location string `json:"location,omitempty"`
|
||||
|
||||
NoPublicIP bool `json:"noPublicIp,omitempty"`
|
||||
|
||||
OpenPort []string `json:"openPort,omitempty"`
|
||||
|
||||
PrivateIPAddress string `json:"privateIpAddress,omitempty"`
|
||||
|
||||
ResourceGroup string `json:"resourceGroup,omitempty"`
|
||||
|
||||
Size string `json:"size,omitempty"`
|
||||
|
||||
SSHUser string `json:"sshUser,omitempty"`
|
||||
|
||||
StaticPublicIP bool `json:"staticPublicIp,omitempty"`
|
||||
|
||||
StorageType string `json:"storageType,omitempty"`
|
||||
|
||||
Subnet string `json:"subnet,omitempty"`
|
||||
|
||||
SubnetPrefix string `json:"subnetPrefix,omitempty"`
|
||||
|
||||
SubscriptionID string `json:"subscriptionId,omitempty"`
|
||||
|
||||
UsePrivateIP bool `json:"usePrivateIp,omitempty"`
|
||||
|
||||
Vnet string `json:"vnet,omitempty"`
|
||||
}
|
||||
|
||||
type DigitalOceanConfig struct {
|
||||
AccessToken string `json:"accessToken,omitempty"`
|
||||
|
||||
Backups bool `json:"backups,omitempty"`
|
||||
|
||||
Image string `json:"image,omitempty"`
|
||||
|
||||
Ipv6 bool `json:"ipv6,omitempty"`
|
||||
|
||||
PrivateNetworking bool `json:"privateNetworking,omitempty"`
|
||||
|
||||
Region string `json:"region,omitempty"`
|
||||
|
||||
Size string `json:"size,omitempty"`
|
||||
|
||||
SSHKeyFingerprint string `json:"sshKeyFingerprint,omitempty"`
|
||||
|
||||
SSHKeyPath string `json:"sshKeyPath,omitempty"`
|
||||
|
||||
SSHPort string `json:"sshPort,omitempty"`
|
||||
|
||||
SSHUser string `json:"sshUser,omitempty"`
|
||||
|
||||
Userdata string `json:"userdata,omitempty"`
|
||||
}
|
||||
|
||||
type MachineCommonParams struct {
|
||||
@ -276,7 +141,6 @@ type MachineDriverCondition struct {
|
||||
}
|
||||
|
||||
type MachineDriverSpec struct {
|
||||
DisplayName string `json:"displayName"`
|
||||
Description string `json:"description"`
|
||||
URL string `json:"url"`
|
||||
ExternalID string `json:"externalId"`
|
||||
|
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
@ -67,6 +67,8 @@ type KubeAPIService struct {
|
||||
BaseService `yaml:",inline" json:",inline"`
|
||||
// Virtual IP range that will be used by Kubernetes services
|
||||
ServiceClusterIPRange string `yaml:"service_cluster_ip_range" json:"serviceClusterIpRange,omitempty"`
|
||||
// Enabled/Disable PodSecurityPolicy
|
||||
PodSecurityPolicy bool `yaml:"pod_security_policy" json:"podSecurityPolicy,omitempty"`
|
||||
}
|
||||
|
||||
type KubeControllerService struct {
|
||||
|
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/schema_types.go
generated
vendored
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/schema_types.go
generated
vendored
@ -18,6 +18,8 @@ type DynamicSchema struct {
|
||||
}
|
||||
|
||||
type DynamicSchemaSpec struct {
|
||||
Embed bool `json:"embed,omitempty"`
|
||||
EmbedType string `json:"embedType,omitempty"`
|
||||
PluralName string `json:"pluralName,omitempty"`
|
||||
ResourceMethods []string `json:"resourceMethods,omitempty"`
|
||||
ResourceFields map[string]Field `json:"resourceFields,omitempty"`
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
CatalogGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Catalog",
|
||||
}
|
||||
CatalogResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type CatalogInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() CatalogController
|
||||
AddSyncHandler(sync CatalogHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle CatalogLifecycle)
|
||||
}
|
||||
|
||||
type catalogLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *catalogClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
func (s *catalogClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *catalogClient) AddSyncHandler(sync CatalogHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *catalogClient) AddLifecycle(name string, lifecycle CatalogLifecycle) {
|
||||
sync := NewCatalogLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ClusterGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Cluster",
|
||||
}
|
||||
ClusterResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ClusterInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterController
|
||||
AddSyncHandler(sync ClusterHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ClusterLifecycle)
|
||||
}
|
||||
|
||||
type clusterLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *clusterClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
func (s *clusterClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterClient) AddSyncHandler(sync ClusterHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *clusterClient) AddLifecycle(name string, lifecycle ClusterLifecycle) {
|
||||
sync := NewClusterLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ClusterEventGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterEvent",
|
||||
}
|
||||
ClusterEventResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ClusterEventInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterEventController
|
||||
AddSyncHandler(sync ClusterEventHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ClusterEventLifecycle)
|
||||
}
|
||||
|
||||
type clusterEventLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *clusterEventClient) Watch(opts metav1.ListOptions) (watch.Interface, er
|
||||
func (s *clusterEventClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterEventClient) AddSyncHandler(sync ClusterEventHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *clusterEventClient) AddLifecycle(name string, lifecycle ClusterEventLifecycle) {
|
||||
sync := NewClusterEventLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ClusterRegistrationTokenGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterRegistrationToken",
|
||||
}
|
||||
ClusterRegistrationTokenResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ClusterRegistrationTokenInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterRegistrationTokenController
|
||||
AddSyncHandler(sync ClusterRegistrationTokenHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ClusterRegistrationTokenLifecycle)
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *clusterRegistrationTokenClient) Watch(opts metav1.ListOptions) (watch.I
|
||||
func (s *clusterRegistrationTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) AddSyncHandler(sync ClusterRegistrationTokenHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) AddLifecycle(name string, lifecycle ClusterRegistrationTokenLifecycle) {
|
||||
sync := NewClusterRegistrationTokenLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ClusterRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterRoleTemplateBinding",
|
||||
}
|
||||
ClusterRoleTemplateBindingResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ClusterRoleTemplateBindingInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterRoleTemplateBindingController
|
||||
AddSyncHandler(sync ClusterRoleTemplateBindingHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ClusterRoleTemplateBindingLifecycle)
|
||||
}
|
||||
|
||||
type clusterRoleTemplateBindingLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *clusterRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch
|
||||
func (s *clusterRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) AddSyncHandler(sync ClusterRoleTemplateBindingHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *clusterRoleTemplateBindingClient) AddLifecycle(name string, lifecycle ClusterRoleTemplateBindingLifecycle) {
|
||||
sync := NewClusterRoleTemplateBindingLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
787
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
787
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
@ -1,11 +1,407 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
rbac_v1 "k8s.io/api/rbac/v1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterDeepCopies)
|
||||
}
|
||||
|
||||
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
|
||||
// to allow building arbitrary schemes.
|
||||
//
|
||||
// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.
|
||||
func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedDeepCopyFuncs(
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Action).DeepCopyInto(out.(*Action))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Action{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AuthnConfig).DeepCopyInto(out.(*AuthnConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&AuthnConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AuthzConfig).DeepCopyInto(out.(*AuthzConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&AuthzConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AzureKubernetesServiceConfig).DeepCopyInto(out.(*AzureKubernetesServiceConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&AzureKubernetesServiceConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*BaseService).DeepCopyInto(out.(*BaseService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&BaseService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Catalog).DeepCopyInto(out.(*Catalog))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Catalog{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*CatalogList).DeepCopyInto(out.(*CatalogList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&CatalogList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*CatalogSpec).DeepCopyInto(out.(*CatalogSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&CatalogSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*CatalogStatus).DeepCopyInto(out.(*CatalogStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&CatalogStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ChangePasswordInput).DeepCopyInto(out.(*ChangePasswordInput))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ChangePasswordInput{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Cluster).DeepCopyInto(out.(*Cluster))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Cluster{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterComponentStatus).DeepCopyInto(out.(*ClusterComponentStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterComponentStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterCondition).DeepCopyInto(out.(*ClusterCondition))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterEvent).DeepCopyInto(out.(*ClusterEvent))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterEvent{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterEventList).DeepCopyInto(out.(*ClusterEventList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterEventList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterList).DeepCopyInto(out.(*ClusterList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRegistrationToken).DeepCopyInto(out.(*ClusterRegistrationToken))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRegistrationToken{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRegistrationTokenList).DeepCopyInto(out.(*ClusterRegistrationTokenList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRegistrationTokenList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRegistrationTokenSpec).DeepCopyInto(out.(*ClusterRegistrationTokenSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRegistrationTokenSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRegistrationTokenStatus).DeepCopyInto(out.(*ClusterRegistrationTokenStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRegistrationTokenStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRoleTemplateBinding).DeepCopyInto(out.(*ClusterRoleTemplateBinding))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRoleTemplateBinding{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterRoleTemplateBindingList).DeepCopyInto(out.(*ClusterRoleTemplateBindingList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterRoleTemplateBindingList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterSpec).DeepCopyInto(out.(*ClusterSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterStatus).DeepCopyInto(out.(*ClusterStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*DynamicSchema).DeepCopyInto(out.(*DynamicSchema))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&DynamicSchema{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*DynamicSchemaList).DeepCopyInto(out.(*DynamicSchemaList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&DynamicSchemaList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*DynamicSchemaSpec).DeepCopyInto(out.(*DynamicSchemaSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&DynamicSchemaSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*DynamicSchemaStatus).DeepCopyInto(out.(*DynamicSchemaStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&DynamicSchemaStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ETCDService).DeepCopyInto(out.(*ETCDService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ETCDService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Field).DeepCopyInto(out.(*Field))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Field{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*File).DeepCopyInto(out.(*File))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&File{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Filter).DeepCopyInto(out.(*Filter))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Filter{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GithubCredential).DeepCopyInto(out.(*GithubCredential))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GithubCredential{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GlobalRole).DeepCopyInto(out.(*GlobalRole))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GlobalRole{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GlobalRoleBinding).DeepCopyInto(out.(*GlobalRoleBinding))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GlobalRoleBinding{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GlobalRoleBindingList).DeepCopyInto(out.(*GlobalRoleBindingList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GlobalRoleBindingList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GlobalRoleList).DeepCopyInto(out.(*GlobalRoleList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GlobalRoleList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GoogleKubernetesEngineConfig).DeepCopyInto(out.(*GoogleKubernetesEngineConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GoogleKubernetesEngineConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Group).DeepCopyInto(out.(*Group))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Group{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GroupList).DeepCopyInto(out.(*GroupList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GroupList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GroupMember).DeepCopyInto(out.(*GroupMember))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GroupMember{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*GroupMemberList).DeepCopyInto(out.(*GroupMemberList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&GroupMemberList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*KubeAPIService).DeepCopyInto(out.(*KubeAPIService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&KubeAPIService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*KubeControllerService).DeepCopyInto(out.(*KubeControllerService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&KubeControllerService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*KubeletService).DeepCopyInto(out.(*KubeletService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&KubeletService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*KubeproxyService).DeepCopyInto(out.(*KubeproxyService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&KubeproxyService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ListOpts).DeepCopyInto(out.(*ListOpts))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ListOpts{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*LocalCredential).DeepCopyInto(out.(*LocalCredential))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&LocalCredential{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*LoginInput).DeepCopyInto(out.(*LoginInput))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&LoginInput{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Machine).DeepCopyInto(out.(*Machine))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Machine{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineCommonParams).DeepCopyInto(out.(*MachineCommonParams))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineCommonParams{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineCondition).DeepCopyInto(out.(*MachineCondition))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineDriver).DeepCopyInto(out.(*MachineDriver))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineDriver{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineDriverCondition).DeepCopyInto(out.(*MachineDriverCondition))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineDriverCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineDriverList).DeepCopyInto(out.(*MachineDriverList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineDriverList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineDriverSpec).DeepCopyInto(out.(*MachineDriverSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineDriverSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineDriverStatus).DeepCopyInto(out.(*MachineDriverStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineDriverStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineList).DeepCopyInto(out.(*MachineList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineSpec).DeepCopyInto(out.(*MachineSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineStatus).DeepCopyInto(out.(*MachineStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineTemplate).DeepCopyInto(out.(*MachineTemplate))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineTemplate{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineTemplateCondition).DeepCopyInto(out.(*MachineTemplateCondition))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineTemplateCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineTemplateList).DeepCopyInto(out.(*MachineTemplateList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineTemplateList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineTemplateSpec).DeepCopyInto(out.(*MachineTemplateSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineTemplateSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*MachineTemplateStatus).DeepCopyInto(out.(*MachineTemplateStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&MachineTemplateStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*NetworkConfig).DeepCopyInto(out.(*NetworkConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&NetworkConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PodSecurityPolicyTemplate).DeepCopyInto(out.(*PodSecurityPolicyTemplate))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PodSecurityPolicyTemplate{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PodSecurityPolicyTemplateList).DeepCopyInto(out.(*PodSecurityPolicyTemplateList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PodSecurityPolicyTemplateList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Principal).DeepCopyInto(out.(*Principal))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Principal{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PrincipalList).DeepCopyInto(out.(*PrincipalList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PrincipalList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Project).DeepCopyInto(out.(*Project))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Project{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectList).DeepCopyInto(out.(*ProjectList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectRoleTemplateBinding).DeepCopyInto(out.(*ProjectRoleTemplateBinding))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectRoleTemplateBinding{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectRoleTemplateBindingList).DeepCopyInto(out.(*ProjectRoleTemplateBindingList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectRoleTemplateBindingList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectSpec).DeepCopyInto(out.(*ProjectSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Question).DeepCopyInto(out.(*Question))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Question{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RKEConfigNode).DeepCopyInto(out.(*RKEConfigNode))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RKEConfigNode{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RKEConfigServices).DeepCopyInto(out.(*RKEConfigServices))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RKEConfigServices{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RancherKubernetesEngineConfig).DeepCopyInto(out.(*RancherKubernetesEngineConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RancherKubernetesEngineConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RoleTemplate).DeepCopyInto(out.(*RoleTemplate))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RoleTemplate{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RoleTemplateList).DeepCopyInto(out.(*RoleTemplateList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RoleTemplateList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*SchedulerService).DeepCopyInto(out.(*SchedulerService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&SchedulerService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Template).DeepCopyInto(out.(*Template))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Template{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateList).DeepCopyInto(out.(*TemplateList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateSpec).DeepCopyInto(out.(*TemplateSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateStatus).DeepCopyInto(out.(*TemplateStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateVersion).DeepCopyInto(out.(*TemplateVersion))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateVersion{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateVersionList).DeepCopyInto(out.(*TemplateVersionList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateVersionList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateVersionSpec).DeepCopyInto(out.(*TemplateVersionSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateVersionSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TemplateVersionStatus).DeepCopyInto(out.(*TemplateVersionStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TemplateVersionStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Token).DeepCopyInto(out.(*Token))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Token{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TokenList).DeepCopyInto(out.(*TokenList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TokenList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*User).DeepCopyInto(out.(*User))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&User{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*UserList).DeepCopyInto(out.(*UserList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&UserList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Values).DeepCopyInto(out.(*Values))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Values{})},
|
||||
)
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Action) DeepCopyInto(out *Action) {
|
||||
*out = *in
|
||||
@ -22,32 +418,6 @@ func (in *Action) DeepCopy() *Action {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AmazonEC2Config) DeepCopyInto(out *AmazonEC2Config) {
|
||||
*out = *in
|
||||
if in.OpenPort != nil {
|
||||
in, out := &in.OpenPort, &out.OpenPort
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.SecurityGroup != nil {
|
||||
in, out := &in.SecurityGroup, &out.SecurityGroup
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmazonEC2Config.
|
||||
func (in *AmazonEC2Config) DeepCopy() *AmazonEC2Config {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AmazonEC2Config)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuthnConfig) DeepCopyInto(out *AuthnConfig) {
|
||||
*out = *in
|
||||
@ -94,27 +464,6 @@ func (in *AuthzConfig) DeepCopy() *AuthzConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AzureConfig) DeepCopyInto(out *AzureConfig) {
|
||||
*out = *in
|
||||
if in.OpenPort != nil {
|
||||
in, out := &in.OpenPort, &out.OpenPort
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureConfig.
|
||||
func (in *AzureConfig) DeepCopy() *AzureConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AzureConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AzureKubernetesServiceConfig) DeepCopyInto(out *AzureKubernetesServiceConfig) {
|
||||
*out = *in
|
||||
@ -249,6 +598,22 @@ func (in *CatalogStatus) DeepCopy() *CatalogStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ChangePasswordInput) DeepCopyInto(out *ChangePasswordInput) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangePasswordInput.
|
||||
func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ChangePasswordInput)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Cluster) DeepCopyInto(out *Cluster) {
|
||||
*out = *in
|
||||
@ -666,22 +1031,6 @@ func (in *ClusterStatus) DeepCopy() *ClusterStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DigitalOceanConfig) DeepCopyInto(out *DigitalOceanConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DigitalOceanConfig.
|
||||
func (in *DigitalOceanConfig) DeepCopy() *DigitalOceanConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DigitalOceanConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DynamicSchema) DeepCopyInto(out *DynamicSchema) {
|
||||
*out = *in
|
||||
@ -919,6 +1268,136 @@ func (in *GithubCredential) DeepCopy() *GithubCredential {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GlobalRole) DeepCopyInto(out *GlobalRole) {
|
||||
*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])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRole.
|
||||
func (in *GlobalRole) DeepCopy() *GlobalRole {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GlobalRole)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GlobalRole) 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 *GlobalRoleBinding) DeepCopyInto(out *GlobalRoleBinding) {
|
||||
*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 GlobalRoleBinding.
|
||||
func (in *GlobalRoleBinding) DeepCopy() *GlobalRoleBinding {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GlobalRoleBinding)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GlobalRoleBinding) 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 *GlobalRoleBindingList) DeepCopyInto(out *GlobalRoleBindingList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GlobalRoleBinding, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBindingList.
|
||||
func (in *GlobalRoleBindingList) DeepCopy() *GlobalRoleBindingList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GlobalRoleBindingList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GlobalRoleBindingList) 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 *GlobalRoleList) DeepCopyInto(out *GlobalRoleList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GlobalRole, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleList.
|
||||
func (in *GlobalRoleList) DeepCopy() *GlobalRoleList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GlobalRoleList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GlobalRoleList) 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 *GoogleKubernetesEngineConfig) DeepCopyInto(out *GoogleKubernetesEngineConfig) {
|
||||
*out = *in
|
||||
@ -1069,74 +1548,6 @@ func (in *GroupMemberList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Identity) DeepCopyInto(out *Identity) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.ExtraInfo != nil {
|
||||
in, out := &in.ExtraInfo, &out.ExtraInfo
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity.
|
||||
func (in *Identity) DeepCopy() *Identity {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Identity)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Identity) 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 *IdentityList) DeepCopyInto(out *IdentityList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Identity, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityList.
|
||||
func (in *IdentityList) DeepCopy() *IdentityList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(IdentityList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *IdentityList) 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 *KubeAPIService) DeepCopyInto(out *KubeAPIService) {
|
||||
*out = *in
|
||||
@ -1508,10 +1919,11 @@ func (in *MachineList) DeepCopyObject() runtime.Object {
|
||||
func (in *MachineSpec) DeepCopyInto(out *MachineSpec) {
|
||||
*out = *in
|
||||
in.NodeSpec.DeepCopyInto(&out.NodeSpec)
|
||||
in.MachineCommonParams.DeepCopyInto(&out.MachineCommonParams)
|
||||
in.AmazonEC2Config.DeepCopyInto(&out.AmazonEC2Config)
|
||||
in.AzureConfig.DeepCopyInto(&out.AzureConfig)
|
||||
out.DigitalOceanConfig = in.DigitalOceanConfig
|
||||
if in.Roles != nil {
|
||||
in, out := &in.Roles, &out.Roles
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -1548,6 +1960,15 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) {
|
||||
(*out)[key] = val.DeepCopy()
|
||||
}
|
||||
}
|
||||
if in.MachineTemplateSpec != nil {
|
||||
in, out := &in.MachineTemplateSpec, &out.MachineTemplateSpec
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(MachineTemplateSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
if in.NodeConfig != nil {
|
||||
in, out := &in.NodeConfig, &out.NodeConfig
|
||||
if *in == nil {
|
||||
@ -1652,20 +2073,7 @@ func (in *MachineTemplateList) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) {
|
||||
*out = *in
|
||||
if in.SecretValues != nil {
|
||||
in, out := &in.SecretValues, &out.SecretValues
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.PublicValues != nil {
|
||||
in, out := &in.PublicValues, &out.PublicValues
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.MachineCommonParams.DeepCopyInto(&out.MachineCommonParams)
|
||||
return
|
||||
}
|
||||
|
||||
@ -1785,6 +2193,74 @@ func (in *PodSecurityPolicyTemplateList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Principal) DeepCopyInto(out *Principal) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.ExtraInfo != nil {
|
||||
in, out := &in.ExtraInfo, &out.ExtraInfo
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principal.
|
||||
func (in *Principal) DeepCopy() *Principal {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Principal)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Principal) 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 *PrincipalList) DeepCopyInto(out *PrincipalList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Principal, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrincipalList.
|
||||
func (in *PrincipalList) DeepCopy() *PrincipalList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PrincipalList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *PrincipalList) 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 *Project) DeepCopyInto(out *Project) {
|
||||
*out = *in
|
||||
@ -2341,10 +2817,10 @@ func (in *Token) DeepCopyInto(out *Token) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.UserIdentity.DeepCopyInto(&out.UserIdentity)
|
||||
if in.GroupIdentities != nil {
|
||||
in, out := &in.GroupIdentities, &out.GroupIdentities
|
||||
*out = make([]Identity, len(*in))
|
||||
in.UserPrincipal.DeepCopyInto(&out.UserPrincipal)
|
||||
if in.GroupPrincipals != nil {
|
||||
in, out := &in.GroupPrincipals, &out.GroupPrincipals
|
||||
*out = make([]Principal, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@ -2417,6 +2893,11 @@ func (in *User) DeepCopyInto(out *User) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.PrincipalIDs != nil {
|
||||
in, out := &in.PrincipalIDs, &out.PrincipalIDs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
DynamicSchemaGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "DynamicSchema",
|
||||
}
|
||||
DynamicSchemaResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type DynamicSchemaInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() DynamicSchemaController
|
||||
AddSyncHandler(sync DynamicSchemaHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle DynamicSchemaLifecycle)
|
||||
}
|
||||
|
||||
type dynamicSchemaLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *dynamicSchemaClient) Watch(opts metav1.ListOptions) (watch.Interface, e
|
||||
func (s *dynamicSchemaClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *dynamicSchemaClient) AddSyncHandler(sync DynamicSchemaHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *dynamicSchemaClient) AddLifecycle(name string, lifecycle DynamicSchemaLifecycle) {
|
||||
sync := NewDynamicSchemaLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_controller.go
generated
vendored
Normal file
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_controller.go
generated
vendored
Normal file
@ -0,0 +1,204 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
GlobalRoleBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "GlobalRoleBinding",
|
||||
}
|
||||
GlobalRoleBindingResource = metav1.APIResource{
|
||||
Name: "globalrolebindings",
|
||||
SingularName: "globalrolebinding",
|
||||
Namespaced: false,
|
||||
Kind: GlobalRoleBindingGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type GlobalRoleBindingList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GlobalRoleBinding
|
||||
}
|
||||
|
||||
type GlobalRoleBindingHandlerFunc func(key string, obj *GlobalRoleBinding) error
|
||||
|
||||
type GlobalRoleBindingLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*GlobalRoleBinding, err error)
|
||||
Get(namespace, name string) (*GlobalRoleBinding, error)
|
||||
}
|
||||
|
||||
type GlobalRoleBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() GlobalRoleBindingLister
|
||||
AddHandler(handler GlobalRoleBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type GlobalRoleBindingInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||
Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error)
|
||||
Update(*GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*GlobalRoleBindingList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() GlobalRoleBindingController
|
||||
AddSyncHandler(sync GlobalRoleBindingHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle GlobalRoleBindingLifecycle)
|
||||
}
|
||||
|
||||
type globalRoleBindingLister struct {
|
||||
controller *globalRoleBindingController
|
||||
}
|
||||
|
||||
func (l *globalRoleBindingLister) List(namespace string, selector labels.Selector) (ret []*GlobalRoleBinding, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*GlobalRoleBinding))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *globalRoleBindingLister) Get(namespace, name string) (*GlobalRoleBinding, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: GlobalRoleBindingGroupVersionKind.Group,
|
||||
Resource: "globalRoleBinding",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*GlobalRoleBinding), nil
|
||||
}
|
||||
|
||||
type globalRoleBindingController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *globalRoleBindingController) Lister() GlobalRoleBindingLister {
|
||||
return &globalRoleBindingLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *globalRoleBindingController) AddHandler(handler GlobalRoleBindingHandlerFunc) {
|
||||
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.(*GlobalRoleBinding))
|
||||
})
|
||||
}
|
||||
|
||||
type globalRoleBindingFactory struct {
|
||||
}
|
||||
|
||||
func (c globalRoleBindingFactory) Object() runtime.Object {
|
||||
return &GlobalRoleBinding{}
|
||||
}
|
||||
|
||||
func (c globalRoleBindingFactory) List() runtime.Object {
|
||||
return &GlobalRoleBindingList{}
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Controller() GlobalRoleBindingController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.globalRoleBindingControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(GlobalRoleBindingGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &globalRoleBindingController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.globalRoleBindingControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type globalRoleBindingClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller GlobalRoleBindingController
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Create(o *GlobalRoleBinding) (*GlobalRoleBinding, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*GlobalRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*GlobalRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Update(o *GlobalRoleBinding) (*GlobalRoleBinding, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*GlobalRoleBinding), err
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) List(opts metav1.ListOptions) (*GlobalRoleBindingList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*GlobalRoleBindingList), err
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) AddSyncHandler(sync GlobalRoleBindingHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *globalRoleBindingClient) AddLifecycle(name string, lifecycle GlobalRoleBindingLifecycle) {
|
||||
sync := NewGlobalRoleBindingLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_lifecycle_adapter.go
generated
vendored
Normal file
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_lifecycle_adapter.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type GlobalRoleBindingLifecycle interface {
|
||||
Create(obj *GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||
Remove(obj *GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||
Updated(obj *GlobalRoleBinding) (*GlobalRoleBinding, error)
|
||||
}
|
||||
|
||||
type globalRoleBindingLifecycleAdapter struct {
|
||||
lifecycle GlobalRoleBindingLifecycle
|
||||
}
|
||||
|
||||
func (w *globalRoleBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*GlobalRoleBinding))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *globalRoleBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*GlobalRoleBinding))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *globalRoleBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*GlobalRoleBinding))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewGlobalRoleBindingLifecycleAdapter(name string, client GlobalRoleBindingInterface, l GlobalRoleBindingLifecycle) GlobalRoleBindingHandlerFunc {
|
||||
adapter := &globalRoleBindingLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
|
||||
return func(key string, obj *GlobalRoleBinding) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_controller.go
generated
vendored
Normal file
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_controller.go
generated
vendored
Normal file
@ -0,0 +1,204 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
GlobalRoleGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "GlobalRole",
|
||||
}
|
||||
GlobalRoleResource = metav1.APIResource{
|
||||
Name: "globalroles",
|
||||
SingularName: "globalrole",
|
||||
Namespaced: false,
|
||||
Kind: GlobalRoleGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type GlobalRoleList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GlobalRole
|
||||
}
|
||||
|
||||
type GlobalRoleHandlerFunc func(key string, obj *GlobalRole) error
|
||||
|
||||
type GlobalRoleLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*GlobalRole, err error)
|
||||
Get(namespace, name string) (*GlobalRole, error)
|
||||
}
|
||||
|
||||
type GlobalRoleController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() GlobalRoleLister
|
||||
AddHandler(handler GlobalRoleHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type GlobalRoleInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*GlobalRole) (*GlobalRole, error)
|
||||
Get(name string, opts metav1.GetOptions) (*GlobalRole, error)
|
||||
Update(*GlobalRole) (*GlobalRole, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*GlobalRoleList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() GlobalRoleController
|
||||
AddSyncHandler(sync GlobalRoleHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle GlobalRoleLifecycle)
|
||||
}
|
||||
|
||||
type globalRoleLister struct {
|
||||
controller *globalRoleController
|
||||
}
|
||||
|
||||
func (l *globalRoleLister) List(namespace string, selector labels.Selector) (ret []*GlobalRole, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*GlobalRole))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *globalRoleLister) Get(namespace, name string) (*GlobalRole, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: GlobalRoleGroupVersionKind.Group,
|
||||
Resource: "globalRole",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*GlobalRole), nil
|
||||
}
|
||||
|
||||
type globalRoleController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *globalRoleController) Lister() GlobalRoleLister {
|
||||
return &globalRoleLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *globalRoleController) AddHandler(handler GlobalRoleHandlerFunc) {
|
||||
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.(*GlobalRole))
|
||||
})
|
||||
}
|
||||
|
||||
type globalRoleFactory struct {
|
||||
}
|
||||
|
||||
func (c globalRoleFactory) Object() runtime.Object {
|
||||
return &GlobalRole{}
|
||||
}
|
||||
|
||||
func (c globalRoleFactory) List() runtime.Object {
|
||||
return &GlobalRoleList{}
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Controller() GlobalRoleController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.globalRoleControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(GlobalRoleGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &globalRoleController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.globalRoleControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type globalRoleClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller GlobalRoleController
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Create(o *GlobalRole) (*GlobalRole, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*GlobalRole), err
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Get(name string, opts metav1.GetOptions) (*GlobalRole, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*GlobalRole), err
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Update(o *GlobalRole) (*GlobalRole, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*GlobalRole), err
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) List(opts metav1.ListOptions) (*GlobalRoleList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*GlobalRoleList), err
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) AddSyncHandler(sync GlobalRoleHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *globalRoleClient) AddLifecycle(name string, lifecycle GlobalRoleLifecycle) {
|
||||
sync := NewGlobalRoleLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_lifecycle_adapter.go
generated
vendored
Normal file
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_lifecycle_adapter.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type GlobalRoleLifecycle interface {
|
||||
Create(obj *GlobalRole) (*GlobalRole, error)
|
||||
Remove(obj *GlobalRole) (*GlobalRole, error)
|
||||
Updated(obj *GlobalRole) (*GlobalRole, error)
|
||||
}
|
||||
|
||||
type globalRoleLifecycleAdapter struct {
|
||||
lifecycle GlobalRoleLifecycle
|
||||
}
|
||||
|
||||
func (w *globalRoleLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*GlobalRole))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *globalRoleLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*GlobalRole))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *globalRoleLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*GlobalRole))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewGlobalRoleLifecycleAdapter(name string, client GlobalRoleInterface, l GlobalRoleLifecycle) GlobalRoleHandlerFunc {
|
||||
adapter := &globalRoleLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
|
||||
return func(key string, obj *GlobalRole) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
GroupGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Group",
|
||||
}
|
||||
GroupResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type GroupInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() GroupController
|
||||
AddSyncHandler(sync GroupHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle GroupLifecycle)
|
||||
}
|
||||
|
||||
type groupLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *groupClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
func (s *groupClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *groupClient) AddSyncHandler(sync GroupHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *groupClient) AddLifecycle(name string, lifecycle GroupLifecycle) {
|
||||
sync := NewGroupLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
GroupMemberGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "GroupMember",
|
||||
}
|
||||
GroupMemberResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type GroupMemberInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() GroupMemberController
|
||||
AddSyncHandler(sync GroupMemberHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle GroupMemberLifecycle)
|
||||
}
|
||||
|
||||
type groupMemberLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *groupMemberClient) Watch(opts metav1.ListOptions) (watch.Interface, err
|
||||
func (s *groupMemberClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *groupMemberClient) AddSyncHandler(sync GroupMemberHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *groupMemberClient) AddLifecycle(name string, lifecycle GroupMemberLifecycle) {
|
||||
sync := NewGroupMemberLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -1,193 +0,0 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
IdentityGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Kind: "Identity",
|
||||
}
|
||||
IdentityResource = metav1.APIResource{
|
||||
Name: "identities",
|
||||
SingularName: "identity",
|
||||
Namespaced: false,
|
||||
Kind: IdentityGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type IdentityList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Identity
|
||||
}
|
||||
|
||||
type IdentityHandlerFunc func(key string, obj *Identity) error
|
||||
|
||||
type IdentityLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*Identity, err error)
|
||||
Get(namespace, name string) (*Identity, error)
|
||||
}
|
||||
|
||||
type IdentityController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() IdentityLister
|
||||
AddHandler(handler IdentityHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type IdentityInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*Identity) (*Identity, error)
|
||||
Get(name string, opts metav1.GetOptions) (*Identity, error)
|
||||
Update(*Identity) (*Identity, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*IdentityList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() IdentityController
|
||||
}
|
||||
|
||||
type identityLister struct {
|
||||
controller *identityController
|
||||
}
|
||||
|
||||
func (l *identityLister) List(namespace string, selector labels.Selector) (ret []*Identity, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*Identity))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *identityLister) Get(namespace, name string) (*Identity, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: IdentityGroupVersionKind.Group,
|
||||
Resource: "identity",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*Identity), nil
|
||||
}
|
||||
|
||||
type identityController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *identityController) Lister() IdentityLister {
|
||||
return &identityLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *identityController) AddHandler(handler IdentityHandlerFunc) {
|
||||
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.(*Identity))
|
||||
})
|
||||
}
|
||||
|
||||
type identityFactory struct {
|
||||
}
|
||||
|
||||
func (c identityFactory) Object() runtime.Object {
|
||||
return &Identity{}
|
||||
}
|
||||
|
||||
func (c identityFactory) List() runtime.Object {
|
||||
return &IdentityList{}
|
||||
}
|
||||
|
||||
func (s *identityClient) Controller() IdentityController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.identityControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(IdentityGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &identityController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.identityControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type identityClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller IdentityController
|
||||
}
|
||||
|
||||
func (s *identityClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *identityClient) Create(o *Identity) (*Identity, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*Identity), err
|
||||
}
|
||||
|
||||
func (s *identityClient) Get(name string, opts metav1.GetOptions) (*Identity, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*Identity), err
|
||||
}
|
||||
|
||||
func (s *identityClient) Update(o *Identity) (*Identity, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*Identity), err
|
||||
}
|
||||
|
||||
func (s *identityClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *identityClient) List(opts metav1.ListOptions) (*IdentityList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*IdentityList), err
|
||||
}
|
||||
|
||||
func (s *identityClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *identityClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type IdentityLifecycle interface {
|
||||
Create(obj *Identity) (*Identity, error)
|
||||
Remove(obj *Identity) (*Identity, error)
|
||||
Updated(obj *Identity) (*Identity, error)
|
||||
}
|
||||
|
||||
type identityLifecycleAdapter struct {
|
||||
lifecycle IdentityLifecycle
|
||||
}
|
||||
|
||||
func (w *identityLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*Identity))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *identityLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*Identity))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *identityLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*Identity))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewIdentityLifecycleAdapter(name string, client IdentityInterface, l IdentityLifecycle) IdentityHandlerFunc {
|
||||
adapter := &identityLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
|
||||
return func(key string, obj *Identity) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
112
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
112
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
@ -18,6 +18,8 @@ type Interface interface {
|
||||
MachineDriversGetter
|
||||
MachineTemplatesGetter
|
||||
ProjectsGetter
|
||||
GlobalRolesGetter
|
||||
GlobalRoleBindingsGetter
|
||||
RoleTemplatesGetter
|
||||
PodSecurityPolicyTemplatesGetter
|
||||
ClusterRoleTemplateBindingsGetter
|
||||
@ -28,11 +30,11 @@ type Interface interface {
|
||||
CatalogsGetter
|
||||
TemplatesGetter
|
||||
TemplateVersionsGetter
|
||||
IdentitiesGetter
|
||||
TokensGetter
|
||||
UsersGetter
|
||||
GroupsGetter
|
||||
GroupMembersGetter
|
||||
PrincipalsGetter
|
||||
TokensGetter
|
||||
UsersGetter
|
||||
DynamicSchemasGetter
|
||||
}
|
||||
|
||||
@ -45,6 +47,8 @@ type Client struct {
|
||||
machineDriverControllers map[string]MachineDriverController
|
||||
machineTemplateControllers map[string]MachineTemplateController
|
||||
projectControllers map[string]ProjectController
|
||||
globalRoleControllers map[string]GlobalRoleController
|
||||
globalRoleBindingControllers map[string]GlobalRoleBindingController
|
||||
roleTemplateControllers map[string]RoleTemplateController
|
||||
podSecurityPolicyTemplateControllers map[string]PodSecurityPolicyTemplateController
|
||||
clusterRoleTemplateBindingControllers map[string]ClusterRoleTemplateBindingController
|
||||
@ -55,11 +59,11 @@ type Client struct {
|
||||
catalogControllers map[string]CatalogController
|
||||
templateControllers map[string]TemplateController
|
||||
templateVersionControllers map[string]TemplateVersionController
|
||||
identityControllers map[string]IdentityController
|
||||
tokenControllers map[string]TokenController
|
||||
userControllers map[string]UserController
|
||||
groupControllers map[string]GroupController
|
||||
groupMemberControllers map[string]GroupMemberController
|
||||
principalControllers map[string]PrincipalController
|
||||
tokenControllers map[string]TokenController
|
||||
userControllers map[string]UserController
|
||||
dynamicSchemaControllers map[string]DynamicSchemaController
|
||||
}
|
||||
|
||||
@ -81,6 +85,8 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
machineDriverControllers: map[string]MachineDriverController{},
|
||||
machineTemplateControllers: map[string]MachineTemplateController{},
|
||||
projectControllers: map[string]ProjectController{},
|
||||
globalRoleControllers: map[string]GlobalRoleController{},
|
||||
globalRoleBindingControllers: map[string]GlobalRoleBindingController{},
|
||||
roleTemplateControllers: map[string]RoleTemplateController{},
|
||||
podSecurityPolicyTemplateControllers: map[string]PodSecurityPolicyTemplateController{},
|
||||
clusterRoleTemplateBindingControllers: map[string]ClusterRoleTemplateBindingController{},
|
||||
@ -91,11 +97,11 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
catalogControllers: map[string]CatalogController{},
|
||||
templateControllers: map[string]TemplateController{},
|
||||
templateVersionControllers: map[string]TemplateVersionController{},
|
||||
identityControllers: map[string]IdentityController{},
|
||||
tokenControllers: map[string]TokenController{},
|
||||
userControllers: map[string]UserController{},
|
||||
groupControllers: map[string]GroupController{},
|
||||
groupMemberControllers: map[string]GroupMemberController{},
|
||||
principalControllers: map[string]PrincipalController{},
|
||||
tokenControllers: map[string]TokenController{},
|
||||
userControllers: map[string]UserController{},
|
||||
dynamicSchemaControllers: map[string]DynamicSchemaController{},
|
||||
}, nil
|
||||
}
|
||||
@ -164,6 +170,32 @@ func (c *Client) Projects(namespace string) ProjectInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type GlobalRolesGetter interface {
|
||||
GlobalRoles(namespace string) GlobalRoleInterface
|
||||
}
|
||||
|
||||
func (c *Client) GlobalRoles(namespace string) GlobalRoleInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalRoleResource, GlobalRoleGroupVersionKind, globalRoleFactory{})
|
||||
return &globalRoleClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type GlobalRoleBindingsGetter interface {
|
||||
GlobalRoleBindings(namespace string) GlobalRoleBindingInterface
|
||||
}
|
||||
|
||||
func (c *Client) GlobalRoleBindings(namespace string) GlobalRoleBindingInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalRoleBindingResource, GlobalRoleBindingGroupVersionKind, globalRoleBindingFactory{})
|
||||
return &globalRoleBindingClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type RoleTemplatesGetter interface {
|
||||
RoleTemplates(namespace string) RoleTemplateInterface
|
||||
}
|
||||
@ -294,13 +326,39 @@ func (c *Client) TemplateVersions(namespace string) TemplateVersionInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type IdentitiesGetter interface {
|
||||
Identities(namespace string) IdentityInterface
|
||||
type GroupsGetter interface {
|
||||
Groups(namespace string) GroupInterface
|
||||
}
|
||||
|
||||
func (c *Client) Identities(namespace string) IdentityInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &IdentityResource, IdentityGroupVersionKind, identityFactory{})
|
||||
return &identityClient{
|
||||
func (c *Client) Groups(namespace string) GroupInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupResource, GroupGroupVersionKind, groupFactory{})
|
||||
return &groupClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type GroupMembersGetter interface {
|
||||
GroupMembers(namespace string) GroupMemberInterface
|
||||
}
|
||||
|
||||
func (c *Client) GroupMembers(namespace string) GroupMemberInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupMemberResource, GroupMemberGroupVersionKind, groupMemberFactory{})
|
||||
return &groupMemberClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type PrincipalsGetter interface {
|
||||
Principals(namespace string) PrincipalInterface
|
||||
}
|
||||
|
||||
func (c *Client) Principals(namespace string) PrincipalInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PrincipalResource, PrincipalGroupVersionKind, principalFactory{})
|
||||
return &principalClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
@ -333,32 +391,6 @@ func (c *Client) Users(namespace string) UserInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type GroupsGetter interface {
|
||||
Groups(namespace string) GroupInterface
|
||||
}
|
||||
|
||||
func (c *Client) Groups(namespace string) GroupInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupResource, GroupGroupVersionKind, groupFactory{})
|
||||
return &groupClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type GroupMembersGetter interface {
|
||||
GroupMembers(namespace string) GroupMemberInterface
|
||||
}
|
||||
|
||||
func (c *Client) GroupMembers(namespace string) GroupMemberInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GroupMemberResource, GroupMemberGroupVersionKind, groupMemberFactory{})
|
||||
return &groupMemberClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type DynamicSchemasGetter interface {
|
||||
DynamicSchemas(namespace string) DynamicSchemaInterface
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
MachineGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Machine",
|
||||
}
|
||||
MachineResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type MachineInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() MachineController
|
||||
AddSyncHandler(sync MachineHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle MachineLifecycle)
|
||||
}
|
||||
|
||||
type machineLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *machineClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
func (s *machineClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *machineClient) AddSyncHandler(sync MachineHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *machineClient) AddLifecycle(name string, lifecycle MachineLifecycle) {
|
||||
sync := NewMachineLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
MachineDriverGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "MachineDriver",
|
||||
}
|
||||
MachineDriverResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type MachineDriverInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() MachineDriverController
|
||||
AddSyncHandler(sync MachineDriverHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle MachineDriverLifecycle)
|
||||
}
|
||||
|
||||
type machineDriverLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *machineDriverClient) Watch(opts metav1.ListOptions) (watch.Interface, e
|
||||
func (s *machineDriverClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *machineDriverClient) AddSyncHandler(sync MachineDriverHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *machineDriverClient) AddLifecycle(name string, lifecycle MachineDriverLifecycle) {
|
||||
sync := NewMachineDriverLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
MachineTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "MachineTemplate",
|
||||
}
|
||||
MachineTemplateResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type MachineTemplateInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() MachineTemplateController
|
||||
AddSyncHandler(sync MachineTemplateHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle MachineTemplateLifecycle)
|
||||
}
|
||||
|
||||
type machineTemplateLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *machineTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface,
|
||||
func (s *machineTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *machineTemplateClient) AddSyncHandler(sync MachineTemplateHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *machineTemplateClient) AddLifecycle(name string, lifecycle MachineTemplateLifecycle) {
|
||||
sync := NewMachineTemplateLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
PodSecurityPolicyTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "PodSecurityPolicyTemplate",
|
||||
}
|
||||
PodSecurityPolicyTemplateResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type PodSecurityPolicyTemplateInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() PodSecurityPolicyTemplateController
|
||||
AddSyncHandler(sync PodSecurityPolicyTemplateHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle PodSecurityPolicyTemplateLifecycle)
|
||||
}
|
||||
|
||||
type podSecurityPolicyTemplateLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *podSecurityPolicyTemplateClient) Watch(opts metav1.ListOptions) (watch.
|
||||
func (s *podSecurityPolicyTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyTemplateClient) AddSyncHandler(sync PodSecurityPolicyTemplateHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *podSecurityPolicyTemplateClient) AddLifecycle(name string, lifecycle PodSecurityPolicyTemplateLifecycle) {
|
||||
sync := NewPodSecurityPolicyTemplateLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_controller.go
generated
vendored
Normal file
204
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_controller.go
generated
vendored
Normal file
@ -0,0 +1,204 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
PrincipalGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Principal",
|
||||
}
|
||||
PrincipalResource = metav1.APIResource{
|
||||
Name: "principals",
|
||||
SingularName: "principal",
|
||||
Namespaced: false,
|
||||
Kind: PrincipalGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type PrincipalList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Principal
|
||||
}
|
||||
|
||||
type PrincipalHandlerFunc func(key string, obj *Principal) error
|
||||
|
||||
type PrincipalLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*Principal, err error)
|
||||
Get(namespace, name string) (*Principal, error)
|
||||
}
|
||||
|
||||
type PrincipalController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() PrincipalLister
|
||||
AddHandler(handler PrincipalHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type PrincipalInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*Principal) (*Principal, error)
|
||||
Get(name string, opts metav1.GetOptions) (*Principal, error)
|
||||
Update(*Principal) (*Principal, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*PrincipalList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() PrincipalController
|
||||
AddSyncHandler(sync PrincipalHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle PrincipalLifecycle)
|
||||
}
|
||||
|
||||
type principalLister struct {
|
||||
controller *principalController
|
||||
}
|
||||
|
||||
func (l *principalLister) List(namespace string, selector labels.Selector) (ret []*Principal, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*Principal))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *principalLister) Get(namespace, name string) (*Principal, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: PrincipalGroupVersionKind.Group,
|
||||
Resource: "principal",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*Principal), nil
|
||||
}
|
||||
|
||||
type principalController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *principalController) Lister() PrincipalLister {
|
||||
return &principalLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *principalController) AddHandler(handler PrincipalHandlerFunc) {
|
||||
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.(*Principal))
|
||||
})
|
||||
}
|
||||
|
||||
type principalFactory struct {
|
||||
}
|
||||
|
||||
func (c principalFactory) Object() runtime.Object {
|
||||
return &Principal{}
|
||||
}
|
||||
|
||||
func (c principalFactory) List() runtime.Object {
|
||||
return &PrincipalList{}
|
||||
}
|
||||
|
||||
func (s *principalClient) Controller() PrincipalController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.principalControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(PrincipalGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &principalController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.principalControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type principalClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller PrincipalController
|
||||
}
|
||||
|
||||
func (s *principalClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *principalClient) Create(o *Principal) (*Principal, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*Principal), err
|
||||
}
|
||||
|
||||
func (s *principalClient) Get(name string, opts metav1.GetOptions) (*Principal, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*Principal), err
|
||||
}
|
||||
|
||||
func (s *principalClient) Update(o *Principal) (*Principal, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*Principal), err
|
||||
}
|
||||
|
||||
func (s *principalClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *principalClient) List(opts metav1.ListOptions) (*PrincipalList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*PrincipalList), err
|
||||
}
|
||||
|
||||
func (s *principalClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *principalClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *principalClient) AddSyncHandler(sync PrincipalHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *principalClient) AddLifecycle(name string, lifecycle PrincipalLifecycle) {
|
||||
sync := NewPrincipalLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_lifecycle_adapter.go
generated
vendored
Normal file
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_lifecycle_adapter.go
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type PrincipalLifecycle interface {
|
||||
Create(obj *Principal) (*Principal, error)
|
||||
Remove(obj *Principal) (*Principal, error)
|
||||
Updated(obj *Principal) (*Principal, error)
|
||||
}
|
||||
|
||||
type principalLifecycleAdapter struct {
|
||||
lifecycle PrincipalLifecycle
|
||||
}
|
||||
|
||||
func (w *principalLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*Principal))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *principalLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*Principal))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *principalLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*Principal))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewPrincipalLifecycleAdapter(name string, client PrincipalInterface, l PrincipalLifecycle) PrincipalHandlerFunc {
|
||||
adapter := &principalLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
|
||||
return func(key string, obj *Principal) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ProjectGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Project",
|
||||
}
|
||||
ProjectResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ProjectInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectController
|
||||
AddSyncHandler(sync ProjectHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ProjectLifecycle)
|
||||
}
|
||||
|
||||
type projectLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *projectClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
func (s *projectClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *projectClient) AddSyncHandler(sync ProjectHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *projectClient) AddLifecycle(name string, lifecycle ProjectLifecycle) {
|
||||
sync := NewProjectLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
ProjectRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ProjectRoleTemplateBinding",
|
||||
}
|
||||
ProjectRoleTemplateBindingResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type ProjectRoleTemplateBindingInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectRoleTemplateBindingController
|
||||
AddSyncHandler(sync ProjectRoleTemplateBindingHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ProjectRoleTemplateBindingLifecycle)
|
||||
}
|
||||
|
||||
type projectRoleTemplateBindingLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *projectRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch
|
||||
func (s *projectRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) AddSyncHandler(sync ProjectRoleTemplateBindingHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *projectRoleTemplateBindingClient) AddLifecycle(name string, lifecycle ProjectRoleTemplateBindingLifecycle) {
|
||||
sync := NewProjectRoleTemplateBindingLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
RoleTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "RoleTemplate",
|
||||
}
|
||||
RoleTemplateResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type RoleTemplateInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() RoleTemplateController
|
||||
AddSyncHandler(sync RoleTemplateHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle RoleTemplateLifecycle)
|
||||
}
|
||||
|
||||
type roleTemplateLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *roleTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, er
|
||||
func (s *roleTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) AddSyncHandler(sync RoleTemplateHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *roleTemplateClient) AddLifecycle(name string, lifecycle RoleTemplateLifecycle) {
|
||||
sync := NewRoleTemplateLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
82
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go
generated
vendored
Normal file
82
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
const (
|
||||
GroupName = "management.cattle.io"
|
||||
Version = "v3"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
// TODO this gets cleaned up when the types are fixed
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
|
||||
&Machine{},
|
||||
&MachineList{},
|
||||
&MachineDriver{},
|
||||
&MachineDriverList{},
|
||||
&MachineTemplate{},
|
||||
&MachineTemplateList{},
|
||||
&Project{},
|
||||
&ProjectList{},
|
||||
&GlobalRole{},
|
||||
&GlobalRoleList{},
|
||||
&GlobalRoleBinding{},
|
||||
&GlobalRoleBindingList{},
|
||||
&RoleTemplate{},
|
||||
&RoleTemplateList{},
|
||||
&PodSecurityPolicyTemplate{},
|
||||
&PodSecurityPolicyTemplateList{},
|
||||
&ClusterRoleTemplateBinding{},
|
||||
&ClusterRoleTemplateBindingList{},
|
||||
&ProjectRoleTemplateBinding{},
|
||||
&ProjectRoleTemplateBindingList{},
|
||||
&Cluster{},
|
||||
&ClusterList{},
|
||||
&ClusterEvent{},
|
||||
&ClusterEventList{},
|
||||
&ClusterRegistrationToken{},
|
||||
&ClusterRegistrationTokenList{},
|
||||
&Catalog{},
|
||||
&CatalogList{},
|
||||
&Template{},
|
||||
&TemplateList{},
|
||||
&TemplateVersion{},
|
||||
&TemplateVersionList{},
|
||||
&Group{},
|
||||
&GroupList{},
|
||||
&GroupMember{},
|
||||
&GroupMemberList{},
|
||||
&Principal{},
|
||||
&PrincipalList{},
|
||||
&Token{},
|
||||
&TokenList{},
|
||||
&User{},
|
||||
&UserList{},
|
||||
&DynamicSchema{},
|
||||
&DynamicSchemaList{},
|
||||
)
|
||||
return nil
|
||||
}
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
TemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Template",
|
||||
}
|
||||
TemplateResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type TemplateInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() TemplateController
|
||||
AddSyncHandler(sync TemplateHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle TemplateLifecycle)
|
||||
}
|
||||
|
||||
type templateLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *templateClient) Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
func (s *templateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *templateClient) AddSyncHandler(sync TemplateHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *templateClient) AddLifecycle(name string, lifecycle TemplateLifecycle) {
|
||||
sync := NewTemplateLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
TemplateVersionGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "TemplateVersion",
|
||||
}
|
||||
TemplateVersionResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type TemplateVersionInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() TemplateVersionController
|
||||
AddSyncHandler(sync TemplateVersionHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle TemplateVersionLifecycle)
|
||||
}
|
||||
|
||||
type templateVersionLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *templateVersionClient) Watch(opts metav1.ListOptions) (watch.Interface,
|
||||
func (s *templateVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *templateVersionClient) AddSyncHandler(sync TemplateVersionHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *templateVersionClient) AddLifecycle(name string, lifecycle TemplateVersionLifecycle) {
|
||||
sync := NewTemplateVersionLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
TokenGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Token",
|
||||
}
|
||||
TokenResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type TokenInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() TokenController
|
||||
AddSyncHandler(sync TokenHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle TokenLifecycle)
|
||||
}
|
||||
|
||||
type tokenLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *tokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
func (s *tokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *tokenClient) AddSyncHandler(sync TokenHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *tokenClient) AddLifecycle(name string, lifecycle TokenLifecycle) {
|
||||
sync := NewTokenLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
|
||||
var (
|
||||
UserGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "User",
|
||||
}
|
||||
UserResource = metav1.APIResource{
|
||||
@ -60,6 +60,8 @@ type UserInterface interface {
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() UserController
|
||||
AddSyncHandler(sync UserHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle UserLifecycle)
|
||||
}
|
||||
|
||||
type userLister struct {
|
||||
@ -191,3 +193,12 @@ func (s *userClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
func (s *userClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *userClient) AddSyncHandler(sync UserHandlerFunc) {
|
||||
s.Controller().AddHandler(sync)
|
||||
}
|
||||
|
||||
func (s *userClient) AddLifecycle(name string, lifecycle UserLifecycle) {
|
||||
sync := NewUserLifecycleAdapter(name, s, lifecycle)
|
||||
s.AddSyncHandler(sync)
|
||||
}
|
||||
|
2
vendor/github.com/rancher/types/vendor.conf
generated
vendored
2
vendor/github.com/rancher/types/vendor.conf
generated
vendored
@ -3,5 +3,5 @@ github.com/rancher/types
|
||||
|
||||
k8s.io/kubernetes v1.8.3 transitive=true,staging=true
|
||||
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
||||
github.com/rancher/norman 8c0d4bfe2e63a801e4e21906d6b37a5173dadcbb
|
||||
github.com/rancher/norman 550db511ba72a75c4a921cf4b1a94d2075fdaaf1
|
||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||
|
Loading…
Reference in New Issue
Block a user