mirror of
https://github.com/rancher/rke.git
synced 2025-07-19 17:50:16 +00:00
vendor update rancher/norman
This commit is contained in:
parent
f38475e141
commit
c08d7738b2
@ -27,5 +27,5 @@ github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceafb
|
||||
github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c
|
||||
github.com/mattn/go-colorable efa589957cd060542a26d2dd7832fd6a6c6c3ade
|
||||
github.com/mattn/go-isatty 6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c
|
||||
github.com/rancher/norman 0557aa4ff31a3a0f007dcb1b684894f23cda390c
|
||||
github.com/rancher/norman ea122abac582d745a00dba0aaf946c29ee8d9d90
|
||||
github.com/rancher/types 3d66c9393f0e3472c8eaec8e5dbc41155155a021
|
||||
|
30
vendor/github.com/rancher/norman/.drone.yml
generated
vendored
30
vendor/github.com/rancher/norman/.drone.yml
generated
vendored
@ -1,9 +1,23 @@
|
||||
---
|
||||
pipeline:
|
||||
build:
|
||||
privileged: true
|
||||
image: rancher/dapper:1.11.2
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
commands:
|
||||
- dapper ci
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
pull: default
|
||||
image: rancher/dapper:1.11.2
|
||||
commands:
|
||||
- dapper ci
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: socket
|
||||
path: /var/run/docker.sock
|
||||
|
||||
volumes:
|
||||
- name: socket
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
@ -304,7 +304,7 @@ func filterConflictsError(err error) error {
|
||||
var newErrors []error
|
||||
for _, err := range errs.Errors {
|
||||
if !ignoreError(err, true) {
|
||||
newErrors = append(newErrors)
|
||||
newErrors = append(newErrors, err)
|
||||
}
|
||||
}
|
||||
return types.NewErrors(newErrors...)
|
||||
|
8
vendor/github.com/rancher/norman/httperror/error.go
generated
vendored
8
vendor/github.com/rancher/norman/httperror/error.go
generated
vendored
@ -105,6 +105,14 @@ func IsAPIError(err error) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsNotFound(err error) bool {
|
||||
if apiError, ok := err.(*APIError); ok {
|
||||
return apiError.Code.Status == 404
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func IsConflict(err error) bool {
|
||||
if apiError, ok := err.(*APIError); ok {
|
||||
return apiError.Code.Status == 409
|
||||
|
7
vendor/github.com/rancher/norman/objectclient/object_client.go
generated
vendored
7
vendor/github.com/rancher/norman/objectclient/object_client.go
generated
vendored
@ -102,6 +102,13 @@ func (p *ObjectClient) Create(o runtime.Object) (runtime.Object, error) {
|
||||
labels := obj.GetLabels()
|
||||
if labels == nil {
|
||||
labels = make(map[string]string)
|
||||
} else {
|
||||
ls := make(map[string]string)
|
||||
for k, v := range labels {
|
||||
ls[k] = v
|
||||
}
|
||||
labels = ls
|
||||
|
||||
}
|
||||
labels["cattle.io/creator"] = "norman"
|
||||
obj.SetLabels(labels)
|
||||
|
38
vendor/github.com/rancher/norman/resource/resource.go
generated
vendored
Normal file
38
vendor/github.com/rancher/norman/resource/resource.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package resource
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
//rancherTypes is a set of all types generated by rancher
|
||||
var (
|
||||
rancherTypes = struct {
|
||||
sync.RWMutex
|
||||
m map[schema.GroupVersionResource]bool
|
||||
}{m: make(map[schema.GroupVersionResource]bool)}
|
||||
)
|
||||
|
||||
//Get returns a copy of the set of rancherTypes
|
||||
func Get() map[schema.GroupVersionResource]bool {
|
||||
rancherTypes.RLock()
|
||||
defer rancherTypes.RUnlock()
|
||||
targetMap := make(map[schema.GroupVersionResource]bool, len(rancherTypes.m))
|
||||
for key, value := range rancherTypes.m {
|
||||
targetMap[key] = value
|
||||
}
|
||||
return targetMap
|
||||
}
|
||||
|
||||
//Put adds an object to the set and panic on collision
|
||||
func Put(key schema.GroupVersionResource) {
|
||||
rancherTypes.Lock()
|
||||
defer rancherTypes.Unlock()
|
||||
_, exists := rancherTypes.m[key]
|
||||
if exists {
|
||||
//only used in an init function
|
||||
panic("key exists in rancherTypes")
|
||||
}
|
||||
rancherTypes.m[key] = true
|
||||
}
|
2
vendor/github.com/rancher/norman/restwatch/rest.go
generated
vendored
2
vendor/github.com/rancher/norman/restwatch/rest.go
generated
vendored
@ -21,7 +21,7 @@ func UnversionedRESTClientFor(config *rest.Config) (rest.Interface, error) {
|
||||
}
|
||||
|
||||
newConfig := *config
|
||||
newConfig.Timeout = time.Hour
|
||||
newConfig.Timeout = 30 * time.Minute
|
||||
watchClient, err := rest.UnversionedRESTClientFor(&newConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
29
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
29
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
@ -108,10 +108,16 @@ func (s *Schemas) removeReferences(schema *Schema) {
|
||||
func (s *Schemas) AddSchema(schema Schema) *Schemas {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.doAddSchema(schema)
|
||||
return s.doAddSchema(schema, false)
|
||||
}
|
||||
|
||||
func (s *Schemas) doAddSchema(schema Schema) *Schemas {
|
||||
func (s *Schemas) ForceAddSchema(schema Schema) *Schemas {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return s.doAddSchema(schema, true)
|
||||
}
|
||||
|
||||
func (s *Schemas) doAddSchema(schema Schema, replace bool) *Schemas {
|
||||
s.setupDefaults(&schema)
|
||||
|
||||
if s.AddHook != nil {
|
||||
@ -125,9 +131,20 @@ func (s *Schemas) doAddSchema(schema Schema) *Schemas {
|
||||
s.versions = append(s.versions, schema.Version)
|
||||
}
|
||||
|
||||
if _, ok := schemas[schema.ID]; !ok {
|
||||
if _, ok := schemas[schema.ID]; !ok ||
|
||||
(replace && schema.DynamicSchemaVersion != schemas[schema.ID].DynamicSchemaVersion) {
|
||||
schemas[schema.ID] = &schema
|
||||
s.schemas = append(s.schemas, &schema)
|
||||
|
||||
if replace {
|
||||
for i, candidate := range s.schemas {
|
||||
if candidate.ID == schema.ID {
|
||||
s.schemas[i] = &schema
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s.schemas = append(s.schemas, &schema)
|
||||
}
|
||||
|
||||
if !schema.Embed {
|
||||
s.addReferences(&schema)
|
||||
@ -159,7 +176,7 @@ func (s *Schemas) removeEmbed(schema *Schema) {
|
||||
}
|
||||
|
||||
s.doRemoveSchema(*target)
|
||||
s.doAddSchema(newSchema)
|
||||
s.doAddSchema(newSchema, false)
|
||||
}
|
||||
|
||||
func (s *Schemas) embed(schema *Schema) {
|
||||
@ -184,7 +201,7 @@ func (s *Schemas) embed(schema *Schema) {
|
||||
}
|
||||
|
||||
s.doRemoveSchema(*target)
|
||||
s.doAddSchema(newSchema)
|
||||
s.doAddSchema(newSchema, false)
|
||||
}
|
||||
|
||||
func (s *Schemas) addReferences(schema *Schema) {
|
||||
|
2
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
2
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
@ -184,6 +184,8 @@ type QueryOptions struct {
|
||||
Pagination *Pagination
|
||||
Conditions []*QueryCondition
|
||||
Options map[string]string
|
||||
// Set namespaces to an empty array will result in an empty response
|
||||
Namespaces []string
|
||||
}
|
||||
|
||||
type ReferenceValidator interface {
|
||||
|
39
vendor/github.com/rancher/norman/types/types.go
generated
vendored
39
vendor/github.com/rancher/norman/types/types.go
generated
vendored
@ -94,25 +94,26 @@ var NamespaceScope TypeScope = "namespace"
|
||||
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:"-"`
|
||||
Type string `json:"type,omitempty"`
|
||||
BaseType string `json:"baseType,omitempty"`
|
||||
Links map[string]string `json:"links"`
|
||||
Version APIVersion `json:"version"`
|
||||
PluralName string `json:"pluralName,omitempty"`
|
||||
ResourceMethods []string `json:"resourceMethods,omitempty"`
|
||||
ResourceFields map[string]Field `json:"resourceFields"`
|
||||
ResourceActions map[string]Action `json:"resourceActions,omitempty"`
|
||||
CollectionMethods []string `json:"collectionMethods,omitempty"`
|
||||
CollectionFields map[string]Field `json:"collectionFields,omitempty"`
|
||||
CollectionActions map[string]Action `json:"collectionActions,omitempty"`
|
||||
CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"`
|
||||
Scope TypeScope `json:"-"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Embed bool `json:"embed,omitempty"`
|
||||
EmbedType string `json:"embedType,omitempty"`
|
||||
CodeName string `json:"-"`
|
||||
CodeNamePlural string `json:"-"`
|
||||
PkgName string `json:"-"`
|
||||
Type string `json:"type,omitempty"`
|
||||
BaseType string `json:"baseType,omitempty"`
|
||||
Links map[string]string `json:"links"`
|
||||
Version APIVersion `json:"version"`
|
||||
PluralName string `json:"pluralName,omitempty"`
|
||||
ResourceMethods []string `json:"resourceMethods,omitempty"`
|
||||
ResourceFields map[string]Field `json:"resourceFields"`
|
||||
ResourceActions map[string]Action `json:"resourceActions,omitempty"`
|
||||
CollectionMethods []string `json:"collectionMethods,omitempty"`
|
||||
CollectionFields map[string]Field `json:"collectionFields,omitempty"`
|
||||
CollectionActions map[string]Action `json:"collectionActions,omitempty"`
|
||||
CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"`
|
||||
DynamicSchemaVersion string `json:"dynamicSchemaVersion,omitempty"`
|
||||
Scope TypeScope `json:"-"`
|
||||
|
||||
InternalSchema *Schema `json:"-"`
|
||||
Mapper Mapper `json:"-"`
|
||||
|
2
vendor/github.com/rancher/norman/vendor.conf
generated
vendored
2
vendor/github.com/rancher/norman/vendor.conf
generated
vendored
@ -5,4 +5,6 @@ k8s.io/kubernetes v1.12.2-lite1 https
|
||||
github.com/maruel/panicparse c0182c169410cfa80c7e8f046dad208eaef91338
|
||||
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||
golang.org/x/tools 202502a5a9245830b5ec7b877e26b67760da8e67
|
||||
github.com/gorilla/mux v1.6.1
|
||||
github.com/matryer/moq ee5226d4300902ed04c84bde4837cb123d936feb https://github.com/rancher/moq
|
Loading…
Reference in New Issue
Block a user