Fixes for new APIs

This commit is contained in:
Gregory Kurtzer
2020-12-03 17:28:12 -08:00
parent 019b405758
commit be03d7b459

View File

@@ -2,14 +2,14 @@ package main
import ( import (
"fmt" "fmt"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"log" "log"
"net" "net"
"net/http" "net/http"
"os" "os"
"os/exec" "os/exec"
"time" "time"
"github.com/hpcng/warewulf/internal/pkg/config"
) )
func main() { func main() {
@@ -24,10 +24,14 @@ func main() {
os.Chdir("/warewulf/wwclient-test") os.Chdir("/warewulf/wwclient-test")
} }
config := config.New() conf, err := warewulfconf.New()
if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not get Warewulf configuration: %s\n", err)
os.Exit(1)
}
localTCPAddr := net.TCPAddr{} localTCPAddr := net.TCPAddr{}
if config.InsecureRuntime == false { if conf.Warewulf.Secure == true {
// Setup local port to something privileged (<1024) // Setup local port to something privileged (<1024)
localTCPAddr.Port = 987 localTCPAddr.Port = 987
} else { } else {
@@ -56,7 +60,7 @@ func main() {
for true { for true {
var err error var err error
getString := fmt.Sprintf("http://%s:%d/overlay-runtime", config.Ipaddr, config.Port) getString := fmt.Sprintf("http://%s:%d/overlay-runtime", conf.Ipaddr, conf.Warewulf.Port)
resp, err = webclient.Get(getString) resp, err = webclient.Get(getString)
if err == nil { if err == nil {
break break