From 8b53e19ef75f47d0db4ed83e68fb9fe54f68133f Mon Sep 17 00:00:00 2001 From: Mike Russell Date: Thu, 25 May 2023 16:54:07 -0700 Subject: [PATCH] fix: Toss Out Invalid Amount On VFs For SR-IOV * toss out anything less than or equal to zero for the SR-IOV device virtual function addresses * avoid making an API call out to the endpoint, reducing network chatter Resolves: github.com/harvester/harvester/issues/3977 --- pkg/harvester/dialog/EnableSriovDevice.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/harvester/dialog/EnableSriovDevice.vue b/pkg/harvester/dialog/EnableSriovDevice.vue index b0c47ab56de..1e665f06cd4 100644 --- a/pkg/harvester/dialog/EnableSriovDevice.vue +++ b/pkg/harvester/dialog/EnableSriovDevice.vue @@ -39,6 +39,12 @@ export default { try { this.resources[0].spec.numVFs = this.numVFs; + if (this.resources[0].spec.numVFs <= 0) { + this.resources[0].spec.numVFs = 0; + this.numVFs = 0; + this.close(); + return; + } await actionResource.save(); buttonCb(true); this.close();