Forráskód Böngészése

Add libvirt provider support

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu 2 hónapja
szülő
commit
d773396c75

+ 2 - 0
config.ts

@@ -169,6 +169,7 @@ const conf: Config = {
     rhev: 3,
     metal: 4,
     lxd: 4,
+    libvirt: 4,
   },
 
   providerNames: {
@@ -191,6 +192,7 @@ const conf: Config = {
     rhev: "Red Hat",
     lxd: "LXD",
     proxmox: "Proxmox VE",
+    libvirt: "Libvirt",
   },
 
   // The list of providers for which to disable setting the 'Execute Now Options' field

+ 2 - 1
src/@types/Providers.ts

@@ -31,7 +31,8 @@ export type ProviderTypes =
   | "harvester"
   | "metal"
   | "rhev"
-  | "lxd";
+  | "lxd"
+  | "libvirt";
 
 export type Providers = {
   [provider in ProviderTypes]: {

+ 2 - 0
src/plugins/index.ts

@@ -22,6 +22,7 @@ import OpcaConnectionSchemaPlugin from "./opca/ConnectionSchemaPlugin";
 import O3cConnectionSchemaPlugin from "./o3c/ConnectionSchemaPlugin";
 import KubevirtConnectionSchemaPlugin from "./kubevirt/ConnectionSchemaPlugin";
 import HarvesterConnectionSchemaPlugin from "./harvester/ConnectionSchemaPlugin";
+import LibvirtConnectionSchemaPlugin from "./libvirt/ConnectionSchemaPlugin";
 
 import DefaultContentPlugin from "./default/ContentPlugin";
 import AzureContentPlugin from "./azure/ContentPlugin";
@@ -61,6 +62,7 @@ export const ConnectionSchemaPlugin = {
       o3c: new O3cConnectionSchemaPlugin(),
       kubevirt: new KubevirtConnectionSchemaPlugin(),
       harvester: new HarvesterConnectionSchemaPlugin(),
+      libvirt: new LibvirtConnectionSchemaPlugin(),
     };
     if (hasKey(map, provider)) {
       return map[provider];

+ 17 - 0
src/plugins/libvirt/ConnectionSchemaPlugin.ts

@@ -0,0 +1,17 @@
+/*
+Copyright (C) 2026  Cloudbase Solutions SRL
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import ConnectionSchemaParserBase from "@src/plugins/default/ConnectionSchemaPlugin";
+
+export default class LibvirtConnectionSchemaPlugin extends ConnectionSchemaParserBase {}

+ 3 - 0
tests/mocks/ProvidersMock.ts

@@ -56,6 +56,9 @@ export const PROVIDERS_MOCK: Providers = {
   lxd: {
     types: [],
   },
+  libvirt: {
+    types: [],
+  },
   vhi: {
     types: [],
   },