nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

Refactor ProxMox module, cosmetic fixes, better string logic #1383

Closed asyslinux closed 1 year ago

asyslinux commented 1 year ago

This pull request contains cosmetic changes, minor refactoring, capitalization of option names in the configuration file. Removed unnecessary type conversions and checks. Everything is converted to a string type.

Example of config.json for Proxmox module (Current state):

{
    "Dirs": ["etc"],
    "NameServers": ["172.21.1.51"],
    "ManifestPassthrough": {
        "syslog": {
            "server": "172.21.1.51"
        }
    },
    "TargetConfig": {
        "Arch": "x86_64",
        "Machine": "q35",
        "Sockets": "1",
        "Cores": "8",
        "Numa": "0",
        "Memory": "4096M",
        "BridgePrefix": "vmbr",
        "IsoStorageName": "local",
        "StorageName": "local-lvm",
        "Protection": "0",
        "Onboot": "1"
    },
    "RunConfig": {
        "Klibs": ["syslog"],
        "Accel": true,
        "InstanceName": "usd",
        "ImageName": "usd",
        "Nics": [
            {"IPAddress": "0.0.0.0", "NetMask": "255.255.255.0"},
            {"IPAddress": "172.21.1.73", "NetMask": "255.255.255.0", "Gateway": "172.21.1.51"}
        ],
        "Verbose": true,
        "ShowErrors": true,
        "ShowWarnings": true
    }
}
eyberg commented 1 year ago

while i'd prob prefer to keep ints as ints i agree it's a bit silly to take a string, convert to int and then immediately convert it back to string