mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 16:40:21 +00:00
client-go/cache: support errors.Unwrap for KeyError
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io> Kubernetes-commit: 85fa121f84ee33bdc8d77e7a35d1f4d2c063c28f
This commit is contained in:
committed by
Kubernetes Publisher
parent
4e267f6cae
commit
fc03592e80
5
tools/cache/store.go
vendored
5
tools/cache/store.go
vendored
@@ -85,6 +85,11 @@ func (k KeyError) Error() string {
|
||||
return fmt.Sprintf("couldn't create key for object %+v: %v", k.Obj, k.Err)
|
||||
}
|
||||
|
||||
// Unwrap implements errors.Unwrap
|
||||
func (k KeyError) Unwrap() error {
|
||||
return k.Err
|
||||
}
|
||||
|
||||
// ExplicitKey can be passed to MetaNamespaceKeyFunc if you have the key for
|
||||
// the object but not the object itself.
|
||||
type ExplicitKey string
|
||||
|
Reference in New Issue
Block a user