Unverified Commit ec6743a9 authored by Sam Foo's avatar Sam Foo Committed by GitHub
Browse files

Merge pull request #774 from GuessWhoSamFoo/pv-init

Use dynamic cache for objectstore get as fallback
parents 77e0bb6f 9c246b4c
Showing with 6 additions and 2 deletions
+6 -2
...@@ -347,7 +347,11 @@ func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.U ...@@ -347,7 +347,11 @@ func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.U
object, err := dc.getFromInformer(ctx, key) object, err := dc.getFromInformer(ctx, key)
if err != nil { if err != nil {
if kerrors.IsNotFound(err) { if kerrors.IsNotFound(err) {
return nil, nil object, err := dc.getFromDynamicClient(ctx, key)
if err != nil {
return nil, err
}
return object, nil
} }
return nil, err return nil, err
......
...@@ -74,7 +74,7 @@ func PersistentVolumeHandler(ctx context.Context, pv *v1.PersistentVolume, optio ...@@ -74,7 +74,7 @@ func PersistentVolumeHandler(ctx context.Context, pv *v1.PersistentVolume, optio
} }
if err := pvh.Status(ctx, options); err != nil { if err := pvh.Status(ctx, options); err != nil {
return nil, errors.Wrap(err, "print persisten volume claims") return nil, errors.Wrap(err, "print persistent volume claims")
} }
return obj.ToComponent(ctx, options) return obj.ToComponent(ctx, options)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment