diff --git a/Dockerfile b/Dockerfile index cafde9fe..1a46b354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,20 @@ -# FIXME this points to the last go-1.20 image of the builder, -# go-1.21 cant be used actually because bookworm mangled libsystemd-dev which breaks the build -# and go-1.21 is not available with bullseye. -# maybe we should switch away from depending on the builder image -FROM metalstack/builder@sha256:d2050a3bef9bbd9d9ea769a71a4a70b9ff4b24c537d29d5870b83fc652bb67f8 as builder +FROM golang:1.21-alpine as builder + +RUN apk add \ + binutils \ + coreutils \ + curl \ + gcc \ + git \ + make \ + musl-dev \ + libpcap-dev +WORKDIR /work +COPY . . +RUN make all # Install Intel Firmware for e800 based network cards -ENV ICE_VERSION=1.9.11 -ENV ICE_PKG_VERSION=1.3.30.0 +ENV ICE_VERSION=1.13.7 +ENV ICE_PKG_VERSION=1.3.35.0 RUN curl -fLsS https://sourceforge.net/projects/e1000/files/ice%20stable/${ICE_VERSION}/ice-${ICE_VERSION}.tar.gz/download -o ice.tar.gz \ && tar -xf ice.tar.gz ice-${ICE_VERSION}/ddp/ice-${ICE_PKG_VERSION}.pkg \ && mkdir -p /lib/firmware/intel/ice/ddp/ \ @@ -13,7 +22,7 @@ RUN curl -fLsS https://sourceforge.net/projects/e1000/files/ice%20stable/${ICE_V # ipmitool from bookworm is broken and returns with error on most commands FROM golang:1.20-bullseye as initrd-builder -ENV UROOT_GIT_SHA_OR_TAG=v0.11.0 +ENV UROOT_GIT_SHA_OR_TAG=v0.12.0 RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ @@ -40,16 +49,15 @@ RUN mkdir -p ${GOPATH}/src/github.com/u-root \ && git clone https://github.com/u-root/u-root \ && cd u-root \ && git checkout ${UROOT_GIT_SHA_OR_TAG} \ - && GO111MODULE=off go install + && go install WORKDIR /work RUN mkdir -p /work/etc/lvm /work/etc/ssl/certs /work/lib/firmware/intel/ice/ddp/ /work/var/run \ && cp /usr/share/zoneinfo/Etc/UTC /work/etc/localtime COPY lvmlocal.conf metal.key metal.key.pub passwd varrun Makefile .git /work/ -COPY --from=r.metal-stack.io/metal/supermicro:2.12.0 /usr/bin/sum /work/ -COPY --from=builder /common /common +COPY --from=r.metal-stack.io/metal/supermicro:2.13.0 /usr/bin/sum /work/ COPY --from=builder /work/ice.pkg /work/ice.pkg COPY --from=builder /work/bin/metal-hammer /work/bin/ -RUN COMMONDIR=/common make ramdisk +RUN make ramdisk FROM scratch COPY --from=builder /work/bin/metal-hammer / diff --git a/Makefile b/Makefile index 11f0a9e1..b81c9960 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,44 @@ +SHA := $(shell git rev-parse --short=8 HEAD) +GITVERSION := $(shell git describe --long --all) +BUILDDATE := $(shell date --iso-8601=seconds) +VERSION := $(or ${VERSION},$(shell git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD)) +GO := go +GOSRC = $(shell find . -not \( -path vendor -prune \) -type f -name '*.go') + BINARY := metal-hammer INITRD := ${BINARY}-initrd.img COMPRESSOR := lz4 COMPRESSOR_ARGS := -f -l INITRD_COMPRESSED := ${INITRD}.${COMPRESSOR} MAINMODULE := . -COMMONDIR := $(or ${COMMONDIR},../builder) CGO_ENABLED := 1 # export CGO_LDFLAGS := "-lsystemd" "-lpcap" "-ldbus-1" -in-docker: gofmt test all; -include $(COMMONDIR)/Makefile.inc +.PHONY: all +all:: bin/$(BINARY); + +in-docker: all; + +LINKMODE := -linkmode external -extldflags '-static -s -w' \ + -X 'github.com/metal-stack/v.Version=$(VERSION)' \ + -X 'github.com/metal-stack/v.Revision=$(GITVERSION)' \ + -X 'github.com/metal-stack/v.GitSHA1=$(SHA)' \ + -X 'github.com/metal-stack/v.BuildDate=$(BUILDDATE)' -release:: gofmt test all ; +bin/$(BINARY): test $(GOSRC) + $(info CGO_ENABLED="$(CGO_ENABLED)") + $(GO) build \ + -tags netgo \ + -ldflags \ + "$(LINKMODE)" \ + -o bin/$(BINARY) \ + $(MAINMODULE) + strip bin/$(BINARY) + +.PHONY: test +test: + CGO_ENABLED=1 $(GO) test -cover ./... .PHONY: clean clean:: @@ -26,39 +52,40 @@ ${INITRD_COMPRESSED}: initrd: ${INITRD_COMPRESSED} # place all binaries in the same directory (/sbin) which is in the PATH of root. +# keep them alphabetically sorted .PHONY: ramdisk ramdisk: GO111MODULE=off u-root \ -format=cpio -build=bb \ -defaultsh=/bin/bash \ -files="bin/metal-hammer:bbin/uinit" \ - -files="/etc/ssl/certs/ca-certificates.crt:etc/ssl/certs/ca-certificates.crt" \ - -files="/etc/localtime:etc/localtime" \ -files="/bin/bash:bin/bash" \ + -files="/bin/netstat:bin/netstat" \ + -files="/etc/localtime:etc/localtime" \ + -files="/etc/lvm/lvm.conf:etc/lvm/lvm.conf" \ + -files="/etc/ssl/certs/ca-certificates.crt:etc/ssl/certs/ca-certificates.crt" \ + -files="/lib/x86_64-linux-gnu/libnss_files-2.31.so:lib/x86_64-linux-gnu/libnss_files-2.31.so" \ + -files="/lib/x86_64-linux-gnu/libnss_files.so.2:lib/x86_64-linux-gnu/libnss_files.so.2" \ -files="/sbin/blkid:sbin/blkid" \ -files="/sbin/ethtool:sbin/ethtool" \ - -files="/usr/bin/lspci:bin/lspci" \ - -files="/usr/bin/strace:bin/strace" \ - -files="/usr/share/misc/pci.ids:usr/share/misc/pci.ids" \ - -files="/bin/netstat:bin/netstat" \ -files="/sbin/hdparm:sbin/hdparm" \ - -files="/usr/bin/ipmitool:usr/bin/ipmitool" \ - -files="/sbin/mkfs.vfat:sbin/mkfs.vfat" \ - -files="/sbin/mkfs.ext3:sbin/mkfs.ext3" \ - -files="/sbin/mkfs.ext4:sbin/mkfs.ext4" \ - -files="/sbin/mke2fs:sbin/mke2fs" \ - -files="/sbin/mkswap:sbin/mkswap" \ - -files="/sbin/mkfs.fat:sbin/mkfs.fat" \ - -files="/usr/sbin/nvme:sbin/nvme" \ -files="/sbin/lvm:sbin/lvm" \ - -files="/etc/lvm/lvm.conf:etc/lvm/lvm.conf" \ - -files="lvmlocal.conf:etc/lvm/lvmlocal.conf" \ -files="/sbin/mdadm:sbin/mdadm" \ -files="/sbin/mdmon:sbin/mdmon" \ + -files="/sbin/mke2fs:sbin/mke2fs" \ + -files="/sbin/mkfs.ext3:sbin/mkfs.ext3" \ + -files="/sbin/mkfs.ext4:sbin/mkfs.ext4" \ + -files="/sbin/mkfs.fat:sbin/mkfs.fat" \ + -files="/sbin/mkfs.vfat:sbin/mkfs.vfat" \ + -files="/sbin/mkswap:sbin/mkswap" \ -files="/sbin/sgdisk:sbin/sgdisk" \ -files="/sbin/wipefs:sbin/wipefs" \ - -files="/lib/x86_64-linux-gnu/libnss_files-2.31.so:lib/x86_64-linux-gnu/libnss_files-2.31.so" \ - -files="/lib/x86_64-linux-gnu/libnss_files.so.2:lib/x86_64-linux-gnu/libnss_files.so.2" \ + -files="/usr/bin/ipmitool:usr/bin/ipmitool" \ + -files="/usr/bin/lspci:bin/lspci" \ + -files="/usr/bin/strace:bin/strace" \ + -files="/usr/sbin/nvme:sbin/nvme" \ + -files="/usr/share/misc/pci.ids:usr/share/misc/pci.ids" \ + -files="lvmlocal.conf:etc/lvm/lvmlocal.conf" \ -files="passwd:etc/passwd" \ -files="varrun:var/run/keep" \ -files="ice.pkg:lib/firmware/intel/ice/ddp/ice.pkg" \ @@ -94,3 +121,16 @@ qemu-up: BGP=1" \ -kernel metal-kernel \ -initrd metal-hammer-initrd.img.lz4 + +start: + # sudo setcap cap_net_admin+ep ~/bin/cloud-hypervisor + # /usr/src/linux-headers-6.5.0-9/scripts/extract-vmlinux metal-kernel-6.6.2 > vmlinux + cloud-hypervisor \ + --kernel ./vmlinux \ + --console off \ + --serial tty \ + --initramfs=metal-hammer-initrd.img.lz4 \ + --cmdline "console=ttyS0" \ + --cpus boot=4 \ + --memory size=1024M \ + --net "tap=,mac=,ip=,mask=" \ No newline at end of file diff --git a/cmd/bios.go b/cmd/bios.go index 9564c7ac..96fe40ef 100644 --- a/cmd/bios.go +++ b/cmd/bios.go @@ -18,12 +18,12 @@ func (h *Hammer) ConfigureBIOS() error { if err != nil { return err } - h.log.Infow("bios", "message", "successfully configured BIOS") + h.log.Info("bios", "message", "successfully configured BIOS") if reboot { msg := "BIOS configuration requires a reboot" h.EventEmitter.Emit(event.ProvisioningEventPlannedReboot, msg) - h.log.Infow("bios", msg, "reboot in 1 sec") + h.log.Info("bios", msg, "reboot in 1 sec") time.Sleep(1 * time.Second) err = kernel.Reboot() if err != nil { @@ -45,7 +45,7 @@ func (h *Hammer) EnsureBootOrder(bootloaderID string) error { if err != nil { return err } - h.log.Infow("bios", "message", "successfully ensured boot order") + h.log.Info("bios", "message", "successfully ensured boot order") return nil } diff --git a/cmd/event/event.go b/cmd/event/event.go index a49d64b4..d9db57a5 100644 --- a/cmd/event/event.go +++ b/cmd/event/event.go @@ -3,10 +3,10 @@ package event import ( "context" "fmt" + "log/slog" "time" v1 "github.com/metal-stack/metal-api/pkg/api/v1" - "go.uber.org/zap" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -30,12 +30,12 @@ const ( ) type EventEmitter struct { - log *zap.SugaredLogger + log *slog.Logger eventClient v1.EventServiceClient machineID string } -func NewEventEmitter(log *zap.SugaredLogger, eventClient v1.EventServiceClient, machineID string) *EventEmitter { +func NewEventEmitter(log *slog.Logger, eventClient v1.EventServiceClient, machineID string) *EventEmitter { emitter := &EventEmitter{ eventClient: eventClient, machineID: machineID, @@ -53,7 +53,7 @@ func NewEventEmitter(log *zap.SugaredLogger, eventClient v1.EventServiceClient, func (e *EventEmitter) Emit(eventType ProvisioningEventType, message string) { eventString := string(eventType) - e.log.Infow("event", "event", eventString, "message", message) + e.log.Info("event", "event", eventString, "message", message) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() s, err := e.eventClient.Send(ctx, &v1.EventServiceSendRequest{ @@ -66,9 +66,9 @@ func (e *EventEmitter) Emit(eventType ProvisioningEventType, message string) { }, }) if err != nil { - e.log.Errorw("event", "cannot send event", eventType, "error", err) + e.log.Error("event", "cannot send event", eventType, "error", err) } if s != nil { - e.log.Infow("event", "send", s.Events, "failed", s.Failed) + e.log.Info("event", "send", s.Events, "failed", s.Failed) } } diff --git a/cmd/firmware/firmware.go b/cmd/firmware/firmware.go index 8c400bd0..5dfabfc2 100644 --- a/cmd/firmware/firmware.go +++ b/cmd/firmware/firmware.go @@ -2,9 +2,8 @@ package firmware import ( "fmt" + "log/slog" "os/exec" - - "go.uber.org/zap" ) // updater check if a firmware update is required and updates @@ -19,11 +18,11 @@ type updater interface { // Firmware take care of firmware management type Firmware struct { updaters []updater - log *zap.SugaredLogger + log *slog.Logger } // New create a new Firmware manager with all Updaters. -func New(log *zap.SugaredLogger) *Firmware { +func New(log *slog.Logger) *Firmware { _ = raidcontroller{ name: "lsi3108", @@ -46,24 +45,24 @@ func (f *Firmware) Update() { for _, u := range f.updaters { cv, err := u.current() if err != nil { - f.log.Errorw("firmware", "unable to get current version", err) + f.log.Error("firmware", "unable to get current version", err) continue } dv := u.desired() - f.log.Infow("firmware", "name", u, "current", cv, "desired", dv, "update required", u.updateRequired()) + f.log.Info("firmware", "name", u, "current", cv, "desired", dv, "update required", u.updateRequired()) if !u.updateRequired() { continue } err = u.update() if err != nil { - f.log.Errorw("firmware", "unable to update", err) + f.log.Error("firmware", "unable to update", err) continue } } } // Run execute a comand with arguments, returns output and error -func run(log *zap.SugaredLogger, command string, args ...string) (string, error) { +func run(log *slog.Logger, command string, args ...string) (string, error) { path, err := exec.LookPath(command) if err != nil { return "", fmt.Errorf("unable to locate program:%s in path %w", command, err) @@ -71,6 +70,6 @@ func run(log *zap.SugaredLogger, command string, args ...string) (string, error) cmd := exec.Command(path, args...) output, err := cmd.Output() - log.Debugw("run", "command", command, "args", args, "output", string(output), "error", err) + log.Debug("run", "command", command, "args", args, "output", string(output), "error", err) return string(output), err } diff --git a/cmd/firmware/intel.go b/cmd/firmware/intel.go index 358216fc..4fec6364 100644 --- a/cmd/firmware/intel.go +++ b/cmd/firmware/intel.go @@ -2,14 +2,13 @@ package firmware import ( "fmt" - - "go.uber.org/zap" + "log/slog" ) type intel struct { name string desiredVersion string - log *zap.SugaredLogger + log *slog.Logger } func (r intel) String() string { @@ -23,12 +22,12 @@ func (r intel) update() error { if err != nil { return fmt.Errorf("unable to update intel firmware %w", err) } - r.log.Infow("intel", "updated firware output", output) + r.log.Info("intel", "updated firware output", output) return nil } func (r intel) current() (string, error) { - r.log.Infow("not implemented") + r.log.Info("not implemented") return "", nil } @@ -37,6 +36,6 @@ func (r intel) desired() string { } func (r intel) updateRequired() bool { - r.log.Infow("not implemented") + r.log.Info("not implemented") return true } diff --git a/cmd/firmware/raid.go b/cmd/firmware/raid.go index 1a1b95eb..3ae6e257 100644 --- a/cmd/firmware/raid.go +++ b/cmd/firmware/raid.go @@ -1,13 +1,11 @@ package firmware -import ( - "go.uber.org/zap" -) +import "log/slog" type raidcontroller struct { name string desiredVersion string - log *zap.SugaredLogger + log *slog.Logger } func (r raidcontroller) String() string { diff --git a/cmd/image/image.go b/cmd/image/image.go index f08232f7..74889cb0 100644 --- a/cmd/image/image.go +++ b/cmd/image/image.go @@ -2,11 +2,11 @@ package image import ( "fmt" + "log/slog" pb "github.com/cheggaaa/pb/v3" "github.com/mholt/archiver" lz4 "github.com/pierrec/lz4/v4" - "go.uber.org/zap" //nolint:gosec "crypto/md5" @@ -18,16 +18,16 @@ import ( ) type Image struct { - log *zap.SugaredLogger + log *slog.Logger } -func NewImage(log *zap.SugaredLogger) *Image { +func NewImage(log *slog.Logger) *Image { return &Image{log: log} } // Pull a image from s3 func (i *Image) Pull(image, destination string) error { - i.log.Infow("pull image", "image", image) + i.log.Info("pull image", "image", image) md5destination := destination + ".md5" md5file := image + ".md5" err := i.download(image, destination) @@ -39,19 +39,19 @@ func (i *Image) Pull(image, destination string) error { if err != nil { return fmt.Errorf("unable to pull md5 %s %w", md5file, err) } - i.log.Infow("check md5") + i.log.Info("check md5") matches, err := i.checkMD5(destination, md5destination) if err != nil || !matches { return fmt.Errorf("md5sum mismatch") } - i.log.Infow("pull image done", "image", image) + i.log.Info("pull image done", "image", image) return nil } // Burn a image pulling a tarball and unpack to a specific directory func (i *Image) Burn(prefix, image, source string) error { - i.log.Infow("burn image", "image", image) + i.log.Info("burn image", "image", image) begin := time.Now() file, err := os.Open(source) @@ -71,7 +71,7 @@ func (i *Image) Burn(prefix, image, source string) error { } lz4Reader := lz4.NewReader(file) - i.log.Infow("lz4", "size", lz4Reader.Size()) + i.log.Info("lz4", "size", lz4Reader.Size()) creader := io.NopCloser(lz4Reader) // wild guess for lz4 compression ratio // lz4 is a stream format and therefore the @@ -95,10 +95,10 @@ func (i *Image) Burn(prefix, image, source string) error { err = os.Remove(source) if err != nil { - i.log.Warnw("burn image unable to remove image source", "error", err) + i.log.Warn("burn image unable to remove image source", "error", err) } - i.log.Infow("burn took", "duration", time.Since(begin)) + i.log.Info("burn took", "duration", time.Since(begin)) return nil } @@ -125,7 +125,7 @@ func (i *Image) checkMD5(file, md5file string) (bool, error) { return false, fmt.Errorf("unable to calculate md5sum of file: %s %w", file, err) } sourceMD5 := fmt.Sprintf("%x", h.Sum(nil)) - i.log.Infow("check md5", "source md5", sourceMD5, "expected md5", expectedMD5) + i.log.Info("check md5", "source md5", sourceMD5, "expected md5", expectedMD5) if sourceMD5 != expectedMD5 { return false, fmt.Errorf("source md5:%s expected md5:%s", sourceMD5, expectedMD5) } @@ -136,7 +136,7 @@ func (i *Image) checkMD5(file, md5file string) (bool, error) { // It's efficient because it will write as it downloads // and not load the whole file into memory. func (i *Image) download(source, dest string) error { - i.log.Infow("download", "from", source, "to", dest) + i.log.Info("download", "from", source, "to", dest) out, err := os.Create(dest) if err != nil { return fmt.Errorf("unable to create destination %s %w", dest, err) diff --git a/cmd/image/image_test.go b/cmd/image/image_test.go index 69947227..c1c438d6 100644 --- a/cmd/image/image_test.go +++ b/cmd/image/image_test.go @@ -1,11 +1,10 @@ package image import ( + "log/slog" "os" "os/exec" "testing" - - "go.uber.org/zap/zaptest" ) func TestCheckMD5(t *testing.T) { @@ -35,7 +34,7 @@ func TestCheckMD5(t *testing.T) { defer os.Remove(testfile) defer os.Remove(testfileMD5) - matches, err := NewImage(zaptest.NewLogger(t).Sugar()).checkMD5(testfile, testfileMD5) + matches, err := NewImage(slog.Default()).checkMD5(testfile, testfileMD5) if err != nil { t.Error(err) } diff --git a/cmd/install.go b/cmd/install.go index f11367f5..1f6b07c3 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -61,7 +61,7 @@ func (h *Hammer) Install(machine *models.V1MachineResponse) (*api.Bootinfo, erro // install will execute /install.sh in the pulled docker image which was extracted onto disk // to finish installation e.g. install mbr, grub, write network and filesystem config func (h *Hammer) install(prefix string, machine *models.V1MachineResponse, rootUUID string) (*api.Bootinfo, error) { - h.log.Infow("install", "image", machine.Allocation.Image.URL) + h.log.Info("install", "image", machine.Allocation.Image.URL) err := h.writeInstallerConfig(machine, rootUUID) if err != nil { @@ -83,7 +83,7 @@ func (h *Hammer) install(prefix string, machine *models.V1MachineResponse, rootU installBinary = "/install-go" } - h.log.Infow("running install", "binary", installBinary, "prefix", prefix) + h.log.Info("running install", "binary", installBinary, "prefix", prefix) err = os.Chdir(prefix) if err != nil { return nil, fmt.Errorf("unable to chdir to: %s error %w", prefix, err) @@ -107,11 +107,11 @@ func (h *Hammer) install(prefix string, machine *models.V1MachineResponse, rootU if err != nil { return nil, fmt.Errorf("unable to chdir to: / error %w", err) } - h.log.Infof("finish running %q", installBinary) + h.log.Info("finish running", "binary", installBinary) err = os.Remove(path.Join(prefix, installBinary)) if err != nil { - h.log.Warnw("unable to remove, ignoring", "binary", installBinary, "error", err) + h.log.Warn("unable to remove, ignoring", "binary", installBinary, "error", err) } info, err := kernel.ReadBootinfo(path.Join(prefix, "etc", "metal", "boot-info.yaml")) @@ -127,7 +127,7 @@ func (h *Hammer) install(prefix string, machine *models.V1MachineResponse, rootU tmp := "/tmp" _, err = utils.Copy(path.Join(prefix, info.Kernel), path.Join(tmp, filepath.Base(info.Kernel))) if err != nil { - h.log.Errorw("could not copy kernel", "error", err) + h.log.Error("could not copy kernel", "error", err) return info, err } info.Kernel = path.Join(tmp, filepath.Base(info.Kernel)) @@ -138,7 +138,7 @@ func (h *Hammer) install(prefix string, machine *models.V1MachineResponse, rootU _, err = utils.Copy(path.Join(prefix, info.Initrd), path.Join(tmp, filepath.Base(info.Initrd))) if err != nil { - h.log.Errorw("could not copy initrd", "error", err) + h.log.Error("could not copy initrd", "error", err) return info, err } info.Initrd = path.Join(tmp, filepath.Base(info.Initrd)) @@ -155,12 +155,12 @@ func (h *Hammer) writeLVMLocalConf() error { _, err := os.Stat(srclvmlocal) // FIXME use fileExists below if os.IsNotExist(err) { - h.log.Infow("src lvmlocal.conf not present, not creating lvmlocal.conf") + h.log.Info("src lvmlocal.conf not present, not creating lvmlocal.conf") return nil } _, err = os.Stat(dstlvm) // FIXME use fileExists below if os.IsNotExist(err) { - h.log.Infow("dst /etc/lvm not present, not creating lvmlocal.conf") + h.log.Info("dst /etc/lvm not present, not creating lvmlocal.conf") return nil } @@ -184,7 +184,7 @@ func (h *Hammer) writeUserData(machine *models.V1MachineResponse) error { if base64UserData != "" { userdata, err := base64.StdEncoding.DecodeString(base64UserData) if err != nil { - h.log.Infow("install", "base64 decode of userdata failed, using plain text", err) + h.log.Info("install", "base64 decode of userdata failed, using plain text", err) userdata = []byte(base64UserData) } return os.WriteFile(destination, userdata, 0600) @@ -193,7 +193,7 @@ func (h *Hammer) writeUserData(machine *models.V1MachineResponse) error { } func (h *Hammer) writeInstallerConfig(machine *models.V1MachineResponse, rootUUiD string) error { - h.log.Infow("write installation configuration") + h.log.Info("write installation configuration") configdir := path.Join(h.ChrootPrefix, "etc", "metal") err := os.MkdirAll(configdir, 0755) if err != nil { @@ -262,7 +262,7 @@ func (h *Hammer) onlyNicsWithNeighbors(nics []*models.V1MachineNic) []*models.V1 } result = append(result, nic) } - h.log.Infow("onlyNicWithNeighbors add", "result", result) + h.log.Info("onlyNicWithNeighbors add", "result", result) return result } diff --git a/cmd/install_test.go b/cmd/install_test.go index 80cabb26..f4ab377f 100644 --- a/cmd/install_test.go +++ b/cmd/install_test.go @@ -1,11 +1,11 @@ package cmd import ( + "log/slog" "reflect" "testing" "github.com/metal-stack/metal-go/api/models" - "go.uber.org/zap/zaptest" ) func TestHammer_onlyNicsWithNeighbors(t *testing.T) { @@ -46,7 +46,7 @@ func TestHammer_onlyNicsWithNeighbors(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { h := &Hammer{ - log: zaptest.NewLogger(t).Sugar(), + log: slog.Default(), } if got := h.onlyNicsWithNeighbors(tt.nics); !reflect.DeepEqual(got, tt.want) { t.Errorf("Hammer.onlyNicsWithNeighbors() = %v, want %v", got, tt.want) diff --git a/cmd/metal-client.go b/cmd/metal-client.go index 1e6480f8..ef387482 100644 --- a/cmd/metal-client.go +++ b/cmd/metal-client.go @@ -8,27 +8,27 @@ import ( "errors" "fmt" "io" + "log/slog" "net/http" "time" v1 "github.com/metal-stack/metal-api/pkg/api/v1" metalgo "github.com/metal-stack/metal-go" pixiecore "github.com/metal-stack/pixie/api" - "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" ) type MetalAPIClient struct { - log *zap.SugaredLogger + log *slog.Logger conn grpc.ClientConnInterface Driver metalgo.Client } // NewMetalAPIClient fetches the address,hmac and certificates from pixie needed to communicate with metal-api, // and returns a new client that can be used to invoke all provided grpc and rest endpoints. -func NewMetalAPIClient(log *zap.SugaredLogger, pixieURL string) (*MetalAPIClient, error) { +func NewMetalAPIClient(log *slog.Logger, pixieURL string) (*MetalAPIClient, error) { certClient := http.Client{ Timeout: 5 * time.Second, } diff --git a/cmd/network/ethtool.go b/cmd/network/ethtool.go index aa84a2f2..903c9a1d 100644 --- a/cmd/network/ethtool.go +++ b/cmd/network/ethtool.go @@ -3,6 +3,7 @@ package network import ( "bufio" "fmt" + "log/slog" "os/exec" "strings" "syscall" @@ -12,7 +13,6 @@ import ( "path/filepath" "github.com/metal-stack/metal-hammer/pkg/os/command" - "go.uber.org/zap" ) // EthtoolCommand to gather ethernet informations @@ -21,14 +21,14 @@ const ethtoolCommand = command.Ethtool // Ethtool to query/set ethernet interfaces type Ethtool struct { command string - log *zap.SugaredLogger + log *slog.Logger } // NewEthtool create a new Ethtool with the default command -func NewEthtool(log *zap.SugaredLogger) *Ethtool { +func NewEthtool(log *slog.Logger) *Ethtool { err := syscall.Mount("debugfs", "/sys/kernel/debug", "debugfs", 0, "") if err != nil { - log.Warnw("ethtool", "mounting debugfs failed", err) + log.Warn("ethtool", "mounting debugfs failed", err) } return &Ethtool{command: ethtoolCommand, log: log} } @@ -42,7 +42,7 @@ func (e *Ethtool) Run(args ...string) (string, error) { cmd := exec.Command(path, args...) output, err := cmd.Output() - e.log.Debugw("run", "command", e.command, "args", args, "output", string(output), "error", err) + e.log.Debug("run", "command", e.command, "args", args, "output", string(output), "error", err) return string(output), err } @@ -54,12 +54,12 @@ func (e *Ethtool) disableFirmwareLLDP(ifi string) { output, err := e.Run("--show-priv-flags", ifi) if err != nil { - e.log.Infow("ethtool", "interface", ifi, "msg", "no priv-flags or disable-fw-lldp not present, try disable via debugfs") + e.log.Info("ethtool", "interface", ifi, "msg", "no priv-flags or disable-fw-lldp not present, try disable via debugfs") e.stopFirmwareLLDP() return } - e.log.Debugw("ethtool", "show-priv-flags", output) + e.log.Debug("ethtool", "show-priv-flags", output) scanner := bufio.NewScanner(strings.NewReader(output)) fwLLDP := "" for scanner.Scan() { @@ -73,17 +73,17 @@ func (e *Ethtool) disableFirmwareLLDP(ifi string) { } if fwLLDP != "" { - e.log.Infow("ethtool", "interface", ifi, "disable-fw-lldp is set to", fwLLDP) + e.log.Info("ethtool", "interface", ifi, "disable-fw-lldp is set to", fwLLDP) } if fwLLDP == "off" { _, err := e.Run("--set-priv-flags", ifi, "disable-fw-lldp", "on") if err != nil { - e.log.Errorw("ethtool", "interface", ifi, "error disabling fw-lldp try to stop it", err) + e.log.Error("ethtool", "interface", ifi, "error disabling fw-lldp try to stop it", err) e.stopFirmwareLLDP() return } - e.log.Infow("ethtool", "interface", ifi, "fw-lldp", "disabled") + e.log.Info("ethtool", "interface", ifi, "fw-lldp", "disabled") } } @@ -96,25 +96,25 @@ var buggyIntelNicDriverNames = []string{"i40e"} // or a loop over all directories in /sys/kernel/debug/i40e/*/command func (e *Ethtool) stopFirmwareLLDP() { for _, driver := range buggyIntelNicDriverNames { - e.log.Infow("ethtool", "stopFirmwareLLDP for driver", driver) + e.log.Info("ethtool", "stopFirmwareLLDP for driver", driver) debugFSPath := path.Join("/sys/kernel/debug", driver) err := filepath.Walk(debugFSPath, func(path string, info os.FileInfo, err error) error { if err != nil { - e.log.Warnw("ethtool", "stopFirmwareLLDP in path", path, "error", err) + e.log.Warn("ethtool", "stopFirmwareLLDP in path", path, "error", err) return err } if !info.IsDir() && info.Name() == "command" { - e.log.Infow("ethtool", "stopFirmwareLLDP found command", path) + e.log.Info("ethtool", "stopFirmwareLLDP found command", path) stopCommand := []byte("lldp stop") err := os.WriteFile(path, stopCommand, os.ModePerm) if err != nil { - e.log.Errorw("ethtool", "stopFirmwareLLDP stop lldp > command", path, "error", err) + e.log.Error("ethtool", "stopFirmwareLLDP stop lldp > command", path, "error", err) } } return nil }) if err != nil { - e.log.Errorw("ethtool", "stopFirmwareLLDP unable to walk through debugfs", debugFSPath, "error", err) + e.log.Error("ethtool", "stopFirmwareLLDP unable to walk through debugfs", debugFSPath, "error", err) } } } diff --git a/cmd/network/interfaces.go b/cmd/network/interfaces.go index cfff02dd..1ea894b0 100644 --- a/cmd/network/interfaces.go +++ b/cmd/network/interfaces.go @@ -2,6 +2,7 @@ package network import ( "fmt" + "log/slog" "net" "strings" "time" @@ -10,7 +11,6 @@ import ( "github.com/metal-stack/go-lldpd/pkg/lldp" "github.com/metal-stack/v" - "go.uber.org/zap" "github.com/vishvananda/netlink" ) @@ -22,7 +22,7 @@ type Network struct { MachineUUID string LLDPClient *LLDPClient Eth0Mac string // this mac is used to calculate the IPMI Port offset in the metal-lab environment. - Log *zap.SugaredLogger + Log *slog.Logger } // We expect to have storage and MTU of 9000 supports efficient transmission. @@ -102,7 +102,7 @@ func (n *Network) Neighbors(name string) (neighbors []*v1.MachineNic, err error) for !host.done { actualNeigh := len(host.neighbors) minimumNeigh := host.minimumNeighbors - n.Log.Infow("waiting for lldp neighbors", "interface", name, "actual", actualNeigh, "minimum", minimumNeigh) + n.Log.Info("waiting for lldp neighbors", "interface", name, "actual", actualNeigh, "minimum", minimumNeigh) time.Sleep(1 * time.Second) duration := time.Since(host.start) @@ -110,7 +110,7 @@ func (n *Network) Neighbors(name string) (neighbors []*v1.MachineNic, err error) return nil, fmt.Errorf("not all neighbor requirements where met within: %s, exiting", host.timeout) } } - n.Log.Infow("all lldp pdu's received", "interface", name) + n.Log.Info("all lldp pdu's received", "interface", name) neighs := host.neighbors[name] for _, neigh := range neighs { @@ -122,7 +122,7 @@ func (n *Network) Neighbors(name string) (neighbors []*v1.MachineNic, err error) // if m, err := net.ParseMAC(identifier); err == nil { // mac = m.String() // } - n.Log.Infow("register add neighbor", "nic", name, "identifier", identifier) + n.Log.Info("register add neighbor", "nic", name, "identifier", identifier) neighbors = append(neighbors, &v1.MachineNic{ Mac: identifier, Identifier: identifier, diff --git a/cmd/network/lldpclient.go b/cmd/network/lldpclient.go index a3833f0a..ed929cd4 100644 --- a/cmd/network/lldpclient.go +++ b/cmd/network/lldpclient.go @@ -1,17 +1,17 @@ package network import ( + "log/slog" "sync" "time" "github.com/metal-stack/metal-hammer/pkg/lldp" - "go.uber.org/zap" ) // LLDPClient act as a small wrapper about low level lldp primitives. type LLDPClient struct { Host *Host - log *zap.SugaredLogger + log *slog.Logger } // Host collects lldp neighbor information's. @@ -37,7 +37,7 @@ const ( ) // NewLLDPClient create a lldp client. -func NewLLDPClient(log *zap.SugaredLogger, interfaces []string, minimumInterfaces, minimumNeighbors int, timeout time.Duration) *LLDPClient { +func NewLLDPClient(log *slog.Logger, interfaces []string, minimumInterfaces, minimumNeighbors int, timeout time.Duration) *LLDPClient { if timeout == 0 { timeout = LLDPTxIntervalTimeout } @@ -58,25 +58,25 @@ func NewLLDPClient(log *zap.SugaredLogger, interfaces []string, minimumInterface // Start starts lldpd for neighbor discovery. func (l *LLDPClient) Start() { - l.log.Infow("lldp start discovery") + l.log.Info("lldp start discovery") neighChan := make(chan lldp.Neighbor) for _, ifi := range l.Host.interfaces { lldpcli, err := lldp.NewClient(l.log, ifi) if err != nil { - l.log.Errorw("lldp", "unable to start client on", ifi, "error", err) + l.log.Error("lldp", "unable to start client on", ifi, "error", err) continue } go lldpcli.Neighbors(neighChan) } for detectedNeighbor := range neighChan { - l.log.Debugw("lldp", "detectedNeighbor", detectedNeighbor) + l.log.Debug("lldp", "detectedNeighbor", detectedNeighbor) if l.neighborKnown(detectedNeighbor) { continue } l.addNeighbor(detectedNeighbor) - l.log.Infow("lldp", "neighbors", l.Host.neighbors) + l.log.Info("lldp", "neighbors", l.Host.neighbors) } } diff --git a/cmd/network/ntpdate.go b/cmd/network/ntpdate.go index 14c9ab7d..40282c97 100644 --- a/cmd/network/ntpdate.go +++ b/cmd/network/ntpdate.go @@ -2,11 +2,10 @@ package network import ( "fmt" + "log/slog" "syscall" "time" - "go.uber.org/zap" - "github.com/beevik/ntp" ) @@ -20,13 +19,13 @@ var ( } ) -func getTime(log *zap.SugaredLogger, servers []string) (t time.Time, err error) { +func getTime(log *slog.Logger, servers []string) (t time.Time, err error) { for _, s := range servers { - log.Debugw("ntpdate", "getting time from", s) + log.Debug("ntpdate", "getting time from", s) if t, err = ntp.Time(s); err == nil { // Right now we return on the first valid time. // We can implement better heuristics here. - log.Debugw("ntpdate", "got time", t) + log.Debug("ntpdate", "got time", t) return t, nil } } @@ -35,14 +34,14 @@ func getTime(log *zap.SugaredLogger, servers []string) (t time.Time, err error) } // NtpDate set the system time to the time comming from a ntp source -func NtpDate(log *zap.SugaredLogger) { +func NtpDate(log *slog.Logger) { t, err := getTime(log, ntpServers) if err != nil { - log.Errorw("ntpdate", "unable to get time", err) + log.Error("ntpdate", "unable to get time", err) } tv := syscall.NsecToTimeval(t.UnixNano()) if err = syscall.Settimeofday(&tv); err != nil { - log.Errorw("ntpdate", "unable to set system time", err) + log.Error("ntpdate", "unable to set system time", err) } } diff --git a/cmd/register/register.go b/cmd/register/register.go index 44a6d7aa..9def6d0d 100644 --- a/cmd/register/register.go +++ b/cmd/register/register.go @@ -3,6 +3,7 @@ package register import ( "context" "fmt" + "log/slog" gonet "net" "os" "strconv" @@ -20,7 +21,6 @@ import ( "github.com/metal-stack/metal-hammer/cmd/storage" "github.com/metal-stack/v" "github.com/vishvananda/netlink" - "go.uber.org/zap" ) // Register the Machine @@ -30,10 +30,10 @@ type Register struct { emitter *event.EventEmitter network *network.Network inband hal.InBand - log *zap.SugaredLogger + log *slog.Logger } -func New(log *zap.SugaredLogger, machineID string, bootClient v1.BootServiceClient, emitter *event.EventEmitter, network *network.Network, inband hal.InBand) *Register { +func New(log *slog.Logger, machineID string, bootClient v1.BootServiceClient, emitter *event.EventEmitter, network *network.Network, inband hal.InBand) *Register { return &Register{ machineUUID: machineID, client: bootClient, @@ -62,7 +62,7 @@ func (r *Register) RegisterMachine() error { return fmt.Errorf("unable to register machine:%#v response payload is nil", req) } - r.log.Infow("machine registered", "response", resp) + r.log.Info("machine registered", "response", resp) return nil } @@ -96,7 +96,7 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error) _, err := gonet.ParseMAC(mac) if err != nil { - r.log.Debugw("skip interface with invalid mac", "interface", name, "mac", mac) + r.log.Debug("skip interface with invalid mac", "interface", name, "mac", mac) continue } // check if after mac validation loopback is still present @@ -111,7 +111,7 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error) Mac: mac, Name: name, } - r.log.Infow("register", "nic", name, "mac", mac) + r.log.Info("register", "nic", name, "mac", mac) nics = append(nics, nic) } // add a lo interface if not present @@ -127,15 +127,15 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error) nics = append(nics, lo) } - // now attach neighbors, this will wait up to 2*tx-intervall + // now attach neighbors, this will wait up to 2*tx-interval // if during this timeout not all required neighbors where found abort and reboot. for _, nic := range nics { - r.log.Infow("register search neighbor for", "nic", nic.Name) + r.log.Info("register search neighbor for", "nic", nic.Name) neighbors, err := r.network.Neighbors(nic.Name) if err != nil { return nil, fmt.Errorf("unable to determine neighbors of interface:%s %w", nic.Name, err) } - r.log.Infow("register found neighbor for", "nic", nic.Name, "neighbors", neighbors) + r.log.Info("register found neighbor for", "nic", nic.Name, "neighbors", neighbors) nic.Neighbors = neighbors } @@ -194,11 +194,11 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error) MetalHammerVersion: v.Version, } - r.log.Infow("register", "request", request) + r.log.Info("register", "request", request) return request, nil } -// save the content of kernel ringbuffer to /var/log/syslog +// save the content of kernel ring buffer to /var/log/syslog // by calling the appropriate syscall. // Only required if Memory is gathered by ghw.Memory() // FIXME consider different implementation @@ -227,7 +227,7 @@ func (r *Register) readIPMIDetails() (*v1.MachineIPMI, error) { bmcVersion := "unknown" bmcConn := r.inband.BMCConnection() if bmcConn.Present() { - r.log.Infow("ipmi details from bmc") + r.log.Info("ipmi details from bmc") board := r.inband.Board() bmc := board.BMC if bmc == nil { @@ -262,7 +262,7 @@ func (r *Register) readIPMIDetails() (*v1.MachineIPMI, error) { return details, nil } - r.log.Infow("ipmi details faked") + r.log.Info("ipmi details faked") eth0Mac := r.network.Eth0Mac if len(r.network.Eth0Mac) == 0 { eth0Mac = "00:00:00:00:00:00" diff --git a/cmd/reinstall.go b/cmd/reinstall.go index 4bfea40e..70ba8b07 100644 --- a/cmd/reinstall.go +++ b/cmd/reinstall.go @@ -10,7 +10,7 @@ import ( ) func (h *Hammer) abortReinstall(reason error, machineID string, primaryDiskWiped bool) error { - h.log.Errorw("reinstall cancelled => boot into existing OS...", "reason", reason) + h.log.Error("reinstall cancelled => boot into existing OS...", "reason", reason) var bootInfo *kernelapi.Bootinfo @@ -18,7 +18,7 @@ func (h *Hammer) abortReinstall(reason error, machineID string, primaryDiskWiped defer cancel() resp, err := h.MetalAPIClient.BootService().AbortReinstall(ctx, &v1.BootServiceAbortReinstallRequest{Uuid: machineID, PrimaryDiskWiped: primaryDiskWiped}) if err != nil { - h.log.Errorw("failed to abort reinstall", "error", err) + h.log.Error("failed to abort reinstall", "error", err) time.Sleep(5 * time.Second) } diff --git a/cmd/report/report.go b/cmd/report/report.go index b5b60f70..5449a8ec 100644 --- a/cmd/report/report.go +++ b/cmd/report/report.go @@ -3,10 +3,10 @@ package report import ( "context" "fmt" + "log/slog" "time" v1 "github.com/metal-stack/metal-api/pkg/api/v1" - "go.uber.org/zap" ) type Report struct { @@ -18,7 +18,7 @@ type Report struct { Cmdline string Kernel string BootloaderID string - Log *zap.SugaredLogger + Log *slog.Logger } // ReportInstallation will tell metal-api the result of the installation @@ -44,9 +44,9 @@ func (r *Report) ReportInstallation() error { defer cancel() _, err := r.Client.Report(ctx, report) if err != nil { - r.Log.Errorw("report", "error", err) + r.Log.Error("report", "error", err) return fmt.Errorf("unable to report image installation %w", err) } - r.Log.Infow("report image installation was successful") + r.Log.Info("report image installation was successful") return nil } diff --git a/cmd/root.go b/cmd/root.go index 6deeabdd..fa216db4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log/slog" "time" "github.com/metal-stack/go-hal" @@ -17,13 +18,12 @@ import ( "github.com/metal-stack/metal-hammer/pkg/os/command" "github.com/metal-stack/metal-hammer/pkg/password" "github.com/metal-stack/v" - "go.uber.org/zap" ) // Hammer is the machine which forms a bare metal to a working server type Hammer struct { Spec *Specification - log *zap.SugaredLogger + log *slog.Logger Hal hal.InBand MetalAPIClient *MetalAPIClient EventEmitter *event.EventEmitter @@ -37,11 +37,11 @@ type Hammer struct { } // Run orchestrates the whole register/wipe/format/burn and reboot process -func Run(log *zap.SugaredLogger, spec *Specification, hal hal.InBand) (*event.EventEmitter, error) { - log.Infow("metal-hammer run", "firmware", kernel.Firmware(), "bios", hal.Board().BIOS.String()) +func Run(log *slog.Logger, spec *Specification, hal hal.InBand) (*event.EventEmitter, error) { + log.Info("metal-hammer run", "firmware", kernel.Firmware(), "bios", hal.Board().BIOS.String()) metalAPIClient, err := NewMetalAPIClient(log, spec.PixieAPIUrl) if err != nil { - log.Errorw("failed to fetch GRPC certificates", "error", err) + log.Error("failed to fetch GRPC certificates", "error", err) return nil, err } @@ -76,7 +76,7 @@ func Run(log *zap.SugaredLogger, spec *Specification, hal hal.InBand) (*event.Ev err = hammer.createBmcSuperuser() if err != nil { - log.Errorw("failed to update bmc superuser password", "error", err) + log.Error("failed to update bmc superuser password", "error", err) return eventEmitter, err } @@ -117,12 +117,12 @@ func Run(log *zap.SugaredLogger, spec *Specification, hal hal.InBand) (*event.Ev if m.Allocation.Image == nil || m.Allocation.Image.ID == nil { err = fmt.Errorf("no image specified") } else { - log.Infow("perform reinstall", "machineID", *m.ID, "imageID", *m.Allocation.Image.ID) + log.Info("perform reinstall", "machineID", *m.ID, "imageID", *m.Allocation.Image.ID) err = hammer.installImage(eventEmitter, bootService, m) primaryDiskWiped = true } if err != nil { - log.Errorw("reinstall failed", "error", err) + log.Error("reinstall failed", "error", err) err = hammer.abortReinstall(err, *m.ID, primaryDiskWiped) } return eventEmitter, err @@ -135,7 +135,7 @@ func Run(log *zap.SugaredLogger, spec *Specification, hal hal.InBand) (*event.Ev err = hammer.ConfigureBIOS() if err != nil { - log.Errorw("failed to configure BIOS", "error", err) + log.Error("failed to configure BIOS", "error", err) return eventEmitter, err } @@ -149,7 +149,7 @@ func Run(log *zap.SugaredLogger, spec *Specification, hal hal.InBand) (*event.Ev } m = resp.Payload - log.Infow("perform install", "machineID", m.ID, "imageID", *m.Allocation.Image.ID) + log.Info("perform install", "machineID", m.ID, "imageID", *m.Allocation.Image.ID) hammer.FilesystemLayout = m.Allocation.Filesystemlayout err = hammer.installImage(eventEmitter, bootService, m) return eventEmitter, err @@ -165,7 +165,6 @@ func (h *Hammer) installImage(eventEmitter *event.EventEmitter, bootService v1.B return fmt.Errorf("install %w ", err) } - // FIXME OSPartition and PrimaryDisk are not used anymore, remove from model in metal-api rep := &report.Report{ MachineUUID: h.Spec.MachineUUID, Client: bootService, @@ -183,7 +182,7 @@ func (h *Hammer) installImage(eventEmitter *event.EventEmitter, bootService v1.B return err } - h.log.Infow("installation", "took", time.Since(installationStart)) + h.log.Info("installation", "took", time.Since(installationStart)) eventEmitter.Emit(event.ProvisioningEventBootingNewKernel, "booting into distro kernel") return kernel.RunKexec(info) } diff --git a/cmd/spec.go b/cmd/spec.go index 85e9f482..90f86046 100644 --- a/cmd/spec.go +++ b/cmd/spec.go @@ -1,13 +1,13 @@ package cmd import ( + "log/slog" "strconv" "strings" "os" "github.com/metal-stack/metal-hammer/pkg/kernel" - "go.uber.org/zap" ) // Specification defines configuration items of the application @@ -27,16 +27,16 @@ type Specification struct { // IP of this instance IP string - log *zap.SugaredLogger + log *slog.Logger } // NewSpec fills Specification with configuration made by kernel commandline -func NewSpec(log *zap.SugaredLogger) *Specification { +func NewSpec(log *slog.Logger) *Specification { spec := &Specification{} // Grab metal-hammer configuration from kernel commandline envmap, err := kernel.ParseCmdline() if err != nil { - log.Errorw("parse cmdline", "error", err) + log.Error("parse cmdline", "error", err) os.Exit(1) } @@ -63,7 +63,7 @@ func NewSpec(log *zap.SugaredLogger) *Specification { // Log print configuration options func (s *Specification) Log() { - s.log.Infow("configuration", + s.log.Info("configuration", "debug", s.Debug, "pixieAPIUrl", s.PixieAPIUrl, "bgpenabled", s.BGPEnabled, diff --git a/cmd/sshd.go b/cmd/sshd.go index ce3af2ec..9fbe009e 100644 --- a/cmd/sshd.go +++ b/cmd/sshd.go @@ -2,18 +2,18 @@ package cmd import ( "fmt" + "log/slog" "os" "os/exec" "syscall" "github.com/metal-stack/metal-hammer/pkg/os/command" - "go.uber.org/zap" ) const sshdCommand = command.SSHD // StartSSHD will start sshd to be able to diagnose problems on the pxe bootet machine. -func StartSSHD(log *zap.SugaredLogger, ip string) error { +func StartSSHD(log *slog.Logger, ip string) error { sshd, err := exec.LookPath(sshdCommand) if err != nil { return fmt.Errorf("unable to locate sshd %w", err) diff --git a/cmd/storage/filesystem.go b/cmd/storage/filesystem.go index f16a0132..baab23d6 100644 --- a/cmd/storage/filesystem.go +++ b/cmd/storage/filesystem.go @@ -3,11 +3,12 @@ package storage import ( "encoding/json" "fmt" + "log/slog" gos "os" "os/exec" "path" "path/filepath" - "golang.org/x/exp/slices" + "slices" "sort" "strings" "syscall" @@ -17,7 +18,6 @@ import ( "github.com/metal-stack/metal-hammer/pkg/os" "github.com/metal-stack/metal-hammer/pkg/os/command" "github.com/metal-stack/v" - "go.uber.org/zap" ) type Filesystem struct { @@ -30,7 +30,7 @@ type Filesystem struct { // disk is the legacy disk.json representatio // TODO remove once old images are gone disk api.Disk - log *zap.SugaredLogger + log *slog.Logger RootUUID string } @@ -46,7 +46,7 @@ type fstabEntry struct { passno uint } -func New(log *zap.SugaredLogger, chroot string, config models.V1FilesystemLayoutResponse) *Filesystem { +func New(log *slog.Logger, chroot string, config models.V1FilesystemLayoutResponse) *Filesystem { return &Filesystem{ config: config, chroot: chroot, @@ -118,17 +118,17 @@ func (f *Filesystem) createPartitions() error { } } if disk.Device != nil { - f.log.Infow("wipe existing partition signatures", "command", command.WIPEFS+" --all"+" "+*disk.Device) + f.log.Info("wipe existing partition signatures", "command", command.WIPEFS+" --all"+" "+*disk.Device) err := os.ExecuteCommand(command.WIPEFS, "--all", *disk.Device) if err != nil { - f.log.Errorw("wipe existing partition signatures failed", "error", err) + f.log.Error("wipe existing partition signatures failed", "error", err) return fmt.Errorf("unable wipe existing partitions on %s %w", *disk.Device, err) } opts = append(opts, *disk.Device) - f.log.Infow("sgdisk create partitions", "command", opts) + f.log.Info("sgdisk create partitions", "command", opts) err = os.ExecuteCommand(command.SGDisk, opts...) if err != nil { - f.log.Errorw("sgdisk creating partitions failed", "error", err) + f.log.Error("sgdisk creating partitions failed", "error", err) return fmt.Errorf("unable to create partitions on %s %w", *disk.Device, err) } } @@ -180,17 +180,17 @@ func (f *Filesystem) createRaids() error { args = append(args, raid.Devices...) - f.log.Infow("create mdadm raid", "args", args) + f.log.Info("create mdadm raid", "args", args) err := os.ExecuteCommand(command.MDADM, args...) if err != nil { - f.log.Errorw("create mdadm raid", "error", err) + f.log.Error("create mdadm raid", "error", err) return fmt.Errorf("unable to create mdadm raid %s %w", *raid.Arrayname, err) } // set sync speed err = gos.WriteFile("/proc/sys/dev/raid/speed_limit_min", []byte("200000000"), 0644) // nolint:gosec if err != nil { - f.log.Errorw("unable to set min sync speed, ignoring...", "error", err) + f.log.Error("unable to set min sync speed, ignoring...", "error", err) } } return nil @@ -222,7 +222,7 @@ func (f *Filesystem) createLogicalVolumes() error { pvcount[*vg.Name] = len(vg.Devices) err := os.ExecuteCommand(command.LVM, args...) if err != nil { - f.log.Errorw("vgcreate", "error", err) + f.log.Error("vgcreate", "error", err) return fmt.Errorf("unable to create volume group %s %w", *vg.Name, err) } } @@ -256,7 +256,7 @@ func (f *Filesystem) createLogicalVolumes() error { lvmtype = *lv.Lvmtype } if pvcount[*lv.Volumegroup] < 2 { - f.log.Warnw("volumegroup has only 1 pv, only linear is supported", "lv", *lv.Name, "vg", *lv.Volumegroup) + f.log.Warn("volumegroup has only 1 pv, only linear is supported", "lv", *lv.Name, "vg", *lv.Volumegroup) lvmtype = "linear" } @@ -271,10 +271,10 @@ func (f *Filesystem) createLogicalVolumes() error { } args = append(args, *lv.Volumegroup) - f.log.Infow("lvcreate", "args", args) + f.log.Info("lvcreate", "args", args) err := os.ExecuteCommand(command.LVM, args...) if err != nil { - f.log.Errorw("lvcreate", "error", err) + f.log.Error("lvcreate", "error", err) return fmt.Errorf("unable to create logical volume %s %w", *lv.Name, err) } } @@ -318,10 +318,10 @@ func (f *Filesystem) createFilesystems() error { return fmt.Errorf("unsupported filesystem format: %q", *fs.Format) } args = append(args, *fs.Device) - f.log.Infow("create filesystem", "args", args) + f.log.Info("create filesystem", "args", args) err := os.ExecuteCommand(mkfs, args...) if err != nil { - f.log.Errorw("create filesystem failed", "device", *fs.Device, "error", err) + f.log.Error("create filesystem failed", "device", *fs.Device, "error", err) return fmt.Errorf("unable to create filesystem on %s %w", *fs.Device, err) } } @@ -426,7 +426,7 @@ func (f *Filesystem) mountSpecialFilesystems() error { return err } - f.log.Infow("mount", "source", m.source, "target", mountPoint, "fstype", m.fstype, "flags", m.flags, "data", m.data) + f.log.Info("mount", "source", m.source, "target", mountPoint, "fstype", m.fstype, "flags", m.flags, "data", m.data) err := syscall.Mount(m.source, mountPoint, m.fstype, m.flags, m.data) if err != nil { return fmt.Errorf("mounting %s to %s failed %w", m.source, m.target, err) @@ -438,10 +438,10 @@ func (f *Filesystem) mountSpecialFilesystems() error { func (f *Filesystem) umountFilesystems() { for index := len(specialMounts) - 1; index >= 0; index-- { m := filepath.Join(f.chroot, specialMounts[index].target) - f.log.Infow("unmounting", "mountpoint", m) + f.log.Info("unmounting", "mountpoint", m) err := syscall.Unmount(m, syscall.MNT_FORCE) if err != nil { - f.log.Errorw("unable to unmount", "path", m, "error", err) + f.log.Error("unable to unmount", "path", m, "error", err) } } for index := len(f.mounts) - 1; index >= 0; index-- { @@ -449,10 +449,10 @@ func (f *Filesystem) umountFilesystems() { if m == "" { continue } - f.log.Infow("unmounting", "mountpoint", m) + f.log.Info("unmounting", "mountpoint", m) err := syscall.Unmount(m, syscall.MNT_FORCE) if err != nil { - f.log.Errorw("unable to unmount", "path", m, "error", err) + f.log.Error("unable to unmount", "path", m, "error", err) } } } @@ -477,11 +477,11 @@ func (f *Filesystem) createDiskJSON() error { if err != nil { return fmt.Errorf("unable to marshal to json %w", err) } - f.log.Infow("create legacy disk.json", "content", string(j)) + f.log.Info("create legacy disk.json", "content", string(j)) return gos.WriteFile(destination, j, 0600) } -func mountFs(log *zap.SugaredLogger, chroot string, fs models.V1Filesystem) (string, error) { +func mountFs(log *slog.Logger, chroot string, fs models.V1Filesystem) (string, error) { if fs.Format == nil || *fs.Format == "swap" || *fs.Format == "" || *fs.Format == "tmpfs" { return "", nil } @@ -495,7 +495,7 @@ func mountFs(log *zap.SugaredLogger, chroot string, fs models.V1Filesystem) (str return "", err } opts := optionSliceToString(fs.Mountoptions, ",") - log.Infow("mount filesystem", "device", *fs.Device, "path", path, "format", fs.Format, "opts", opts) + log.Info("mount filesystem", "device", *fs.Device, "path", path, "format", fs.Format, "opts", opts) var args []string if len(opts) > 0 { args = append(args, "-o", opts) @@ -503,7 +503,7 @@ func mountFs(log *zap.SugaredLogger, chroot string, fs models.V1Filesystem) (str args = append(args, "-t", *fs.Format, *fs.Device, path) err := os.ExecuteCommand("mount", args...) if err != nil { - log.Errorw("mount filesystem failed", "device", *fs.Device, "path", fs.Path, "opts", opts, "error", err) + log.Error("mount filesystem failed", "device", *fs.Device, "path", fs.Path, "opts", opts, "error", err) return "", fmt.Errorf("unable to mount filesystem %s on %s opts:%v error:%w", *fs.Device, fs.Path, opts, err) } return path, nil @@ -539,7 +539,7 @@ func optionSliceToString(opts []string, separator string) string { } // write all fstab entries to /etc/fstab inside chroot -func (fss fstabEntries) write(log *zap.SugaredLogger, chroot string) error { +func (fss fstabEntries) write(log *slog.Logger, chroot string) error { entries := []string{} for _, fs := range fss { entries = append(entries, fs.string()) @@ -547,7 +547,7 @@ func (fss fstabEntries) write(log *zap.SugaredLogger, chroot string) error { fstab := strings.Join(entries, "\n") header := fmt.Sprintf("# created by metal-hammer: %q\n", v.V) content := header + fstab + "\n" - log.Infow("write fstab", "content", content) + log.Info("write fstab", "content", content) //nolint:gosec return gos.WriteFile(path.Join(chroot, "/etc/fstab"), []byte(content), 0644) } @@ -556,22 +556,22 @@ func (fs fstabEntry) string() string { return fmt.Sprintf("%s %s %s %s %d %d", fs.spec, fs.file, fs.vfsType, strings.Join(fs.mountOpts, ","), fs.freq, fs.passno) } -func lvExists(log *zap.SugaredLogger, vg string, name string) bool { +func lvExists(log *slog.Logger, vg string, name string) bool { //nolint:gosec cmd := exec.Command("lvm", "lvs", vg+"/"+name, "--noheadings", "-o", "lv_name") out, err := cmd.CombinedOutput() if err != nil { - log.Infow("unable to list existing volumes", "lv", name, "error", err) + log.Info("unable to list existing volumes", "lv", name, "error", err) return false } return name == strings.TrimSpace(string(out)) } -func vgExists(log *zap.SugaredLogger, vgname string) bool { +func vgExists(log *slog.Logger, vgname string) bool { cmd := exec.Command("lvm", "vgs", vgname, "--noheadings", "-o", "vg_name") out, err := cmd.CombinedOutput() if err != nil { - log.Infow("unable to list existing volumegroups", "vg", vgname, "error", err) + log.Info("unable to list existing volumegroups", "vg", vgname, "error", err) return false } return vgname == strings.TrimSpace(string(out)) diff --git a/cmd/storage/wipe.go b/cmd/storage/wipe.go index 24f332ad..37116c3d 100644 --- a/cmd/storage/wipe.go +++ b/cmd/storage/wipe.go @@ -3,13 +3,13 @@ package storage import ( "context" "fmt" + "log/slog" "strings" gos "os" "github.com/metal-stack/metal-hammer/pkg/os" "github.com/metal-stack/metal-hammer/pkg/os/command" - "go.uber.org/zap" "golang.org/x/sync/errgroup" "github.com/jaypipes/ghw" @@ -21,10 +21,10 @@ var ( ) type Disks struct { - log *zap.SugaredLogger + log *slog.Logger } -func NewDisks(log *zap.SugaredLogger) *Disks { +func NewDisks(log *slog.Logger) *Disks { return &Disks{log: log} } @@ -37,13 +37,13 @@ func (d *Disks) Wipe() error { } disks := block.Disks - d.log.Infow("wipe existing disks", "disks", disks) + d.log.Info("wipe existing disks", "disks", disks) g, _ := errgroup.WithContext(context.Background()) for _, disk := range disks { disk := disk if strings.HasPrefix(disk.Name, DiskPrefixToIgnore) { - d.log.Infow("skip because in ignorelist", "disk", disk.Name) + d.log.Info("skip because in ignorelist", "disk", disk.Name) continue } g.Go(func() error { @@ -53,7 +53,7 @@ func (d *Disks) Wipe() error { err = g.Wait() if err != nil { - d.log.Errorw("failed to wipe disk", "error", err) + d.log.Error("failed to wipe disk", "error", err) } return nil @@ -87,35 +87,35 @@ func (d *Disks) insecureErase(device string, bytes uint64) error { } func (d *Disks) discard(device string) error { - d.log.Infow("wipe", "disk", device, "message", "discard existing data") + d.log.Info("wipe", "disk", device, "message", "discard existing data") err := os.ExecuteCommand(command.MKFSExt4, "-F", "-E", "discard", device) if err != nil { - d.log.Errorw("wipe", "disk", device, "message", "discard of existing data failed", "error", err) + d.log.Error("wipe", "disk", device, "message", "discard of existing data failed", "error", err) return err } // additionally wipe magic bytes in the first 1MiB err = os.ExecuteCommand(command.DD, "status=progress", "if=/dev/zero", "of="+device, "bs=1M", "count=1") if err != nil { - d.log.Errorw("wipe", "disk", device, "message", "overwrite of the first bytes of data with dd failed", "error", err) + d.log.Error("wipe", "disk", device, "message", "overwrite of the first bytes of data with dd failed", "error", err) return err } - d.log.Infow("wipe", "disk", device, "message", "finish discard of existing data") + d.log.Info("wipe", "disk", device, "message", "finish discard of existing data") return nil } func (d *Disks) wipeSlow(device string, bytes uint64) error { - d.log.Infow("wipe", "disk", device, "message", "slow deleting of existing data") + d.log.Info("wipe", "disk", device, "message", "slow deleting of existing data") count := bytes / bs bsArg := fmt.Sprintf("bs=%d", bs) countArg := fmt.Sprintf("count=%d", count) err := os.ExecuteCommand(command.DD, "status=progress", "if=/dev/zero", "of="+device, bsArg, countArg) if err != nil { - d.log.Errorw("wipe", "disk", device, "message", "overwrite of existing data with dd failed", "error", err) + d.log.Error("wipe", "disk", device, "message", "overwrite of existing data with dd failed", "error", err) return err } - d.log.Infow("wipe", "disk", device, "message", "finish deleting of existing data") + d.log.Info("wipe", "disk", device, "message", "finish deleting of existing data") return nil } @@ -131,7 +131,7 @@ func isNVMeDisk(device string) bool { // https://github.com/nvmecompliance/manage/blob/master/runQemu.sh // https://github.com/arunar/nvmeqemu func (d *Disks) secureEraseNVMe(device string) error { - d.log.Infow("wipe", "disk", device, "message", "start very fast deleting of existing data") + d.log.Info("wipe", "disk", device, "message", "start very fast deleting of existing data") err := os.ExecuteCommand(command.NVME, "--format", "--force", "--ses=1", device) if err != nil { return fmt.Errorf("unable to secure erase nvme disk %s %w", device, err) @@ -145,12 +145,12 @@ func (d *Disks) isRotational(deviceName string) bool { result := true if err != nil { // defensive guess, fall back to hdd if unknown - d.log.Warnw("unable to detect if disk is rotational", "disk", deviceName, "error", err) + d.log.Warn("unable to detect if disk is rotational", "disk", deviceName, "error", err) return true } if strings.Contains(string(rotational), "0") { result = false } - d.log.Debugw("wipe", "disk", deviceName, "rotational", result) + d.log.Debug("wipe", "disk", deviceName, "rotational", result) return result } diff --git a/cmd/wait.go b/cmd/wait.go index 8b2a17c6..0fd8b71b 100644 --- a/cmd/wait.go +++ b/cmd/wait.go @@ -24,7 +24,7 @@ func (c *MetalAPIClient) WaitForAllocation(e *event.EventEmitter, machineID stri for { stream, err := c.BootService().Wait(context.Background(), req) if err != nil { - c.log.Errorw("failed waiting for allocation", "retry after", defaultWaitTimeOut, "error", err) + c.log.Error("failed waiting for allocation", "retry after", defaultWaitTimeOut, "error", err) time.Sleep(defaultWaitTimeOut) continue @@ -33,26 +33,26 @@ func (c *MetalAPIClient) WaitForAllocation(e *event.EventEmitter, machineID stri for { _, err := stream.Recv() if errors.Is(err, io.EOF) { - c.log.Infow("machine has been requested for allocation", "machineID", machineID) + c.log.Info("machine has been requested for allocation", "machineID", machineID) return nil } if err != nil { if e, ok := status.FromError(err); ok { - c.log.Errorw("got error from wait call", "code", e.Code(), "message", e.Message(), "details", e.Details()) + c.log.Error("got error from wait call", "code", e.Code(), "message", e.Message(), "details", e.Details()) switch e.Code() { // nolint:exhaustive case codes.Unimplemented: return fmt.Errorf("metal-api breaking change detected, rebooting: %w", err) } } - c.log.Errorw("failed stream receiving during waiting for allocation", "retry after", defaultWaitTimeOut, "error", err) + c.log.Error("failed stream receiving during waiting for allocation", "retry after", defaultWaitTimeOut, "error", err) time.Sleep(defaultWaitTimeOut) break } - c.log.Infow("wait for allocation...", "machineID", machineID) + c.log.Info("wait for allocation...", "machineID", machineID) } } } diff --git a/download-kernel.sh b/download-kernel.sh index 6427f415..088e40a0 100755 --- a/download-kernel.sh +++ b/download-kernel.sh @@ -3,7 +3,7 @@ # Intentionally added to download metal-hammer-kernel. set -e -KERNEL=https://github.com/metal-stack/kernel/releases/download/5.10.28-55/metal-kernel +KERNEL=https://github.com/metal-stack/kernel/releases/download/6.1.62-128/metal-kernel dirty() { curl \ diff --git a/go.mod b/go.mod index c8eb39c3..91b479f1 100644 --- a/go.mod +++ b/go.mod @@ -3,29 +3,26 @@ module github.com/metal-stack/metal-hammer go 1.21 require ( - github.com/beevik/ntp v1.3.0 + github.com/beevik/ntp v1.3.1 github.com/cheggaaa/pb/v3 v3.1.4 github.com/google/gopacket v1.1.19 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/jaypipes/ghw v0.12.0 - github.com/metal-stack/go-hal v0.4.4 - github.com/metal-stack/go-lldpd v0.4.4 - github.com/metal-stack/metal-api v0.24.5 - github.com/metal-stack/metal-go v0.24.5 - github.com/metal-stack/pixie v0.2.5 + github.com/metal-stack/go-hal v0.5.0 + github.com/metal-stack/go-lldpd v0.4.6 + github.com/metal-stack/metal-api v0.26.2 + github.com/metal-stack/metal-go v0.26.2 + github.com/metal-stack/pixie v0.3.0 github.com/metal-stack/v v1.0.3 // archiver must stay in version v2.1.0, see replace below github.com/mholt/archiver v3.1.1+incompatible - github.com/pierrec/lz4/v4 v4.1.18 - github.com/u-root/u-root v0.11.0 + github.com/pierrec/lz4/v4 v4.1.21 + github.com/u-root/u-root v0.12.0 github.com/vishvananda/netlink v1.2.1-beta.2 - go.uber.org/zap v1.26.0 - // TODO remove once we really migrated the build to 1.21 - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa - golang.org/x/sync v0.5.0 - golang.org/x/sys v0.14.0 - google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.31.0 + golang.org/x/sync v0.6.0 + golang.org/x/sys v0.16.0 + google.golang.org/grpc v1.60.1 + google.golang.org/protobuf v1.32.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -36,29 +33,29 @@ require ( github.com/VividCortex/ewma v1.2.0 // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/avast/retry-go/v4 v4.5.0 // indirect - github.com/coreos/go-oidc/v3 v3.6.0 // indirect - github.com/creack/pty v1.1.20 // indirect + github.com/avast/retry-go/v4 v4.5.1 // indirect + github.com/coreos/go-oidc/v3 v3.9.0 // indirect + github.com/creack/pty v1.1.21 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dsnet/compress v0.0.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/frankban/quicktest v1.14.6 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gliderlabs/ssh v0.3.5 // indirect - github.com/go-jose/go-jose/v3 v3.0.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/gliderlabs/ssh v0.3.6 // indirect + github.com/go-jose/go-jose/v3 v3.0.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/analysis v0.21.4 // indirect - github.com/go-openapi/errors v0.20.4 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/loads v0.21.2 // indirect - github.com/go-openapi/runtime v0.26.0 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-openapi/strfmt v0.21.7 // indirect - github.com/go-openapi/swag v0.22.4 // indirect - github.com/go-openapi/validate v0.22.1 // indirect + github.com/go-openapi/analysis v0.22.2 // indirect + github.com/go-openapi/errors v0.21.0 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/loads v0.21.5 // indirect + github.com/go-openapi/runtime v0.26.2 // indirect + github.com/go-openapi/spec v0.20.14 // indirect + github.com/go-openapi/strfmt v0.22.0 // indirect + github.com/go-openapi/swag v0.22.7 // indirect + github.com/go-openapi/validate v0.22.6 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -66,11 +63,11 @@ require ( github.com/gorilla/mux v1.8.1 // indirect github.com/jaypipes/pcidb v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect + github.com/lestrrat-go/httprc v1.0.4 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect - github.com/lestrrat-go/jwx v1.2.26 // indirect + github.com/lestrrat-go/jwx/v2 v2.0.19 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -78,8 +75,8 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5 // indirect - github.com/metal-stack/metal-lib v0.13.5 // indirect - github.com/metal-stack/security v0.6.7 // indirect + github.com/metal-stack/metal-lib v0.14.2 // indirect + github.com/metal-stack/security v0.7.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/nwaples/rardecode v1.1.3 // indirect @@ -88,22 +85,22 @@ require ( github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect + github.com/segmentio/asm v1.2.0 // indirect github.com/sethvargo/go-password v0.2.0 // indirect - github.com/stmcginnis/gofish v0.14.0 // indirect + github.com/stmcginnis/gofish v0.15.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/vishvananda/netns v0.0.4 // indirect github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702 // indirect - go.mongodb.org/mongo-driver v1.12.1 // indirect - go.opentelemetry.io/otel v1.16.0 // indirect - go.opentelemetry.io/otel/metric v1.16.0 // indirect - go.opentelemetry.io/otel/trace v1.16.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - howett.net/plist v1.0.0 // indirect + howett.net/plist v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4a09c742..b38adc37 100644 --- a/go.sum +++ b/go.sum @@ -1,120 +1,71 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg= -github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5Aq1fboC3+I= -github.com/beevik/ntp v1.3.0 h1:/w5VhpW5BGKS37vFm1p9oVk/t4HnnkKZAZIubHM6F7Q= -github.com/beevik/ntp v1.3.0/go.mod h1:vD6h1um4kzXpqmLTuu0cCLcC+NfvC0IC+ltmEDA8E78= +github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o= +github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc= +github.com/beevik/ntp v1.3.1 h1:Y/srlT8L1yQr58kyPWFPZIxRL8ttx2SRIpVYJqZIlAM= +github.com/beevik/ntp v1.3.1/go.mod h1:fT6PylBq86Tsq23ZMEe47b7QQrZfYBFPnpzt0a9kJxw= github.com/cheggaaa/pb/v3 v3.1.4 h1:DN8j4TVVdKu3WxVwcRKu0sG00IIU6FewoABZzXbRQeo= github.com/cheggaaa/pb/v3 v3.1.4/go.mod h1:6wVjILNBaXMs8c21qRiaUM8BR82erfgau1DQ4iUXmSA= -github.com/coreos/go-oidc/v3 v3.6.0 h1:AKVxfYw1Gmkn/w96z0DbT/B/xFnzTd3MkZvWLjF4n/o= -github.com/coreos/go-oidc/v3 v3.6.0/go.mod h1:ZpHUsHBucTUj6WOkrP4E20UPynbLZzhTQ1XKCXkxyPc= +github.com/coreos/go-oidc/v3 v3.9.0 h1:0J/ogVOd4y8P0f0xUh8l9t07xRP/d8tccvjHl2dcsSo= +github.com/coreos/go-oidc/v3 v3.9.0/go.mod h1:rTKz2PYwftcrtoCzV5g5kvfJoWcm0Mk8AF8y1iAQro4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.20 h1:VIPb/a2s17qNeQgDnkfZC35RScx+blkKF8GV68n80J4= -github.com/creack/pty v1.1.20/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.1 h1:S+9bSbua1z3FgCnV0KKOSSZ3mDthb5NyEPL5gEpCvyk= +github.com/emicklei/go-restful/v3 v3.11.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= -github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= -github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= +github.com/gliderlabs/ssh v0.3.6 h1:ZzjlDa05TcFRICb3anf/dSPN3ewz1Zx6CMLPWgkm3b8= +github.com/gliderlabs/ssh v0.3.6/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= +github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= -github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= -github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= -github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= -github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= -github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQjTcc= -github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k= -github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= -github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/go-openapi/analysis v0.22.2 h1:ZBmNoP2h5omLKr/srIC9bfqrUGzT6g6gNv03HE9Vpj0= +github.com/go-openapi/analysis v0.22.2/go.mod h1:pDF4UbZsQTo/oNuRfAWWd4dAh4yuYf//LYorPTjrpvo= +github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY= +github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/loads v0.21.5 h1:jDzF4dSoHw6ZFADCGltDb2lE4F6De7aWSpe+IcsRzT0= +github.com/go-openapi/loads v0.21.5/go.mod h1:PxTsnFBoBe+z89riT+wYt3prmSBP6GDAQh2l9H1Flz8= +github.com/go-openapi/runtime v0.26.2 h1:elWyB9MacRzvIVgAZCBJmqTi7hBzU0hlKD4IvfX0Zl0= +github.com/go-openapi/runtime v0.26.2/go.mod h1:O034jyRZ557uJKzngbMDJXkcKJVzXJiymdSfgejrcRw= +github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= +github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/strfmt v0.22.0 h1:Ew9PnEYc246TwrEspvBdDHS4BVKXy/AOVsfqGDgAcaI= +github.com/go-openapi/strfmt v0.22.0/go.mod h1:HzJ9kokGIju3/K6ap8jL+OlGAbjpSv27135Yr9OivU4= +github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8= +github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= +github.com/go-openapi/validate v0.22.6 h1:+NhuwcEYpWdO5Nm4bmvhGLW0rt1Fcc532Mu3wpypXfo= +github.com/go-openapi/validate v0.22.6/go.mod h1:eaddXSqKeTg5XpSmj1dYyFTK/95n/XHwcOY+BMxKMyM= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -131,63 +82,44 @@ github.com/google/go-cmp v0.5.2/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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 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/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= -github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= +github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8= +github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= -github.com/lestrrat-go/jwx v1.2.26 h1:4iFo8FPRZGDYe1t19mQP0zTRqA7n8HnJ5lkIiDvJcB0= -github.com/lestrrat-go/jwx v1.2.26/go.mod h1:MaiCdGbn3/cckbOFSCluJlJMmp9dmZm5hDuIkx8ftpQ= -github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= +github.com/lestrrat-go/jwx/v2 v2.0.19 h1:ekv1qEZE6BVct89QA+pRF6+4pCpfVrOnEJnTnT4RXoY= +github.com/lestrrat-go/jwx/v2 v2.0.19/go.mod h1:l3im3coce1lL2cDeAjqmaR+Awx+X8Ih+2k8BuHNJ4CU= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -201,50 +133,40 @@ github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5 h1:i4JJtLb5iDVsncU7s github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5/go.mod h1:IZAsRpRUv/4B6NhGzofHK/+I+N31NTUz/hrEm4ssUwA= github.com/mdlayher/packet v1.0.0/go.mod h1:eE7/ctqDhoiRhQ44ko5JZU2zxB88g+JH/6jmnjzPjOU= github.com/mdlayher/socket v0.2.1/go.mod h1:QLlNPkFR88mRUNQIzRBMfXxwKal8H7u1h3bL1CV+f0E= -github.com/metal-stack/go-hal v0.4.4 h1:/8w0UqvKWK00cyMPXTvMbzT4DOq5WtHJ19/vKQyLb1k= -github.com/metal-stack/go-hal v0.4.4/go.mod h1:KgyQYb3vX7COEJWAaS/rYVf+5YBC62sZSPzDvpWSY30= -github.com/metal-stack/go-lldpd v0.4.4 h1:WUwCoJRcHxKtWU5NBa797xmJvq7S2K0fRqn+vTj8vhY= -github.com/metal-stack/go-lldpd v0.4.4/go.mod h1:GwUZ3xrIyUurNH6c8xvWd7LEOWeT/KVBQmvn1/rNYQY= -github.com/metal-stack/metal-api v0.24.5 h1:P0o7F8N65LIc4Vky1mdidCxy/OhEwFoDi11IeRTvQjg= -github.com/metal-stack/metal-api v0.24.5/go.mod h1:+WGFNiWydnQqYltEMu8P+zVI0EtdD4Gv3ex5CDt0m/U= -github.com/metal-stack/metal-go v0.24.5 h1:NuKPwvFfmsg6bPekZiWJF6cwfljImKxp7Eb/cA+bnAY= -github.com/metal-stack/metal-go v0.24.5/go.mod h1:jNJ0dWIBRwKeJoP+RGqTyE5qLsdZFISFrNHU5m3IDwA= -github.com/metal-stack/metal-lib v0.13.5 h1:OX94H+Pw31MOE9xSr460kFBv6CNJ2Nhjf4GY5IcuCxM= -github.com/metal-stack/metal-lib v0.13.5/go.mod h1:BAR7fjdoV7DDg8i9GpJQBDaNSFirOcBs0vLYTBnhHQU= -github.com/metal-stack/pixie v0.2.5 h1:awgUEjbTso0P24GpZqUSqnepGsiTTaHxs/X4rgqkoE4= -github.com/metal-stack/pixie v0.2.5/go.mod h1:ATmu7ULPBVQ9MJkEMTGshZBei5/bWqUaOw/CgldBNJI= -github.com/metal-stack/security v0.6.7 h1:8wstGy0pdUmphVclAlT+9RKQmx9lF+cIGklJZAB5cIc= -github.com/metal-stack/security v0.6.7/go.mod h1:dXyrQ8PYZuUiodWFQ/NwSROxu6tajwRBc5yR/PoK5uE= +github.com/metal-stack/go-hal v0.5.0 h1:0w+rRgKy05ltresjGFL0Bj3dPAknYnIdjuAkOlUJuZ8= +github.com/metal-stack/go-hal v0.5.0/go.mod h1:ddFBHVHzDbAk8mOKq77SlTk7EM7f9d5Rmu69+49IwZQ= +github.com/metal-stack/go-lldpd v0.4.6 h1:+BiPYbAWaAggev/m5iVw/bMBHEYR3Mhh5Lx8hcQRups= +github.com/metal-stack/go-lldpd v0.4.6/go.mod h1:aCVI7lCka0uRo6dkrh2ET97WBpN7M5yZqK8NX0vGpho= +github.com/metal-stack/metal-api v0.26.2 h1:J3Hes69FNjCtPk/fO/a1Xmol7zM8PHD4uH2KqEFbUr8= +github.com/metal-stack/metal-api v0.26.2/go.mod h1:rk/w+hoKJ9/BmZRuw+eoUxa6O7BWyDVvbBYFtZOea/Q= +github.com/metal-stack/metal-go v0.26.2 h1:KZRV1wtCsj0dMo4GpW2+XemmAkPZAYFjbGe7QhhcH1k= +github.com/metal-stack/metal-go v0.26.2/go.mod h1:olJ3Az7RBh39Q5WFCJOQBd7cJi0xgGYwMTEIFvkDQQY= +github.com/metal-stack/metal-lib v0.14.2 h1:ntIZiV8fVoWsgPLXOy9xrObZr1NdU5caYUP0zzefUME= +github.com/metal-stack/metal-lib v0.14.2/go.mod h1:2wKxFXSCpA1Dr+Rq0ddpQCPKPGMWJp4cpIaVTM4lDi0= +github.com/metal-stack/pixie v0.3.0 h1:DfvAhLdGCdLNqevMNTv8op/+FQjUV2L+2Rqarw6+zNQ= +github.com/metal-stack/pixie v0.3.0/go.mod h1:UCyL5+W87RH29Bc2zpsfTmSrKJXaN332mE23DHEZKSQ= +github.com/metal-stack/security v0.7.1 h1:bwiPhT/gArl9IRJlhpDZzAs5Us6rmIt9bcuQXcLKO5k= +github.com/metal-stack/security v0.7.1/go.mod h1:v+JrV2tIvoKESY0puONL3rAocfLkol1pqm2osm9PLcw= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= github.com/metal-stack/v v1.0.3/go.mod h1:YTahEu7/ishwpYKnp/VaW/7nf8+PInogkfGwLcGPdXg= github.com/mholt/archiver v2.1.0+incompatible h1:1ivm7KAHPtPere1YDOdrY6xGdbMNGRWThZbYh5lWZT0= github.com/mholt/archiver v2.1.0+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= -github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -253,36 +175,24 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= +github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stmcginnis/gofish v0.14.0 h1:geECNAiG33JDB2x2xDkerpOOuXFqxp5YP3EFE3vd5iM= -github.com/stmcginnis/gofish v0.14.0/go.mod h1:BLDSFTp8pDlf/xDbLZa+F7f7eW0E/CHCboggsu8CznI= +github.com/stmcginnis/gofish v0.15.0 h1:8TG41+lvJk/0Nf8CIIYErxbMlQUy80W0JFRZP3Ld82A= +github.com/stmcginnis/gofish v0.15.0/go.mod h1:BLDSFTp8pDlf/xDbLZa+F7f7eW0E/CHCboggsu8CznI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/u-root/u-root v0.11.0 h1:6gCZLOeRyevw7gbTwMj3fKxnr9+yHFlgF3N7udUVNO8= -github.com/u-root/u-root v0.11.0/go.mod h1:DBkDtiZyONk9hzVEdB/PWI9B4TxDkElWlVTHseglrZY= +github.com/u-root/u-root v0.12.0 h1:K0AuBFriwr0w/PGS3HawiAw89e3+MU7ks80GpghAsNs= +github.com/u-root/u-root v0.12.0/go.mod h1:FYjTOh4IkIZHhjsd17lb8nYW6udgXdJhG1c0r6u0arI= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -294,166 +204,100 @@ github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZla github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702 h1:yx587LNBbOpIxzCBHBiI94Wx8ryIAFlu1w0lDwm64cA= github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702/go.mod h1:YiWonbS/PuCtti3wt9jl+FvNEJ7c0nvmjGoEYxdjyk0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE= -go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= -go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= -go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= -go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= -go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= -go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= +go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 h1:mchzmB1XO2pMaKFRqk/+MV3mgGG96aqaPXaMifQU47w= -golang.org/x/exp v0.0.0-20231108232855-2478ac86f678/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= 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.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 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/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= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= -howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= +howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= +howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= diff --git a/main.go b/main.go index 8dbadac3..8d295cf0 100644 --- a/main.go +++ b/main.go @@ -2,16 +2,15 @@ package main import ( "fmt" + "log/slog" "os" "syscall" "time" "github.com/metal-stack/v" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" "github.com/metal-stack/go-hal/connect" - halzap "github.com/metal-stack/go-hal/pkg/logger/zap" + "github.com/metal-stack/go-hal/pkg/logger" "github.com/metal-stack/metal-hammer/cmd" "github.com/metal-stack/metal-hammer/cmd/event" "github.com/metal-stack/metal-hammer/cmd/network" @@ -36,31 +35,34 @@ func main() { os.Exit(1) } - log := initLog(true) + jsonHandler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{ + Level: slog.LevelDebug, + }) + log := slog.New(jsonHandler) // Reboot if metal-hammer crashes after 60sec. go kernel.Watchdog(log) - hal, err := connect.InBand(halzap.New(log)) + hal, err := connect.InBand(logger.NewSlog(log)) if err != nil { - log.Errorw("unable to detect hardware", "error", err) + log.Error("unable to detect hardware", "error", err) os.Exit(1) } uuid, err := hal.UUID() if err != nil { - log.Errorw("unable to get uuid hardware", "error", err) + log.Error("unable to get uuid hardware", "error", err) os.Exit(1) } ip := network.InternalIP() err = cmd.StartSSHD(log, ip) if err != nil { - log.Errorw("sshd error", "error", err) + log.Error("sshd error", "error", err) os.Exit(1) } - log.Infow("metal-hammer", "version", v.V, "hal", hal.Describe()) + log.Info("metal-hammer", "version", v.V, "hal", hal.Describe()) spec := cmd.NewSpec(log) spec.MachineUUID = uuid.String() @@ -73,13 +75,17 @@ func main() { emitter, err := cmd.Run(log, spec, hal) if err != nil { wait := 5 * time.Second - log.Errorw("metal-hammer failed", "rebooting in", wait, "error", err) - emitter.Emit(event.ProvisioningEventCrashed, fmt.Sprintf("%s", err)) + log.Error("metal-hammer failed", "rebooting in", wait, "error", err) + if emitter != nil { + emitter.Emit(event.ProvisioningEventCrashed, fmt.Sprintf("%s", err)) + } time.Sleep(wait) err := kernel.Reboot() if err != nil { - log.Errorw("metal-hammer reboot failed", "error", err) - emitter.Emit(event.ProvisioningEventCrashed, fmt.Sprintf("%s", err)) + log.Error("metal-hammer reboot failed", "error", err) + if emitter != nil { + emitter.Emit(event.ProvisioningEventCrashed, fmt.Sprintf("%s", err)) + } } } } @@ -103,22 +109,3 @@ func updateResolvConf() error { return os.Symlink(target, symlink) } - -func initLog(d bool) *zap.SugaredLogger { - pe := zap.NewProductionEncoderConfig() - pe.EncodeLevel = zapcore.LowercaseColorLevelEncoder - pe.EncodeTime = zapcore.ISO8601TimeEncoder - consoleEncoder := zapcore.NewConsoleEncoder(pe) - - level := zap.InfoLevel - if d { - level = zap.DebugLevel - } - - core := zapcore.NewTee( - zapcore.NewCore(consoleEncoder, zapcore.AddSync(os.Stdout), level), - ) - - l := zap.New(core) - return l.Sugar() -} diff --git a/pkg/kernel/kernel.go b/pkg/kernel/kernel.go index c753a229..d28c21b1 100644 --- a/pkg/kernel/kernel.go +++ b/pkg/kernel/kernel.go @@ -3,6 +3,7 @@ package kernel import ( "crypto/rand" "fmt" + "log/slog" "math/big" "os" "strings" @@ -12,7 +13,6 @@ import ( "github.com/metal-stack/metal-hammer/pkg/api" "github.com/u-root/u-root/pkg/boot/kexec" - "go.uber.org/zap" "golang.org/x/sys/unix" "gopkg.in/yaml.v3" ) @@ -108,46 +108,46 @@ func Firmware() string { // Watchdog periodically pings kernel software watchdog. // from https://github.com/gokrazy/gokrazy -func Watchdog(log *zap.SugaredLogger) { +func Watchdog(log *slog.Logger) { f, err := os.OpenFile("/dev/watchdog", os.O_WRONLY, 0) if err != nil { - log.Errorw("watchdog", "disabling hardware watchdog, as it could not be opened.", err) + log.Error("watchdog", "disabling hardware watchdog, as it could not be opened.", err) return } defer f.Close() // timeout in seconds after which a reboot will be triggered if no write to /dev/watchdog was made. timeout := uint32(60) if _, _, errno := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.WDIOC_SETTIMEOUT, uintptr(unsafe.Pointer(&timeout))); errno != 0 { - log.Errorw("watchdog", "set timeout failed", errno) + log.Error("watchdog", "set timeout failed", errno) } for { if _, _, errno := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.WDIOC_KEEPALIVE, 0); errno != 0 { - log.Errorw("watchdog", "hardware watchdog ping failed", errno) + log.Error("watchdog", "hardware watchdog ping failed", errno) } time.Sleep(10 * time.Second) } } // AutoReboot will start a timer and reboot after given duration a random variation spread is added -func AutoReboot(log *zap.SugaredLogger, after, spread time.Duration, callback func()) { - log.Infow("autoreboot set to", "after", after, "spread", spread) +func AutoReboot(log *slog.Logger, after, spread time.Duration, callback func()) { + log.Info("autoreboot set to", "after", after, "spread", spread) spreadMinutes, err := rand.Int(rand.Reader, big.NewInt(int64(spread.Minutes()))) if err != nil { - log.Warnw("autoreboot", "unable to calculate spread, disable spread", err) + log.Warn("autoreboot", "unable to calculate spread, disable spread", err) spread = time.Duration(0) } spread = time.Minute * time.Duration(spreadMinutes.Int64()) after = after + spread - log.Infow("autoreboot with spread", "after", after) + log.Info("autoreboot with spread", "after", after) rebootTimer := time.NewTimer(after) <-rebootTimer.C - log.Infow("autoreboot", "timeout reached", "rebooting in 10sec") + log.Info("autoreboot", "timeout reached", "rebooting in 10sec") callback() time.Sleep(10 * time.Second) err = Reboot() if err != nil { - log.Errorw("autoreboot", "unable to reboot, error", err) + log.Error("autoreboot", "unable to reboot, error", err) } } diff --git a/pkg/lldp/client.go b/pkg/lldp/client.go index eb4bcafe..addb86ee 100644 --- a/pkg/lldp/client.go +++ b/pkg/lldp/client.go @@ -2,13 +2,13 @@ package lldp import ( "fmt" + "log/slog" "net" "time" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/google/gopacket/pcap" - "go.uber.org/zap" ) // LinkType can be Interface or Mac @@ -62,12 +62,12 @@ type Client struct { } // NewClient create a new lldp client. -func NewClient(log *zap.SugaredLogger, ifi string) (*Client, error) { +func NewClient(log *slog.Logger, ifi string) (*Client, error) { iface, err := net.InterfaceByName(ifi) if err != nil { return nil, fmt.Errorf("unable to lookup interface:%s %w", ifi, err) } - log.Infow("lldp", "listen on interface", iface.Name) + log.Info("lldp", "listen on interface", iface.Name) handle, err := pcap.OpenLive(iface.Name, 65536, true, 5*time.Second)