From 03619f805594d447036225cd96eab4161e3b26e3 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Mon, 21 Sep 2026 17:27:16 +0800 Subject: [PATCH] chore(utils.nu): drop the dead upload-vm helper It wrote a built image into a KubeVirt DataVolume over the CDI upload proxy; with KubeVirt gone (and the Justfile callers removed) it is dead code. --- utils.nu | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/utils.nu b/utils.nu index 37914aae..9f4716a1 100644 --- a/utils.nu +++ b/utils.nu @@ -72,32 +72,3 @@ export def darwin-switch [ export def darwin-rollback [] { ./result/sw/bin/darwin-rebuild --rollback } - -# ==================== Virtual Machines related ===================== - -# Build and upload a VM image -export def upload-vm [ - name: string - size: string - verbosity: string -] { - print $"upload-vm '($name)' with '($verbosity)' verbosity..." - print (repeat-str "=" 50) - let target = $".#($name)" - if "debug" == $verbosity { - nom build $target --show-trace --verbose - } else { - nix build $target - } - - # Write the freshly built image straight into the VM's own root disk (a - # DataVolume with `source: upload` in k8s-gitops). CDI only accepts an - # upload into a DataVolume, and this way the disk is populated once, on the - # node the VM is pinned to. - # - # Requires the CDI upload proxy to be reachable from here; it is exposed - # as a NodePort by the cluster. - let uploadProxyUrl = "https://192.168.5.181:30443" - let image = (glob result/nixos-image-*.qcow2 | first) - virtctl image-upload dv $"($name)-disk" -n vms --size $size --image-path $image --uploadproxy-url $uploadProxyUrl --insecure -}