const VERSION="3.5.5";
const SRC=src;
const DEST=dest;
const DOIT=config.apply;
const PURGE=config.purge;
const crdFiles=[
    "apiextensions.k8s.io_v1_CustomResourceDefinition_cdis.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_cdiconfigs.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_dataimportcrons.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_datasources.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_datavolumes.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_objecttransfers.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_storageprofiles.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_volumeclonesources.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_volumeimportsources.cdi.kubevirt.io.yaml",
    "apiextensions.k8s.io_v1_CustomResourceDefinition_volumeuploadsources.cdi.kubevirt.io.yaml",
];
fn pre_install() {
    if ! global::DOIT {
        return;
    }
    for file in global::crdFiles {
        shell(`kubectl replace -f ${global::SRC}/${file} || kubectl create -f ${global::SRC}/${file}`);
    }
}
fn post_destroy() {
    if ! global::PURGE {
        return;
    }
    for file in global::crdFiles {
        shell(`kubectl delete -f ${global::SRC}/${file}`);
    }
}
