diff --git a/cmd/wwclient/wwclient.go b/cmd/wwclient/wwclient.go index cdac4a9b..622dd5b7 100644 --- a/cmd/wwclient/wwclient.go +++ b/cmd/wwclient/wwclient.go @@ -41,7 +41,6 @@ func main() { LocalAddr: &localTCPAddr, Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, - DualStack: true, }).DialContext, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, @@ -74,18 +73,12 @@ func main() { time.Sleep(1000 * time.Millisecond) } -// defer resp.Body.Close() - - - - if resp.StatusCode != 200 { log.Printf("Not updating runtime system-overlay, got status code: %d\n", resp.StatusCode) time.Sleep(60000 * time.Millisecond) continue } - log.Printf("Updating runtime system\n") command := exec.Command("/bin/cpio", "-iu") command.Stdin = resp.Body diff --git a/internal/app/wwctl/overlay/list/root.go b/internal/app/wwctl/overlay/list/root.go new file mode 100644 index 00000000..23519641 --- /dev/null +++ b/internal/app/wwctl/overlay/list/root.go @@ -0,0 +1,32 @@ +package list + +import ( + "fmt" + "github.com/spf13/cobra" +) + +var ( + listCmd = &cobra.Command{ + Use: "list", + Short: "List Warewulf Overlays", + Long: "Warewulf List overlay", + RunE: CobraRunE, + } + +) + +func init() { + +} + +// GetRootCommand returns the root cobra.Command for the application. +func GetCommand() *cobra.Command { + return listCmd +} + + +func CobraRunE(cmd *cobra.Command, args []string) error { + + fmt.Printf("List: Hello World\n") + return nil +} \ No newline at end of file diff --git a/internal/app/wwctl/overlay/root.go b/internal/app/wwctl/overlay/root.go new file mode 100644 index 00000000..a61ce3ce --- /dev/null +++ b/internal/app/wwctl/overlay/root.go @@ -0,0 +1,30 @@ +package overlay + +import ( + "github.com/hpcng/warewulf/internal/app/wwctl/overlay/list" + "github.com/hpcng/warewulf/internal/app/wwctl/overlay/show" + + "github.com/spf13/cobra" +) + +var ( + overlayCmd = &cobra.Command{ + Use: "overlay", + Short: "Warewulf Overlay Management", + Long: "Management interface for Warewulf overlays", + } + test bool +) + +func init() { + overlayCmd.PersistentFlags().BoolVarP(&test, "test", "t", false, "Testing.") + + overlayCmd.AddCommand(list.GetCommand()) + overlayCmd.AddCommand(show.GetCommand()) + +} + +// GetRootCommand returns the root cobra.Command for the application. +func GetCommand() *cobra.Command { + return overlayCmd +} diff --git a/internal/app/wwctl/overlay/show/root.go b/internal/app/wwctl/overlay/show/root.go new file mode 100644 index 00000000..d41248c0 --- /dev/null +++ b/internal/app/wwctl/overlay/show/root.go @@ -0,0 +1,32 @@ +package show + +import ( + "fmt" + "github.com/spf13/cobra" +) + +var ( + showCmd = &cobra.Command{ + Use: "show", + Short: "Show Warewulf Overlay objects", + Long: "Warewulf show overlay objects", + RunE: CobraRunE, + } + +) + +func init() { + +} + +// GetRootCommand returns the root cobra.Command for the application. +func GetCommand() *cobra.Command { + return showCmd +} + + +func CobraRunE(cmd *cobra.Command, args []string) error { + + fmt.Printf("Show: Hello World\n") + return nil +} \ No newline at end of file diff --git a/internal/app/wwctl/root.go b/internal/app/wwctl/root.go index bd214392..4bb36f0f 100644 --- a/internal/app/wwctl/root.go +++ b/internal/app/wwctl/root.go @@ -2,6 +2,7 @@ package wwctl import ( "github.com/hpcng/warewulf/internal/app/wwctl/build" + "github.com/hpcng/warewulf/internal/app/wwctl/overlay" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/spf13/cobra" ) @@ -22,6 +23,7 @@ func init() { rootCmd.PersistentFlags().BoolVarP(&debugArg, "debug", "d", false, "Run with debugging messages enabled.") rootCmd.AddCommand(build.GetCommand()) + rootCmd.AddCommand(overlay.GetCommand()) } // GetRootCommand returns the root cobra.Command for the application.