From 5ebee436a0e36a5be7e5d61f988ab6e8753f4eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Sun, 15 Oct 2023 13:07:34 -0400 Subject: [PATCH] global: Update to current incus/shared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- distrobuilder/main.go | 2 +- distrobuilder/main_incus.go | 6 +- distrobuilder/main_repack-windows.go | 8 +-- distrobuilder/vm.go | 4 +- generators/cloud-init.go | 4 +- generators/cloud-init_test.go | 2 +- generators/copy.go | 52 +++++++++++++-- generators/hostname.go | 2 +- generators/hosts.go | 2 +- generators/incus-agent.go | 2 +- go.mod | 44 ++++++------- go.sum | 96 +++++++++++++--------------- image/lxc.go | 2 +- managers/apt.go | 2 +- managers/luet.go | 2 +- managers/pacman.go | 6 +- managers/yum.go | 2 +- shared/archive_linux.go | 13 +--- shared/chroot.go | 2 +- shared/definition.go | 25 ++++---- shared/definition_test.go | 6 +- shared/util.go | 6 +- sources/common.go | 2 +- sources/common_test.go | 2 +- sources/debootstrap.go | 4 +- sources/oraclelinux-http.go | 2 +- sources/plamolinux-http.go | 4 +- sources/rhel-common.go | 2 +- sources/slackware-http.go | 4 +- sources/utils.go | 2 +- 30 files changed, 169 insertions(+), 143 deletions(-) diff --git a/distrobuilder/main.go b/distrobuilder/main.go index 795aa989..affdbe55 100644 --- a/distrobuilder/main.go +++ b/distrobuilder/main.go @@ -65,7 +65,7 @@ import ( "strings" "time" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "gopkg.in/yaml.v2" diff --git a/distrobuilder/main_incus.go b/distrobuilder/main_incus.go index a7e4fde1..f02829c2 100644 --- a/distrobuilder/main_incus.go +++ b/distrobuilder/main_incus.go @@ -9,8 +9,8 @@ import ( "path/filepath" client "github.com/lxc/incus/client" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/api" + incus "github.com/lxc/incus/shared/util" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "golang.org/x/sys/unix" @@ -45,7 +45,7 @@ func (c *cmdIncus) commandBuild() *cobra.Command { `, typeDescription, compressionDescription), Args: cobra.RangeArgs(1, 2), PreRunE: func(cmd *cobra.Command, args []string) error { - if !incus.StringInSlice(c.flagType, []string{"split", "unified"}) { + if !incus.ValueInSlice(c.flagType, []string{"split", "unified"}) { return errors.New("--type needs to be one of ['split', 'unified']") } @@ -113,7 +113,7 @@ func (c *cmdIncus) commandPack() *cobra.Command { `, typeDescription, compressionDescription), Args: cobra.RangeArgs(2, 3), PreRunE: func(cmd *cobra.Command, args []string) error { - if !incus.StringInSlice(c.flagType, []string{"split", "unified"}) { + if !incus.ValueInSlice(c.flagType, []string{"split", "unified"}) { return errors.New("--type needs to be one of ['split', 'unified']") } diff --git a/distrobuilder/main_repack-windows.go b/distrobuilder/main_repack-windows.go index 43cd58ed..76735f22 100644 --- a/distrobuilder/main_repack-windows.go +++ b/distrobuilder/main_repack-windows.go @@ -15,7 +15,7 @@ import ( "strings" "github.com/flosch/pongo2" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "golang.org/x/sys/unix" @@ -110,7 +110,7 @@ func (c *cmdRepackWindows) preRun(cmd *cobra.Command, args []string) error { } else { supportedVersions := []string{"w11", "w10", "2k19", "2k12", "2k16", "2k22"} - if !incus.StringInSlice(c.flagWindowsVersion, supportedVersions) { + if !incus.ValueInSlice(c.flagWindowsVersion, supportedVersions) { return fmt.Errorf("Version must be one of %v", supportedVersions) } } @@ -126,7 +126,7 @@ func (c *cmdRepackWindows) preRun(cmd *cobra.Command, args []string) error { } else { supportedArchitectures := []string{"amd64", "ARM64"} - if !incus.StringInSlice(c.flagWindowsArchitecture, supportedArchitectures) { + if !incus.ValueInSlice(c.flagWindowsArchitecture, supportedArchitectures) { return fmt.Errorf("Architecture must be one of %v", supportedArchitectures) } } @@ -554,7 +554,7 @@ func (c *cmdRepackWindows) injectDrivers(dirs map[string]string) error { targetPath := filepath.Join(targetBasePath, filepath.Base(path)) // Copy driver files - if incus.StringInSlice(ext, []string{".cat", ".dll", ".inf", ".sys"}) { + if incus.ValueInSlice(ext, []string{".cat", ".dll", ".inf", ".sys"}) { logger.WithFields(logrus.Fields{"src": path, "dest": targetPath}).Debug("Copying file") err := shared.Copy(path, targetPath) diff --git a/distrobuilder/vm.go b/distrobuilder/vm.go index 6bad51db..fc9ba21c 100644 --- a/distrobuilder/vm.go +++ b/distrobuilder/vm.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "golang.org/x/sys/unix" "github.com/lxc/distrobuilder/shared" @@ -29,7 +29,7 @@ func newVM(ctx context.Context, imageFile, rootfsDir, fs string, size uint64) (* fs = "ext4" } - if !incus.StringInSlice(fs, []string{"btrfs", "ext4"}) { + if !incus.ValueInSlice(fs, []string{"btrfs", "ext4"}) { return nil, fmt.Errorf("Unsupported fs: %s", fs) } diff --git a/generators/cloud-init.go b/generators/cloud-init.go index 11e54e48..66ecd512 100644 --- a/generators/cloud-init.go +++ b/generators/cloud-init.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/api" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/image" "github.com/lxc/distrobuilder/shared" @@ -29,7 +29,7 @@ func (g *cloudInit) RunLXC(img *image.LXCImage, target shared.DefinitionTargetLX return nil } - if incus.StringInSlice(info.Name(), []string{"cloud-init-local", "cloud-config", "cloud-init", "cloud-final"}) { + if incus.ValueInSlice(info.Name(), []string{"cloud-init-local", "cloud-config", "cloud-init", "cloud-final"}) { err := os.Remove(path) if err != nil { return fmt.Errorf("Failed to remove file %q: %w", path, err) diff --git a/generators/cloud-init_test.go b/generators/cloud-init_test.go index 0d6b4bab..56dad4c2 100644 --- a/generators/cloud-init_test.go +++ b/generators/cloud-init_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/stretchr/testify/require" "github.com/lxc/distrobuilder/image" diff --git a/generators/copy.go b/generators/copy.go index 978d1349..c268acca 100644 --- a/generators/copy.go +++ b/generators/copy.go @@ -2,11 +2,12 @@ package generators import ( "fmt" + "io" "os" "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/image" "github.com/lxc/distrobuilder/shared" @@ -173,18 +174,59 @@ func (g *copy) copyFile(src, dest string, defFile shared.DefinitionFile) error { return fmt.Errorf("Failed to create directory %q: %w", dir, err) } - err = incus.FileCopy(src, dest) + fi, err := os.Lstat(src) if err != nil { - return fmt.Errorf("Failed to copy file %q to %q: %w", src, dest, err) + return fmt.Errorf("Failed to access source path %q: %w", src, err) } - out, err := os.Open(dest) + if fi.Mode()&os.ModeSymlink != 0 { + // Handle symlinks. + target, err := os.Readlink(src) + if err != nil { + return err + } + + if util.PathExists(dest) { + err = os.Remove(dest) + if err != nil { + return err + } + } + + err = os.Symlink(target, dest) + if err != nil { + return err + } + + return nil + } + + in, err := os.Open(src) + if err != nil { + return fmt.Errorf("Failed to open file %q: %w", src, err) + } + + defer in.Close() + + out, err := os.Create(dest) if err != nil { - return fmt.Errorf("Failed to open file %q: %w", dest, err) + if os.IsExist(err) { + out, err = os.OpenFile(dest, os.O_WRONLY, 0644) + if err != nil { + return fmt.Errorf("Failed to open file %q: %w", dest, err) + } + } else { + return fmt.Errorf("Failed to open file %q: %w", dest, err) + } } defer out.Close() + _, err = io.Copy(out, in) + if err != nil { + return fmt.Errorf("Failed to copy file %q: %w", dest, err) + } + err = updateFileAccess(out, defFile) if err != nil { return fmt.Errorf("Failed to update file access of %q: %w", dest, err) diff --git a/generators/hostname.go b/generators/hostname.go index 688f86b7..07c12093 100644 --- a/generators/hostname.go +++ b/generators/hostname.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/api" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/image" "github.com/lxc/distrobuilder/shared" diff --git a/generators/hosts.go b/generators/hosts.go index c81dfa2f..38af9e76 100644 --- a/generators/hosts.go +++ b/generators/hosts.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/api" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/image" "github.com/lxc/distrobuilder/shared" diff --git a/generators/incus-agent.go b/generators/incus-agent.go index d6e7d6e2..a0a666d2 100644 --- a/generators/incus-agent.go +++ b/generators/incus-agent.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/image" "github.com/lxc/distrobuilder/shared" diff --git a/go.mod b/go.mod index 30bf1b06..59ff87c9 100644 --- a/go.mod +++ b/go.mod @@ -9,12 +9,12 @@ exclude ( require ( github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3 - github.com/lxc/incus v0.0.0-20230914061032-a5e904192307 + github.com/lxc/incus v0.0.0-20231013213300-12aef4d0bd3d github.com/mudler/docker-companion v0.4.6-0.20211015133729-bd4704fad372 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 - golang.org/x/sys v0.12.0 + golang.org/x/sys v0.13.0 golang.org/x/text v0.13.0 gopkg.in/antchfx/htmlquery.v1 v1.2.2 gopkg.in/flosch/pongo2.v3 v3.0.0-20141028000813-5e81b817a0c4 @@ -25,21 +25,23 @@ require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.0 // indirect + github.com/Microsoft/hcsshim v0.11.1 // indirect github.com/antchfx/xpath v1.2.4 // indirect github.com/apex/log v1.9.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect - github.com/containerd/containerd v1.7.6 // indirect + github.com/containerd/containerd v1.7.7 // indirect github.com/containerd/continuity v0.4.2 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v24.0.6+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect - github.com/fsouza/go-dockerclient v1.9.8 // indirect + github.com/fsouza/go-dockerclient v1.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -49,8 +51,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/heroku/docker-registry-client v0.0.0-20211012143308-9463674c8930 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.1 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/fs v0.1.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect @@ -59,16 +60,13 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/muhlemmer/gu v0.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc4 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.9 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opencontainers/umoci v0.4.8-0.20211009121349-9c76304c034d // indirect - github.com/pborman/uuid v1.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/sftp v1.13.6 // indirect - github.com/pkg/xattr v0.4.9 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rootless-containers/proto/go-proto v0.0.0-20230421021042-4cd87ebadd67 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -77,16 +75,16 @@ require ( github.com/vbatts/go-mtree v0.5.3 // indirect github.com/zitadel/oidc/v2 v2.11.0 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.13.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/term v0.12.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sync v0.4.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/tools v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect - google.golang.org/grpc v1.58.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index a06075cd..1ca929f1 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/Microsoft/go-winio v0.4.15-0.20200113171025-3fe6c5262873/go.mod h1:tT github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.11.0 h1:7EFNIY4igHEXUdj1zXgAyU3fLc7QfOKHbkldRVTBdiM= -github.com/Microsoft/hcsshim v0.11.0/go.mod h1:OEthFdQv/AD2RAdzR6Mm1N1KPCztGKDurW1Z8b8VGMM= +github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA= +github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg= github.com/OpenPeeDeeP/depguard v1.0.0/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/antchfx/xpath v1.2.4 h1:dW1HB/JxKvGtJ9WyVGJ0sIoEcqftV3SqIstujI+B9XY= @@ -43,22 +43,25 @@ github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.7.6 h1:oNAVsnhPoy4BTPQivLgTzI9Oleml9l/+eYIDYXRCYo8= -github.com/containerd/containerd v1.7.6/go.mod h1:SY6lrkkuJT40BVNO37tlYTSnKJnP5AXBc0fhx0q+TJ4= +github.com/containerd/containerd v1.7.7 h1:QOC2K4A42RQpcrZyptP6z9EJZnlHfHJUfZrAAHe15q4= +github.com/containerd/containerd v1.7.7/go.mod h1:3c4XZv6VeT9qgf9GMTxNTMFxGJrGpI2vz1yk4ye+YY8= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= @@ -66,12 +69,15 @@ github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/distribution v0.0.0-20171011171712-7484e51bf6af/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v24.0.6+incompatible h1:hceabKCtUgDqPu+qm0NgsaXf28Ljf4/pWFL7xjWWDgE= github.com/docker/docker v24.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -96,8 +102,8 @@ github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3/go.mod h1:bJWSKrZyQv github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsouza/go-dockerclient v1.6.4/go.mod h1:GOdftxWLWIbIWKbIMDroKFJzPdg6Iw7r+jX1DDZdVsA= -github.com/fsouza/go-dockerclient v1.9.8 h1:UdfyV4/w8VthS2VS0muJqUSPL/e6XSj49jqPnbuUOWA= -github.com/fsouza/go-dockerclient v1.9.8/go.mod h1:74lNReDQxrOaogajs51IvZgkDME4qe9yPJAUEUTJtHw= +github.com/fsouza/go-dockerclient v1.10.0 h1:ppSBsbR60I1DFbV4Ag7LlHlHakHFRNLk9XakATW1yVQ= +github.com/fsouza/go-dockerclient v1.10.0/go.mod h1:+iNzAW78AzClIBTZ6WFjkaMvOgz68GyCJ236b1opLTs= github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA= github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -172,7 +178,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= @@ -201,8 +206,6 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jeremija/gosubmit v0.2.7 h1:At0OhGCFGPXyjPYAsCchoBUhE099pcBXmsb4iZqROIc= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -211,8 +214,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= +github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -232,8 +235,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lxc/incus v0.0.0-20230914061032-a5e904192307 h1:SMkWGFNZOIWAY3Yc01VF4B4B58QgdvT/i1E6rab9oqg= -github.com/lxc/incus v0.0.0-20230914061032-a5e904192307/go.mod h1:yhHdpW6Uzxn10at7nNMPQRVr7qQA0gS+EVT32mi+9/U= +github.com/lxc/incus v0.0.0-20231013213300-12aef4d0bd3d h1:sKR3vDj3Tlvx1NM9eB3A4hgBJAzpieLfWe9HK6eZ+lo= +github.com/lxc/incus v0.0.0-20231013213300-12aef4d0bd3d/go.mod h1:LM6m8ACKPMTxV8yijO5Q6vzJOv2LB5Pccs/ELlk2ZwI= github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -285,8 +288,8 @@ github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= -github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc90/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -303,8 +306,6 @@ github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xA github.com/opencontainers/umoci v0.4.7/go.mod h1:lgJ4bnwJezsN1o/5d7t/xdRPvmf8TvBko5kKYJsYvgo= github.com/opencontainers/umoci v0.4.8-0.20211009121349-9c76304c034d h1:aTf3VD/a24obMN/7xMM+5t5hVQpzTQeYnYS8aERRl8o= github.com/opencontainers/umoci v0.4.8-0.20211009121349-9c76304c034d/go.mod h1:kO0Bh4G4BZUh2QSlqsCR/OCtdqLjmt3mvD6okZhMBlU= -github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= -github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -312,22 +313,18 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= -github.com/pkg/xattr v0.4.9 h1:5883YPCtkSd8LFbs13nXplj9g9tlrwoJRjgpgMu1/fE= -github.com/pkg/xattr v0.4.9/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= -github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rootless-containers/proto/go-proto v0.0.0-20210921234734-69430b6543fb/go.mod h1:LLjEAc6zmycfeN7/1fxIphWQPjHpTt7ElqT7eVf8e4A= github.com/rootless-containers/proto/go-proto v0.0.0-20230421021042-4cd87ebadd67 h1:58jvc5cZ+hGKidQ4Z37/+rj9eQxRRjOOsqNEwPSZXR4= github.com/rootless-containers/proto/go-proto v0.0.0-20230421021042-4cd87ebadd67/go.mod h1:LLjEAc6zmycfeN7/1fxIphWQPjHpTt7ElqT7eVf8e4A= -github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -417,9 +414,9 @@ go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= -go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= -go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -431,8 +428,8 @@ golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -440,8 +437,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -460,11 +457,11 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -473,8 +470,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -501,18 +498,17 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -540,8 +536,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -554,8 +550,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb h1:Isk1sSH7bovx8Rti2wZK0UZF6oraBDK74uoyLEEVFN0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -563,8 +559,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/image/lxc.go b/image/lxc.go index 60963a0d..50226b41 100644 --- a/image/lxc.go +++ b/image/lxc.go @@ -8,7 +8,7 @@ import ( "strings" "time" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) diff --git a/managers/apt.go b/managers/apt.go index 46a49b1d..44fd28b7 100644 --- a/managers/apt.go +++ b/managers/apt.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) diff --git a/managers/luet.go b/managers/luet.go index b6d2628d..938b935f 100644 --- a/managers/luet.go +++ b/managers/luet.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) diff --git a/managers/pacman.go b/managers/pacman.go index c76b612e..b16a96ad 100644 --- a/managers/pacman.go +++ b/managers/pacman.go @@ -6,7 +6,7 @@ import ( "path/filepath" "runtime" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) @@ -100,7 +100,7 @@ func (m *pacman) setupTrustedKeys() error { var keyring string - if incus.StringInSlice(runtime.GOARCH, []string{"arm", "arm64"}) { + if incus.ValueInSlice(runtime.GOARCH, []string{"arm", "arm64"}) { keyring = "archlinuxarm" } else { keyring = "archlinux" @@ -124,7 +124,7 @@ func (m *pacman) setMirrorlist() error { var mirror string - if incus.StringInSlice(runtime.GOARCH, []string{"arm", "arm64"}) { + if incus.ValueInSlice(runtime.GOARCH, []string{"arm", "arm64"}) { mirror = "Server = http://mirror.archlinuxarm.org/$arch/$repo" } else { mirror = "Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch" diff --git a/managers/yum.go b/managers/yum.go index 5b2760e3..7c4c1e1d 100644 --- a/managers/yum.go +++ b/managers/yum.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) diff --git a/shared/archive_linux.go b/shared/archive_linux.go index 610b8647..81ea1861 100644 --- a/shared/archive_linux.go +++ b/shared/archive_linux.go @@ -8,7 +8,6 @@ import ( "os" "strings" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/archive" "github.com/lxc/incus/shared/subprocess" "golang.org/x/sys/unix" @@ -43,17 +42,7 @@ func Unpack(file string, path string) error { // unsquashfs does not support reading from stdin, // so ProgressTracker is not possible. command = "unsquashfs" - args = append(args, "-f", "-d", path, "-n") - - // Limit unsquashfs chunk size to 10% of memory and up to 256MB (default) - // When running on a low memory system, also disable multi-processing - mem, err := incus.DeviceTotalMemory() - mem = mem / 1024 / 1024 / 10 - if err == nil && mem < 256 { - args = append(args, "-da", fmt.Sprintf("%d", mem), "-fr", fmt.Sprintf("%d", mem), "-p", "1") - } - - args = append(args, file) + args = append(args, "-f", "-d", path, "-n", file) } else { return fmt.Errorf("Unsupported image format: %s", extension) } diff --git a/shared/chroot.go b/shared/chroot.go index 108f133d..dfb9ae40 100644 --- a/shared/chroot.go +++ b/shared/chroot.go @@ -7,7 +7,7 @@ import ( "regexp" "strconv" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "golang.org/x/sys/unix" ) diff --git a/shared/definition.go b/shared/definition.go index 84eb3dc3..edb89437 100644 --- a/shared/definition.go +++ b/shared/definition.go @@ -8,8 +8,9 @@ import ( "strings" "time" - "github.com/lxc/incus/shared" + "github.com/lxc/incus/shared/osarch" incusArch "github.com/lxc/incus/shared/osarch" + "github.com/lxc/incus/shared/util" ) // ImageTarget represents the image target. @@ -312,8 +313,8 @@ func (d *Definition) SetValue(key string, value string) error { func (d *Definition) SetDefaults() { // default to local arch if d.Image.Architecture == "" { - uname, _ := shared.Uname() - d.Image.Architecture = uname.Machine + localArch, _ := osarch.ArchitectureGetLocal() + d.Image.Architecture = localArch } // set default expiry of 30 days @@ -384,7 +385,7 @@ func (d *Definition) Validate() error { "slackware-http", } - if !shared.StringInSlice(strings.TrimSpace(d.Source.Downloader), validDownloaders) { + if !util.ValueInSlice(strings.TrimSpace(d.Source.Downloader), validDownloaders) { return fmt.Errorf("source.downloader must be one of %v", validDownloaders) } @@ -405,7 +406,7 @@ func (d *Definition) Validate() error { "slackpkg", } - if !shared.StringInSlice(strings.TrimSpace(d.Packages.Manager), validManagers) { + if !util.ValueInSlice(strings.TrimSpace(d.Packages.Manager), validManagers) { return fmt.Errorf("packages.manager must be one of %v", validManagers) } @@ -451,7 +452,7 @@ func (d *Definition) Validate() error { } for _, file := range d.Files { - if !shared.StringInSlice(strings.TrimSpace(file.Generator), validGenerators) { + if !util.ValueInSlice(strings.TrimSpace(file.Generator), validGenerators) { return fmt.Errorf("files.*.generator must be one of %v", validGenerators) } } @@ -472,7 +473,7 @@ func (d *Definition) Validate() error { architectureMap := strings.TrimSpace(d.Mappings.ArchitectureMap) if architectureMap != "" { - if !shared.StringInSlice(architectureMap, validMappings) { + if !util.ValueInSlice(architectureMap, validMappings) { return fmt.Errorf("mappings.architecture_map must be one of %v", validMappings) } } @@ -485,7 +486,7 @@ func (d *Definition) Validate() error { } for _, action := range d.Actions { - if !shared.StringInSlice(action.Trigger, validTriggers) { + if !util.ValueInSlice(action.Trigger, validTriggers) { return fmt.Errorf("actions.*.trigger must be one of %v", validTriggers) } } @@ -496,7 +497,7 @@ func (d *Definition) Validate() error { } for _, set := range d.Packages.Sets { - if !shared.StringInSlice(set.Action, validPackageActions) { + if !util.ValueInSlice(set.Action, validPackageActions) { return fmt.Errorf("packages.*.set.*.action must be one of %v", validPackageActions) } } @@ -641,15 +642,15 @@ func getFieldByTag(v reflect.Value, t reflect.Type, tag string) (reflect.Value, // ApplyFilter returns true if the filter matches. func ApplyFilter(filter Filter, release string, architecture string, variant string, targetType DefinitionFilterType, acceptedImageTargets ImageTarget) bool { - if len(filter.GetReleases()) > 0 && !shared.StringInSlice(release, filter.GetReleases()) { + if len(filter.GetReleases()) > 0 && !util.ValueInSlice(release, filter.GetReleases()) { return false } - if len(filter.GetArchitectures()) > 0 && !shared.StringInSlice(architecture, filter.GetArchitectures()) { + if len(filter.GetArchitectures()) > 0 && !util.ValueInSlice(architecture, filter.GetArchitectures()) { return false } - if len(filter.GetVariants()) > 0 && !shared.StringInSlice(variant, filter.GetVariants()) { + if len(filter.GetVariants()) > 0 && !util.ValueInSlice(variant, filter.GetVariants()) { return false } diff --git a/shared/definition_test.go b/shared/definition_test.go index b2092208..6c2ffc13 100644 --- a/shared/definition_test.go +++ b/shared/definition_test.go @@ -4,7 +4,7 @@ import ( "log" "testing" - "github.com/lxc/incus/shared" + "github.com/lxc/incus/shared/osarch" "github.com/stretchr/testify/require" yaml "gopkg.in/yaml.v2" ) @@ -14,9 +14,9 @@ func TestSetDefinitionDefaults(t *testing.T) { def.SetDefaults() - uname, _ := shared.Uname() + localArch, _ := osarch.ArchitectureGetLocal() - require.Equal(t, uname.Machine, def.Image.Architecture) + require.Equal(t, localArch, def.Image.Architecture) require.Equal(t, "30d", def.Image.Expiry) } diff --git a/shared/util.go b/shared/util.go index 64d91e98..2f70161a 100644 --- a/shared/util.go +++ b/shared/util.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/lxc/incus/shared" + "github.com/lxc/incus/shared/util" "golang.org/x/sys/unix" "gopkg.in/flosch/pongo2.v3" yaml "gopkg.in/yaml.v2" @@ -135,7 +135,7 @@ func compressTarball(ctx context.Context, filename, compression string) (string, } // If supported, use as many threads as possible. - if shared.StringInSlice(compression, []string{"zstd", "xz", "lzma"}) { + if util.ValueInSlice(compression, []string{"zstd", "xz", "lzma"}) { args = append(args, "--threads=0") } @@ -385,7 +385,7 @@ func ParseSquashfsCompression(compression string) (string, *int, error) { compression = "lzo" } - if shared.StringInSlice(compression, []string{"gzip", "lzo", "lz4", "xz", "zstd", "lzma"}) { + if util.ValueInSlice(compression, []string{"gzip", "lzo", "lz4", "xz", "zstd", "lzma"}) { return compression, nil, nil } diff --git a/sources/common.go b/sources/common.go index 5f48e376..5486d355 100644 --- a/sources/common.go +++ b/sources/common.go @@ -13,8 +13,8 @@ import ( "strings" "time" - incus "github.com/lxc/incus/shared" "github.com/lxc/incus/shared/ioprogress" + incus "github.com/lxc/incus/shared/util" "github.com/sirupsen/logrus" "github.com/lxc/distrobuilder/shared" diff --git a/sources/common_test.go b/sources/common_test.go index 6011952b..480ee378 100644 --- a/sources/common_test.go +++ b/sources/common_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/stretchr/testify/require" "github.com/lxc/distrobuilder/shared" diff --git a/sources/debootstrap.go b/sources/debootstrap.go index bd86cc7b..00f1f31b 100644 --- a/sources/debootstrap.go +++ b/sources/debootstrap.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "github.com/lxc/distrobuilder/shared" ) @@ -24,7 +24,7 @@ func (s *debootstrap) Run() error { release := strings.ToLower(s.definition.Image.Release) // Enable merged /usr by default, and disable it for certain distros/releases - if distro == "ubuntu" && incus.StringInSlice(release, []string{"xenial", "bionic"}) || distro == "mint" && incus.StringInSlice(release, []string{"tara", "tessa", "tina", "tricia", "ulyana"}) || distro == "devuan" { + if distro == "ubuntu" && incus.ValueInSlice(release, []string{"xenial", "bionic"}) || distro == "mint" && incus.ValueInSlice(release, []string{"tara", "tessa", "tina", "tricia", "ulyana"}) || distro == "devuan" { args = append(args, "--no-merged-usr") } else { args = append(args, "--merged-usr") diff --git a/sources/oraclelinux-http.go b/sources/oraclelinux-http.go index 7a337afb..2e5decca 100644 --- a/sources/oraclelinux-http.go +++ b/sources/oraclelinux-http.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "golang.org/x/sys/unix" "gopkg.in/antchfx/htmlquery.v1" diff --git a/sources/plamolinux-http.go b/sources/plamolinux-http.go index 7ee6f5e6..ba638d7d 100644 --- a/sources/plamolinux-http.go +++ b/sources/plamolinux-http.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "gopkg.in/antchfx/htmlquery.v1" "github.com/lxc/distrobuilder/shared" @@ -152,7 +152,7 @@ func (s *plamolinux) downloadFiles(def shared.DefinitionImage, URL string, ignor if strings.HasSuffix(target, ".txz") || strings.HasSuffix(target, ".tzst") { pkgName := strings.Split(target, "-")[0] - if incus.StringInSlice(pkgName, ignoredPkgs) { + if incus.ValueInSlice(pkgName, ignoredPkgs) { continue } diff --git a/sources/rhel-common.go b/sources/rhel-common.go index b860082b..1780b747 100644 --- a/sources/rhel-common.go +++ b/sources/rhel-common.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "golang.org/x/sys/unix" "github.com/lxc/distrobuilder/shared" diff --git a/sources/slackware-http.go b/sources/slackware-http.go index a6bbbdd2..69330c9b 100644 --- a/sources/slackware-http.go +++ b/sources/slackware-http.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" "gopkg.in/antchfx/htmlquery.v1" "github.com/lxc/distrobuilder/shared" @@ -150,7 +150,7 @@ func (s *slackware) downloadFiles(def shared.DefinitionImage, URL string, requir pkgName := strings.Split(target, "-")[0] twoPkgName := strings.Split(target, "-")[0] + "-" + strings.Split(target, "-")[1] - if !((incus.StringInSlice(pkgName, requiredPkgs)) || (incus.StringInSlice(twoPkgName, requiredPkgs))) { + if !((incus.ValueInSlice(pkgName, requiredPkgs)) || (incus.ValueInSlice(twoPkgName, requiredPkgs))) { continue } diff --git a/sources/utils.go b/sources/utils.go index 2c8b7a7d..7616c611 100644 --- a/sources/utils.go +++ b/sources/utils.go @@ -15,7 +15,7 @@ import ( "regexp" "strings" - incus "github.com/lxc/incus/shared" + incus "github.com/lxc/incus/shared/util" ) // downloadChecksum downloads or opens URL, and matches fname against the