Moving warewulfd code around and implementing new API for config.*()

This commit is contained in:
Gregory Kurtzer
2020-11-11 22:16:24 -08:00
parent 9a9672a060
commit fa2a7e26d3
18 changed files with 140 additions and 447 deletions

View File

@@ -0,0 +1,27 @@
package warewulfd
import (
warewulfd_responses "github.com/hpcng/warewulf/internal/app/warewulfd/warewulfd-reponses"
"github.com/spf13/cobra"
"net/http"
)
// TODO: https://github.com/danderson/netboot/blob/master/pixiecore/dhcp.go
// TODO: https://github.com/pin/tftp
//const LocalStateDir = "/var/warewulf"
func CobraRunE(cmd *cobra.Command, args []string) error {
http.HandleFunc("/ipxe/", warewulfd_responses.IpxeSend)
http.HandleFunc("/kernel/", warewulfd_responses.KernelSend)
http.HandleFunc("/kmods/", warewulfd_responses.KmodsSend)
http.HandleFunc("/vnfs/", warewulfd_responses.VnfsSend)
http.HandleFunc("/overlay-system/", warewulfd_responses.SystemOverlaySend)
http.HandleFunc("/overlay-runtime", warewulfd_responses.RuntimeOverlaySend)
http.ListenAndServe(":9873", nil)
return nil
}