Update godeps
This commit is contained in:
parent
423433bc5f
commit
701c5a0e30
482 changed files with 86915 additions and 19741 deletions
6
vendor/k8s.io/kubernetes/pkg/storage/OWNERS
generated
vendored
Normal file
6
vendor/k8s.io/kubernetes/pkg/storage/OWNERS
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
assignees:
|
||||
- lavalamp
|
||||
- liggitt
|
||||
- timothysc
|
||||
- wojtek-t
|
||||
- xiang90
|
||||
48
vendor/k8s.io/kubernetes/pkg/storage/cacher.go
generated
vendored
48
vendor/k8s.io/kubernetes/pkg/storage/cacher.go
generated
vendored
|
|
@ -18,6 +18,7 @@ package storage
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -25,8 +26,10 @@ import (
|
|||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
|
|
@ -259,7 +262,10 @@ func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string,
|
|||
defer c.watchCache.RUnlock()
|
||||
initEvents, err := c.watchCache.GetAllEventsSinceThreadUnsafe(watchRV)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// To match the uncached watch implementation, once we have passed authn/authz/admission,
|
||||
// and successfully parsed a resource version, other errors must fail with a watch event of type ERROR,
|
||||
// rather than a directly returned error.
|
||||
return newErrWatcher(err), nil
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
|
|
@ -455,6 +461,46 @@ func (lw *cacherListerWatcher) Watch(options api.ListOptions) (watch.Interface,
|
|||
return lw.storage.WatchList(context.TODO(), lw.resourcePrefix, options.ResourceVersion, Everything)
|
||||
}
|
||||
|
||||
// cacherWatch implements watch.Interface to return a single error
|
||||
type errWatcher struct {
|
||||
result chan watch.Event
|
||||
}
|
||||
|
||||
func newErrWatcher(err error) *errWatcher {
|
||||
// Create an error event
|
||||
errEvent := watch.Event{Type: watch.Error}
|
||||
switch err := err.(type) {
|
||||
case runtime.Object:
|
||||
errEvent.Object = err
|
||||
case *errors.StatusError:
|
||||
errEvent.Object = &err.ErrStatus
|
||||
default:
|
||||
errEvent.Object = &unversioned.Status{
|
||||
Status: unversioned.StatusFailure,
|
||||
Message: err.Error(),
|
||||
Reason: unversioned.StatusReasonInternalError,
|
||||
Code: http.StatusInternalServerError,
|
||||
}
|
||||
}
|
||||
|
||||
// Create a watcher with room for a single event, populate it, and close the channel
|
||||
watcher := &errWatcher{result: make(chan watch.Event, 1)}
|
||||
watcher.result <- errEvent
|
||||
close(watcher.result)
|
||||
|
||||
return watcher
|
||||
}
|
||||
|
||||
// Implements watch.Interface.
|
||||
func (c *errWatcher) ResultChan() <-chan watch.Event {
|
||||
return c.result
|
||||
}
|
||||
|
||||
// Implements watch.Interface.
|
||||
func (c *errWatcher) Stop() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
// cacherWatch implements watch.Interface
|
||||
type cacheWatcher struct {
|
||||
sync.Mutex
|
||||
|
|
|
|||
2
vendor/k8s.io/kubernetes/pkg/storage/interfaces.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/interfaces.go
generated
vendored
|
|
@ -129,7 +129,7 @@ type Interface interface {
|
|||
// GuaranteedUpdate keeps calling 'tryUpdate()' to update key 'key' (of type 'ptrToType')
|
||||
// retrying the update until success if there is index conflict.
|
||||
// Note that object passed to tryUpdate may change across invocations of tryUpdate() if
|
||||
// other writers are simultaneously updating it, to tryUpdate() needs to take into account
|
||||
// other writers are simultaneously updating it, so tryUpdate() needs to take into account
|
||||
// the current contents of the object when deciding how the update object should look.
|
||||
// If the key doesn't exist, it will return NotFound storage error if ignoreNotFound=false
|
||||
// or zero value in 'ptrToType' parameter otherwise.
|
||||
|
|
|
|||
8
vendor/k8s.io/kubernetes/pkg/storage/util.go
generated
vendored
8
vendor/k8s.io/kubernetes/pkg/storage/util.go
generated
vendored
|
|
@ -71,8 +71,8 @@ func NamespaceKeyFunc(prefix string, obj runtime.Object) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
name := meta.GetName()
|
||||
if ok, msg := validation.IsValidPathSegmentName(name); !ok {
|
||||
return "", fmt.Errorf("invalid name: %v", msg)
|
||||
if msgs := validation.IsValidPathSegmentName(name); len(msgs) != 0 {
|
||||
return "", fmt.Errorf("invalid name: %v", msgs)
|
||||
}
|
||||
return prefix + "/" + meta.GetNamespace() + "/" + name, nil
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ func NoNamespaceKeyFunc(prefix string, obj runtime.Object) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
name := meta.GetName()
|
||||
if ok, msg := validation.IsValidPathSegmentName(name); !ok {
|
||||
return "", fmt.Errorf("invalid name: %v", msg)
|
||||
if msgs := validation.IsValidPathSegmentName(name); len(msgs) != 0 {
|
||||
return "", fmt.Errorf("invalid name: %v", msgs)
|
||||
}
|
||||
return prefix + "/" + name, nil
|
||||
}
|
||||
|
|
|
|||
5
vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go
generated
vendored
5
vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go
generated
vendored
|
|
@ -324,3 +324,8 @@ func (w *watchCache) GetAllEventsSince(resourceVersion uint64) ([]watchCacheEven
|
|||
defer w.RUnlock()
|
||||
return w.GetAllEventsSinceThreadUnsafe(resourceVersion)
|
||||
}
|
||||
|
||||
func (w *watchCache) Resync() error {
|
||||
// Nothing to do
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue