moved print_defaults to wwctl genconfig defaults
Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
9
Makefile
9
Makefile
@@ -101,7 +101,7 @@ export GOPROXY
|
||||
WW_GO_BUILD_TAGS := containers_image_openpgp containers_image_ostree
|
||||
|
||||
# Default target
|
||||
all: config vendor wwctl wwclient man_pages config_defaults print_defaults wwapid wwapic wwapird
|
||||
all: config vendor wwctl wwclient man_pages config_defaults wwapid wwapic wwapird
|
||||
|
||||
# Validate source and build all packages
|
||||
build: lint test-it vet all
|
||||
@@ -183,7 +183,7 @@ files: all
|
||||
test -f $(DESTDIR)$(WWCONFIGDIR)/wwapic.conf || install -m 644 etc/wwapic.conf $(DESTDIR)$(WWCONFIGDIR)
|
||||
test -f $(DESTDIR)$(WWCONFIGDIR)/wwapid.conf || install -m 644 etc/wwapid.conf $(DESTDIR)$(WWCONFIGDIR)
|
||||
test -f $(DESTDIR)$(WWCONFIGDIR)/wwapird.conf || install -m 644 etc/wwapird.conf $(DESTDIR)$(WWCONFIGDIR)
|
||||
test -f $(DESTDIR)$(WWCONFIGDIR)/defaults.conf || ./print_defaults > $(DESTDIR)$(WWCONFIGDIR)/defaults.conf
|
||||
test -f $(DESTDIR)$(WWCONFIGDIR)/defaults.conf || ./wwctl genconfig defaults > $(DESTDIR)$(WWCONFIGDIR)/defaults.conf
|
||||
cp -r etc/examples $(DESTDIR)$(WWCONFIGDIR)/
|
||||
cp -r etc/ipxe $(DESTDIR)$(WWCONFIGDIR)/
|
||||
cp -r overlays/* $(DESTDIR)$(WWOVERLAYDIR)/
|
||||
@@ -236,10 +236,6 @@ config_defaults: vendor cmd/config_defaults/config_defaults.go
|
||||
-X 'github.com/hpcng/warewulf/internal/pkg/node.ConfigFile=./etc/nodes.conf'"\
|
||||
-mod vendor -tags "$(WW_GO_BUILD_TAGS)" -o ../../config_defaults
|
||||
|
||||
print_defaults: vendor cmd/print_defaults/print_defaults.go
|
||||
cd cmd/print_defaults && go build -ldflags="-X 'github.com/hpcng/warewulf/internal/pkg/warewulfconf.ConfigFile=./etc/warewulf.conf'" -o ../../print_defaults
|
||||
|
||||
|
||||
update_configuration: vendor cmd/update_configuration/update_configuration.go
|
||||
cd cmd/update_configuration && go build -ldflags="-X 'github.com/hpcng/warewulf/internal/pkg/warewulfconf.ConfigFile=./etc/warewulf.conf'\
|
||||
-X 'github.com/hpcng/warewulf/internal/pkg/node.ConfigFile=./etc/nodes.conf'"\
|
||||
@@ -301,7 +297,6 @@ contclean:
|
||||
rm -rf $(TOOLS_DIR)
|
||||
rm -f config_defaults
|
||||
rm -f update_configuration
|
||||
rm -f print_defaults
|
||||
rm -f etc/wwapi{c,d,rd}.conf
|
||||
|
||||
clean: contclean
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
)
|
||||
|
||||
/*
|
||||
Print the build in defaults for the nodes.
|
||||
Called via Makefile so that there is single upstream
|
||||
source of the defaults which is FallBackConf
|
||||
*/
|
||||
|
||||
func main() {
|
||||
fmt.Println(node.FallBackConf)
|
||||
}
|
||||
13
internal/app/wwctl/genconf/dfaults/main.go
Normal file
13
internal/app/wwctl/genconf/dfaults/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package dfaults
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
fmt.Println(node.FallBackConf)
|
||||
return
|
||||
}
|
||||
22
internal/app/wwctl/genconf/dfaults/root.go
Normal file
22
internal/app/wwctl/genconf/dfaults/root.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package dfaults
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
var (
|
||||
baseCmd = &cobra.Command{
|
||||
Use: "defaults",
|
||||
Short: "print defaults",
|
||||
Long: "This command prints the fallbacks which are used if defaults.conf isn't present",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.NoArgs,
|
||||
Aliases: []string{"dfaults"},
|
||||
}
|
||||
Zsh bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
func GetCommand() *cobra.Command {
|
||||
return baseCmd
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package genconf
|
||||
|
||||
import (
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/completions"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/dfaults"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/man"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/reference"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -23,6 +24,7 @@ func init() {
|
||||
baseCmd.AddCommand(completions.GetCommand())
|
||||
baseCmd.AddCommand(man.GetCommand())
|
||||
baseCmd.AddCommand(reference.GetCommand())
|
||||
baseCmd.AddCommand(dfaults.GetCommand())
|
||||
}
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
Reference in New Issue
Block a user