Rename pkg/warewulfconf to pkg/config

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2023-04-14 14:23:18 -06:00
parent b6e6795dee
commit c461e65a98
38 changed files with 47 additions and 44 deletions

3
.gitignore vendored
View File

@@ -25,10 +25,11 @@
/etc/bash_completion.d/
warewulf.spec
internal/pkg/buildconfig/setconfigs.go
internal/pkg/warewulfconf/buildconfig.go
internal/pkg/config/buildconfig.go
include/systemd/warewulfd.service
_dist/
config
!internal/pkg/config
warewulf-*.tar.gz
Defaults.mk
/etc/wwapid.config

View File

@@ -151,7 +151,7 @@ vet:
go vet ./...
test-it:
go test -v ./... -ldflags="-X 'github.com/hpcng/warewulf/internal/pkg/warewulfconf.ConfigFile=$(shell pwd)/etc/warewulf.conf'"
go test -v ./... -ldflags="-X 'github.com/hpcng/warewulf/internal/pkg/config.ConfigFile=$(shell pwd)/etc/warewulf.conf'"
# Generate test coverage
test-cover: ## Run test coverage and generate html report
@@ -219,13 +219,13 @@ init:
wwctl: $(WWCTL_DEPS)
@echo Building "$@"
@cd cmd/wwctl; GOOS=linux go build -mod vendor -tags "$(WW_GO_BUILD_TAGS)" \
-ldflags "-X 'github.com/hpcng/warewulf/internal/pkg/warewulfconf.ConfigFile=$(SYSCONFDIR)/warewulf/warewulf.conf'" \
-ldflags "-X 'github.com/hpcng/warewulf/internal/pkg/config.ConfigFile=$(SYSCONFDIR)/warewulf/warewulf.conf'" \
-o ../../wwctl
wwclient: $(WWCLIENT_DEPS)
@echo Building "$@"
@cd cmd/wwclient; CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -ldflags "-extldflags -static \
-X 'github.com/hpcng/warewulf/internal/pkg/warewulfconf.ConfigFile=/etc/warewulf/warewulf.conf'" -o ../../wwclient
-X 'github.com/hpcng/warewulf/internal/pkg/config.ConfigFile=/etc/warewulf/warewulf.conf'" -o ../../wwclient
man_pages: wwctl
@install -d man_pages
@@ -235,7 +235,7 @@ man_pages: wwctl
@cd man_pages; for i in wwctl*1 *.5; do gzip --force $$i; echo -n "$$i "; done; echo
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'\
cd cmd/update_configuration && go build -ldflags="-X 'github.com/hpcng/warewulf/internal/pkg/config.ConfigFile=./etc/warewulf.conf'\
-X 'github.com/hpcng/warewulf/internal/pkg/node.ConfigFile=./etc/nodes.conf'"\
-mod vendor -tags "$(WW_GO_BUILD_TAGS)" -o ../../update_configuration

View File

@@ -12,7 +12,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/api/apiconfig"
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

View File

@@ -16,7 +16,7 @@ import (
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/version"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
"github.com/hpcng/warewulf/internal/pkg/config"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
@@ -34,7 +34,7 @@ var apiVersion string
func main() {
log.Println("Server running")
conf := warewulfconf.New()
conf := config.New()
// Read the config file.
config, err := apiconfig.NewServer(path.Join(conf.Paths.Sysconfdir, "warewulf/wwapid.conf"))
if err != nil {

View File

@@ -18,7 +18,7 @@ import (
"google.golang.org/grpc/credentials/insecure"
"github.com/hpcng/warewulf/internal/pkg/api/apiconfig"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
gw "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"

View File

@@ -17,7 +17,7 @@ import (
"github.com/coreos/go-systemd/daemon"
"github.com/google/uuid"
"github.com/hpcng/warewulf/internal/pkg/pidfile"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra"
"github.com/talos-systems/go-smbios/smbios"

View File

@@ -15,7 +15,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/overlay"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
"github.com/spf13/cobra"

View File

@@ -10,7 +10,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/stretchr/testify/assert"
)

View File

@@ -3,7 +3,7 @@ package print
import (
"fmt"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
)

View File

@@ -6,7 +6,7 @@ import (
"testing"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/stretchr/testify/assert"
)

View File

@@ -7,7 +7,7 @@ import (
"testing"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/stretchr/testify/assert"
)

View File

@@ -9,7 +9,7 @@ import (
"github.com/fatih/color"
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/hpcng/warewulf/pkg/hostlist"
"github.com/spf13/cobra"

View File

@@ -7,7 +7,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/overlay"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/hpcng/warewulf/pkg/hostlist"
"github.com/spf13/cobra"

View File

@@ -8,7 +8,7 @@ import (
"testing"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/stretchr/testify/assert"
)

View File

@@ -15,7 +15,7 @@ import (
"github.com/hpcng/warewulf/internal/app/wwctl/ssh"
"github.com/hpcng/warewulf/internal/app/wwctl/version"
"github.com/hpcng/warewulf/internal/pkg/help"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra"
)

View File

@@ -1,7 +1,7 @@
package start
import (
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
"github.com/pkg/errors"
"github.com/spf13/cobra"

View File

@@ -10,7 +10,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/hpcng/warewulf/pkg/hostlist"
"github.com/pkg/errors"

View File

@@ -1,4 +1,4 @@
package warewulfconf
package config
type BuildConfig struct {
Bindir string `default:"@BINDIR@"`

View File

@@ -1,4 +1,4 @@
package warewulfconf
package config
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package warewulfconf
package config
import (
"github.com/creasty/defaults"

View File

@@ -1,4 +1,4 @@
package warewulfconf
package config
import (
"os"

View File

@@ -6,7 +6,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/overlay"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)

View File

@@ -5,7 +5,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/overlay"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)

View File

@@ -6,7 +6,7 @@ import (
"path"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)

View File

@@ -6,7 +6,7 @@ import (
"path"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -3,7 +3,7 @@ package container
import (
"path"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
)
func SourceParentDir() string {

View File

@@ -9,7 +9,7 @@ import (
"github.com/containers/storage/drivers/copy"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/oci"
"github.com/hpcng/warewulf/internal/pkg/util"
)

View File

@@ -3,7 +3,7 @@ package container
import (
"strings"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -12,7 +12,7 @@ import (
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -8,7 +8,7 @@ import (
"sort"
"strings"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"gopkg.in/yaml.v2"

View File

@@ -1,7 +1,9 @@
package oci
import "github.com/hpcng/warewulf/internal/pkg/warewulfconf"
import "path/filepath"
import (
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"path/filepath"
)
var defaultCachePath = filepath.Join(warewulfconf.DataStore(), "/container-cache/oci/")

View File

@@ -5,7 +5,7 @@ import (
"path"
"strings"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
)
func OverlaySourceTopDir() string {

View File

@@ -7,7 +7,7 @@ import (
"time"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -8,7 +8,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
)
/*

View File

@@ -11,7 +11,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/version"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)

View File

@@ -10,7 +10,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/kernel"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -7,7 +7,7 @@ import (
"strconv"
"syscall"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
warewulfconf "github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)