From dbd747788f137e702bce4445fe055be25fc31769 Mon Sep 17 00:00:00 2001 From: jcsiadal Date: Tue, 19 Apr 2022 21:59:34 +0000 Subject: [PATCH 01/10] wwctl profile fixes Signed-off-by: jcsiadal --- internal/app/wwctl/node/set/main.go | 4 ++-- internal/app/wwctl/node/set/root.go | 2 +- internal/app/wwctl/profile/set/main.go | 16 ++++++++-------- internal/app/wwctl/profile/set/root.go | 1 + internal/pkg/node/datastructure.go | 2 +- internal/pkg/node/methods.go | 5 +++++ 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/internal/app/wwctl/node/set/main.go b/internal/app/wwctl/node/set/main.go index c41900d8..6460313e 100644 --- a/internal/app/wwctl/node/set/main.go +++ b/internal/app/wwctl/node/set/main.go @@ -289,10 +289,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error { n.Default.SetB(false) } - wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Setting DEFAULT\n", n.Id.Get(), SetNetName) + wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Setting PRIMARY\n", n.Id.Get(), SetNetName) n.NetDevs[SetNetName].Default.SetB(true) } else { - wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Unsetting DEFAULT\n", n.Id.Get(), SetNetName) + wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Unsetting PRIMARY\n", n.Id.Get(), SetNetName) n.NetDevs[SetNetName].Default.SetB(false) } } diff --git a/internal/app/wwctl/node/set/root.go b/internal/app/wwctl/node/set/root.go index 1470cafb..d6eb7bf7 100644 --- a/internal/app/wwctl/node/set/root.go +++ b/internal/app/wwctl/node/set/root.go @@ -143,7 +143,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetHwaddr, "hwaddr", "H", "", "Set the node's network device HW address") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "", "Enable/disable device (yes/no)") - baseCmd.PersistentFlags().StringVar(&SetNetDefault, "default", "", "Enable/disable device as default (yes/no)") + baseCmd.PersistentFlags().StringVar(&SetNetDefault, "primary", "", "Enable/disable device as primary (yes/no)") baseCmd.PersistentFlags().BoolVar(&SetNetDevDel, "netdel", false, "Delete the node's network device") baseCmd.PersistentFlags().StringSliceVar(&SetNetTags, "nettag", []string{}, "Define custom tag to network device (key=value)") diff --git a/internal/app/wwctl/profile/set/main.go b/internal/app/wwctl/profile/set/main.go index f14df079..e217ed4c 100644 --- a/internal/app/wwctl/profile/set/main.go +++ b/internal/app/wwctl/profile/set/main.go @@ -219,32 +219,32 @@ func CobraRunE(cmd *cobra.Command, args []string) error { if SetNetDefault == "yes" || SetNetDefault == "y" || SetNetDefault == "1" || SetNetDefault == "true" { - // Set all other devices to non-default + // Set all other networks to non-default for _, n := range p.NetDevs { n.Default.SetB(false) } - wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Setting DEFAULT\n", p.Id.Get(), SetNetName) + wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Setting PRIMARY\n", p.Id.Get(), SetNetName) p.NetDevs[SetNetName].Default.SetB(true) } else { - wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Unsetting DEFAULT\n", p.Id.Get(), SetNetName) + wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Unsetting PRIMARY\n", p.Id.Get(), SetNetName) p.NetDevs[SetNetName].Default.SetB(false) } } if SetNetDevDel { - if SetNetDev == "" { + if SetNetName == "" { wwlog.Printf(wwlog.ERROR, "You must include the '--netname' option\n") os.Exit(1) } - if _, ok := p.NetDevs[SetNetDev]; !ok { - wwlog.Printf(wwlog.ERROR, "Profile '%s': network Device doesn't exist: %s\n", p.Id.Get(), SetNetDev) + if _, ok := p.NetDevs[SetNetName]; !ok { + wwlog.Printf(wwlog.ERROR, "Profile '%s': network name doesn't exist: %s\n", p.Id.Get(), SetNetName) os.Exit(1) } - wwlog.Printf(wwlog.VERBOSE, "Profile %s: Deleting network device: %s\n", p.Id.Get(), SetNetDev) - delete(p.NetDevs, SetNetDev) + wwlog.Printf(wwlog.VERBOSE, "Profile %s: Deleting network: %s\n", p.Id.Get(), SetNetName) + delete(p.NetDevs, SetNetName) } if len(SetTags) > 0 { diff --git a/internal/app/wwctl/profile/set/root.go b/internal/app/wwctl/profile/set/root.go index eb2a6b6e..e586314c 100644 --- a/internal/app/wwctl/profile/set/root.go +++ b/internal/app/wwctl/profile/set/root.go @@ -118,6 +118,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetNetName, "netname", "n", "default", "Define the network name to configure") baseCmd.PersistentFlags().StringVarP(&SetNetDev, "netdev", "N", "", "Set the node's network device") + baseCmd.PersistentFlags().StringVar(&SetNetDefault, "primary", "", "Enable/disable device as primary (yes/no)") baseCmd.PersistentFlags().StringVarP(&SetNetmask, "netmask", "M", "", "Set the node's network device netmask") baseCmd.PersistentFlags().StringVarP(&SetGateway, "gateway", "G", "", "Set the node's network device gateway") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") diff --git a/internal/pkg/node/datastructure.go b/internal/pkg/node/datastructure.go index 11f83c60..d78ee910 100644 --- a/internal/pkg/node/datastructure.go +++ b/internal/pkg/node/datastructure.go @@ -75,7 +75,7 @@ type NetDevs struct { Prefix string `yaml:"prefix,omitempty"` Netmask string `yaml:"netmask,omitempty"` Gateway string `yaml:"gateway,omitempty"` - Default string `yaml:"default,omitempty"` + Default string `yaml:"primary,omitempty"` Tags map[string]string `yaml:"tags,omitempty"` } diff --git a/internal/pkg/node/methods.go b/internal/pkg/node/methods.go index 20960b1c..2e0546af 100644 --- a/internal/pkg/node/methods.go +++ b/internal/pkg/node/methods.go @@ -68,6 +68,8 @@ Set bool func (ent *Entry) SetB(val bool) { if val { ent.value = []string{"true"} + } else { + ent.value = []string{"false"} } } @@ -100,6 +102,9 @@ func (ent *Entry) SetAltB(val bool, from string) { if val { ent.altvalue = []string{"true"} ent.from = from + } else { + ent.altvalue = []string{"false"} + ent.from = from } } From 673253fbe03b1b786bd0496c14dedd6e552e01ce Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 26 Apr 2022 11:13:54 +0200 Subject: [PATCH 02/10] Inlcude build in vars in version output --- internal/app/wwctl/version/main.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/app/wwctl/version/main.go b/internal/app/wwctl/version/main.go index 08e48d09..183c33d0 100644 --- a/internal/app/wwctl/version/main.go +++ b/internal/app/wwctl/version/main.go @@ -3,13 +3,25 @@ package version import ( "fmt" + "github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/version" "github.com/spf13/cobra" ) func CobraRunE(cmd *cobra.Command, args []string) error { - fmt.Println("Version:\t", version.GetVersion()) + fmt.Println("VERSION:\t", version.GetVersion()) + fmt.Println("BINDIR:\t", buildconfig.BINDIR()) + fmt.Println("DATADIR:\t", buildconfig.DATADIR()) + fmt.Println("SYSCONFDIR:\t", buildconfig.SYSCONFDIR()) + fmt.Println("LOCALSTATEDIR:\t", buildconfig.LOCALSTATEDIR()) + fmt.Println("SRVDIR:\t", buildconfig.SRVDIR()) + fmt.Println("TFTPDIR:\t", buildconfig.TFTPDIR()) + fmt.Println("SYSTEMDDIR:\t", buildconfig.SYSTEMDDIR()) + fmt.Println("WWOVERLAYDIR:\t", buildconfig.WWOVERLAYDIR()) + fmt.Println("WWCHROOTDIR:\t", buildconfig.WWCHROOTDIR()) + fmt.Println("WWPROVISIONDIR:\t", buildconfig.WWPROVISIONDIR()) + fmt.Println("WWCLIENTDIR:\t", buildconfig.WWCLIENTDIR()) return nil } From 0a9e4b89a16d12bfda03766ab6129e4615d41a4f Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 26 Apr 2022 11:30:04 +0200 Subject: [PATCH 03/10] fixup format --- internal/app/wwctl/version/main.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/internal/app/wwctl/version/main.go b/internal/app/wwctl/version/main.go index 183c33d0..6cee1028 100644 --- a/internal/app/wwctl/version/main.go +++ b/internal/app/wwctl/version/main.go @@ -10,18 +10,20 @@ import ( func CobraRunE(cmd *cobra.Command, args []string) error { - fmt.Println("VERSION:\t", version.GetVersion()) - fmt.Println("BINDIR:\t", buildconfig.BINDIR()) - fmt.Println("DATADIR:\t", buildconfig.DATADIR()) - fmt.Println("SYSCONFDIR:\t", buildconfig.SYSCONFDIR()) - fmt.Println("LOCALSTATEDIR:\t", buildconfig.LOCALSTATEDIR()) - fmt.Println("SRVDIR:\t", buildconfig.SRVDIR()) - fmt.Println("TFTPDIR:\t", buildconfig.TFTPDIR()) - fmt.Println("SYSTEMDDIR:\t", buildconfig.SYSTEMDDIR()) - fmt.Println("WWOVERLAYDIR:\t", buildconfig.WWOVERLAYDIR()) - fmt.Println("WWCHROOTDIR:\t", buildconfig.WWCHROOTDIR()) - fmt.Println("WWPROVISIONDIR:\t", buildconfig.WWPROVISIONDIR()) - fmt.Println("WWCLIENTDIR:\t", buildconfig.WWCLIENTDIR()) + fmt.Printf("%-20s %-18s\n", "VERSION:", version.GetVersion()) + fmt.Printf("%-20s %-18s\n", "BINDIR:", buildconfig.BINDIR()) + fmt.Printf("%-20s %-18s\n", "DATADIR:", buildconfig.DATADIR()) + fmt.Printf("%-20s %-18s\n", "SYSCONFDIR:", buildconfig.SYSCONFDIR()) + fmt.Printf("%-20s %-18s\n", "LOCALSTATEDIR:", buildconfig.LOCALSTATEDIR()) + fmt.Printf("%-20s %-18s\n", "SRVDIR:", buildconfig.SRVDIR()) + fmt.Printf("%-20s %-18s\n", "TFTPDIR:", buildconfig.TFTPDIR()) + fmt.Printf("%-20s %-18s\n", "SYSTEMDDIR:", buildconfig.SYSTEMDDIR()) + fmt.Printf("%-20s %-18s\n", "WWOVERLAYDIR:", buildconfig.WWOVERLAYDIR()) + fmt.Printf("%-20s %-18s\n", "WWCHROOTDIR:", buildconfig.WWCHROOTDIR()) + fmt.Printf("%-20s %-18s\n", "WWPROVISIONDIR:", buildconfig.WWPROVISIONDIR()) + fmt.Printf("%-20s %-18s\n", "BASEVERSION:", buildconfig.VERSION()) + fmt.Printf("%-20s %-18s\n", "RELEASE:", buildconfig.RELEASE()) + fmt.Printf("%-20s %-18s\n", "WWCLIENTDIR:", buildconfig.WWCLIENTDIR()) return nil } From 2f836aaf87a22f31b10a5169e392d9edf6af6d73 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 26 Apr 2022 11:30:22 +0200 Subject: [PATCH 04/10] uisng short hash for version var --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b57afee1..bdf59094 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ VARLIST := OS VARLIST += WAREWULF VERSION RELEASE WAREWULF ?= warewulf VERSION ?= 4.3.0rc2 -GIT_TAG := $(shell test -e .git && git describe --tags --long --first-parent --always) +GIT_TAG := $(shell test -e .git && git log -1 --format="%h") ifdef GIT_TAG ifdef $(filter $(OS),ubuntu debian) From d03619935e28c6617918517f3b0828beaeff9aed Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 26 Apr 2022 15:02:36 +0200 Subject: [PATCH 05/10] fixed up spec file --- warewulf.spec.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/warewulf.spec.in b/warewulf.spec.in index a4b2dbac..67d9261f 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -1,13 +1,12 @@ %define debug_package %{nil} -%if 0%{?sle_version} +%if 0%{?suse_version} %global tftpdir /srv/tftpboot -%global srvdir /srv %else # Assume Fedora-based OS if not SUSE-based %global tftpdir /var/lib/tftpboot -%global srvdir %{_sharedstatedir} %endif +%global srvdir %{_sharedstatedir} %global wwgroup warewulf @@ -30,12 +29,15 @@ Conflicts: warewulf-ipmi BuildRequires: make -%if 0%{?sle_version} +%if 0%{?suse_version} BuildRequires: systemd-rpm-macros BuildRequires: go BuildRequires: firewall-macros +BuildRequires: firewalld +BuildRequires: tftp Requires: tftp Requires: nfs-kernel-server +Requires: firewalld %else BuildRequires: systemd BuildRequires: golang @@ -44,7 +46,7 @@ Requires: tftp-server Requires: nfs-utils %endif -%if 0%{?rhel} >= 8 || 0%{?sle_version} +%if 0%{?rhel} >= 8 || 0%{?suse_version} Requires: dhcp-server %else # rhel < 8 @@ -82,6 +84,7 @@ make %install +export NO_BRP_STALE_LINK_ERROR=yes make install DESTDIR=%{buildroot} @@ -121,6 +124,7 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %attr(-, root, root) %{_mandir}/man1/wwctl* %attr(-, root, root) %{_datadir}/warewulf +%dir %{_docdir}/warewulf %license %{_docdir}/warewulf/LICENSE.md From c95c518dde812be931fe5b3df3df441dd357cead Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Wed, 27 Apr 2022 22:32:57 -0700 Subject: [PATCH 06/10] Align boolean prints --- internal/app/wwctl/node/list/main.go | 2 +- internal/app/wwctl/profile/list/main.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/app/wwctl/node/list/main.go b/internal/app/wwctl/node/list/main.go index dd83d7c7..75f06d34 100644 --- a/internal/app/wwctl/node/list/main.go +++ b/internal/app/wwctl/node/list/main.go @@ -56,7 +56,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "IpmiGateway", node.Ipmi.Gateway.Source(), node.Ipmi.Gateway.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "IpmiUserName", node.Ipmi.UserName.Source(), node.Ipmi.UserName.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "IpmiInterface", node.Ipmi.Interface.Source(), node.Ipmi.Interface.Print()) - fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "IpmiWrite", node.Ipmi.Interface.Source(), node.Ipmi.Write.Print()) + fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "IpmiWrite", node.Ipmi.Interface.Source(), node.Ipmi.Write.PrintB()) for keyname, key := range node.Tags { fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Tag["+keyname+"]", key.Source(), key.Print()) diff --git a/internal/app/wwctl/profile/list/main.go b/internal/app/wwctl/profile/list/main.go index 4f4f5d4c..a5eecb85 100644 --- a/internal/app/wwctl/profile/list/main.go +++ b/internal/app/wwctl/profile/list/main.go @@ -32,6 +32,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "Comment", profile.Comment.Print()) fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "Cluster", profile.ClusterName.Print()) + fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "Discoverable", profile.Discoverable.PrintB()) + fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "Container", profile.ContainerName.Print()) fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "KernelOverride", profile.Kernel.Override.Print()) fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "KernelArgs", profile.Kernel.Args.Print()) From 0fd8553bada4db3e268073e13804234a44808016 Mon Sep 17 00:00:00 2001 From: mslacken Date: Fri, 29 Apr 2022 10:07:15 +0200 Subject: [PATCH 07/10] add full output siwtch to wwctl version --- internal/app/wwctl/version/main.go | 34 ++++++++++++++++-------------- internal/app/wwctl/version/root.go | 2 ++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/internal/app/wwctl/version/main.go b/internal/app/wwctl/version/main.go index 6cee1028..3577036b 100644 --- a/internal/app/wwctl/version/main.go +++ b/internal/app/wwctl/version/main.go @@ -9,21 +9,23 @@ import ( ) func CobraRunE(cmd *cobra.Command, args []string) error { - - fmt.Printf("%-20s %-18s\n", "VERSION:", version.GetVersion()) - fmt.Printf("%-20s %-18s\n", "BINDIR:", buildconfig.BINDIR()) - fmt.Printf("%-20s %-18s\n", "DATADIR:", buildconfig.DATADIR()) - fmt.Printf("%-20s %-18s\n", "SYSCONFDIR:", buildconfig.SYSCONFDIR()) - fmt.Printf("%-20s %-18s\n", "LOCALSTATEDIR:", buildconfig.LOCALSTATEDIR()) - fmt.Printf("%-20s %-18s\n", "SRVDIR:", buildconfig.SRVDIR()) - fmt.Printf("%-20s %-18s\n", "TFTPDIR:", buildconfig.TFTPDIR()) - fmt.Printf("%-20s %-18s\n", "SYSTEMDDIR:", buildconfig.SYSTEMDDIR()) - fmt.Printf("%-20s %-18s\n", "WWOVERLAYDIR:", buildconfig.WWOVERLAYDIR()) - fmt.Printf("%-20s %-18s\n", "WWCHROOTDIR:", buildconfig.WWCHROOTDIR()) - fmt.Printf("%-20s %-18s\n", "WWPROVISIONDIR:", buildconfig.WWPROVISIONDIR()) - fmt.Printf("%-20s %-18s\n", "BASEVERSION:", buildconfig.VERSION()) - fmt.Printf("%-20s %-18s\n", "RELEASE:", buildconfig.RELEASE()) - fmt.Printf("%-20s %-18s\n", "WWCLIENTDIR:", buildconfig.WWCLIENTDIR()) - + if ListFull { + fmt.Printf("%-20s %-18s\n", "VERSION:", version.GetVersion()) + fmt.Printf("%-20s %-18s\n", "BINDIR:", buildconfig.BINDIR()) + fmt.Printf("%-20s %-18s\n", "DATADIR:", buildconfig.DATADIR()) + fmt.Printf("%-20s %-18s\n", "SYSCONFDIR:", buildconfig.SYSCONFDIR()) + fmt.Printf("%-20s %-18s\n", "LOCALSTATEDIR:", buildconfig.LOCALSTATEDIR()) + fmt.Printf("%-20s %-18s\n", "SRVDIR:", buildconfig.SRVDIR()) + fmt.Printf("%-20s %-18s\n", "TFTPDIR:", buildconfig.TFTPDIR()) + fmt.Printf("%-20s %-18s\n", "SYSTEMDDIR:", buildconfig.SYSTEMDDIR()) + fmt.Printf("%-20s %-18s\n", "WWOVERLAYDIR:", buildconfig.WWOVERLAYDIR()) + fmt.Printf("%-20s %-18s\n", "WWCHROOTDIR:", buildconfig.WWCHROOTDIR()) + fmt.Printf("%-20s %-18s\n", "WWPROVISIONDIR:", buildconfig.WWPROVISIONDIR()) + fmt.Printf("%-20s %-18s\n", "BASEVERSION:", buildconfig.VERSION()) + fmt.Printf("%-20s %-18s\n", "RELEASE:", buildconfig.RELEASE()) + fmt.Printf("%-20s %-18s\n", "WWCLIENTDIR:", buildconfig.WWCLIENTDIR()) + } else { + fmt.Println(version.GetVersion()) + } return nil } diff --git a/internal/app/wwctl/version/root.go b/internal/app/wwctl/version/root.go index 766d3b8f..4e88e9d9 100644 --- a/internal/app/wwctl/version/root.go +++ b/internal/app/wwctl/version/root.go @@ -11,9 +11,11 @@ var ( Args: cobra.ExactArgs(0), Aliases: []string{"vers"}, } + ListFull bool ) func init() { + baseCmd.PersistentFlags().BoolVarP(&ListFull, "full", "f", false, "List all compiled in variables.") } // GetRootCommand returns the root cobra.Command for the application. From 95c951e6738a74d1950d5d123e3a3f673f6c0e6b Mon Sep 17 00:00:00 2001 From: mslacken Date: Fri, 29 Apr 2022 10:20:56 +0200 Subject: [PATCH 08/10] use bash export syntax for variables --- internal/app/wwctl/version/main.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/app/wwctl/version/main.go b/internal/app/wwctl/version/main.go index 3577036b..50387ef6 100644 --- a/internal/app/wwctl/version/main.go +++ b/internal/app/wwctl/version/main.go @@ -10,20 +10,20 @@ import ( func CobraRunE(cmd *cobra.Command, args []string) error { if ListFull { - fmt.Printf("%-20s %-18s\n", "VERSION:", version.GetVersion()) - fmt.Printf("%-20s %-18s\n", "BINDIR:", buildconfig.BINDIR()) - fmt.Printf("%-20s %-18s\n", "DATADIR:", buildconfig.DATADIR()) - fmt.Printf("%-20s %-18s\n", "SYSCONFDIR:", buildconfig.SYSCONFDIR()) - fmt.Printf("%-20s %-18s\n", "LOCALSTATEDIR:", buildconfig.LOCALSTATEDIR()) - fmt.Printf("%-20s %-18s\n", "SRVDIR:", buildconfig.SRVDIR()) - fmt.Printf("%-20s %-18s\n", "TFTPDIR:", buildconfig.TFTPDIR()) - fmt.Printf("%-20s %-18s\n", "SYSTEMDDIR:", buildconfig.SYSTEMDDIR()) - fmt.Printf("%-20s %-18s\n", "WWOVERLAYDIR:", buildconfig.WWOVERLAYDIR()) - fmt.Printf("%-20s %-18s\n", "WWCHROOTDIR:", buildconfig.WWCHROOTDIR()) - fmt.Printf("%-20s %-18s\n", "WWPROVISIONDIR:", buildconfig.WWPROVISIONDIR()) - fmt.Printf("%-20s %-18s\n", "BASEVERSION:", buildconfig.VERSION()) - fmt.Printf("%-20s %-18s\n", "RELEASE:", buildconfig.RELEASE()) - fmt.Printf("%-20s %-18s\n", "WWCLIENTDIR:", buildconfig.WWCLIENTDIR()) + fmt.Printf("%s=%s\n", "VERSION", version.GetVersion()) + fmt.Printf("%s=%s\n", "BINDIR", buildconfig.BINDIR()) + fmt.Printf("%s=%s\n", "DATADIR", buildconfig.DATADIR()) + fmt.Printf("%s=%s\n", "SYSCONFDIR", buildconfig.SYSCONFDIR()) + fmt.Printf("%s=%s\n", "LOCALSTATEDIR", buildconfig.LOCALSTATEDIR()) + fmt.Printf("%s=%s\n", "SRVDIR", buildconfig.SRVDIR()) + fmt.Printf("%s=%s\n", "TFTPDIR", buildconfig.TFTPDIR()) + fmt.Printf("%s=%s\n", "SYSTEMDDIR", buildconfig.SYSTEMDDIR()) + fmt.Printf("%s=%s\n", "WWOVERLAYDIR", buildconfig.WWOVERLAYDIR()) + fmt.Printf("%s=%s\n", "WWCHROOTDIR", buildconfig.WWCHROOTDIR()) + fmt.Printf("%s=%s\n", "WWPROVISIONDIR", buildconfig.WWPROVISIONDIR()) + fmt.Printf("%s=%s\n", "BASEVERSION", buildconfig.VERSION()) + fmt.Printf("%s=%s\n", "RELEASE", buildconfig.RELEASE()) + fmt.Printf("%s=%s\n", "WWCLIENTDIR", buildconfig.WWCLIENTDIR())o } else { fmt.Println(version.GetVersion()) } From 5643b71de655694c8ea6d89c03e622bf01f85c7b Mon Sep 17 00:00:00 2001 From: mslacken Date: Fri, 29 Apr 2022 11:18:20 +0200 Subject: [PATCH 09/10] fixed linting --- internal/app/wwctl/version/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/app/wwctl/version/main.go b/internal/app/wwctl/version/main.go index 50387ef6..17e446de 100644 --- a/internal/app/wwctl/version/main.go +++ b/internal/app/wwctl/version/main.go @@ -23,7 +23,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%s=%s\n", "WWPROVISIONDIR", buildconfig.WWPROVISIONDIR()) fmt.Printf("%s=%s\n", "BASEVERSION", buildconfig.VERSION()) fmt.Printf("%s=%s\n", "RELEASE", buildconfig.RELEASE()) - fmt.Printf("%s=%s\n", "WWCLIENTDIR", buildconfig.WWCLIENTDIR())o + fmt.Printf("%s=%s\n", "WWCLIENTDIR", buildconfig.WWCLIENTDIR()) } else { fmt.Println(version.GetVersion()) } From 1a61b53bb2814df9fafe05e2d81afca2b4d23898 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 3 May 2022 10:23:19 +0200 Subject: [PATCH 10/10] container show prints kernel version --- internal/app/wwctl/container/show/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/app/wwctl/container/show/main.go b/internal/app/wwctl/container/show/main.go index a902eee2..30defabf 100644 --- a/internal/app/wwctl/container/show/main.go +++ b/internal/app/wwctl/container/show/main.go @@ -18,6 +18,11 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } else { fmt.Printf("Name: %s\n", containerName) fmt.Printf("Rootfs: %s\n", container.RootFsDir(containerName)) + kernelVersion := container.KernelVersion(containerName) + if kernelVersion != "" { + kernelVersion = "not found" + fmt.Printf("Kernelversion: %s\n", kernelVersion) + } nodeDB, _ := node.New() nodes, _ := nodeDB.FindAllNodes()