From cb655b4959623a45f9cef076abe421fd42ba95d2 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 3 Apr 2020 19:24:47 -0700 Subject: [PATCH] Handle namespaces in the mirage handler for volumes --- ui/mirage/config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/mirage/config.js b/ui/mirage/config.js index 3978c9c5e..367dc67ba 100644 --- a/ui/mirage/config.js +++ b/ui/mirage/config.js @@ -234,7 +234,13 @@ export default function() { return new Response(200, {}, '[]'); } - return this.serialize(csiVolumes.all()); + const json = this.serialize(csiVolumes.all()); + const namespace = queryParams.namespace || 'default'; + return json.filter(volume => + namespace === 'default' + ? !volume.NamespaceID || volume.NamespaceID === namespace + : volume.NamespaceID === namespace + ); }) );