Merge pull request #113 from gmkurtzer/errors

Update Warewulf to use the standard upstream errors package
This commit is contained in:
Gregory M. Kurtzer
2021-09-07 20:26:34 -07:00
committed by GitHub
11 changed files with 22 additions and 32 deletions

1
go.mod
View File

@@ -9,6 +9,7 @@ require (
github.com/manifoldco/promptui v0.8.0
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
github.com/opencontainers/umoci v0.4.6
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/cobra v1.1.1
gopkg.in/yaml.v2 v2.4.0
)

View File

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

View File

@@ -5,13 +5,13 @@ import (
"os"
"path"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/containers/image/v5/types"
"github.com/containers/storage/drivers/copy"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/oci"
"github.com/hpcng/warewulf/internal/pkg/util"
)
func ImportDocker(uri string, name string, sCtx *types.SystemContext) error {

View File

@@ -5,8 +5,9 @@ import (
"os"
"path"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -1,19 +0,0 @@
package errors
type error interface {
Error() string
}
// errorString is a trivial implementation of error.
type errorString struct {
s string
}
func (e *errorString) Error() string {
return e.s
}
// New returns an error that formats as the given text.
func New(text string) error {
return &errorString{text}
}

View File

@@ -7,8 +7,9 @@ import (
"os/exec"
"path"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -6,9 +6,10 @@ import (
"sort"
"strings"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)
const ConfigFile = "/etc/warewulf/nodes.conf"

View File

@@ -3,9 +3,10 @@ package node
import (
"os"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)
/****

View File

@@ -13,8 +13,9 @@ import (
"strings"
"text/template"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/config"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"

View File

@@ -3,7 +3,8 @@ package warewulfd
import (
"sync"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
)

View File

@@ -8,7 +8,8 @@ import (
"strconv"
"strings"
"github.com/hpcng/warewulf/internal/pkg/errors"
"github.com/pkg/errors"
"github.com/hpcng/warewulf/internal/pkg/node"
)