diff --git a/ghw/ghw.go b/ghw/ghw.go new file mode 100644 index 00000000..0d136212 --- /dev/null +++ b/ghw/ghw.go @@ -0,0 +1,326 @@ +package ghw + +import ( + "bufio" + "fmt" + "io" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/kairos-io/kairos-sdk/types" +) + +const ( + sectorSize = 512 + UNKNOWN = "unknown" +) + +type Disk struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + SizeBytes uint64 `json:"size_bytes,omitempty" yaml:"size_bytes,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` + Partitions types.PartitionList `json:"partitions,omitempty" yaml:"partitions,omitempty"` +} + +type Paths struct { + SysBlock string + RunUdevData string + ProcMounts string +} + +func NewPaths(withOptionalPrefix string) *Paths { + p := &Paths{ + SysBlock: "/sys/block/", + RunUdevData: "/run/udev/data", + ProcMounts: "/proc/mounts", + } + if withOptionalPrefix != "" { + withOptionalPrefix = strings.TrimSuffix(withOptionalPrefix, "/") + p.SysBlock = fmt.Sprintf("%s%s", withOptionalPrefix, p.SysBlock) + p.RunUdevData = fmt.Sprintf("%s%s", withOptionalPrefix, p.RunUdevData) + p.ProcMounts = fmt.Sprintf("%s%s", withOptionalPrefix, p.ProcMounts) + } + return p +} + +func GetDisks(paths *Paths, logger *types.KairosLogger) []*Disk { + if logger == nil { + newLogger := types.NewKairosLogger("ghw", "info", false) + logger = &newLogger + } + disks := make([]*Disk, 0) + logger.Logger.Debug().Str("path", paths.SysBlock).Msg("Scanning for disks") + files, err := os.ReadDir(paths.SysBlock) + if err != nil { + return nil + } + for _, file := range files { + logger.Logger.Debug().Str("file", file.Name()).Msg("Reading file") + dname := file.Name() + size := diskSizeBytes(paths, dname, logger) + + if strings.HasPrefix(dname, "loop") && size == 0 { + // We don't care about unused loop devices... + continue + } + d := &Disk{ + Name: dname, + SizeBytes: size, + UUID: diskUUID(paths, dname, "", logger), + } + + parts := diskPartitions(paths, dname, logger) + d.Partitions = parts + + disks = append(disks, d) + } + + return disks +} + +func diskSizeBytes(paths *Paths, disk string, logger *types.KairosLogger) uint64 { + // We can find the number of 512-byte sectors by examining the contents of + // /sys/block/$DEVICE/size and calculate the physical bytes accordingly. + path := filepath.Join(paths.SysBlock, disk, "size") + logger.Logger.Debug().Str("path", path).Msg("Reading disk size") + contents, err := os.ReadFile(path) + if err != nil { + logger.Logger.Error().Str("path", path).Err(err).Msg("Failed to read file") + return 0 + } + size, err := strconv.ParseUint(strings.TrimSpace(string(contents)), 10, 64) + if err != nil { + logger.Logger.Error().Str("path", path).Err(err).Str("content", string(contents)).Msg("Failed to parse size") + return 0 + } + logger.Logger.Trace().Uint64("size", size*sectorSize).Msg("Got disk size") + return size * sectorSize +} + +// diskPartitions takes the name of a disk (note: *not* the path of the disk, +// but just the name. In other words, "sda", not "/dev/sda" and "nvme0n1" not +// "/dev/nvme0n1") and returns a slice of pointers to Partition structs +// representing the partitions in that disk +func diskPartitions(paths *Paths, disk string, logger *types.KairosLogger) types.PartitionList { + out := make(types.PartitionList, 0) + path := filepath.Join(paths.SysBlock, disk) + logger.Logger.Debug().Str("file", path).Msg("Reading disk file") + files, err := os.ReadDir(path) + if err != nil { + logger.Logger.Error().Err(err).Msg("failed to read disk partitions") + return out + } + for _, file := range files { + fname := file.Name() + if !strings.HasPrefix(fname, disk) { + continue + } + logger.Logger.Debug().Str("file", fname).Msg("Reading partition file") + size := partitionSizeBytes(paths, disk, fname, logger) + mp, pt := partitionInfo(paths, fname, logger) + du := diskPartUUID(paths, disk, fname, logger) + if pt == "" { + pt = diskPartTypeUdev(paths, disk, fname, logger) + } + fsLabel := diskFSLabel(paths, disk, fname, logger) + p := &types.Partition{ + Name: fname, + Size: uint(size / (1024 * 1024)), + MountPoint: mp, + UUID: du, + FilesystemLabel: fsLabel, + FS: pt, + Path: filepath.Join("/dev", fname), + Disk: filepath.Join("/dev", disk), + } + out = append(out, p) + } + return out +} + +func partitionSizeBytes(paths *Paths, disk string, part string, logger *types.KairosLogger) uint64 { + path := filepath.Join(paths.SysBlock, disk, part, "size") + logger.Logger.Debug().Str("file", path).Msg("Reading size file") + contents, err := os.ReadFile(path) + if err != nil { + logger.Logger.Error().Str("file", path).Err(err).Msg("failed to read disk partition size") + return 0 + } + size, err := strconv.ParseUint(strings.TrimSpace(string(contents)), 10, 64) + if err != nil { + logger.Logger.Error().Str("contents", string(contents)).Err(err).Msg("failed to parse disk partition size") + return 0 + } + logger.Logger.Trace().Str("disk", disk).Str("partition", part).Uint64("size", size*sectorSize).Msg("Got partition size") + return size * sectorSize +} + +func partitionInfo(paths *Paths, part string, logger *types.KairosLogger) (string, string) { + // Allow calling PartitionInfo with either the full partition name + // "/dev/sda1" or just "sda1" + if !strings.HasPrefix(part, "/dev") { + part = "/dev/" + part + } + + // mount entries for mounted partitions look like this: + // /dev/sda6 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0 + var r io.ReadCloser + logger.Logger.Debug().Str("file", paths.ProcMounts).Msg("Reading mounts file") + r, err := os.Open(paths.ProcMounts) + if err != nil { + logger.Logger.Error().Str("file", paths.ProcMounts).Err(err).Msg("failed to open mounts") + return "", "" + } + defer r.Close() + + scanner := bufio.NewScanner(r) + for scanner.Scan() { + line := scanner.Text() + logger.Logger.Debug().Str("line", line).Msg("Parsing mount info") + entry := parseMountEntry(line, logger) + if entry == nil || entry.Partition != part { + continue + } + + return entry.Mountpoint, entry.FilesystemType + } + return "", "" +} + +type mountEntry struct { + Partition string + Mountpoint string + FilesystemType string +} + +func parseMountEntry(line string, logger *types.KairosLogger) *mountEntry { + // mount entries for mounted partitions look like this: + // /dev/sda6 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0 + if line[0] != '/' { + return nil + } + fields := strings.Fields(line) + + if len(fields) < 4 { + logger.Logger.Debug().Interface("fields", fields).Msg("Mount line has less than 4 fields") + return nil + } + + // We do some special parsing of the mountpoint, which may contain space, + // tab and newline characters, encoded into the mount entry line using their + // octal-to-string representations. From the GNU mtab man pages: + // + // "Therefore these characters are encoded in the files and the getmntent + // function takes care of the decoding while reading the entries back in. + // '\040' is used to encode a space character, '\011' to encode a tab + // character, '\012' to encode a newline character, and '\\' to encode a + // backslash." + mp := fields[1] + r := strings.NewReplacer( + "\\011", "\t", "\\012", "\n", "\\040", " ", "\\\\", "\\", + ) + mp = r.Replace(mp) + + res := &mountEntry{ + Partition: fields[0], + Mountpoint: mp, + FilesystemType: fields[2], + } + return res +} + +func diskUUID(paths *Paths, disk string, partition string, logger *types.KairosLogger) string { + info, err := udevInfoPartition(paths, disk, partition, logger) + logger.Logger.Trace().Interface("info", info).Msg("Disk UUID") + if err != nil { + logger.Logger.Error().Str("disk", disk).Str("partition", partition).Interface("info", info).Err(err).Msg("failed to read disk UUID") + return UNKNOWN + } + + if pType, ok := info["ID_PART_TABLE_UUID"]; ok { + logger.Logger.Trace().Str("disk", disk).Str("partition", partition).Str("uuid", pType).Msg("Got disk uuid") + return pType + } + + return UNKNOWN +} + +func diskPartUUID(paths *Paths, disk string, partition string, logger *types.KairosLogger) string { + info, err := udevInfoPartition(paths, disk, partition, logger) + logger.Logger.Trace().Interface("info", info).Msg("Disk Part UUID") + if err != nil { + logger.Logger.Error().Str("disk", disk).Str("partition", partition).Interface("info", info).Err(err).Msg("Disk Part UUID") + return UNKNOWN + } + + if pType, ok := info["ID_PART_ENTRY_UUID"]; ok { + logger.Logger.Trace().Str("disk", disk).Str("partition", partition).Str("uuid", pType).Msg("Got partition uuid") + return pType + } + return UNKNOWN +} + +// diskPartTypeUdev gets the partition type from the udev database directly and its only used as fallback when +// the partition is not mounted, so we cannot get the type from paths.ProcMounts from the partitionInfo function +func diskPartTypeUdev(paths *Paths, disk string, partition string, logger *types.KairosLogger) string { + info, err := udevInfoPartition(paths, disk, partition, logger) + logger.Logger.Trace().Interface("info", info).Msg("Disk Part Type") + if err != nil { + logger.Logger.Error().Str("disk", disk).Str("partition", partition).Interface("info", info).Err(err).Msg("Disk Part Type") + return UNKNOWN + } + + if pType, ok := info["ID_FS_TYPE"]; ok { + logger.Logger.Trace().Str("disk", disk).Str("partition", partition).Str("FS", pType).Msg("Got partition fs type") + return pType + } + return UNKNOWN +} + +func diskFSLabel(paths *Paths, disk string, partition string, logger *types.KairosLogger) string { + info, err := udevInfoPartition(paths, disk, partition, logger) + logger.Logger.Trace().Interface("info", info).Msg("Disk FS label") + if err != nil { + logger.Logger.Error().Str("disk", disk).Str("partition", partition).Interface("info", info).Err(err).Msg("Disk FS label") + return UNKNOWN + } + + if label, ok := info["ID_FS_LABEL"]; ok { + logger.Logger.Trace().Str("disk", disk).Str("partition", partition).Str("uuid", label).Msg("Got partition label") + return label + } + return UNKNOWN +} + +func udevInfoPartition(paths *Paths, disk string, partition string, logger *types.KairosLogger) (map[string]string, error) { + // Get device major:minor numbers + devNo, err := os.ReadFile(filepath.Join(paths.SysBlock, disk, partition, "dev")) + if err != nil { + logger.Logger.Error().Err(err).Str("path", filepath.Join(paths.SysBlock, disk, partition, "dev")).Msg("failed to read udev info") + return nil, err + } + return UdevInfo(paths, string(devNo), logger) +} + +// UdevInfo will return information on udev database about a device number +func UdevInfo(paths *Paths, devNo string, logger *types.KairosLogger) (map[string]string, error) { + // Look up block device in udev runtime database + udevID := "b" + strings.TrimSpace(devNo) + udevBytes, err := os.ReadFile(filepath.Join(paths.RunUdevData, udevID)) + if err != nil { + logger.Logger.Error().Err(err).Str("path", filepath.Join(paths.RunUdevData, udevID)).Msg("failed to read udev info for device") + return nil, err + } + + udevInfo := make(map[string]string) + for _, udevLine := range strings.Split(string(udevBytes), "\n") { + if strings.HasPrefix(udevLine, "E:") { + if s := strings.SplitN(udevLine[2:], "=", 2); len(s) == 2 { + udevInfo[s[0]] = s[1] + } + } + } + return udevInfo, nil +} diff --git a/ghw/ghw_test.go b/ghw/ghw_test.go new file mode 100644 index 00000000..7ac1e6b6 --- /dev/null +++ b/ghw/ghw_test.go @@ -0,0 +1,226 @@ +package ghw_test + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/kairos-io/kairos-sdk/ghw" + "github.com/kairos-io/kairos-sdk/types" + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestGHW(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "GHW test suite") +} + +var _ = Describe("GHW functions tests", func() { + var ghwMock GhwMock + BeforeEach(func() { + ghwMock = GhwMock{} + }) + AfterEach(func() { + ghwMock.Clean() + }) + Describe("With a disk", func() { + BeforeEach(func() { + mainDisk := ghw.Disk{ + Name: "disk", + UUID: "555", + SizeBytes: 1 * 1024, + Partitions: []*types.Partition{ + { + Name: "disk1", + FilesystemLabel: "COS_GRUB", + FS: "ext4", + MountPoint: "/efi", + Size: 0, + UUID: "666", + }, + }, + } + + ghwMock.AddDisk(mainDisk) + ghwMock.CreateDevices() + }) + + It("Finds the disk and partition", func() { + disks := ghw.GetDisks(ghw.NewPaths(ghwMock.chroot), nil) + Expect(len(disks)).To(Equal(1), disks) + Expect(disks[0].Name).To(Equal("disk"), disks) + Expect(disks[0].UUID).To(Equal("555"), disks) + // Expected is size * sectorsize which is 512 + Expect(disks[0].SizeBytes).To(Equal(uint64(1*1024*512)), disks) + Expect(len(disks[0].Partitions)).To(Equal(1), disks) + Expect(disks[0].Partitions[0].Name).To(Equal("disk1"), disks) + Expect(disks[0].Partitions[0].FilesystemLabel).To(Equal("COS_GRUB"), disks) + Expect(disks[0].Partitions[0].FS).To(Equal("ext4"), disks) + Expect(disks[0].Partitions[0].MountPoint).To(Equal("/efi"), disks) + Expect(disks[0].Partitions[0].UUID).To(Equal("666"), disks) + }) + }) + Describe("With no disks", func() { + It("Finds nothing", func() { + ghwMock.CreateDevices() + disks := ghw.GetDisks(ghw.NewPaths(ghwMock.chroot), nil) + Expect(len(disks)).To(Equal(0), disks) + }) + }) + +}) + +// GhwMock is used to construct a fake disk to present to ghw when scanning block devices +// The way this works is ghw will use the existing files in the system to determine the different disks, partitions and +// mountpoints. It uses /sys/block, /proc/self/mounts and /run/udev/data to gather everything +// It also has an entrypoint to overwrite the root dir from which the paths are constructed so that allows us to override +// it easily and make it read from a different location. +// This mock is used to construct a fake FS with all its needed files on a different chroot and just add a Disk with its +// partitions and let the struct do its thing creating files and mountpoints and such +// You can even just pass no disks to simulate a system in which there is no disk/no cos partitions +type GhwMock struct { + chroot string + paths *ghw.Paths + disks []ghw.Disk + mounts []string +} + +// AddDisk adds a disk to GhwMock +func (g *GhwMock) AddDisk(disk ghw.Disk) { + g.disks = append(g.disks, disk) +} + +// AddPartitionToDisk will add a partition to the given disk and call Clean+CreateDevices, so we recreate all files +// It makes no effort checking if the disk exists +func (g *GhwMock) AddPartitionToDisk(diskName string, partition *types.Partition) { + for _, disk := range g.disks { + if disk.Name == diskName { + disk.Partitions = append(disk.Partitions, partition) + g.Clean() + g.CreateDevices() + } + } +} + +// CreateDevices will create a new context and paths for ghw using the Chroot value as base, then set the env var GHW_ROOT so the +// ghw library picks that up and then iterate over the disks and partitions and create the necessary files +func (g *GhwMock) CreateDevices() { + d, _ := os.MkdirTemp("", "ghwmock") + g.chroot = d + g.paths = ghw.NewPaths(d) + // Create the /sys/block dir + _ = os.MkdirAll(g.paths.SysBlock, 0755) + // Create the /run/udev/data dir + _ = os.MkdirAll(g.paths.RunUdevData, 0755) + // Create only the /proc/ dir, we add the mounts file afterwards + procDir, _ := filepath.Split(g.paths.ProcMounts) + _ = os.MkdirAll(procDir, 0755) + for indexDisk, disk := range g.disks { + // For each dir we create the /sys/block/DISK_NAME + diskPath := filepath.Join(g.paths.SysBlock, disk.Name) + _ = os.Mkdir(diskPath, 0755) + // We create a dev file to indicate the devicenumber for a given disk + _ = os.WriteFile(filepath.Join(g.paths.SysBlock, disk.Name, "dev"), []byte(fmt.Sprintf("%d:0\n", indexDisk)), 0644) + // Also write the size + _ = os.WriteFile(filepath.Join(g.paths.SysBlock, disk.Name, "size"), []byte(strconv.FormatUint(disk.SizeBytes, 10)), 0644) + // Create the udevdata for this disk + _ = os.WriteFile(filepath.Join(g.paths.RunUdevData, fmt.Sprintf("b%d:0", indexDisk)), []byte(fmt.Sprintf("E:ID_PART_TABLE_UUID=%s\n", disk.UUID)), 0644) + for indexPart, partition := range disk.Partitions { + // For each partition we create the /sys/block/DISK_NAME/PARTITION_NAME + _ = os.Mkdir(filepath.Join(diskPath, partition.Name), 0755) + // Create the /sys/block/DISK_NAME/PARTITION_NAME/dev file which contains the major:minor of the partition + _ = os.WriteFile(filepath.Join(diskPath, partition.Name, "dev"), []byte(fmt.Sprintf("%d:6%d\n", indexDisk, indexPart)), 0644) + _ = os.WriteFile(filepath.Join(diskPath, partition.Name, "size"), []byte(fmt.Sprintf("%d\n", partition.Size)), 0644) + // Create the /run/udev/data/bMAJOR:MINOR file with the data inside to mimic the udev database + data := []string{fmt.Sprintf("E:ID_FS_LABEL=%s\n", partition.FilesystemLabel)} + if partition.FS != "" { + data = append(data, fmt.Sprintf("E:ID_FS_TYPE=%s\n", partition.FS)) + } + if partition.UUID != "" { + data = append(data, fmt.Sprintf("E:ID_PART_ENTRY_UUID=%s\n", partition.UUID)) + } + _ = os.WriteFile(filepath.Join(g.paths.RunUdevData, fmt.Sprintf("b%d:6%d", indexDisk, indexPart)), []byte(strings.Join(data, "")), 0644) + // If we got a mountpoint, add it to our fake /proc/self/mounts + if partition.MountPoint != "" { + // Check if the partition has a fs, otherwise default to ext4 + if partition.FS == "" { + partition.FS = "ext4" + } + // Prepare the g.mounts with all the mount lines + g.mounts = append( + g.mounts, + fmt.Sprintf("%s %s %s ro,relatime 0 0\n", filepath.Join("/dev", partition.Name), partition.MountPoint, partition.FS)) + } + } + } + // Finally, write all the mounts + _ = os.WriteFile(g.paths.ProcMounts, []byte(strings.Join(g.mounts, "")), 0644) +} + +// RemoveDisk will remove the files for a disk. It makes no effort to check if the disk exists or not +func (g *GhwMock) RemoveDisk(disk string) { + // This could be simpler I think, just removing the /sys/block/DEVICE should make ghw not find anything and not search + // for partitions, but just in case do it properly + var newMounts []string + diskPath := filepath.Join(g.paths.SysBlock, disk) + _ = os.RemoveAll(diskPath) + + // Try to find any mounts that match the disk given and remove them from the mounts + for _, mount := range g.mounts { + fields := strings.Fields(mount) + // If first field does not contain the /dev/DEVICE, add it to the newmounts + if !strings.Contains(fields[0], filepath.Join("/dev", disk)) { + newMounts = append(newMounts, mount) + } + } + g.mounts = newMounts + // Write the mounts again + _ = os.WriteFile(g.paths.ProcMounts, []byte(strings.Join(g.mounts, "")), 0644) +} + +// RemovePartitionFromDisk will remove the files for a partition +// It makes no effort checking if the disk/partition/files exist +func (g *GhwMock) RemovePartitionFromDisk(diskName string, partitionName string) { + var newMounts []string + diskPath := filepath.Join(g.paths.SysBlock, diskName) + // Read the dev major:minor + devName, _ := os.ReadFile(filepath.Join(diskPath, partitionName, "dev")) + // Remove the MAJOR:MINOR file from the udev database + _ = os.RemoveAll(filepath.Join(g.paths.RunUdevData, fmt.Sprintf("b%s", devName))) + // Remove the /sys/block/DISK/PARTITION dir + _ = os.RemoveAll(filepath.Join(diskPath, partitionName)) + + // Try to find any mounts that match the partition given and remove them from the mounts + for _, mount := range g.mounts { + fields := strings.Fields(mount) + // If first field does not contain the /dev/PARTITION, add it to the newmounts + if !strings.Contains(fields[0], filepath.Join("/dev", partitionName)) { + newMounts = append(newMounts, mount) + } + } + g.mounts = newMounts + // Write the mounts again + _ = os.WriteFile(g.paths.ProcMounts, []byte(strings.Join(g.mounts, "")), 0644) + // Remove it from the partitions list + for index, disk := range g.disks { + if disk.Name == diskName { + var newPartitions types.PartitionList + for _, partition := range disk.Partitions { + if partition.Name != partitionName { + newPartitions = append(newPartitions, partition) + } + } + g.disks[index].Partitions = newPartitions + } + } +} + +// Clean will remove the chroot dir and unset the env var +func (g *GhwMock) Clean() { + _ = os.RemoveAll(g.chroot) +} diff --git a/go.mod b/go.mod index 1482278e..3963fc4c 100644 --- a/go.mod +++ b/go.mod @@ -23,8 +23,7 @@ require ( github.com/qeesung/image2ascii v1.0.1 github.com/rs/zerolog v1.33.0 github.com/saferwall/pe v1.5.4 - github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 - github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 github.com/swaggest/jsonschema-go v0.3.62 github.com/twpayne/go-vfs/v4 v4.3.0 github.com/urfave/cli/v2 v2.27.4 @@ -57,7 +56,6 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect - github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect @@ -71,7 +69,7 @@ require ( github.com/gookit/color v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/itchyny/timefmt-go v0.1.6 // indirect - github.com/jaypipes/pcidb v1.0.0 // indirect + github.com/jaypipes/pcidb v1.0.1 // indirect github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -103,7 +101,6 @@ require ( go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.24.0 // indirect diff --git a/go.sum b/go.sum index 1c56d0a8..6e374ceb 100644 --- a/go.sum +++ b/go.sum @@ -93,10 +93,8 @@ github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaD github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.7.20 h1:Sl6jQYk3TRavaU83h66QMbI2Nqg9Jm6qzwX57Vsn1SQ= -github.com/containerd/containerd v1.7.20/go.mod h1:52GsS5CwquuqPuLncsXwG0t2CiUce+KsNHJZQJvAgR0= -github.com/containerd/containerd v1.7.21 h1:USGXRK1eOC/SX0L195YgxTHb0a00anxajOzgfN0qrCA= -github.com/containerd/containerd v1.7.21/go.mod h1:e3Jz1rYRUZ2Lt51YrH9Rz0zPyJBOlSvB3ghr2jbVD8g= +github.com/containerd/containerd v1.7.22 h1:nZuNnNRA6T6jB975rx2RRNqqH2k6ELYKDZfqTHqwyy0= +github.com/containerd/containerd v1.7.22/go.mod h1:e3Jz1rYRUZ2Lt51YrH9Rz0zPyJBOlSvB3ghr2jbVD8g= 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/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= @@ -117,18 +115,12 @@ github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMS github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v24.0.0+incompatible h1:0+1VshNwBQzQAx9lOl+OYCTCEAD8fKs/qeXMx3O0wqM= -github.com/docker/cli v24.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= 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/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY= -github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v27.1.2+incompatible h1:AhGzR1xaQIy53qCkxARaFluI00WPGtXn0AJuoQsVYTY= -github.com/docker/docker v27.1.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v27.2.0+incompatible h1:Rk9nIVdfH3+Vz4cyI/uhbINhEZ/oLmc+CBXmH6fbNk4= -github.com/docker/docker v27.2.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.2.1+incompatible h1:fQdiLfW7VLscyoeYEBz7/J8soYFDZV1u6VW6gJEjNMI= +github.com/docker/docker v27.2.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -145,16 +137,12 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/foxboron/go-uefi v0.0.0-20240722190620-5d4f760099bd h1:as2HfgSh+rJJgM9yCSAv+VpJt11hMPpYh6Jo9l45Ceo= -github.com/foxboron/go-uefi v0.0.0-20240722190620-5d4f760099bd/go.mod h1:ffg/fkDeOYicEQLoO2yFFGt00KUTYVXI+rfnc8il6vQ= github.com/foxboron/go-uefi v0.0.0-20240805124652-e2076f0e58ca h1:ErxkaWK5AIt8gQf3KpAuQQBdZI4ps72HzEe123kh+So= github.com/foxboron/go-uefi v0.0.0-20240805124652-e2076f0e58ca/go.mod h1:ffg/fkDeOYicEQLoO2yFFGt00KUTYVXI+rfnc8il6vQ= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -215,8 +203,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.20.1 h1:eTgx9QNYugV4DN5mz4U8hiAGTi1ybXn0TPi4Smd8du0= -github.com/google/go-containerregistry v0.20.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo= github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -232,10 +218,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= -github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= -github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -271,10 +253,10 @@ github.com/itchyny/gojq v0.12.16 h1:yLfgLxhIr/6sJNVmYfQjTIv0jGctu6/DgDoivmxTr7g= github.com/itchyny/gojq v0.12.16/go.mod h1:6abHbdC2uB9ogMS38XsErnfqJ94UlngIJGlRAIj4jTM= github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q= github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg= -github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho= -github.com/jaypipes/ghw v0.12.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= -github.com/jaypipes/pcidb v1.0.0 h1:vtZIfkiCUE42oYbJS0TAq9XSfSmcsgo9IdxSm9qzYU8= -github.com/jaypipes/pcidb v1.0.0/go.mod h1:TnYUvqhPBzCKnH34KrIX22kAeEbDCSRJ9cqLRCuNDfk= +github.com/jaypipes/ghw v0.13.0 h1:log8MXuB8hzTNnSktqpXMHc0c/2k/WgjOMSUtnI1RV4= +github.com/jaypipes/ghw v0.13.0/go.mod h1:In8SsaDqlb1oTyrbmTC14uy+fbBMvp+xdqX51MidlD8= +github.com/jaypipes/pcidb v1.0.1 h1:WB2zh27T3nwg8AE8ei81sNRb9yWBii3JGNJtT7K9Oic= +github.com/jaypipes/pcidb v1.0.1/go.mod h1:6xYUz/yYEyOkIkUt2t2J2folIuZ4Yg6uByCGFXMCeE4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= @@ -321,6 +303,7 @@ github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcY github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mudler/go-pluggable v0.0.0-20230126220627-7710299a0ae5 h1:FaZD86+A9mVt7lh9glAryzQblMsbJYU2VnrdZ8yHlTs= github.com/mudler/go-pluggable v0.0.0-20230126220627-7710299a0ae5/go.mod h1:WmKcT8ONmhDQIqQ+HxU+tkGWjzBEyY/KFO8LTGCu4AI= github.com/mudler/yip v1.9.4 h1:yaiPKWG5kt/DTNCf7ZGfyWdb1j5c06zYqWF3F+SVKsE= @@ -335,19 +318,11 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= -github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= -github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= -github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -384,7 +359,6 @@ github.com/saferwall/pe v1.5.4 h1:tLmMggEMUfeqrpJ25zS/okUQmyFdD5xWKL2+z9njCqg= github.com/saferwall/pe v1.5.4/go.mod h1:mJx+PuptmNpoPFBNhWs/uDMFL/kTHVZIkg0d4OUJFbQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d h1:RQqyEogx5J6wPdoxqL132b100j8KjcVHO1c0KLRoIhc= github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d/go.mod h1:PegD7EVqlN88z7TpCqH92hHP+GBpfomGCCnw1PFtNOA= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -417,8 +391,6 @@ github.com/swaggest/refl v1.3.0/go.mod h1:3Ujvbmh1pfSbDYjC6JGG7nMgPvpG0ehQL4iNon github.com/twpayne/go-vfs/v4 v4.3.0 h1:rTqFzzOQ/6ESKTSiwVubHlCBedJDOhQyVSnw8rQNZhU= github.com/twpayne/go-vfs/v4 v4.3.0/go.mod h1:tq2UVhnUepesc0lSnPJH/jQ8HruGhzwZe2r5kDFpEIw= github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= -github.com/urfave/cli/v2 v2.27.3 h1:/POWahRmdh7uztQ3CYnaDddk0Rm90PyOgIxgW2rr41M= -github.com/urfave/cli/v2 v2.27.3/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= @@ -442,6 +414,7 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/zcalusic/sysinfo v1.1.0 h1:79Hqn8h4poVz6T57/4ezXbT5ZkZbZm7u1YU1C4paMyk= github.com/zcalusic/sysinfo v1.1.0/go.mod h1:NX+qYnWGtJVPV0yWldff9uppNKU4h40hJIRPf/pGLv4= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 h1:A/5uWzF44DlIgdm/PQFwfMkW0JX+cIcQi/SwLAmZP5M= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -474,8 +447,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -515,8 +486,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -554,8 +525,6 @@ 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.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -579,8 +548,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -637,10 +604,6 @@ golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -648,8 +611,6 @@ golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -661,8 +622,6 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -721,8 +680,6 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/types/logger.go b/types/logger.go index a6882eb8..809c0537 100644 --- a/types/logger.go +++ b/types/logger.go @@ -54,6 +54,11 @@ func NewKairosLogger(name, level string, quiet bool) KairosLogger { if debugFromEnv { l = zerolog.DebugLevel } + // Set trace level if set on ENV + traceFromEnv := os.Getenv(fmt.Sprintf("%s_TRACE", strings.ToUpper(name))) != "" + if traceFromEnv { + l = zerolog.TraceLevel + } k := KairosLogger{ zerolog.New(multi).With().Timestamp().Logger().Level(l), loggers, diff --git a/types/partitions.go b/types/partitions.go new file mode 100644 index 00000000..cda7c01f --- /dev/null +++ b/types/partitions.go @@ -0,0 +1,15 @@ +package types + +type Partition struct { + Name string `yaml:"-"` + FilesystemLabel string `yaml:"label,omitempty" mapstructure:"label"` + Size uint `yaml:"size,omitempty" mapstructure:"size"` + FS string `yaml:"fs,omitempty" mapstrcuture:"fs"` + Flags []string `yaml:"flags,omitempty" mapstrcuture:"flags"` + UUID string + MountPoint string `yaml:"-"` + Path string `yaml:"-"` + Disk string `yaml:"-"` +} + +type PartitionList []*Partition