From 71eed99298f11ca723a03ffcf9107f2ecb61ae55 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 21 Oct 2026 08:25:17 +0200 Subject: [PATCH 1/2] Update dependencies, update to go-1.27 --- go.mod | 181 +++++++++++++------------- go.sum | 400 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 282 insertions(+), 299 deletions(-) diff --git a/go.mod b/go.mod index abf46b4d..e0b86da2 100644 --- a/go.mod +++ b/go.mod @@ -1,55 +1,51 @@ module github.com/metal-stack/metal-api -go 1.26 +go 1.27 require ( - connectrpc.com/connect v1.20.0 - github.com/Masterminds/semver/v3 v3.4.0 + connectrpc.com/connect v1.21.1 + github.com/Masterminds/semver/v3 v3.5.0 + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/avast/retry-go/v4 v4.7.0 github.com/aws/aws-sdk-go v1.55.8 - github.com/dustin/go-humanize v1.0.1 - github.com/emicklei/go-restful-openapi/v2 v2.12.0 - github.com/emicklei/go-restful/v3 v3.13.0 - github.com/go-openapi/spec v0.22.6 + github.com/dustin/go-humanize v1.1.0 + github.com/emicklei/go-restful-openapi/v2 v2.12.1 + github.com/emicklei/go-restful/v3 v3.14.0 + github.com/go-openapi/spec v1.0.1 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 - github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 + github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.1 + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4 github.com/juanfont/headscale v0.28.0 github.com/klauspost/connect-compress/v2 v2.1.1 - github.com/looplab/fsm v1.0.3 - github.com/metal-stack/api v0.1.7 - github.com/metal-stack/go-ipam v1.15.1 + github.com/looplab/fsm v1.0.4 + github.com/metal-stack/api v0.8.2 + github.com/metal-stack/go-ipam v1.16.0 github.com/metal-stack/masterdata-api v0.12.0 - github.com/metal-stack/metal-lib v0.25.1 - github.com/metal-stack/security v0.9.6 + github.com/metal-stack/metal-lib v0.26.3 + github.com/metal-stack/security v0.9.7 github.com/metal-stack/v v1.0.3 github.com/nsqio/go-nsq v1.1.0 - github.com/prometheus/client_golang v1.23.2 + github.com/prometheus/client_golang v1.25.0 github.com/samber/lo v1.53.0 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 - github.com/stretchr/testify v1.11.1 - github.com/testcontainers/testcontainers-go v0.42.0 - go4.org/netipx v0.0.0-20231129151722-fdeea329fbba - golang.org/x/crypto v0.53.0 - golang.org/x/sync v0.21.0 - google.golang.org/grpc v1.81.1 - google.golang.org/protobuf v1.36.11 + github.com/stretchr/testify v1.12.1 + github.com/testcontainers/testcontainers-go v0.44.0 + go.opentelemetry.io/otel/trace v1.47.0 + go4.org/netipx v0.0.0-20260823151212-3075585bcbeb + golang.org/x/crypto v0.58.0 + golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e + golang.org/x/sync v0.24.0 + google.golang.org/grpc v1.84.0 + google.golang.org/protobuf v1.36.12 gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2 ) -require github.com/valyala/fastjson v1.6.10 // indirect - -// Newer versions do not export base entities which are used to composite other entities. -// This breaks metalctl and friends -replace github.com/emicklei/go-restful-openapi/v2 => github.com/emicklei/go-restful-openapi/v2 v2.9.1 - require ( dario.cat/mergo v1.0.2 // indirect - github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect + github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -57,121 +53,122 @@ require ( github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v1.0.0-rc.4 // indirect - github.com/coreos/go-oidc/v3 v3.19.0 // indirect + github.com/coreos/go-oidc/v3 v3.20.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.7.0 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/docker/go-connections v0.7.0 // indirect + github.com/docker/go-connections v0.8.2 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/ebitengine/purego v0.10.1 // indirect + github.com/ebitengine/purego v0.11.1 // indirect github.com/felixge/httpsnoop v1.1.0 // indirect github.com/fsnotify/fsnotify v1.10.1 // indirect - github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/go-jose/go-jose/v4 v4.1.6 // indirect + github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/errors v0.22.8 // indirect - github.com/go-openapi/jsonpointer v0.23.1 // indirect - github.com/go-openapi/jsonreference v0.21.6 // indirect - github.com/go-openapi/runtime v0.32.4 // indirect - github.com/go-openapi/strfmt v0.26.3 // indirect - github.com/go-openapi/swag/conv v0.26.1 // indirect - github.com/go-openapi/swag/fileutils v0.26.1 // indirect - github.com/go-openapi/swag/jsonname v0.26.1 // indirect - github.com/go-openapi/swag/jsonutils v0.26.1 // indirect - github.com/go-openapi/swag/loading v0.26.1 // indirect - github.com/go-openapi/swag/stringutils v0.26.1 // indirect - github.com/go-openapi/swag/typeutils v0.26.1 // indirect - github.com/go-openapi/swag/yamlutils v0.26.1 // indirect + github.com/go-openapi/errors v0.22.9 // indirect + github.com/go-openapi/jsonpointer v1.0.2 // indirect + github.com/go-openapi/jsonreference v1.0.3 // indirect + github.com/go-openapi/runtime v0.33.3 // indirect + github.com/go-openapi/strfmt v0.27.4 // indirect + github.com/go-openapi/swag/conv v0.29.2 // indirect + github.com/go-openapi/swag/fileutils v0.29.2 // indirect + github.com/go-openapi/swag/jsonutils v0.29.2 // indirect + github.com/go-openapi/swag/loading v0.29.2 // indirect + github.com/go-openapi/swag/pools v0.29.2 // indirect + github.com/go-openapi/swag/stringutils v0.29.2 // indirect + github.com/go-openapi/swag/typeutils v0.29.2 // indirect + github.com/go-openapi/swag/yamlutils v0.29.2 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect - github.com/goccy/go-json v0.10.6 // indirect - github.com/gogo/protobuf v1.3.2 // indirect + github.com/goccy/go-json v0.11.2 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v1.0.0 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect - github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 // indirect + github.com/icza/dyno v0.0.0-20260912175837-51f8ab52fd15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmoiron/sqlx v1.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.6 // indirect + github.com/klauspost/compress v1.20.3 // indirect github.com/lestrrat-go/blackmagic v1.0.4 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc/v3 v3.0.6 // indirect - github.com/lestrrat-go/jwx/v3 v3.1.1 // indirect + github.com/lestrrat-go/jwx/v3 v3.3.0 // indirect github.com/lestrrat-go/option/v2 v2.0.0 // indirect github.com/lib/pq v1.12.3 // indirect github.com/lopezator/migrator v0.3.1 // indirect - github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e // indirect - github.com/magiconair/properties v1.8.10 // indirect - github.com/minio/minlz v1.1.1 // indirect + github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect + github.com/magiconair/properties v1.18.12 // indirect + github.com/minio/minlz v1.2.3 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect - github.com/moby/go-archive v0.2.0 // indirect - github.com/moby/moby/api v1.55.0 // indirect - github.com/moby/moby/client v0.5.0 // indirect + github.com/moby/go-archive v0.3.3 // indirect + github.com/moby/moby/api v1.56.1 // indirect + github.com/moby/moby/client v0.6.2 // indirect github.com/moby/patternmatcher v0.6.1 // indirect github.com/moby/sys/sequential v0.7.0 // indirect - github.com/moby/sys/user v0.4.0 // indirect - github.com/moby/sys/userns v0.1.0 // indirect + github.com/moby/sys/user v0.4.1 // indirect + github.com/moby/sys/userns v0.2.1 // indirect github.com/moby/term v0.5.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect - github.com/montanaflynn/stats v0.9.0 // indirect + github.com/montanaflynn/stats v0.13.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/oklog/ulid/v2 v2.1.1 // indirect + github.com/oklog/ulid/v2 v2.1.2 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.4.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect - github.com/prometheus/client_model v0.6.2 // indirect - github.com/prometheus/common v0.69.0 // indirect - github.com/prometheus/procfs v0.20.1 // indirect - github.com/redis/go-redis/v9 v9.21.0 // indirect + github.com/pelletier/go-toml/v2 v2.4.3 // indirect + github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 // indirect + github.com/prometheus/client_model v0.6.3 // indirect + github.com/prometheus/common v0.72.1 // indirect + github.com/prometheus/procfs v0.22.0 // indirect + github.com/redis/go-redis/v9 v9.23.0 // indirect github.com/sagikazarmark/locafero v0.12.0 // indirect github.com/segmentio/asm v1.2.1 // indirect - github.com/shirou/gopsutil/v4 v4.26.5 // indirect - github.com/sirupsen/logrus v1.9.4 // indirect + github.com/shirou/gopsutil/v4 v4.26.9 // indirect + github.com/sirupsen/logrus v1.10.2 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect - github.com/stretchr/objx v0.5.3 // indirect + github.com/stretchr/objx v0.8.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tklauser/go-sysconf v0.4.0 // indirect github.com/tklauser/numcpus v0.12.0 // indirect + github.com/valyala/fastjson v1.6.10 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.2.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.etcd.io/etcd/api/v3 v3.6.12 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.12 // indirect - go.etcd.io/etcd/client/v3 v3.6.12 // indirect - go.mongodb.org/mongo-driver v1.17.9 // indirect + go.etcd.io/etcd/api/v3 v3.7.2 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.7.2 // indirect + go.etcd.io/etcd/client/v3 v3.7.2 // indirect + go.mongodb.org/mongo-driver v1.17.10 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect - go.opentelemetry.io/otel v1.44.0 // indirect - go.opentelemetry.io/otel/metric v1.44.0 // indirect - go.opentelemetry.io/otel/trace v1.44.0 - go.uber.org/atomic v1.11.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.uber.org/atomic v1.12.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.28.0 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/exp v0.0.0-20260611194520-c48552f49976 - golang.org/x/net v0.56.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.46.0 // indirect - golang.org/x/text v0.38.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/net v0.61.0 // indirect + golang.org/x/oauth2 v0.37.0 // indirect + golang.org/x/sys v0.49.0 // indirect + golang.org/x/text v0.43.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b // indirect gopkg.in/cenkalti/backoff.v2 v2.2.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +// Newer versions do not export base entities which are used to composite other entities. +// This breaks metalctl and friends +replace github.com/emicklei/go-restful-openapi/v2 => github.com/emicklei/go-restful-openapi/v2 v2.9.1 diff --git a/go.sum b/go.sum index 782302b6..8dcf7ea3 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,16 @@ -connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ= -connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4= +connectrpc.com/connect v1.21.1 h1:h2kacdlzXpZU2OQFSv98xkjYXNUSr/ptxmGVbS/+CRM= +connectrpc.com/connect v1.21.1/go.mod h1:fhMcVJ5w6r/yTYhnkEbW6+sIF7OZ5Ay7KYgmfebh2ek= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= -filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= +filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= -github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= -github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= -github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 h1:m2xcjRABtG288vnlV3U/PKh/HnPURxZp50RKNUwBxM8= +github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4/go.mod h1:MTUE7ZuZO89FAtAwozGg6AWD83pcdefnEq5gF82MB8s= +github.com/Masterminds/semver/v3 v3.5.0 h1:kQceYJfbupGfZOKZQg0kou0DgAKhzDg2NZPAwZ/2OOE= +github.com/Masterminds/semver/v3 v3.5.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -47,8 +47,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v1.0.0-rc.4 h1:M42JrUT4zfZTqtkUwkr0GzmUWbfyO5VO0Q5b3op97T4= github.com/containerd/platforms v1.0.0-rc.4/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A= -github.com/coreos/go-oidc/v3 v3.19.0 h1:F/xyOi3x1UnG1U27YVnM1N6bHiL1K2upi6U/0qr8r+I= -github.com/coreos/go-oidc/v3 v3.19.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= +github.com/coreos/go-oidc/v3 v3.20.0 h1:EtE0WIBHk03N+DqGkY4+UONzzZHk7amKt6IyNd7OsZE= +github.com/coreos/go-oidc/v3 v3.20.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= @@ -67,19 +67,19 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 h1:5RVFMOWjMyRy8cARdy79nAmgYw3h github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c= -github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= +github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcykSlxMNc= +github.com/docker/go-connections v0.8.2/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/ebitengine/purego v0.10.1 h1:dewVBCBT2GaMu1SrNTYxQhgQBethzfhiwvZiLGP/qyY= -github.com/ebitengine/purego v0.10.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg= +github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI= +github.com/ebitengine/purego v0.11.1 h1:2zpWRSQNVKN4eKsKO9eM1ILDgWfYMY9GwqRmK6XeQ/0= +github.com/ebitengine/purego v0.11.1/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ= github.com/emicklei/go-restful-openapi/v2 v2.9.1 h1:Of8B1rXdG81il5TTiSY+9Qrh7pYOr8aLdynHIpvo7fM= github.com/emicklei/go-restful-openapi/v2 v2.9.1/go.mod h1:VKNgZyYviM1hnyrjD9RDzP2RuE94xTXxV+u6MGN4v4k= github.com/emicklei/go-restful/v3 v3.7.3/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= -github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.14.0 h1:6V6Ba8/5W1Z7amPinklZeCMlHBMwj53thpfxazCLMX4= +github.com/emicklei/go-restful/v3 v3.14.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -87,73 +87,71 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= -github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= -github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-jose/go-jose/v4 v4.1.6 h1:sNRkftxFJxwsILiQukqp5z83QBSmntVwmgRY7AqBDO4= +github.com/go-jose/go-jose/v4 v4.1.6/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/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.6/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.25.2 h1:I0vy4n3alz+DHTiN1PRhCb7QZxkK6g5YmswZKv2TKuw= -github.com/go-openapi/analysis v0.25.2/go.mod h1:Uhs1t/2XR10EnwONYILGEzw8gcfGIG5Xk5K2AxnhqDo= -github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I= -github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w= +github.com/go-openapi/analysis v1.0.0 h1:sNvbAGCJqUTqIAodr9IVqJMmuZas3YS9ms1dGK9yiJ4= +github.com/go-openapi/analysis v1.0.0/go.mod h1:NhYjJ57fnE+bcE7UwrJyMkhWA3Dfz7TdiBfTVAnos4Y= +github.com/go-openapi/errors v0.22.9 h1:HI9+SyVYiRzyeBQGv0CbWbQa+u2S0nny7G7AhY+UMiM= +github.com/go-openapi/errors v0.22.9/go.mod h1:R73q66sXP2smzAGgFOI4nqtusRK2xN5pYCjsij+KX58= 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.23.1 h1:1HBACs7XIwR2RcmItfdSFlALhGbe6S92p0ry4d1GWg4= -github.com/go-openapi/jsonpointer v0.23.1/go.mod h1:iWRmZTrGn7XwYhtPt/fvdSFj1OfNBngqRT2UG3BxSqY= +github.com/go-openapi/jsonpointer v1.0.2 h1:NbW7xT2b+l7x+JefiPGDsZWsrLk1ogrz4AHK1TTzMt8= +github.com/go-openapi/jsonpointer v1.0.2/go.mod h1:N0rI4MbNKD7xAFTiHtB+5Nhrg2j/wwYg7m7Fmb4/jk8= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.21.6 h1:NZ5nGfnaM1n4I43Xjm1e5/M2GjOwQwndQz22uhxwD+Y= -github.com/go-openapi/jsonreference v0.21.6/go.mod h1:xzbgtQ3ZbWxvET3AxdzCJlJt6vkovbf+IfSPJjD0tUY= -github.com/go-openapi/loads v0.24.0 h1:4LLorXRPTzIN9V6ngMUZbAscsBOUBk3Oa8cClu/bFrQ= -github.com/go-openapi/loads v0.24.0/go.mod h1:xQMgX+hw5xRAhGrcDXxeMw78IFqUpIzhleu3HqPhyF4= -github.com/go-openapi/runtime v0.32.4 h1:8ElGj/3goG0itt0nBPP6Cm57ehcYyuHoI3O20nxgvkw= -github.com/go-openapi/runtime v0.32.4/go.mod h1:Bz6keOZw1NX4T6f+m42OoT1MBPDt6Re13dbccHyGH/4= +github.com/go-openapi/jsonreference v1.0.3 h1:5rDbq+JsjCv6/nUDDJt83nLZoADI4w03uvHXer+4aYQ= +github.com/go-openapi/jsonreference v1.0.3/go.mod h1:OJSlMXHysgH272D9z2tiy2MGe5A9vQLHaCPb6KbYdE4= +github.com/go-openapi/loads v0.25.3 h1:V+jKy/thXWdLJUuYC8sZX2dICyAa8M3DokF70jj34P0= +github.com/go-openapi/loads v0.25.3/go.mod h1:LgLyCSOLBL2Qnj0Ps1oo2YH8jZoEKsMeVZCc+ALIxFo= +github.com/go-openapi/runtime v0.33.3 h1:qVgTDaFH+pzO8UqlwYNVmx2DD+nwVK3rB65V29ednD0= +github.com/go-openapi/runtime v0.33.3/go.mod h1:57crQFXXnCtT68LuAd+NOELX5tSF4ZE1GFW3Z+r/KCk= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.22.6 h1:Tyy1pLaNCM8GBCFLoGYLonjJi6zykqyLCjXLc19ZPic= -github.com/go-openapi/spec v0.22.6/go.mod h1:HZvTHat+iH0PALQRWhrqIHtU/PEqxqd89fu0MxGlMeM= -github.com/go-openapi/strfmt v0.26.3 h1:rzmslHarJgBbf2qfGge+X3htclQfmXqBZMm0Too0HhU= -github.com/go-openapi/strfmt v0.26.3/go.mod h1:a5nsUw0oRpQzZeOwx8bi6cKbzFZslpbCKt1LEot+KnQ= +github.com/go-openapi/spec v1.0.1 h1:lj2vdGpNDcVgwRc6qXdw6qt/KQpCtSa9tnUH6vpDPDk= +github.com/go-openapi/spec v1.0.1/go.mod h1:M//GWQGtDUAjnP37gE6fInLgaczB+FatoipV3H1fYw8= +github.com/go-openapi/strfmt v0.27.4 h1:E1xsvHb8R9vsuYru4TP2PVVTv9AIgSFAUACUZrFQfCI= +github.com/go-openapi/strfmt v0.27.4/go.mod h1:SCOff81PPhU26acBiW96jHaFycEbT2nkQRvojM+V2z0= 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.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU= -github.com/go-openapi/swag/conv v0.26.1 h1:slr5FVkg9Wc3Y5zcwenD8Sd/PQ94b2I/QJI7N7KTBpg= -github.com/go-openapi/swag/conv v0.26.1/go.mod h1:mvQXgPptZk9GTrFgGwWvT4q+dN+zQej9JfmGwnipz1A= -github.com/go-openapi/swag/fileutils v0.26.1 h1:K1XCM2CGhfNsc6YDt6v7Q5+1e59rftYWdcu/isZhvFw= -github.com/go-openapi/swag/fileutils v0.26.1/go.mod h1:mYUgxQAKX4ShS3qvvySx+/9yrlUnDhjiD1CalaQl8lQ= -github.com/go-openapi/swag/jsonname v0.26.1 h1:VReupaV6WxlAsCn0e4DUfgV6bPmINnPpyJDLqSfNPcE= -github.com/go-openapi/swag/jsonname v0.26.1/go.mod h1:OvdW6BoWoj33pTfi7x9vFrgmT+fk7aw0BRwvCE0YOuc= -github.com/go-openapi/swag/jsonutils v0.26.1 h1:2hdBfFkHg+7Wrz2VsCbeyR6hzkRDs7AztnMR2u84yOY= -github.com/go-openapi/swag/jsonutils v0.26.1/go.mod h1:U+RMJH3wa+6BRiphuRtIyI8fW9HPFqFQ4sHk2oRx0UQ= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.26.1 h1:1CD7NiLLb/TXl3tOnFYU4b+mNfb5rtgHkaA+q7RMYYQ= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.26.1/go.mod h1:ZWafc8nMdYzTE3uYY6W86f0n46+IF0g4uUyRhJw/kXc= -github.com/go-openapi/swag/loading v0.26.1 h1:E9K4wqXeROlhjFQ13K9zMz6ojFGXIggGe+ad1odrK9w= -github.com/go-openapi/swag/loading v0.26.1/go.mod h1:3qvRIlWzWdq1HvmldwmuJ2ohpcAryN6xVt2OTKd0/7E= -github.com/go-openapi/swag/mangling v0.26.1 h1:gpYI4WuPKFJJVjV5cDLGlDVJhFIxYjQc7yN5eEb4CqM= -github.com/go-openapi/swag/mangling v0.26.1/go.mod h1:POETDH01hqAdASXfw7ISEd9bCOE6xBHOt8NHmGZRmYM= -github.com/go-openapi/swag/stringutils v0.26.1 h1:f88uYyTso7TnHrKM/bUBsQ5e2wKf37cpgo6pvbzd9yU= -github.com/go-openapi/swag/stringutils v0.26.1/go.mod h1:Sc6d3bU8fgk5AyZR8/8jEQ+Is/Ald+TD/IIggPN8UJk= -github.com/go-openapi/swag/typeutils v0.26.1 h1:yg42FgMzRR6PVQ3M3qHz1s+Y6/P4HoJ3cBarXa3OVnU= -github.com/go-openapi/swag/typeutils v0.26.1/go.mod h1:VfnV+oUtSP2vCSCn2aJgnr8OevUYemyIzzS1VOzS10o= -github.com/go-openapi/swag/yamlutils v0.26.1 h1:0TSLK+lXs9vfIhAWzBeI/lOzEnIoot6WTCO1aAeWFTk= -github.com/go-openapi/swag/yamlutils v0.26.1/go.mod h1:7W5b7PRX9MxwL7TjeG7H8HkyBGRsIDRObhyMWFgBI2M= -github.com/go-openapi/testify/enable/yaml/v2 v2.5.1 h1:q9NtHwK4qHF7yZziBPvZyv7zWAIk8ok88Gh2mR6Jpc8= -github.com/go-openapi/testify/enable/yaml/v2 v2.5.1/go.mod h1:JW0MXIotCYps/XsgJnG3a8Q7rE5xAiBwoOD5OfaIQBk= -github.com/go-openapi/testify/v2 v2.5.1 h1:TMdhCaw8fUNraVSf3Omoob1dO/AzBfhtFAPW0an6sBo= -github.com/go-openapi/testify/v2 v2.5.1/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= -github.com/go-openapi/validate v0.26.0 h1:dxWzQ3F+vb1SajqUxHjwb5T4mTpSHmdrtv5Bi7+ZNhw= -github.com/go-openapi/validate v0.26.0/go.mod h1:b4o00uq7fJeJA+wWhVFCJpKTctzeFwzZImGGmHsl2JA= +github.com/go-openapi/swag v0.29.2 h1:9n8frkcsuQRA0INU31VbxNxt1zBaHxrHYGEf5BUjFi4= +github.com/go-openapi/swag/conv v0.29.2 h1:8c9shoB8l0QRSR6ymq1llHdBWDqpIgJfjTGHx3Vuhm0= +github.com/go-openapi/swag/conv v0.29.2/go.mod h1:AZS0YigTNf8qNtD6WqJz/N4RUNmpr76SyjFGkq4+p6Q= +github.com/go-openapi/swag/fileutils v0.29.2 h1:mdUL+Vw5ah1fO1AvFCoHeIyv7YZsCz2MN3KNqd/lLVI= +github.com/go-openapi/swag/fileutils v0.29.2/go.mod h1:7QKmmodjAebaq61lGVJa8ldLdGeMF4DSgYv8tXOGGo0= +github.com/go-openapi/swag/jsonutils v0.29.2 h1:uZNSD2/rJDYAfvsLYkykTzXuyxM3QpDKV9jhRHrMu6k= +github.com/go-openapi/swag/jsonutils v0.29.2/go.mod h1:ONTdNvj3Y+IXRzfa17E+Rgt2ns/qiSOYjIo2K7v2yDs= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2 h1:w+Fd6EBOMGlC74GYGHqCLGyb3Bpams8TtNrgM/SG4jo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2/go.mod h1:HC2egPORFzbj/gf05Zrfgz8Mgplx3oW7hgGi7pjZVhM= +github.com/go-openapi/swag/loading v0.29.2 h1:QU1ry24e6r6Shoxe380Nx0X5iKkpRO+hJffsyJ2dVlY= +github.com/go-openapi/swag/loading v0.29.2/go.mod h1:DqilDjuiJKETecsS4TRopWG1acUDsfqN39ZmQhPu6uI= +github.com/go-openapi/swag/mangling v0.29.2 h1:ltdo3K0tTP4P6zWhVVWDU9D37/YYBuMJRdZxiS2Dtog= +github.com/go-openapi/swag/mangling v0.29.2/go.mod h1:RjDi4TnItAenS3cgCXSpIl1kKbjG7il6pnmQVl/8bp8= +github.com/go-openapi/swag/pools v0.29.2 h1:PlGoDRF8WtSyXkedZZkpW3f9wDhFf3u8KtaBcmgmh8c= +github.com/go-openapi/swag/pools v0.29.2/go.mod h1:V3lhxVT4qDYRqc2MRSSbLsTYIYV/2HlHafhyEkmzLIc= +github.com/go-openapi/swag/stringutils v0.29.2 h1:lcnBxwAaysT3bMUVBfn9V/PkfVqkurpqufKU6rTUMGk= +github.com/go-openapi/swag/stringutils v0.29.2/go.mod h1:i9cdh7sGaa0nm3CqIvH5IM5h2QClk1wns2ktKeILvRI= +github.com/go-openapi/swag/typeutils v0.29.2 h1:O7aVvkTs3pXwikgtrPLenigEMdQFgONKRooQA9pgf2I= +github.com/go-openapi/swag/typeutils v0.29.2/go.mod h1:7+GDG+uz9Ke+eVt4rClZg7wklSDp8hT/mKNh/pC26TE= +github.com/go-openapi/swag/yamlutils v0.29.2 h1:IFKFFeDnuIwzfsuWRQU+rI8iL3g4XyAYjV/RlnlxPLM= +github.com/go-openapi/swag/yamlutils v0.29.2/go.mod h1:7MGqtcrK73sxQ4ceiyIf8qiXS/s09JLMdR5esK5euYQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.8.0 h1:dvOQNZ2ovOdogn902NYq7i6jUI9Dma4qyjTXABY5YTY= +github.com/go-openapi/testify/enable/yaml/v2 v2.8.0/go.mod h1:3VwZZUT6nWcAjhIr2RypXxlsxd3mPPtXh3T8z65aRlQ= +github.com/go-openapi/testify/v2 v2.8.0 h1:19QDx5b57p8KjO2E4sgs/woL4Akp+FGLRlVm2xn0Rho= +github.com/go-openapi/testify/v2 v2.8.0/go.mod h1:4gUN8jC+RqOE2qjW/vDmfyTvl5BCht4qL7oca0odrak= +github.com/go-openapi/validate v1.0.0 h1:dFsYCLVUQUL6Vi2lQSexgwmCXDuHe7eWRDhQxkE+xYA= +github.com/go-openapi/validate v1.0.0/go.mod h1:wwXGRqMQzOZ7PCqBcgNk+DD9+Cacnxv7we5T0M/eA3Y= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= -github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/goccy/go-json v0.11.2 h1:jdZv93Tt4ioR8yW1CoNsvSxrcZlCXAUU1aZXN7gpXUA= +github.com/goccy/go-json v0.11.2/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -170,17 +168,17 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.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/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.1 h1:E4CBXV5a/63B3ugXigjU28gr4HHM/BuMa1DtOYWhEz8= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.1/go.mod h1:4c5LkgQnrWyJl9pvs2+nPRS12n3g/93FAQg8IzhEgnY= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4 h1:9ZJYjPEJpcleIKcqysXOo14NLQYwu23fzmKRFpIjPjc= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4/go.mod h1:0xydIeg2omQ9DH6zYMP24Kk57793rnLUvP8fwdbFvz8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 h1:QMILzF8BA7xftE4zVORkRrlv08m12St3csK4RsyRgRs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0/go.mod h1:+ZQ6iUL8+ATyxGDQNuRKpNwJFdGDUi0e7E1QL9MvI7U= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 h1:nHoRIX8iXob3Y2kdt9KsjyIb7iApSvb3vgsd93xb5Ow= -github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0/go.mod h1:c1tRKs5Tx7E2+uHGSyyncziFjvGpgv4H2HrqXeUQ/Uk= +github.com/icza/dyno v0.0.0-20260912175837-51f8ab52fd15 h1:DdsUFd+NbqOdz+qGOcAPq9luE3jH2pxDm2vxp34MDIA= +github.com/icza/dyno v0.0.0-20260912175837-51f8ab52fd15/go.mod h1:c1tRKs5Tx7E2+uHGSyyncziFjvGpgv4H2HrqXeUQ/Uk= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -212,14 +210,12 @@ github.com/juanfont/headscale v0.28.0 h1:1lz1wj1NhKH2Y+U6URaVochCMrBsb+IUNDjQdwK github.com/juanfont/headscale v0.28.0/go.mod h1:7fIvcHzqXdsF4G0Um+f5crs7zPMRWZSXqCHlXHRdXWU= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= -github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4= +github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= -github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= -github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw= +github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -231,64 +227,68 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA= github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw= -github.com/lestrrat-go/dsig v1.2.1 h1:MwxzZhE4+4fguHi+uDALKVlC3Cn+O1QU1Q/F8D7hVIc= -github.com/lestrrat-go/dsig v1.2.1/go.mod h1:RD2eOaidyPvpc7IJQoO3Qq52RWdy8ZcJs8lrOnoa1Kc= +github.com/lestrrat-go/dsig v1.4.0 h1:g7LUjK8cT74A5DzBXJI5HzsJuLhoYN0Wzj4nuOMIrH8= +github.com/lestrrat-go/dsig v1.4.0/go.mod h1:I8Nddg/vN2cUl/h8N7SRRApLnNNeyZPIqLYpvpOtGGo= github.com/lestrrat-go/dsig-secp256k1 v1.0.0 h1:JpDe4Aybfl0soBvoVwjqDbp+9S1Y2OM7gcrVVMFPOzY= github.com/lestrrat-go/dsig-secp256k1 v1.0.0/go.mod h1:CxUgAhssb8FToqbL8NjSPoGQlnO4w3LG1P0qPWQm/NU= 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/v3 v3.0.6 h1:4FpLQ18KK/ypPbVU3NLWJNRvH3kcYiqKqWfKGqNWxxI= github.com/lestrrat-go/httprc/v3 v3.0.6/go.mod h1:mSMtkZW92Z98M5YoNNztbRGxbXHql7tSitCvaxvo9l0= -github.com/lestrrat-go/jwx/v3 v3.1.1 h1:yd9AdPmZ4INnQ7k42IrzXYpnEG803+SrQ6hdMvzHJzw= -github.com/lestrrat-go/jwx/v3 v3.1.1/go.mod h1:uw/MN2M/Xiu4FhwcIwH11Zsh9JWx9SWzgALl7/uIEkU= +github.com/lestrrat-go/jwx/v3 v3.3.0 h1:OXcYvQOQ7cxWzeZ/Q9sYk8ABe/kCSI371WmuACiCT+4= +github.com/lestrrat-go/jwx/v3 v3.3.0/go.mod h1:eIJhDcKHBwcgxqv8RiIylV67TVl1wJp/265IAHY1Db8= github.com/lestrrat-go/option/v2 v2.0.0 h1:XxrcaJESE1fokHy3FpaQ/cXW8ZsIdWcdFzzLOcID3Ss= github.com/lestrrat-go/option/v2 v2.0.0/go.mod h1:oSySsmzMoR0iRzCDCaUfsCzxQHUEuhOViQObyy7S6Vg= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= -github.com/looplab/fsm v1.0.3 h1:qtxBsa2onOs0qFOtkqwf5zE0uP0+Te+wlIvXctPKpcw= -github.com/looplab/fsm v1.0.3/go.mod h1:PmD3fFvQEIsjMEfvZdrCDZ6y8VwKTwWNjlpEr6IKPO4= +github.com/looplab/fsm v1.0.4 h1:UydovCL/p39HLvmBsLNsX/WgpfyfTZ+3e7YEFywkLMI= +github.com/looplab/fsm v1.0.4/go.mod h1:PmD3fFvQEIsjMEfvZdrCDZ6y8VwKTwWNjlpEr6IKPO4= github.com/lopezator/migrator v0.3.1 h1:ZFPT6aC7+nGWkqhleynABZ6ftycSf6hmHHLOaryq1Og= github.com/lopezator/migrator v0.3.1/go.mod h1:X+lHDMZ9Ci3/KdbypJcQYFFwipVrJsX4fRCQ4QLauYk= -github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e h1:Q6MvJtQK/iRcRtzAscm/zF23XxJlbECiGPyRicsX+Ak= -github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= -github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= -github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= +github.com/magiconair/properties v1.18.12 h1:sT9zQpvTB3B4gzrX0tmZNTEaGyg8Zw55MFYRE32Mr9I= +github.com/magiconair/properties v1.18.12/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= 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/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= -github.com/metal-stack/api v0.1.7 h1:sOngiC7vuErxgaAGLXDUuzigV3ZXQ7zTG5Mvjqhn2O0= -github.com/metal-stack/api v0.1.7/go.mod h1:+WrGqA7QpQ2O60vakm3tjDbo70Q4c92pdco4R5MRcL8= -github.com/metal-stack/go-ipam v1.15.1 h1:lpW0tioHx0V4udAtpqY06LZ8odkGd0aoATjWCdiLtCk= -github.com/metal-stack/go-ipam v1.15.1/go.mod h1:CbkULx+ZsB8/lmDYaFX3jN5J2SeeSHMQzGJnYYPNfGg= +github.com/metal-stack/api v0.8.2 h1:GWgtAqN2jp5TTkmjVlIUKQptc80KY4cSH0/cwYLYKIs= +github.com/metal-stack/api v0.8.2/go.mod h1:mx2KOLoCwogU/riKSYTYAb1DXtP7n4A0+FitzOxlCUE= +github.com/metal-stack/go-ipam v1.16.0 h1:HRFji/d797kgjSA3nBtZgcKfCNC6C+BObkDBVAkSQNk= +github.com/metal-stack/go-ipam v1.16.0/go.mod h1:eWSe79eBW8e1nPN6G/CEGSS+ZYVuEkOE4JmBxp2eSig= github.com/metal-stack/masterdata-api v0.12.0 h1:8EZmf/A+GMVpShYvYDJ3YmPoK0MmqsWtzef9y1wRRwo= github.com/metal-stack/masterdata-api v0.12.0/go.mod h1:w12kbaV8wmf+/8j7JLWUNDsv6/l8sh6F9OYYYi09hDU= -github.com/metal-stack/metal-lib v0.25.1 h1:z14xNl59ueQavNvMG4wcIZGqVyosNlaNFcy8hUu3SCU= -github.com/metal-stack/metal-lib v0.25.1/go.mod h1:FWviUPM7oH1CnmCwkyLjWpd3yuzf6NnR97Xf45P2/Fk= -github.com/metal-stack/security v0.9.6 h1:q+JbfFis/G2IuyKky2btmDmO0Y2GQ47p7lmzOi80kMY= -github.com/metal-stack/security v0.9.6/go.mod h1:HBwf4y3E4VLJPG6vNW1ynlrym46cENDtzIoN9c7uxFI= +github.com/metal-stack/metal-lib v0.26.3 h1:K5gLoD65m6p3l6qCPrfavIdvNdWfmF2QdXrvU2URaZs= +github.com/metal-stack/metal-lib v0.26.3/go.mod h1:cNXjPBs8SFnjqfBobuSbm5mDk6E/jS8PVeIOrV/7POE= +github.com/metal-stack/security v0.9.7 h1:JAKj/01gIyO4rY7DrrIGBK6X+27uvMX+XPgW15U2d7g= +github.com/metal-stack/security v0.9.7/go.mod h1:6DFjP2KjdwrXF2aboQDrleo6/dZlGXoYtrV/YioKoFY= 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/minio/minlz v1.1.1 h1:OGmft1V6AnI/Wme332U6bhG54nxEan+VFgkD7lat4KM= -github.com/minio/minlz v1.1.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= +github.com/minio/minlz v1.2.3 h1:xUNhxBd8AlRJbJIsFkVmrN96gk9as9PjheVh3f9x90s= +github.com/minio/minlz v1.2.3/go.mod h1:xHhZ+MJmC2U4ssK/rSENsoyCfv0VFQo1mT6AdCA2RJ8= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/go-archive v0.2.0 h1:zg5QDUM2mi0JIM9fdQZWC7U8+2ZfixfTYoHL7rWUcP8= -github.com/moby/go-archive v0.2.0/go.mod h1:mNeivT14o8xU+5q1YnNrkQVpK+dnNe/K6fHqnTg4qPU= -github.com/moby/moby/api v1.55.0 h1:2/sexvQyqIWS8pRSCFddBfpW2qE7vR7FCL+vN8pxwMc= -github.com/moby/moby/api v1.55.0/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= -github.com/moby/moby/client v0.5.0 h1:5XhyPk2fuOWf6RlSFa3MkIIgDZkF25xToXW8Q/BH7cc= -github.com/moby/moby/client v0.5.0/go.mod h1:rcVpF8ncl9vo5gaIBdol6CnbEtSj1uxMvEV/UrykF/s= +github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME= +github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE= +github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c= +github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk= +github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4= +github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc= github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U= github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00= +github.com/moby/sys/mount v0.3.5/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M= +github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= +github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/sys/sequential v0.7.0 h1:ASQNGNROJSuOO6LL6bPHbKvuZu6NU8P4ldPWk31zj/8= github.com/moby/sys/sequential v0.7.0/go.mod h1:NfSTAp6V3fw4tmkD62PEcOKeZKquXT8VKCkf7aVR79o= -github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= -github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= -github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= -github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/sys/user v0.4.1 h1:RgjRlaDKi/Xmyrz4t8lyzXT6v2ooFeO/7xtchmhVWE0= +github.com/moby/sys/user v0.4.1/go.mod h1:E9QsW5WRe1kUAf7kW8hXKwu1uhsZEAdPLYHYSDudF4Y= +github.com/moby/sys/userns v0.2.1 h1:4OvdM7BcPkASbuouHsbW3aeMJSFlYDldBRnXVZhaRk8= +github.com/moby/sys/userns v0.2.1/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -297,8 +297,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.9.0 h1:tsBJ0RXwph9BmAuFoCmqGv6e8xa0MENQ8m0ptKq29mQ= -github.com/montanaflynn/stats v0.9.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/montanaflynn/stats v0.13.0 h1:qqY7uKUbPffViAAuGxe4uLma24DGJeD/jpj3Bmtk5Gs= +github.com/montanaflynn/stats v0.13.0/go.mod h1:xmkP2Ib5njMgVeJreDr/tf5J0G+/i/ijWpSH/3IBRsE= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -308,8 +308,8 @@ github.com/nsqio/go-nsq v1.1.0 h1:PQg+xxiUjA7V+TLdXw7nVrJ5Jbl3sN86EhGCQj4+FYE= github.com/nsqio/go-nsq v1.1.0/go.mod h1:vKq36oyeVXgsS5Q8YEO7WghqidAVXQlcFxzQbQTuDEY= github.com/nsqio/nsq v1.3.0 h1:v7NtyO844ieTIOCQEqQ7IUSSi1ImhgrTTto1rgIYGEU= github.com/nsqio/nsq v1.3.0/go.mod h1:RxNr6UC0kSkNF44LnJrlN3U3CQnQGTXk+QKfSZLzqvc= -github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= -github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= +github.com/oklog/ulid/v2 v2.1.2 h1:IEclFb9JNvzYA6MW2SCxbLzcHTVsfqm3PrqGQJH5zec= +github.com/oklog/ulid/v2 v2.1.2/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -322,23 +322,23 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt 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/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -github.com/pelletier/go-toml/v2 v2.4.1 h1:j5OMOImsH+j2k7GJ5YO+RxfWwohNiH6t5zB/+h3bagc= -github.com/pelletier/go-toml/v2 v2.4.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdDPYVpY= +github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= -github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= -github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= -github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.69.0 h1:OA85nJQS/T/MaYh/Q2CcgDKSGWqNIgrBDvDH85CuiNk= -github.com/prometheus/common v0.69.0/go.mod h1:ZzL3f6u94qUxh9p+tJTrF+FvBS1XXbbRAZCQkytAL0Y= -github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= -github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= -github.com/redis/go-redis/v9 v9.21.0 h1:FPBE4hhbAke+TLmcY3WkpbDffJEomdqPn3HYiqAtL9E= -github.com/redis/go-redis/v9 v9.21.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= +github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 h1:XA01Vk/wv9YikCi1V51yRzIHPMT5of9+cMpZoZvDn/M= +github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKqbYtNOXuiK0= +github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk= +github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo= +github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM= +github.com/prometheus/common v0.72.1 h1:ZAiQed/nk8IIcsdzb2TlJu23NEUDyDLQ9TXTN2WRK6Y= +github.com/prometheus/common v0.72.1/go.mod h1:1IoBY4IRaJnhs2ESjNzjilP1cJ/P8pimGoomq7zRXrA= +github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics= +github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58= +github.com/redis/go-redis/v9 v9.23.0 h1:/TTVdJa8BRNsybwwGGnmiYktHNlUXtbOQxlWpHBPL3s= +github.com/redis/go-redis/v9 v9.23.0/go.mod h1:EWP2UUk+XDaI1s5nQB5mablZN6vccXlmBQTyfnF87D0= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -348,11 +348,11 @@ github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM= github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/shirou/gopsutil/v4 v4.26.5 h1:RPcBXkpz7kOj9PqGFQOlBPZHsyaPvPVQc098y9RmCNM= -github.com/shirou/gopsutil/v4 v4.26.5/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/shirou/gopsutil/v4 v4.26.9 h1:CaBo/hBFqvlJoLvAQEKdHdf5GD97/MN2ACfyv63+2Ig= +github.com/shirou/gopsutil/v4 v4.26.9/go.mod h1:nKH+8wX2zxr/mDbsR+AAy6Qd2z4ZOQ7wfQaEp+yrYmg= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= -github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= +github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo= +github.com/sirupsen/logrus v1.10.2/go.mod h1:SLEg8TqYulVKKfIGHldVp2K2aYz2DKSVBq4g/H5bR7Q= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= @@ -366,19 +366,19 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= -github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= +github.com/stretchr/objx v0.8.0 h1:rm9oMkeprG/wHifkZP4EuDww9S0mvEaQ/p9cXTNT4cw= +github.com/stretchr/objx v0.8.0/go.mod h1:xSzHnPHkdEv7vtgdQej8atlCuU1mdX+ELge8bn0hCsE= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/testcontainers/testcontainers-go v0.42.0 h1:He3IhTzTZOygSXLJPMX7n44XtK+qhjat1nI9cneBbUY= -github.com/testcontainers/testcontainers-go v0.42.0/go.mod h1:vZjdY1YmUA1qEForxOIOazfsrdyORJAbhi0bp8plN30= +github.com/testcontainers/testcontainers-go v0.44.0 h1:/Fwh6HY1mIikhnm9e7HwoxGycx0lzRAE0f5VQpjFxzI= +github.com/testcontainers/testcontainers-go v0.44.0/go.mod h1:IcnwQrYTO86xHXu5bvMaBH7ATlbS3Qn1M1QWW3c66rE= github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU= github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI= github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4= @@ -393,37 +393,37 @@ github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6 github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= -go.etcd.io/etcd/api/v3 v3.6.12 h1:OLOZUKEuAA36TR48F0cIaa8FdzrWygjyfrJxXg4iDgs= -go.etcd.io/etcd/api/v3 v3.6.12/go.mod h1:p14EIQXHbuOQbVvL/WEes5uqKnxP9AgKJgpjbMVvzvE= -go.etcd.io/etcd/client/pkg/v3 v3.6.12 h1:36zzB+pQOdHbhN+kH2iJz/K8bJn0ZLtLfPPO7jozTDo= -go.etcd.io/etcd/client/pkg/v3 v3.6.12/go.mod h1:hh2+ZXtfLzs3o6mn92ntgNPBrTJJOvXqICM5g3L3DMY= -go.etcd.io/etcd/client/v3 v3.6.12 h1:kMSP6JcPZMqSJiX+TXdUIBU/4eXEZWBAaui4VihMbIc= -go.etcd.io/etcd/client/v3 v3.6.12/go.mod h1:CMs6fJWYiZQk4ytFjd4lE1diOvvRMmtbbn/alZXd3dQ= -go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU= -go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ= +go.etcd.io/etcd/api/v3 v3.7.2 h1:xgt/6el1LsPWWYNLkhMAK4tZm6dF+1sCqDecpE5gdbk= +go.etcd.io/etcd/api/v3 v3.7.2/go.mod h1:RoRCBRt9BfBff1pIGZLUVMiz7wu3bY+b2qLysGu1HY4= +go.etcd.io/etcd/client/pkg/v3 v3.7.2 h1:SVtlR7tiSVAYOQ4nWPIyFXb4RMgEcnzeAG9RQ8MoNDU= +go.etcd.io/etcd/client/pkg/v3 v3.7.2/go.mod h1:HsSux/B3ahgyw/D5+d4YbZqicOi0mEbuxm6lIUdjAoI= +go.etcd.io/etcd/client/v3 v3.7.2 h1:Z66GqDQDI7zPDfVSsIBqGSK4mJYLtv8ESwXa4mPf+wY= +go.etcd.io/etcd/client/v3 v3.7.2/go.mod h1:x03t1qMs4tGZirCDJlMuzPBJdQffXJImIyEjLhNBCsY= +go.mongodb.org/mongo-driver v1.17.10 h1:kdAgQvu8TROXZpSkJQd5wzfaNCCrMbpZyKFtQ6qkPCE= +go.mongodb.org/mongo-driver v1.17.10/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI= -go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= -go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= -go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= -go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= -go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= -go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= -go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= -go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.uber.org/atomic v1.12.0 h1:BvcXdFKuviU4fTL/f+SxdQ5qJX/Jix8pAkgdUcb3XOE= +go.uber.org/atomic v1.12.0/go.mod h1:I6c4cg+6HCxRjfjSsYtApoFILnpc0CGUdGkXVqbYVNk= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -432,87 +432,73 @@ go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M= -go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +go4.org/netipx v0.0.0-20260823151212-3075585bcbeb h1:XBM4hvfwGAttkkiTIFfeigdfcL1xIfdKXqFdgiHGtDs= +go4.org/netipx v0.0.0-20260823151212-3075585bcbeb/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= -golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= -golang.org/x/exp v0.0.0-20260611194520-c48552f49976 h1:X8Hz2ImujgbmetVuW+w2YkyZChE3cBpZi2P158rTG9M= -golang.org/x/exp v0.0.0-20260611194520-c48552f49976/go.mod h1:vnf4pv9iKZXY58sQE1L86zmNWJ4159e1RkcWiLCkeEY= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= +golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= +golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e h1:HgI6W1OolKK6tcV74is+rl9SMT0njsHlp0TbQiGXI/A= +golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e/go.mod h1:DBoxwWhjaW8DJJw/YeM4zpeOKMC1FMXSblsYy+1mFSw= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 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-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= -golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw= +golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= +golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= -golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= +golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-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.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= -golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= +golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= 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.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= -golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= +golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= +golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= 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.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.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= -golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= +golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= +golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d h1:xr2lwHI91bn3UiXcnyzRMQjp2LRiM8wEHzwUaE0YhTs= -google.golang.org/genproto/googleapis/api v0.0.0-20260622175928-b703f567277d/go.mod h1:O0ZOWSrfWfJ+Z5HbwZ+wNtHsg/vk1k2C/w67eww8PfQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d h1:mpAgMyM9vQHxycBlDq50y1VHpfSfVwzXvrQKtYbXuUY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= -google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b h1:nB3spRIaSPtxJpxb0k41yljROvm2Jrwfs2pSNdKS5y8= +google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b/go.mod h1:9N4vtjEwvgQKEdlFVQO0M44ErhecQ9DCSQfGoZ51M6w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b h1:6WNWHZk91dp4gZ25642OALkuG1UVNZbwENJD19DnB8k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= +google.golang.org/grpc v1.84.0/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII= gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU= From 70dfe3bd2c233c2f5af34bf1f2e96fa591b8de58 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 21 Oct 2026 08:26:00 +0200 Subject: [PATCH 2/2] Run go fix --- cmd/metal-api/internal/datastore/event.go | 4 +- .../internal/datastore/image_test.go | 116 +++++++------- .../internal/datastore/machine_test.go | 62 ++++---- .../migrations/07_size_reservations_table.go | 8 +- cmd/metal-api/internal/eventbus/nsq_test.go | 2 +- cmd/metal-api/internal/grpc/boot-service.go | 6 +- cmd/metal-api/internal/grpc/event-service.go | 4 +- cmd/metal-api/internal/ipam/ipam.go | 3 +- cmd/metal-api/internal/issues/issues_test.go | 8 +- .../internal/metal/filesystem_test.go | 46 +++--- cmd/metal-api/internal/metal/image_test.go | 24 ++- cmd/metal-api/internal/metal/machine_test.go | 10 +- .../internal/metal/partition_test.go | 24 ++- cmd/metal-api/internal/metal/size.go | 6 +- cmd/metal-api/internal/metal/size_test.go | 132 +++++---------- .../metal/sizeimageconstraint_test.go | 34 ++-- cmd/metal-api/internal/metal/switch_test.go | 52 ++---- cmd/metal-api/internal/service/async-actor.go | 3 +- .../internal/service/audit-service.go | 6 +- .../internal/service/filesystem-service.go | 6 +- .../internal/service/firewall-service.go | 6 +- .../internal/service/firmware-service.go | 6 +- .../internal/service/image-service.go | 14 +- .../internal/service/image-service_test.go | 56 ++----- cmd/metal-api/internal/service/ip-service.go | 12 +- .../internal/service/machine-service.go | 16 +- .../internal/service/network-service.go | 29 ++-- .../internal/service/network-service_test.go | 30 ++-- .../internal/service/partition-service.go | 26 +-- .../service/partition-service_test.go | 100 ++++-------- .../internal/service/project-service.go | 6 +- .../internal/service/size-service.go | 28 ++-- .../internal/service/size-service_test.go | 150 +++++------------- .../service/sizeimageconstraint-service.go | 6 +- .../internal/service/switch-service.go | 8 +- .../internal/service/switch-service_test.go | 144 +++++------------ .../internal/service/tenant-service.go | 4 +- .../internal/service/tenant-service_test.go | 4 +- .../internal/service/user-service.go | 4 +- .../internal/service/v1/filesystem.go | 34 ++-- cmd/metal-api/internal/service/v1/image.go | 28 ++-- cmd/metal-api/internal/service/v1/ip.go | 28 ++-- cmd/metal-api/internal/service/v1/machine.go | 74 ++++----- cmd/metal-api/internal/service/v1/network.go | 54 +++---- .../internal/service/v1/partition.go | 28 ++-- cmd/metal-api/internal/service/v1/size.go | 24 +-- .../service/v1/sizeimageconstraint.go | 20 +-- cmd/metal-api/internal/service/v1/switch.go | 64 +++----- cmd/metal-api/internal/service/vpn-service.go | 4 +- .../internal/service/vpn-service_test.go | 12 +- cmd/metal-api/main.go | 74 ++++----- test/integration.go | 16 +- 52 files changed, 584 insertions(+), 1081 deletions(-) diff --git a/cmd/metal-api/internal/datastore/event.go b/cmd/metal-api/internal/datastore/event.go index 88b45d61..382893a5 100644 --- a/cmd/metal-api/internal/datastore/event.go +++ b/cmd/metal-api/internal/datastore/event.go @@ -48,9 +48,7 @@ func (rs *RethinkStore) ProvisioningEventForMachine(ctx context.Context, log *sl if ec == nil { ec = &metal.ProvisioningEventContainer{ - Base: metal.Base{ - ID: machineID, - }, + ID: machineID, Liveliness: metal.MachineLivelinessAlive, } } diff --git a/cmd/metal-api/internal/datastore/image_test.go b/cmd/metal-api/internal/datastore/image_test.go index 5676fe61..31ef53b7 100644 --- a/cmd/metal-api/internal/datastore/image_test.go +++ b/cmd/metal-api/internal/datastore/image_test.go @@ -16,22 +16,22 @@ import ( func Test_getMostRecentImageFor(t *testing.T) { valid := time.Now().Add(time.Hour) - ubuntu14_1 := metal.Image{Base: metal.Base{ID: "ubuntu-14.1"}, OS: "ubuntu", Version: "14.1", ExpirationDate: valid} - ubuntu14_04 := metal.Image{Base: metal.Base{ID: "ubuntu-14.4"}, OS: "ubuntu", Version: "14.4", ExpirationDate: valid} - ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4", ExpirationDate: valid} - ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10", ExpirationDate: valid} - ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4", ExpirationDate: valid} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: valid} - ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10", ExpirationDate: valid} - ubuntu20_04_20200401 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200401"}, OS: "ubuntu", Version: "20.4.20200401", ExpirationDate: valid} - ubuntu20_04_20200501 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200501"}, OS: "ubuntu", Version: "20.4.20200501", ExpirationDate: valid} - ubuntu20_04_20200502 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200502"}, OS: "ubuntu", Version: "20.4.20200502", ExpirationDate: valid} - ubuntu20_04_20200603 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200603"}, OS: "ubuntu", Version: "20.4.20200603", ExpirationDate: valid} + ubuntu14_1 := metal.Image{ID: "ubuntu-14.1", OS: "ubuntu", Version: "14.1", ExpirationDate: valid} + ubuntu14_04 := metal.Image{ID: "ubuntu-14.4", OS: "ubuntu", Version: "14.4", ExpirationDate: valid} + ubuntu17_04 := metal.Image{ID: "ubuntu-17.4", OS: "ubuntu", Version: "17.4", ExpirationDate: valid} + ubuntu17_10 := metal.Image{ID: "ubuntu-17.10", OS: "ubuntu", Version: "17.10", ExpirationDate: valid} + ubuntu18_04 := metal.Image{ID: "ubuntu-18.4", OS: "ubuntu", Version: "18.4", ExpirationDate: valid} + ubuntu19_04 := metal.Image{ID: "ubuntu-19.4", OS: "ubuntu", Version: "19.4", ExpirationDate: valid} + ubuntu19_10 := metal.Image{ID: "ubuntu-19.10", OS: "ubuntu", Version: "19.10", ExpirationDate: valid} + ubuntu20_04_20200401 := metal.Image{ID: "ubuntu-20.4.20200401", OS: "ubuntu", Version: "20.4.20200401", ExpirationDate: valid} + ubuntu20_04_20200501 := metal.Image{ID: "ubuntu-20.4.20200501", OS: "ubuntu", Version: "20.4.20200501", ExpirationDate: valid} + ubuntu20_04_20200502 := metal.Image{ID: "ubuntu-20.4.20200502", OS: "ubuntu", Version: "20.4.20200502", ExpirationDate: valid} + ubuntu20_04_20200603 := metal.Image{ID: "ubuntu-20.4.20200603", OS: "ubuntu", Version: "20.4.20200603", ExpirationDate: valid} - alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9", ExpirationDate: valid} - alpine3_9_20191012 := metal.Image{Base: metal.Base{ID: "alpine-3.9.20191012"}, OS: "alpine", Version: "3.9.20191012", ExpirationDate: valid} - alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10", ExpirationDate: valid} - alpine3_10_20191012 := metal.Image{Base: metal.Base{ID: "alpine-3.10.20191012"}, OS: "alpine", Version: "3.10.20191012", ExpirationDate: valid} + alpine3_9 := metal.Image{ID: "alpine-3.9", OS: "alpine", Version: "3.9", ExpirationDate: valid} + alpine3_9_20191012 := metal.Image{ID: "alpine-3.9.20191012", OS: "alpine", Version: "3.9.20191012", ExpirationDate: valid} + alpine3_10 := metal.Image{ID: "alpine-3.10", OS: "alpine", Version: "3.10", ExpirationDate: valid} + alpine3_10_20191012 := metal.Image{ID: "alpine-3.10.20191012", OS: "alpine", Version: "3.10.20191012", ExpirationDate: valid} tests := []struct { name string id string @@ -101,8 +101,8 @@ func Test_getMostRecentImageFor(t *testing.T) { func Test_getMostRecentImageForFirewall(t *testing.T) { valid := time.Now().Add(time.Hour) - firewall2 := metal.Image{Base: metal.Base{ID: "firewall-2.0.20200331"}, OS: "firewall", Version: "2.0.20200331", ExpirationDate: valid} - firewallubuntu2 := metal.Image{Base: metal.Base{ID: "firewall-ubuntu-2.0.20200331"}, OS: "firewall-ubuntu", Version: "2.0.20200331", ExpirationDate: valid} + firewall2 := metal.Image{ID: "firewall-2.0.20200331", OS: "firewall", Version: "2.0.20200331", ExpirationDate: valid} + firewallubuntu2 := metal.Image{ID: "firewall-ubuntu-2.0.20200331", OS: "firewall-ubuntu", Version: "2.0.20200331", ExpirationDate: valid} tests := []struct { name string id string @@ -144,22 +144,22 @@ func Test_getMostRecentImageForFirewall(t *testing.T) { func Test_getImagesFor(t *testing.T) { valid := time.Now().Add(time.Hour) - ubuntu14_1 := metal.Image{Base: metal.Base{ID: "ubuntu-14.1"}, OS: "ubuntu", Version: "14.1", ExpirationDate: valid} - ubuntu14_04 := metal.Image{Base: metal.Base{ID: "ubuntu-14.4"}, OS: "ubuntu", Version: "14.4", ExpirationDate: valid} - ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4", ExpirationDate: valid} - ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10", ExpirationDate: valid} - ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4", ExpirationDate: valid} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: valid} - ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10", ExpirationDate: valid} - ubuntu20_04_20200401 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200401"}, OS: "ubuntu", Version: "20.4.20200401", ExpirationDate: valid} - ubuntu20_04_20200501 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200501"}, OS: "ubuntu", Version: "20.4.20200501", ExpirationDate: valid} - ubuntu20_04_20200502 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200502"}, OS: "ubuntu", Version: "20.4.20200502", ExpirationDate: valid} - ubuntu20_04_20200603 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200603"}, OS: "ubuntu", Version: "20.4.20200603", ExpirationDate: valid} + ubuntu14_1 := metal.Image{ID: "ubuntu-14.1", OS: "ubuntu", Version: "14.1", ExpirationDate: valid} + ubuntu14_04 := metal.Image{ID: "ubuntu-14.4", OS: "ubuntu", Version: "14.4", ExpirationDate: valid} + ubuntu17_04 := metal.Image{ID: "ubuntu-17.4", OS: "ubuntu", Version: "17.4", ExpirationDate: valid} + ubuntu17_10 := metal.Image{ID: "ubuntu-17.10", OS: "ubuntu", Version: "17.10", ExpirationDate: valid} + ubuntu18_04 := metal.Image{ID: "ubuntu-18.4", OS: "ubuntu", Version: "18.4", ExpirationDate: valid} + ubuntu19_04 := metal.Image{ID: "ubuntu-19.4", OS: "ubuntu", Version: "19.4", ExpirationDate: valid} + ubuntu19_10 := metal.Image{ID: "ubuntu-19.10", OS: "ubuntu", Version: "19.10", ExpirationDate: valid} + ubuntu20_04_20200401 := metal.Image{ID: "ubuntu-20.4.20200401", OS: "ubuntu", Version: "20.4.20200401", ExpirationDate: valid} + ubuntu20_04_20200501 := metal.Image{ID: "ubuntu-20.4.20200501", OS: "ubuntu", Version: "20.4.20200501", ExpirationDate: valid} + ubuntu20_04_20200502 := metal.Image{ID: "ubuntu-20.4.20200502", OS: "ubuntu", Version: "20.4.20200502", ExpirationDate: valid} + ubuntu20_04_20200603 := metal.Image{ID: "ubuntu-20.4.20200603", OS: "ubuntu", Version: "20.4.20200603", ExpirationDate: valid} - alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9", ExpirationDate: valid} - alpine3_9_20191012 := metal.Image{Base: metal.Base{ID: "alpine-3.9.20191012"}, OS: "alpine", Version: "3.9.20191012", ExpirationDate: valid} - alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10", ExpirationDate: valid} - alpine3_10_20191012 := metal.Image{Base: metal.Base{ID: "alpine-3.10.20191012"}, OS: "alpine", Version: "3.10.20191012", ExpirationDate: valid} + alpine3_9 := metal.Image{ID: "alpine-3.9", OS: "alpine", Version: "3.9", ExpirationDate: valid} + alpine3_9_20191012 := metal.Image{ID: "alpine-3.9.20191012", OS: "alpine", Version: "3.9.20191012", ExpirationDate: valid} + alpine3_10 := metal.Image{ID: "alpine-3.10", OS: "alpine", Version: "3.10", ExpirationDate: valid} + alpine3_10_20191012 := metal.Image{ID: "alpine-3.10.20191012", OS: "alpine", Version: "3.10.20191012", ExpirationDate: valid} tests := []struct { name string id string @@ -220,25 +220,25 @@ func Test_getImagesFor(t *testing.T) { } func Test_sortImages(t *testing.T) { - firewall2 := metal.Image{Base: metal.Base{ID: "firewall-2.0.20200331"}, OS: "firewall", Version: "2.0.20200331"} - firewallubuntu2 := metal.Image{Base: metal.Base{ID: "firewall-ubuntu-2.0.20200331"}, OS: "firewall-ubuntu", Version: "2.0.20200331"} - ubuntu14_1 := metal.Image{Base: metal.Base{ID: "ubuntu-14.1"}, OS: "ubuntu", Version: "14.1"} - ubuntu14_04 := metal.Image{Base: metal.Base{ID: "ubuntu-14.4"}, OS: "ubuntu", Version: "14.4"} - ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4"} - ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10"} - ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4"} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4"} - ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10"} - ubuntu20_04_20200401 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200401"}, OS: "ubuntu", Version: "20.4.20200401"} - ubuntu20_04_20200501 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200501"}, OS: "ubuntu", Version: "20.4.20200501"} - ubuntu20_04_20200502 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200502"}, OS: "ubuntu", Version: "20.4.20200502"} - ubuntu20_04_20200603 := metal.Image{Base: metal.Base{ID: "ubuntu-20.4.20200603"}, OS: "ubuntu", Version: "20.4.20200603"} + firewall2 := metal.Image{ID: "firewall-2.0.20200331", OS: "firewall", Version: "2.0.20200331"} + firewallubuntu2 := metal.Image{ID: "firewall-ubuntu-2.0.20200331", OS: "firewall-ubuntu", Version: "2.0.20200331"} + ubuntu14_1 := metal.Image{ID: "ubuntu-14.1", OS: "ubuntu", Version: "14.1"} + ubuntu14_04 := metal.Image{ID: "ubuntu-14.4", OS: "ubuntu", Version: "14.4"} + ubuntu17_04 := metal.Image{ID: "ubuntu-17.4", OS: "ubuntu", Version: "17.4"} + ubuntu17_10 := metal.Image{ID: "ubuntu-17.10", OS: "ubuntu", Version: "17.10"} + ubuntu18_04 := metal.Image{ID: "ubuntu-18.4", OS: "ubuntu", Version: "18.4"} + ubuntu19_04 := metal.Image{ID: "ubuntu-19.4", OS: "ubuntu", Version: "19.4"} + ubuntu19_10 := metal.Image{ID: "ubuntu-19.10", OS: "ubuntu", Version: "19.10"} + ubuntu20_04_20200401 := metal.Image{ID: "ubuntu-20.4.20200401", OS: "ubuntu", Version: "20.4.20200401"} + ubuntu20_04_20200501 := metal.Image{ID: "ubuntu-20.4.20200501", OS: "ubuntu", Version: "20.4.20200501"} + ubuntu20_04_20200502 := metal.Image{ID: "ubuntu-20.4.20200502", OS: "ubuntu", Version: "20.4.20200502"} + ubuntu20_04_20200603 := metal.Image{ID: "ubuntu-20.4.20200603", OS: "ubuntu", Version: "20.4.20200603"} - alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9"} - alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10"} + alpine3_9 := metal.Image{ID: "alpine-3.9", OS: "alpine", Version: "3.9"} + alpine3_10 := metal.Image{ID: "alpine-3.10", OS: "alpine", Version: "3.10"} - debian17_04 := metal.Image{Base: metal.Base{ID: "debian-17.4"}, OS: "debian", Version: "17.4"} - debian17_10 := metal.Image{Base: metal.Base{ID: "debian-17.10"}, OS: "debian", Version: "17.10"} + debian17_04 := metal.Image{ID: "debian-17.4", OS: "debian", Version: "17.4"} + debian17_10 := metal.Image{ID: "debian-17.10", OS: "debian", Version: "17.10"} tests := []struct { name string @@ -301,15 +301,15 @@ func TestRethinkStore_DeleteOrphanImages(t *testing.T) { invalid := time.Now().Add(time.Hour * -1) valid := time.Now().Add(time.Hour) - ubuntu14_1 := metal.Image{Base: metal.Base{ID: "ubuntu-14.1"}, OS: "ubuntu", Version: "14.1", ExpirationDate: valid} - ubuntu14_04 := metal.Image{Base: metal.Base{ID: "ubuntu-14.4"}, OS: "ubuntu", Version: "14.4", ExpirationDate: valid} - ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4", ExpirationDate: valid} - ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10", ExpirationDate: valid} - ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4", ExpirationDate: valid} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated - ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10", ExpirationDate: invalid} // allocated - alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9", ExpirationDate: invalid} // not allocated - alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10", ExpirationDate: invalid} // not allocated but kept because last from that os + ubuntu14_1 := metal.Image{ID: "ubuntu-14.1", OS: "ubuntu", Version: "14.1", ExpirationDate: valid} + ubuntu14_04 := metal.Image{ID: "ubuntu-14.4", OS: "ubuntu", Version: "14.4", ExpirationDate: valid} + ubuntu17_04 := metal.Image{ID: "ubuntu-17.4", OS: "ubuntu", Version: "17.4", ExpirationDate: valid} + ubuntu17_10 := metal.Image{ID: "ubuntu-17.10", OS: "ubuntu", Version: "17.10", ExpirationDate: valid} + ubuntu18_04 := metal.Image{ID: "ubuntu-18.4", OS: "ubuntu", Version: "18.4", ExpirationDate: valid} + ubuntu19_04 := metal.Image{ID: "ubuntu-19.4", OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated + ubuntu19_10 := metal.Image{ID: "ubuntu-19.10", OS: "ubuntu", Version: "19.10", ExpirationDate: invalid} // allocated + alpine3_9 := metal.Image{ID: "alpine-3.9", OS: "alpine", Version: "3.9", ExpirationDate: invalid} // not allocated + alpine3_10 := metal.Image{ID: "alpine-3.10", OS: "alpine", Version: "3.10", ExpirationDate: invalid} // not allocated but kept because last from that os tests := []struct { name string images metal.Images diff --git a/cmd/metal-api/internal/datastore/machine_test.go b/cmd/metal-api/internal/datastore/machine_test.go index 30ff5c50..fd959a30 100644 --- a/cmd/metal-api/internal/datastore/machine_test.go +++ b/cmd/metal-api/internal/datastore/machine_test.go @@ -723,11 +723,11 @@ func getTestMachines(numPerRack int, rackids []string, tags []string) metal.Mach func Test_checkSizeReservations(t *testing.T) { var ( available = metal.Machines{ - {Base: metal.Base{ID: "1"}}, - {Base: metal.Base{ID: "2"}}, - {Base: metal.Base{ID: "3"}}, - {Base: metal.Base{ID: "4"}}, - {Base: metal.Base{ID: "5"}}, + {ID: "1"}, + {ID: "2"}, + {ID: "3"}, + {ID: "4"}, + {ID: "5"}, } partitionA = "a" @@ -756,7 +756,7 @@ func Test_checkSizeReservations(t *testing.T) { available = slices.DeleteFunc(available, func(m metal.Machine) bool { return m.ID == id }) - projectMachines[project] = append(projectMachines[project], metal.Machine{Base: metal.Base{ID: id}}) + projectMachines[project] = append(projectMachines[project], metal.Machine{ID: id}) } ) @@ -766,14 +766,14 @@ func Test_checkSizeReservations(t *testing.T) { allocate(available[0].ID, p0) require.Equal(t, metal.Machines{ - {Base: metal.Base{ID: "2"}}, - {Base: metal.Base{ID: "3"}}, - {Base: metal.Base{ID: "4"}}, - {Base: metal.Base{ID: "5"}}, + {ID: "2"}, + {ID: "3"}, + {ID: "4"}, + {ID: "5"}, }, available) require.Equal(t, map[string]metal.Machines{ p0: { - {Base: metal.Base{ID: "1"}}, + {ID: "1"}, }, }, projectMachines) @@ -783,16 +783,16 @@ func Test_checkSizeReservations(t *testing.T) { allocate(available[0].ID, p2) require.Equal(t, metal.Machines{ - {Base: metal.Base{ID: "3"}}, - {Base: metal.Base{ID: "4"}}, - {Base: metal.Base{ID: "5"}}, + {ID: "3"}, + {ID: "4"}, + {ID: "5"}, }, available) require.Equal(t, map[string]metal.Machines{ p0: { - {Base: metal.Base{ID: "1"}}, + {ID: "1"}, }, p2: { - {Base: metal.Base{ID: "2"}}, + {ID: "2"}, }, }, projectMachines) @@ -802,16 +802,16 @@ func Test_checkSizeReservations(t *testing.T) { allocate(available[0].ID, p0) require.Equal(t, metal.Machines{ - {Base: metal.Base{ID: "4"}}, - {Base: metal.Base{ID: "5"}}, + {ID: "4"}, + {ID: "5"}, }, available) require.Equal(t, map[string]metal.Machines{ p0: { - {Base: metal.Base{ID: "1"}}, - {Base: metal.Base{ID: "3"}}, + {ID: "1"}, + {ID: "3"}, }, p2: { - {Base: metal.Base{ID: "2"}}, + {ID: "2"}, }, }, projectMachines) @@ -825,16 +825,16 @@ func Test_checkSizeReservations(t *testing.T) { allocate(available[0].ID, p2) require.Equal(t, metal.Machines{ - {Base: metal.Base{ID: "5"}}, + {ID: "5"}, }, available) require.Equal(t, map[string]metal.Machines{ p0: { - {Base: metal.Base{ID: "1"}}, - {Base: metal.Base{ID: "3"}}, + {ID: "1"}, + {ID: "3"}, }, p2: { - {Base: metal.Base{ID: "2"}}, - {Base: metal.Base{ID: "4"}}, + {ID: "2"}, + {ID: "4"}, }, }, projectMachines) @@ -852,15 +852,15 @@ func Test_checkSizeReservations(t *testing.T) { require.Equal(t, metal.Machines{}, available) require.Equal(t, map[string]metal.Machines{ p0: { - {Base: metal.Base{ID: "1"}}, - {Base: metal.Base{ID: "3"}}, + {ID: "1"}, + {ID: "3"}, }, p1: { - {Base: metal.Base{ID: "5"}}, + {ID: "5"}, }, p2: { - {Base: metal.Base{ID: "2"}}, - {Base: metal.Base{ID: "4"}}, + {ID: "2"}, + {ID: "4"}, }, }, projectMachines) } diff --git a/cmd/metal-api/internal/datastore/migrations/07_size_reservations_table.go b/cmd/metal-api/internal/datastore/migrations/07_size_reservations_table.go index ddbe8626..d5a1a705 100644 --- a/cmd/metal-api/internal/datastore/migrations/07_size_reservations_table.go +++ b/cmd/metal-api/internal/datastore/migrations/07_size_reservations_table.go @@ -53,11 +53,9 @@ func init() { for _, old := range oldSizes { for _, rv := range old.Reservations { err = rs.CreateSizeReservation(&metal.SizeReservation{ - Base: metal.Base{ - ID: "", - Name: "", - Description: rv.Description, - }, + ID: "", + Name: "", + Description: rv.Description, SizeID: old.ID, Amount: rv.Amount, ProjectID: rv.ProjectID, diff --git a/cmd/metal-api/internal/eventbus/nsq_test.go b/cmd/metal-api/internal/eventbus/nsq_test.go index 87353865..257cb168 100644 --- a/cmd/metal-api/internal/eventbus/nsq_test.go +++ b/cmd/metal-api/internal/eventbus/nsq_test.go @@ -48,7 +48,7 @@ func TestNSQ_WaitForPublisher(t *testing.T) { func TestNSQ_WaitForTopicsCreated(t *testing.T) { topic := metal.NSQTopic{Name: "gopher"} partition := metal.Partition{ - Base: metal.Base{ID: "partition-id"}, + ID: "partition-id", } publisher := NopPublisher{ T: t, diff --git a/cmd/metal-api/internal/grpc/boot-service.go b/cmd/metal-api/internal/grpc/boot-service.go index 2b31671e..ba054055 100644 --- a/cmd/metal-api/internal/grpc/boot-service.go +++ b/cmd/metal-api/internal/grpc/boot-service.go @@ -205,9 +205,7 @@ func (b *BootService) Register(ctx context.Context, req *v1.BootServiceRegisterR if m == nil { // machine is not in the database, create it m = &metal.Machine{ - Base: metal.Base{ - ID: req.Uuid, - }, + ID: req.Uuid, Allocation: nil, SizeID: size.ID, Hardware: machineHardware, @@ -259,7 +257,7 @@ func (b *BootService) Register(ctx context.Context, req *v1.BootServiceRegisterR if ec == nil { err = b.ds.CreateProvisioningEventContainer(&metal.ProvisioningEventContainer{ - Base: metal.Base{ID: m.ID}, + ID: m.ID, Liveliness: metal.MachineLivelinessAlive, }, ) diff --git a/cmd/metal-api/internal/grpc/event-service.go b/cmd/metal-api/internal/grpc/event-service.go index fdd77b39..ec333fc1 100644 --- a/cmd/metal-api/internal/grpc/event-service.go +++ b/cmd/metal-api/internal/grpc/event-service.go @@ -45,9 +45,7 @@ func (e *EventService) Send(ctx context.Context, req *v1.EventServiceSendRequest // in a machine lifecycle if m == nil { m = &metal.Machine{ - Base: metal.Base{ - ID: machineID, - }, + ID: machineID, } err = e.ds.CreateMachine(m) if err != nil { diff --git a/cmd/metal-api/internal/ipam/ipam.go b/cmd/metal-api/internal/ipam/ipam.go index 2346a744..0223bf70 100644 --- a/cmd/metal-api/internal/ipam/ipam.go +++ b/cmd/metal-api/internal/ipam/ipam.go @@ -134,8 +134,7 @@ func (i *ipam) ReleaseIP(ctx context.Context, ip metal.IP) error { PrefixCidr: ip.ParentPrefixCidr, Ip: ip.IPAddress, }) - var connectErr *connect.Error - if errors.As(err, &connectErr) { + if connectErr, ok := errors.AsType[*connect.Error](err); ok { if connectErr.Code() == connect.CodeNotFound { return metal.NotFound("ip not found") } diff --git a/cmd/metal-api/internal/issues/issues_test.go b/cmd/metal-api/internal/issues/issues_test.go index 36297a4d..2a1e358b 100644 --- a/cmd/metal-api/internal/issues/issues_test.go +++ b/cmd/metal-api/internal/issues/issues_test.go @@ -13,9 +13,7 @@ import ( func TestFindIssues(t *testing.T) { machineTemplate := func(id string) metal.Machine { return metal.Machine{ - Base: metal.Base{ - ID: id, - }, + ID: id, PartitionID: "a", IPMI: metal.IPMI{ Address: "1.2.3.4", @@ -26,9 +24,7 @@ func TestFindIssues(t *testing.T) { } eventContainerTemplate := func(id string) metal.ProvisioningEventContainer { return metal.ProvisioningEventContainer{ - Base: metal.Base{ - ID: id, - }, + ID: id, Liveliness: metal.MachineLivelinessAlive, } } diff --git a/cmd/metal-api/internal/metal/filesystem_test.go b/cmd/metal-api/internal/metal/filesystem_test.go index 6b23b39f..0769c196 100644 --- a/cmd/metal-api/internal/metal/filesystem_test.go +++ b/cmd/metal-api/internal/metal/filesystem_test.go @@ -160,14 +160,14 @@ func TestFilesystemLayouts_From(t *testing.T) { name: "simple match debian", fls: FilesystemLayouts{ FilesystemLayout{ - Base: Base{ID: "default"}, + ID: "default", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}, }, }, FilesystemLayout{ - Base: Base{ID: "firewall"}, + ID: "firewall", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"firewall": "*"}, @@ -185,14 +185,14 @@ func TestFilesystemLayouts_From(t *testing.T) { name: "simple match firewall", fls: FilesystemLayouts{ FilesystemLayout{ - Base: Base{ID: "default"}, + ID: "default", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}, }, }, FilesystemLayout{ - Base: Base{ID: "firewall"}, + ID: "firewall", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"firewall": "*"}, @@ -210,14 +210,14 @@ func TestFilesystemLayouts_From(t *testing.T) { name: "no match, wrong size", fls: FilesystemLayouts{ FilesystemLayout{ - Base: Base{ID: "default"}, + ID: "default", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}, }, }, FilesystemLayout{ - Base: Base{ID: "firewall"}, + ID: "firewall", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"firewall": "*"}, @@ -235,14 +235,14 @@ func TestFilesystemLayouts_From(t *testing.T) { name: "no match, wrong image", fls: FilesystemLayouts{ FilesystemLayout{ - Base: Base{ID: "default"}, + ID: "default", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}, }, }, FilesystemLayout{ - Base: Base{ID: "firewall"}, + ID: "firewall", Constraints: FilesystemLayoutConstraints{ Sizes: []string{"c1-large-x86", "c1-xlarge-x86"}, Images: map[string]string{"firewall": "*"}, @@ -679,7 +679,7 @@ func TestFilesystemLayout_Validate(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { f := &FilesystemLayout{ - Base: Base{ID: tt.id}, + ID: tt.id, Constraints: tt.fields.Constraints, Filesystems: tt.fields.Filesystems, Disks: tt.fields.Disks, @@ -772,36 +772,36 @@ func TestFilesystemLayouts_Validate(t *testing.T) { { name: "simple valid", fls: FilesystemLayouts{ - FilesystemLayout{Base: Base{ID: "default"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, - FilesystemLayout{Base: Base{ID: "firewall"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, + FilesystemLayout{ID: "default", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, + FilesystemLayout{ID: "firewall", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, }, wantErr: false, }, { name: "valid with open layout", fls: FilesystemLayouts{ - FilesystemLayout{Base: Base{ID: "default"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, - FilesystemLayout{Base: Base{ID: "develop-1"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{}, Images: map[string]string{}}}, - FilesystemLayout{Base: Base{ID: "develop-2"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{}, Images: map[string]string{}}}, - FilesystemLayout{Base: Base{ID: "firewall"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, + FilesystemLayout{ID: "default", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, + FilesystemLayout{ID: "develop-1", Constraints: FilesystemLayoutConstraints{Sizes: []string{}, Images: map[string]string{}}}, + FilesystemLayout{ID: "develop-2", Constraints: FilesystemLayoutConstraints{Sizes: []string{}, Images: map[string]string{}}}, + FilesystemLayout{ID: "firewall", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, }, wantErr: false, }, { name: "simple not overlapping, different sizes, same images", fls: FilesystemLayouts{ - FilesystemLayout{Base: Base{ID: "default"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, - FilesystemLayout{Base: Base{ID: "default2"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"s1-large", "s1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, - FilesystemLayout{Base: Base{ID: "firewall"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, + FilesystemLayout{ID: "default", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, + FilesystemLayout{ID: "default2", Constraints: FilesystemLayoutConstraints{Sizes: []string{"s1-large", "s1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "*"}}}, + FilesystemLayout{ID: "firewall", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, }, wantErr: false, }, { name: "one overlapping, different sizes, same images", fls: FilesystemLayouts{ - FilesystemLayout{Base: Base{ID: "default"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": ">= 10"}}}, - FilesystemLayout{Base: Base{ID: "default2"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "s1-large", "s1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "< 9"}}}, - FilesystemLayout{Base: Base{ID: "firewall"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, + FilesystemLayout{ID: "default", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": ">= 10"}}}, + FilesystemLayout{ID: "default2", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "s1-large", "s1-xlarge"}, Images: map[string]string{"ubuntu": "*", "debian": "< 9"}}}, + FilesystemLayout{ID: "firewall", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large", "c1-xlarge"}, Images: map[string]string{"firewall": "*"}}}, }, wantErr: true, errString: "these combinations already exist:c1-large->[ubuntu *]", @@ -810,8 +810,8 @@ func TestFilesystemLayouts_Validate(t *testing.T) { name: "one overlapping, same sizes, different images", // FIXME fails fls: FilesystemLayouts{ - FilesystemLayout{Base: Base{ID: "default"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large"}, Images: map[string]string{"debian": ">= 10"}}}, - FilesystemLayout{Base: Base{ID: "default2"}, Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large"}, Images: map[string]string{"debian": "< 10"}}}, + FilesystemLayout{ID: "default", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large"}, Images: map[string]string{"debian": ">= 10"}}}, + FilesystemLayout{ID: "default2", Constraints: FilesystemLayoutConstraints{Sizes: []string{"c1-large"}, Images: map[string]string{"debian": "< 10"}}}, }, wantErr: false, }, diff --git a/cmd/metal-api/internal/metal/image_test.go b/cmd/metal-api/internal/metal/image_test.go index 4bc634a5..17597c92 100644 --- a/cmd/metal-api/internal/metal/image_test.go +++ b/cmd/metal-api/internal/metal/image_test.go @@ -8,25 +8,19 @@ import ( func TestImages_ByID(t *testing.T) { testImages := []Image{ { - Base: Base{ - ID: "1", - Name: "Image 1", - Description: "description 1", - }, + ID: "1", + Name: "Image 1", + Description: "description 1", }, { - Base: Base{ - ID: "2", - Name: "Image 2", - Description: "description 2", - }, + ID: "2", + Name: "Image 2", + Description: "description 2", }, { - Base: Base{ - ID: "3", - Name: "Image 3", - Description: "description 3", - }, + ID: "3", + Name: "Image 3", + Description: "description 3", }, } diff --git a/cmd/metal-api/internal/metal/machine_test.go b/cmd/metal-api/internal/metal/machine_test.go index 798eba95..f8ec7006 100644 --- a/cmd/metal-api/internal/metal/machine_test.go +++ b/cmd/metal-api/internal/metal/machine_test.go @@ -14,11 +14,9 @@ func TestMachine_HasMAC(t *testing.T) { { name: "Test 1", d: &Machine{ - Base: Base{ - Name: "1-core/100 B", - Description: "a machine with 1 core(s) and 100 B of RAM", - ID: "5", - }, + Name: "1-core/100 B", + Description: "a machine with 1 core(s) and 100 B of RAM", + ID: "5", RackID: "1", RoomID: "1", PartitionID: "1", @@ -55,7 +53,7 @@ func TestMachine_HasMAC(t *testing.T) { { name: "Test 2", d: &Machine{ - Base: Base{ID: "1"}, + ID: "1", PartitionID: "1", SizeID: "1", Allocation: &MachineAllocation{ diff --git a/cmd/metal-api/internal/metal/partition_test.go b/cmd/metal-api/internal/metal/partition_test.go index e0a6f8b6..04761098 100644 --- a/cmd/metal-api/internal/metal/partition_test.go +++ b/cmd/metal-api/internal/metal/partition_test.go @@ -8,25 +8,19 @@ import ( func TestPartitions_ByID(t *testing.T) { testPartitions := []Partition{ { - Base: Base{ - ID: "1", - Name: "partition1", - Description: "description 1", - }, + ID: "1", + Name: "partition1", + Description: "description 1", }, { - Base: Base{ - ID: "2", - Name: "partition2", - Description: "description 2", - }, + ID: "2", + Name: "partition2", + Description: "description 2", }, { - Base: Base{ - ID: "3", - Name: "partition3", - Description: "description 3", - }, + ID: "3", + Name: "partition3", + Description: "description 3", }, } diff --git a/cmd/metal-api/internal/metal/size.go b/cmd/metal-api/internal/metal/size.go index 7c1fd362..16a1feeb 100644 --- a/cmd/metal-api/internal/metal/size.go +++ b/cmd/metal-api/internal/metal/size.go @@ -70,10 +70,8 @@ func (sz Sizes) ByID() SizeMap { // UnknownSize is the size to use, when someone requires a size we do not know. func UnknownSize() *Size { return &Size{ - Base: Base{ - ID: "unknown", - Name: "unknown", - }, + ID: "unknown", + Name: "unknown", } } diff --git a/cmd/metal-api/internal/metal/size_test.go b/cmd/metal-api/internal/metal/size_test.go index 507a4270..9e553573 100644 --- a/cmd/metal-api/internal/metal/size_test.go +++ b/cmd/metal-api/internal/metal/size_test.go @@ -10,9 +10,7 @@ import ( var ( miniLabSize = Size{ - Base: Base{ - ID: "v1-small-x86", - }, + ID: "v1-small-x86", Constraints: []Constraint{ { Type: CoreConstraint, @@ -32,9 +30,7 @@ var ( }, } mixedDiskSize = Size{ - Base: Base{ - ID: "mixedDisk", - }, + ID: "mixedDisk", Constraints: []Constraint{ { Type: CoreConstraint, @@ -61,9 +57,7 @@ var ( }, } sdaDiskSize = Size{ - Base: Base{ - ID: "sdaDisk", - }, + ID: "sdaDisk", Constraints: []Constraint{ { Type: CoreConstraint, @@ -84,9 +78,7 @@ var ( }, } noIdentifierDiskSize = Size{ - Base: Base{ - ID: "mixedDisk", - }, + ID: "mixedDisk", Constraints: []Constraint{ { Type: CoreConstraint, @@ -106,9 +98,7 @@ var ( }, } microSize = Size{ - Base: Base{ - ID: "micro", - }, + ID: "micro", Constraints: []Constraint{ { Type: CoreConstraint, @@ -128,9 +118,7 @@ var ( }, } microOverlappingSize = Size{ - Base: Base{ - ID: "microOverlapping", - }, + ID: "microOverlapping", Constraints: []Constraint{ { Type: CoreConstraint, @@ -150,9 +138,7 @@ var ( }, } tinySize = Size{ - Base: Base{ - ID: "tiny", - }, + ID: "tiny", Constraints: []Constraint{ { Type: CoreConstraint, @@ -172,9 +158,7 @@ var ( }, } tinyGPUSize = Size{ - Base: Base{ - ID: "tiny gpu", - }, + ID: "tiny gpu", Constraints: []Constraint{ { Type: CoreConstraint, @@ -200,9 +184,7 @@ var ( }, } miniGPUSize = Size{ - Base: Base{ - ID: "mini gpu", - }, + ID: "mini gpu", Constraints: []Constraint{ { Type: CoreConstraint, @@ -228,9 +210,7 @@ var ( }, } maxGPUSize = Size{ - Base: Base{ - ID: "max gpu", - }, + ID: "max gpu", Constraints: []Constraint{ { Type: CoreConstraint, @@ -256,9 +236,7 @@ var ( }, } intelCPUSize = Size{ - Base: Base{ - ID: "intel cpu", - }, + ID: "intel cpu", Constraints: []Constraint{ { Type: CoreConstraint, @@ -274,9 +252,7 @@ var ( }, } amdCPUSize = Size{ - Base: Base{ - ID: "amd cpu", - }, + ID: "amd cpu", Constraints: []Constraint{ { Type: CoreConstraint, @@ -293,11 +269,9 @@ var ( } // Sizes sz1 = Size{ - Base: Base{ - ID: "1", - Name: "sz1", - Description: "description 1", - }, + ID: "1", + Name: "sz1", + Description: "description 1", Constraints: []Constraint{ { Type: CoreConstraint, @@ -312,25 +286,19 @@ var ( }, } sz2 = Size{ - Base: Base{ - ID: "2", - Name: "sz2", - Description: "description 2", - }, + ID: "2", + Name: "sz2", + Description: "description 2", } sz3 = Size{ - Base: Base{ - ID: "3", - Name: "sz3", - Description: "description 3", - }, + ID: "3", + Name: "sz3", + Description: "description 3", } sz999 = Size{ - Base: Base{ - ID: "999", - Name: "sz1", - Description: "description 1", - }, + ID: "999", + Name: "sz1", + Description: "description 1", Constraints: []Constraint{ { Type: CoreConstraint, @@ -700,9 +668,7 @@ func TestSizes_FromHardware(t *testing.T) { name: "memory exhaustive check", sz: Sizes{ { - Base: Base{ - ID: "without core constraint", - }, + ID: "without core constraint", Constraints: []Constraint{ { Type: MemoryConstraint, @@ -712,9 +678,7 @@ func TestSizes_FromHardware(t *testing.T) { }, }, { - Base: Base{ - ID: "with core constraint", - }, + ID: "with core constraint", Constraints: []Constraint{ { Type: MemoryConstraint, @@ -740,9 +704,7 @@ func TestSizes_FromHardware(t *testing.T) { }, }, want: &Size{ - Base: Base{ - ID: "with core constraint", - }, + ID: "with core constraint", Constraints: []Constraint{ { Type: MemoryConstraint, @@ -844,9 +806,7 @@ func TestSizes_Overlaps(t *testing.T) { sizes: Sizes{ tinySize, Size{ - Base: Base{ - ID: "large", - }, + ID: "large", Constraints: []Constraint{ { Type: CoreConstraint, @@ -894,9 +854,7 @@ func TestSizes_Overlaps(t *testing.T) { }, sizes: Sizes{ { - Base: Base{ - ID: "micro", - }, + ID: "micro", Constraints: []Constraint{ { Type: CoreConstraint, @@ -916,9 +874,7 @@ func TestSizes_Overlaps(t *testing.T) { }, }, { - Base: Base{ - ID: "tiny", - }, + ID: "tiny", Constraints: []Constraint{ { Type: CoreConstraint, @@ -938,9 +894,7 @@ func TestSizes_Overlaps(t *testing.T) { }, }, Size{ - Base: Base{ - ID: "large", - }, + ID: "large", Constraints: []Constraint{ { Type: CoreConstraint, @@ -980,9 +934,7 @@ func TestSizes_Overlaps(t *testing.T) { microSize, tinySize, Size{ - Base: Base{ - ID: "large", - }, + ID: "large", Constraints: []Constraint{ { Type: CoreConstraint, @@ -1021,9 +973,7 @@ func TestSizes_Overlaps(t *testing.T) { }, sizes: Sizes{ Size{ - Base: Base{ - ID: "micro", - }, + ID: "micro", Constraints: []Constraint{ { Type: MemoryConstraint, @@ -1509,9 +1459,7 @@ func TestSize_overlaps(t *testing.T) { { name: "independent of order #1", this: &Size{ - Base: Base{ - ID: "g1-medium-x86", - }, + ID: "g1-medium-x86", Constraints: []Constraint{ { Type: CoreConstraint, @@ -1537,9 +1485,7 @@ func TestSize_overlaps(t *testing.T) { }, }, other: &Size{ - Base: Base{ - ID: "c2-xlarge-x86", - }, + ID: "c2-xlarge-x86", Constraints: []Constraint{ { Type: CoreConstraint, @@ -1563,9 +1509,7 @@ func TestSize_overlaps(t *testing.T) { { name: "independent of order #2", this: &Size{ - Base: Base{ - ID: "c2-xlarge-x86", - }, + ID: "c2-xlarge-x86", Constraints: []Constraint{ { Type: CoreConstraint, @@ -1585,9 +1529,7 @@ func TestSize_overlaps(t *testing.T) { }, }, other: &Size{ - Base: Base{ - ID: "g1-medium-x86", - }, + ID: "g1-medium-x86", Constraints: []Constraint{ { Type: CoreConstraint, diff --git a/cmd/metal-api/internal/metal/sizeimageconstraint_test.go b/cmd/metal-api/internal/metal/sizeimageconstraint_test.go index 3cceacb9..06335245 100644 --- a/cmd/metal-api/internal/metal/sizeimageconstraint_test.go +++ b/cmd/metal-api/internal/metal/sizeimageconstraint_test.go @@ -6,9 +6,9 @@ import ( ) var ( - n1Medium = Size{Base: Base{ID: "n1-medium-x86"}} - c1Xlarge = Size{Base: Base{ID: "c1-xlarge-x86"}} - s1Xlarge = Size{Base: Base{ID: "s1-xlarge-x86"}} + n1Medium = Size{ID: "n1-medium-x86"} + c1Xlarge = Size{ID: "c1-xlarge-x86"} + s1Xlarge = Size{ID: "s1-xlarge-x86"} newFirewall = Image{OS: "firewall", Version: "2.0.20211101"} oldFirewall = Image{OS: "firewall", Version: "2.0.20201101"} onlyMajorFirewall = Image{OS: "firewall", Version: "2"} @@ -104,13 +104,13 @@ func TestSizeImageConstraints_Matches(t *testing.T) { name: "new enough image", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, }, { - Base: Base{ID: c1Xlarge.ID}, + ID: c1Xlarge.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, @@ -123,13 +123,13 @@ func TestSizeImageConstraints_Matches(t *testing.T) { name: "only major version given", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, }, { - Base: Base{ID: c1Xlarge.ID}, + ID: c1Xlarge.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, @@ -142,13 +142,13 @@ func TestSizeImageConstraints_Matches(t *testing.T) { name: "no constraints for this image", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, }, { - Base: Base{ID: c1Xlarge.ID}, + ID: c1Xlarge.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, @@ -161,13 +161,13 @@ func TestSizeImageConstraints_Matches(t *testing.T) { name: "to old image", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, }, { - Base: Base{ID: c1Xlarge.ID}, + ID: c1Xlarge.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, @@ -201,13 +201,13 @@ func TestSizeImageConstraints_Validate(t *testing.T) { name: "valid", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "firewall": ">= 2.0.20211001", }, }, { - Base: Base{ID: c1Xlarge.ID}, + ID: c1Xlarge.ID, Images: map[string]string{ "debian": ">= 10.0", }, @@ -219,7 +219,7 @@ func TestSizeImageConstraints_Validate(t *testing.T) { name: "no wildcard os", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "*": "", }, @@ -231,7 +231,7 @@ func TestSizeImageConstraints_Validate(t *testing.T) { name: "wildcard version is allowed", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "debian": "*", }, @@ -243,7 +243,7 @@ func TestSizeImageConstraints_Validate(t *testing.T) { name: "invalid op", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "debian": "% 2", }, @@ -255,7 +255,7 @@ func TestSizeImageConstraints_Validate(t *testing.T) { name: "invalid op and not separated by space", scs: &SizeImageConstraints{ { - Base: Base{ID: n1Medium.ID}, + ID: n1Medium.ID, Images: map[string]string{ "debian": "%2", }, diff --git a/cmd/metal-api/internal/metal/switch_test.go b/cmd/metal-api/internal/metal/switch_test.go index 03d8092d..7805842b 100644 --- a/cmd/metal-api/internal/metal/switch_test.go +++ b/cmd/metal-api/internal/metal/switch_test.go @@ -22,9 +22,7 @@ var ( // Switches switch1 = Switch{ - Base: Base{ - ID: "switch1", - }, + ID: "switch1", PartitionID: "1", RackID: "1", RoomID: "1", @@ -63,11 +61,9 @@ func TestSwitch_ConnectMachine_ForTestData(t *testing.T) { s: &switch1, args: args{ Machine: &Machine{ - Base: Base{ - Name: "1-core/100 B", - Description: "a machine with 1 core(s) and 100 B of RAM", - ID: "5", - }, + Name: "1-core/100 B", + Description: "a machine with 1 core(s) and 100 B of RAM", + ID: "5", RackID: "1", RoomID: "1", PartitionID: "1", @@ -114,9 +110,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { { name: "switch and machine are not connected", s: &Switch{ - Base: Base{ - ID: "sw1", - }, + ID: "sw1", Nics: Nics{ { MacAddress: "aa:aa:aa:aa:aa:aa", @@ -137,9 +131,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { }, }, machine: &Machine{ - Base: Base{ - ID: "m1", - }, + ID: "m1", Hardware: MachineHardware{ Nics: Nics{ { @@ -171,9 +163,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { { name: "error when machine connection for the switch exists in the database but not physically", s: &Switch{ - Base: Base{ - ID: "sw1", - }, + ID: "sw1", Nics: Nics{ { MacAddress: "aa:aa:aa:aa:aa:aa", @@ -194,9 +184,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { }, }, machine: &Machine{ - Base: Base{ - ID: "m1", - }, + ID: "m1", Hardware: MachineHardware{ Nics: Nics{ { @@ -226,9 +214,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { { name: "new connection replaces old ones for the same switch", s: &Switch{ - Base: Base{ - ID: "sw1", - }, + ID: "sw1", Nics: Nics{ { MacAddress: "bb:bb:bb:bb:bb:bb", @@ -257,9 +243,7 @@ func TestSwitch_ConnectMachine(t *testing.T) { }, }, machine: &Machine{ - Base: Base{ - ID: "m1", - }, + ID: "m1", Hardware: MachineHardware{ Nics: Nics{ { @@ -883,9 +867,7 @@ func TestSwitch_getPhysicalMachineConnection(t *testing.T) { { name: "machine is connected", s: &Switch{ - Base: Base{ - Name: "leaf01", - }, + Name: "leaf01", Nics: Nics{ { MacAddress: "aa:aa:aa:aa:aa:aa", @@ -895,9 +877,7 @@ func TestSwitch_getPhysicalMachineConnection(t *testing.T) { }, }, machine: &Machine{ - Base: Base{ - ID: "m1", - }, + ID: "m1", Hardware: MachineHardware{ Nics: Nics{ { @@ -925,9 +905,7 @@ func TestSwitch_getPhysicalMachineConnection(t *testing.T) { { name: "machine is not connected", s: &Switch{ - Base: Base{ - Name: "leaf02", - }, + Name: "leaf02", Nics: Nics{ { MacAddress: "aa:aa:aa:aa:aa:aa", @@ -937,9 +915,7 @@ func TestSwitch_getPhysicalMachineConnection(t *testing.T) { }, }, machine: &Machine{ - Base: Base{ - ID: "m1", - }, + ID: "m1", Hardware: MachineHardware{ Nics: Nics{ { diff --git a/cmd/metal-api/internal/service/async-actor.go b/cmd/metal-api/internal/service/async-actor.go index a7f775fc..f637b998 100644 --- a/cmd/metal-api/internal/service/async-actor.go +++ b/cmd/metal-api/internal/service/async-actor.go @@ -220,8 +220,7 @@ func (a *asyncActor) releaseIP(ip metal.IP) error { ctx := context.Background() err = a.ReleaseIP(ctx, ip) if err != nil { - var connectErr *connect.Error - if errors.As(err, &connectErr) { + if connectErr, ok := errors.AsType[*connect.Error](err); ok { if connectErr.Code() == connect.CodeNotFound { return nil } diff --git a/cmd/metal-api/internal/service/audit-service.go b/cmd/metal-api/internal/service/audit-service.go index 07515e9c..79137924 100644 --- a/cmd/metal-api/internal/service/audit-service.go +++ b/cmd/metal-api/internal/service/audit-service.go @@ -21,10 +21,8 @@ type auditResource struct { func NewAudit(log *slog.Logger, a auditing.Auditing) *restful.WebService { ir := auditResource{ - webResource: webResource{ - log: log, - }, - a: a, + log: log, + a: a, } return ir.webService() diff --git a/cmd/metal-api/internal/service/filesystem-service.go b/cmd/metal-api/internal/service/filesystem-service.go index 66b594e1..66d5bdf6 100644 --- a/cmd/metal-api/internal/service/filesystem-service.go +++ b/cmd/metal-api/internal/service/filesystem-service.go @@ -22,10 +22,8 @@ type filesystemResource struct { // NewFilesystemLayout returns a webservice for filesystem specific endpoints. func NewFilesystemLayout(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService { r := filesystemResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, } return r.webService() } diff --git a/cmd/metal-api/internal/service/firewall-service.go b/cmd/metal-api/internal/service/firewall-service.go index 21e64efd..c09835f7 100644 --- a/cmd/metal-api/internal/service/firewall-service.go +++ b/cmd/metal-api/internal/service/firewall-service.go @@ -51,10 +51,8 @@ func NewFirewall( headscaleClient *headscale.HeadscaleClient, ) (*restful.WebService, error) { r := firewallResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, Publisher: pub, ipamer: ipamer, mdc: mdc, diff --git a/cmd/metal-api/internal/service/firmware-service.go b/cmd/metal-api/internal/service/firmware-service.go index d52f7f03..dfec8639 100644 --- a/cmd/metal-api/internal/service/firmware-service.go +++ b/cmd/metal-api/internal/service/firmware-service.go @@ -33,10 +33,8 @@ type firmwareResource struct { // NewFirmware returns a webservice for firmware specific endpoints. func NewFirmware(log *slog.Logger, ds *datastore.RethinkStore, s3Client *s3server.Client) (*restful.WebService, error) { r := firmwareResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, s3Client: s3Client, } return r.webService(), nil diff --git a/cmd/metal-api/internal/service/image-service.go b/cmd/metal-api/internal/service/image-service.go index 18e78be1..e92f75b7 100644 --- a/cmd/metal-api/internal/service/image-service.go +++ b/cmd/metal-api/internal/service/image-service.go @@ -26,10 +26,8 @@ type imageResource struct { // NewImage returns a webservice for image specific endpoints. func NewImage(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService { ir := imageResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, } return ir.webService() @@ -324,11 +322,9 @@ func (r *imageResource) createImage(request *restful.Request, response *restful. } img := &metal.Image{ - Base: metal.Base{ - ID: requestPayload.ID, - Name: name, - Description: description, - }, + ID: requestPayload.ID, + Name: name, + Description: description, URL: requestPayload.URL, Features: features, OS: os, diff --git a/cmd/metal-api/internal/service/image-service_test.go b/cmd/metal-api/internal/service/image-service_test.go index 54a2d7a1..29e65c9a 100644 --- a/cmd/metal-api/internal/service/image-service_test.go +++ b/cmd/metal-api/internal/service/image-service_test.go @@ -114,16 +114,10 @@ func TestCreateImage(t *testing.T) { log := slog.Default() createRequest := v1.ImageCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Img1.ID, - }, - Describable: v1.Describable{ - Name: &testdata.Img1.Name, - Description: &testdata.Img1.Description, - }, - }, - URL: testdata.Img1.URL, + ID: testdata.Img1.ID, + Name: &testdata.Img1.Name, + Description: &testdata.Img1.Description, + URL: testdata.Img1.URL, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -155,16 +149,10 @@ func TestCreateImageWithBrokenURL(t *testing.T) { log := slog.Default() createRequest := v1.ImageCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Img1.ID, - }, - Describable: v1.Describable{ - Name: &testdata.Img1.Name, - Description: &testdata.Img1.Description, - }, - }, - URL: "http://this.domain.does.not.exist/", + ID: testdata.Img1.ID, + Name: &testdata.Img1.Name, + Description: &testdata.Img1.Description, + URL: "http://this.domain.does.not.exist/", } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -212,15 +200,9 @@ func TestCreateImageWithClassification(t *testing.T) { log := slog.Default() createRequest := v1.ImageCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Img1.ID, - }, - Describable: v1.Describable{ - Name: &testdata.Img1.Name, - Description: &testdata.Img1.Description, - }, - }, + ID: testdata.Img1.ID, + Name: &testdata.Img1.Name, + Description: &testdata.Img1.Description, URL: testdata.Img1.URL, Classification: &vc, } @@ -257,18 +239,10 @@ func TestUpdateImage(t *testing.T) { container := restful.NewContainer().Add(imageservice) updateRequest := v1.ImageUpdateRequest{ - Common: v1.Common{ - Describable: v1.Describable{ - Name: &testdata.Img2.Name, - Description: &testdata.Img2.Description, - }, - Identifiable: v1.Identifiable{ - ID: testdata.Img1.ID, - }, - }, - ImageBase: v1.ImageBase{ - URL: &testdata.Img2.URL, - }, + Name: &testdata.Img2.Name, + Description: &testdata.Img2.Description, + ID: testdata.Img1.ID, + URL: &testdata.Img2.URL, } js, err := json.Marshal(updateRequest) require.NoError(t, err) diff --git a/cmd/metal-api/internal/service/ip-service.go b/cmd/metal-api/internal/service/ip-service.go index ed7d6e7d..21b07005 100644 --- a/cmd/metal-api/internal/service/ip-service.go +++ b/cmd/metal-api/internal/service/ip-service.go @@ -39,10 +39,8 @@ type ipResource struct { // NewIP returns a webservice for ip specific endpoints. func NewIP(log *slog.Logger, ds *datastore.RethinkStore, ep *bus.Endpoints, ipamer ipam.IPAMer, mdc mdm.Client) (*restful.WebService, error) { ir := ipResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, ipamer: ipamer, mdc: mdc, } @@ -450,8 +448,7 @@ func allocateSpecificIP(ctx context.Context, parent *metal.Network, specificIP s } ipAddress, err = ipamer.AllocateSpecificIP(ctx, prefix, specificIP) - var connectErr *connect.Error - if errors.As(err, &connectErr) { + if connectErr, ok := errors.AsType[*connect.Error](err); ok { if connectErr.Code() == connect.CodeAlreadyExists { return "", "", metal.Conflict("ip already allocated") } @@ -477,8 +474,7 @@ func allocateRandomIP(ctx context.Context, parent *metal.Network, ipamer ipam.IP for _, prefix := range parent.Prefixes.OfFamily(addressfamily) { ipAddress, err = ipamer.AllocateIP(ctx, prefix) if err != nil { - var connectErr *connect.Error - if errors.As(err, &connectErr) { + if connectErr, ok := errors.AsType[*connect.Error](err); ok { if connectErr.Code() == connect.CodeNotFound { continue } diff --git a/cmd/metal-api/internal/service/machine-service.go b/cmd/metal-api/internal/service/machine-service.go index 3aad7110..57bbbbe0 100644 --- a/cmd/metal-api/internal/service/machine-service.go +++ b/cmd/metal-api/internal/service/machine-service.go @@ -125,10 +125,8 @@ func NewMachine( ipmiSuperUser metal.MachineIPMISuperUser, ) (*restful.WebService, error) { r := machineResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, Publisher: pub, ipamer: ipamer, mdc: mdc, @@ -659,7 +657,7 @@ func (r *machineResource) getMachineConsolePassword(request *restful.Request, re } resp := v1.MachineConsolePasswordResponse{ - Common: v1.Common{Identifiable: v1.Identifiable{ID: m.ID}, Describable: v1.Describable{Name: &m.Name, Description: &m.Description}}, + ID: m.ID, Name: &m.Name, Description: &m.Description, ConsolePassword: m.Allocation.ConsolePassword, } @@ -847,9 +845,7 @@ func (r *machineResource) ipmiReport(request *restful.Request, response *restful continue } m := &metal.Machine{ - Base: metal.Base{ - ID: uuid, - }, + ID: uuid, PartitionID: p.ID, IPMI: metal.IPMI{ Address: report.BMCIp + ":" + defaultIPMIPort, @@ -1289,9 +1285,7 @@ func allocateMachine(ctx context.Context, logger *slog.Logger, ds *datastore.Ret rollbackOnError := func(err error) error { if err != nil { cleanupMachine := &metal.Machine{ - Base: metal.Base{ - ID: allocationSpec.UUID, - }, + ID: allocationSpec.UUID, Allocation: alloc, } rollbackError := actor.machineNetworkReleaser(cleanupMachine) diff --git a/cmd/metal-api/internal/service/network-service.go b/cmd/metal-api/internal/service/network-service.go index bf64828b..5c78f4ff 100644 --- a/cmd/metal-api/internal/service/network-service.go +++ b/cmd/metal-api/internal/service/network-service.go @@ -34,10 +34,8 @@ type networkResource struct { // NewNetwork returns a webservice for network specific endpoints. func NewNetwork(log *slog.Logger, ds *datastore.RethinkStore, ipamer ipam.IPAMer, mdc mdm.Client) *restful.WebService { r := networkResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, ipamer: ipamer, mdc: mdc, } @@ -425,11 +423,9 @@ func (r *networkResource) createNetwork(request *restful.Request, response *rest } nw := &metal.Network{ - Base: metal.Base{ - ID: id, - Name: name, - Description: description, - }, + ID: id, + Name: name, + Description: description, Prefixes: prefixes, DestinationPrefixes: destPrefixes, DefaultChildPrefixLength: childPrefixLength, @@ -622,10 +618,8 @@ func (r *networkResource) allocateNetwork(request *restful.Request, response *re } nwSpec := &metal.Network{ - Base: metal.Base{ - Name: name, - Description: description, - }, + Name: name, + Description: description, PartitionID: partition.ID, ProjectID: project.GetProject().GetMeta().GetId(), Labels: requestPayload.Labels, @@ -711,10 +705,8 @@ func (r *networkResource) createChildNetwork(ctx context.Context, nwSpec *metal. } nw := &metal.Network{ - Base: metal.Base{ - Name: nwSpec.Name, - Description: nwSpec.Description, - }, + Name: nwSpec.Name, + Description: nwSpec.Description, Prefixes: childPrefixes, DestinationPrefixes: nwSpec.DestinationPrefixes, PartitionID: parent.PartitionID, @@ -1042,8 +1034,7 @@ func (r *networkResource) createChildPrefix(ctx context.Context, parentPrefixes for _, parentPrefix := range parentPrefixes.OfFamily(af) { childPrefix, err := r.ipamer.AllocateChildPrefix(ctx, parentPrefix, childLength) if err != nil { - var connectErr *connect.Error - if errors.As(err, &connectErr) { + if connectErr, ok := errors.AsType[*connect.Error](err); ok { if connectErr.Code() == connect.CodeNotFound { continue } diff --git a/cmd/metal-api/internal/service/network-service_test.go b/cmd/metal-api/internal/service/network-service_test.go index b2d990eb..1a258242 100644 --- a/cmd/metal-api/internal/service/network-service_test.go +++ b/cmd/metal-api/internal/service/network-service_test.go @@ -169,9 +169,9 @@ func TestCreateNetwork(t *testing.T) { destPrefixes := []string{"0.0.0.0/0"} vrf := uint(10000) createRequest := &v1.NetworkCreateRequest{ - Describable: v1.Describable{Name: &testdata.Nw1.Name}, - NetworkBase: v1.NetworkBase{PartitionID: &testdata.Nw1.PartitionID, ProjectID: &testdata.Nw1.ProjectID}, - NetworkImmutable: v1.NetworkImmutable{Prefixes: prefixes, DestinationPrefixes: destPrefixes, Vrf: &vrf}, + Name: &testdata.Nw1.Name, + PartitionID: &testdata.Nw1.PartitionID, ProjectID: &testdata.Nw1.ProjectID, + Prefixes: prefixes, DestinationPrefixes: destPrefixes, Vrf: &vrf, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -207,10 +207,8 @@ func TestUpdateNetwork(t *testing.T) { newName := "new" updateRequest := &v1.NetworkUpdateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: testdata.Nw1.GetID()}, - Describable: v1.Describable{Name: &newName}, - }, + ID: testdata.Nw1.GetID(), + Name: &newName, } js, err := json.Marshal(updateRequest) require.NoError(t, err) @@ -407,13 +405,11 @@ func Test_networkResource_createNetwork(t *testing.T) { container := restful.NewContainer().Add(networkservice) createRequest := &v1.NetworkCreateRequest{ - Describable: v1.Describable{Name: &tt.networkName}, - NetworkBase: v1.NetworkBase{PartitionID: &tt.partitionID, ProjectID: &tt.projectID}, - NetworkImmutable: v1.NetworkImmutable{ - Prefixes: tt.prefixes, - DestinationPrefixes: tt.destinationPrefixes, - Vrf: &tt.vrf, Nat: tt.nat, PrivateSuper: tt.privateSuper, Underlay: tt.underlay, - }, + Name: &tt.networkName, + PartitionID: &tt.partitionID, ProjectID: &tt.projectID, + Prefixes: tt.prefixes, + DestinationPrefixes: tt.destinationPrefixes, + Vrf: &tt.vrf, Nat: tt.nat, PrivateSuper: tt.privateSuper, Underlay: tt.underlay, } if tt.childprefixlength != nil { createRequest.DefaultChildPrefixLength = tt.childprefixlength @@ -525,9 +521,9 @@ func Test_networkResource_allocateNetwork(t *testing.T) { container := restful.NewContainer().Add(networkservice) allocateRequest := &v1.NetworkAllocateRequest{ - Describable: v1.Describable{Name: &tt.networkName}, - NetworkBase: v1.NetworkBase{PartitionID: &tt.partitionID, ProjectID: &tt.projectID}, - Length: tt.childprefixlength, + Name: &tt.networkName, + PartitionID: &tt.partitionID, ProjectID: &tt.projectID, + Length: tt.childprefixlength, } js, err := json.Marshal(allocateRequest) diff --git a/cmd/metal-api/internal/service/partition-service.go b/cmd/metal-api/internal/service/partition-service.go index 7cae3189..6df7e158 100644 --- a/cmd/metal-api/internal/service/partition-service.go +++ b/cmd/metal-api/internal/service/partition-service.go @@ -32,10 +32,8 @@ type partitionResource struct { // NewPartition returns a webservice for partition specific endpoints. func NewPartition(log *slog.Logger, ds *datastore.RethinkStore, tc TopicCreator) *restful.WebService { r := partitionResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, topicCreator: tc, } @@ -225,11 +223,9 @@ func (r *partitionResource) createPartition(request *restful.Request, response * } p := &metal.Partition{ - Base: metal.Base{ - ID: requestPayload.ID, - Name: name, - Description: description, - }, + ID: requestPayload.ID, + Name: name, + Description: description, Labels: labels, MgmtServiceAddress: mgmtServiceAddress, BootConfiguration: metal.BootConfiguration{ @@ -469,15 +465,9 @@ func (r *partitionResource) calcPartitionCapacity(pcr *v1.PartitionCapacityReque pc, ok := pcs[m.PartitionID] if !ok { pc = &v1.PartitionCapacity{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: p.ID, - }, - Describable: v1.Describable{ - Name: &p.Name, - Description: &p.Description, - }, - }, + ID: p.ID, + Name: &p.Name, + Description: &p.Description, ServerCapacities: v1.ServerCapacities{}, } } diff --git a/cmd/metal-api/internal/service/partition-service_test.go b/cmd/metal-api/internal/service/partition-service_test.go index 59da76a5..0ac6ffba 100644 --- a/cmd/metal-api/internal/service/partition-service_test.go +++ b/cmd/metal-api/internal/service/partition-service_test.go @@ -160,15 +160,9 @@ func TestCreatePartition(t *testing.T) { downloadableFile := ts.URL createRequest := v1.PartitionCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Partition1.ID, - }, - Describable: v1.Describable{ - Name: &testdata.Partition1.Name, - Description: &testdata.Partition1.Description, - }, - }, + ID: testdata.Partition1.ID, + Name: &testdata.Partition1.Name, + Description: &testdata.Partition1.Description, PartitionBootConfiguration: v1.PartitionBootConfiguration{ ImageURL: &downloadableFile, KernelURL: &downloadableFile, @@ -210,15 +204,9 @@ func TestUpdatePartition(t *testing.T) { mgmtService := "mgmt" downloadableFile := ts.URL updateRequest := v1.PartitionUpdateRequest{ - Common: v1.Common{ - Describable: v1.Describable{ - Name: &testdata.Partition2.Name, - Description: &testdata.Partition2.Description, - }, - Identifiable: v1.Identifiable{ - ID: testdata.Partition1.ID, - }, - }, + Name: &testdata.Partition2.Name, + Description: &testdata.Partition2.Description, + ID: testdata.Partition1.ID, MgmtServiceAddress: &mgmtService, PartitionBootConfiguration: &v1.PartitionBootConfiguration{ ImageURL: &downloadableFile, @@ -279,7 +267,7 @@ func TestPartitionCapacity(t *testing.T) { ) for _, m := range ms { - ec := metal.ProvisioningEventContainer{Base: metal.Base{ID: m.ID}, Liveliness: liveliness} + ec := metal.ProvisioningEventContainer{ID: m.ID, Liveliness: liveliness} if m.Waiting { ec.Events = append(ec.Events, metal.ProvisioningEvent{ Event: metal.ProvisioningEventWaiting, @@ -294,13 +282,13 @@ func TestPartitionCapacity(t *testing.T) { if !slices.ContainsFunc(sizes, func(s metal.Size) bool { return s.ID == m.SizeID }) { - s := metal.Size{Base: metal.Base{ID: m.SizeID}} + s := metal.Size{ID: m.SizeID} sizes = append(sizes, s) } if !slices.ContainsFunc(partitions, func(p metal.Partition) bool { return p.ID == m.PartitionID }) { - partitions = append(partitions, metal.Partition{Base: metal.Base{ID: m.PartitionID}}) + partitions = append(partitions, metal.Partition{ID: m.PartitionID}) } } @@ -334,7 +322,7 @@ func TestPartitionCapacity(t *testing.T) { machineTpl = func(id, partition, size, project string) metal.Machine { m := metal.Machine{ - Base: metal.Base{ID: id}, + ID: id, PartitionID: partition, SizeID: size, IPMI: metal.IPMI{ // required for healthy machine state @@ -369,9 +357,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -392,9 +378,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -415,9 +399,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -449,9 +431,7 @@ func TestPartitionCapacity(t *testing.T) { want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -479,9 +459,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -502,9 +480,7 @@ func TestPartitionCapacity(t *testing.T) { }, }, { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-b"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-b", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -526,9 +502,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -551,9 +525,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -577,9 +549,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -604,9 +574,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -628,9 +596,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -662,9 +628,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -705,9 +669,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -744,9 +706,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -784,9 +744,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -830,9 +788,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", @@ -874,9 +830,7 @@ func TestPartitionCapacity(t *testing.T) { }, want: []*v1.PartitionCapacity{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "partition-a"}, Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "partition-a", Name: new(""), Description: new(""), ServerCapacities: v1.ServerCapacities{ { Size: "size-a", diff --git a/cmd/metal-api/internal/service/project-service.go b/cmd/metal-api/internal/service/project-service.go index 14a95f28..1806b7ae 100644 --- a/cmd/metal-api/internal/service/project-service.go +++ b/cmd/metal-api/internal/service/project-service.go @@ -28,10 +28,8 @@ type projectResource struct { // NewProject returns a webservice for project specific endpoints. func NewProject(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService { r := projectResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, mdc: mdc, } return r.webService() diff --git a/cmd/metal-api/internal/service/size-service.go b/cmd/metal-api/internal/service/size-service.go index 4bc977a4..f0be9907 100644 --- a/cmd/metal-api/internal/service/size-service.go +++ b/cmd/metal-api/internal/service/size-service.go @@ -28,10 +28,8 @@ type sizeResource struct { // NewSize returns a webservice for size specific endpoints. func NewSize(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService { r := sizeResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, mdc: mdc, } return r.webService() @@ -337,11 +335,9 @@ func (r *sizeResource) createSize(request *restful.Request, response *restful.Re } s := &metal.Size{ - Base: metal.Base{ - ID: requestPayload.ID, - Name: name, - Description: description, - }, + ID: requestPayload.ID, + Name: name, + Description: description, Constraints: constraints, Labels: labels, } @@ -546,11 +542,9 @@ func (r *sizeResource) createSizeReservation(request *restful.Request, response } rv := &metal.SizeReservation{ - Base: metal.Base{ - ID: requestPayload.ID, - Name: pointer.SafeDeref(requestPayload.Name), - Description: pointer.SafeDeref(requestPayload.Description), - }, + ID: requestPayload.ID, + Name: pointer.SafeDeref(requestPayload.Name), + Description: pointer.SafeDeref(requestPayload.Description), SizeID: requestPayload.SizeID, Amount: requestPayload.Amount, ProjectID: requestPayload.ProjectID, @@ -717,10 +711,8 @@ func (r *sizeResource) sizeReservationsUsage(request *restful.Request, response allocations := len(machinesByProjectID[reservation.ProjectID].WithPartition(partitionID).WithSize(reservation.SizeID)) result = append(result, &v1.SizeReservationUsageResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: reservation.ID}, - Describable: v1.Describable{Name: &reservation.Name, Description: &reservation.Description}, - }, + ID: reservation.ID, + Name: &reservation.Name, Description: &reservation.Description, SizeID: reservation.SizeID, PartitionID: partitionID, ProjectID: reservation.ProjectID, diff --git a/cmd/metal-api/internal/service/size-service_test.go b/cmd/metal-api/internal/service/size-service_test.go index e1282f87..07adad95 100644 --- a/cmd/metal-api/internal/service/size-service_test.go +++ b/cmd/metal-api/internal/service/size-service_test.go @@ -231,15 +231,9 @@ func TestCreateSize(t *testing.T) { container := restful.NewContainer().Add(sizeservice) createRequest := v1.SizeCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Sz1.ID, - }, - Describable: v1.Describable{ - Name: &testdata.Sz1.Name, - Description: &testdata.Sz1.Description, - }, - }, + ID: testdata.Sz1.ID, + Name: &testdata.Sz1.Name, + Description: &testdata.Sz1.Description, SizeConstraints: []v1.SizeConstraint{ { Type: metal.CoreConstraint, @@ -291,15 +285,9 @@ func TestUpdateSize(t *testing.T) { minCores := uint64(8) maxCores := uint64(16) updateRequest := v1.SizeUpdateRequest{ - Common: v1.Common{ - Describable: v1.Describable{ - Name: &testdata.Sz2.Name, - Description: &testdata.Sz2.Description, - }, - Identifiable: v1.Identifiable{ - ID: testdata.Sz1.ID, - }, - }, + Name: &testdata.Sz2.Name, + Description: &testdata.Sz2.Description, + ID: testdata.Sz1.ID, SizeConstraints: &[]v1.SizeConstraint{ { Type: metal.CoreConstraint, @@ -350,9 +338,7 @@ func Test_ListSizeReservationsUsage(t *testing.T) { dbMockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("sizereservation").Filter(r.MockAnything()).Filter(r.MockAnything()).Filter(r.MockAnything())).Return(metal.SizeReservations{ { - Base: metal.Base{ - ID: "1", - }, + ID: "1", SizeID: "1", Amount: 3, PartitionIDs: []string{"a"}, @@ -361,9 +347,7 @@ func Test_ListSizeReservationsUsage(t *testing.T) { }, nil) mock.On(r.DB("mockdb").Table("machine").Filter(r.MockAnything())).Return(metal.Machines{ { - Base: metal.Base{ - ID: "1", - }, + ID: "1", SizeID: "1", PartitionID: "a", Allocation: &metal.MachineAllocation{ @@ -374,15 +358,9 @@ func Test_ListSizeReservationsUsage(t *testing.T) { }, want: []*v1.SizeReservationUsageResponse{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "1", + Name: new(""), + Description: new(""), SizeID: "1", PartitionID: "a", ProjectID: "p1", @@ -431,7 +409,7 @@ func Test_ListSizeReservations(t *testing.T) { dbMockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("sizereservation")).Return(metal.SizeReservations{ { - Base: metal.Base{ID: "1"}, + ID: "1", SizeID: "1", Amount: 3, PartitionIDs: []string{"a"}, @@ -443,10 +421,8 @@ func Test_ListSizeReservations(t *testing.T) { }, want: []*v1.SizeReservationResponse{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "1"}, - Describable: v1.Describable{Name: new(""), Description: new("")}, - }, + ID: "1", + Name: new(""), Description: new(""), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -499,9 +475,7 @@ func Test_FindSizeReservationsUsage(t *testing.T) { dbMockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("sizereservation").Filter(r.MockAnything()).Filter(r.MockAnything()).Filter(r.MockAnything())).Return(metal.SizeReservations{ { - Base: metal.Base{ - ID: "1", - }, + ID: "1", SizeID: "1", Amount: 3, PartitionIDs: []string{"a"}, @@ -511,15 +485,9 @@ func Test_FindSizeReservationsUsage(t *testing.T) { }, want: []*v1.SizeReservationResponse{ { - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "1", + Name: new(""), + Description: new(""), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -567,9 +535,7 @@ func Test_GetSizeReservationsUsage(t *testing.T) { id: "1", dbMockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("sizereservation").Get("1")).Return(metal.SizeReservation{ - Base: metal.Base{ - ID: "1", - }, + ID: "1", SizeID: "1", Amount: 3, PartitionIDs: []string{"a"}, @@ -577,15 +543,9 @@ func Test_GetSizeReservationsUsage(t *testing.T) { }, nil) }, want: &v1.SizeReservationResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "1", + Name: new(""), + Description: new(""), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -632,9 +592,7 @@ func Test_DeleteSizeReservationsUsage(t *testing.T) { id: "1", dbMockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("sizereservation").Get("1")).Return(metal.SizeReservation{ - Base: metal.Base{ - ID: "1", - }, + ID: "1", SizeID: "1", Amount: 3, PartitionIDs: []string{"a"}, @@ -644,15 +602,9 @@ func Test_DeleteSizeReservationsUsage(t *testing.T) { mock.On(r.DB("mockdb").Table("sizereservation").Get("1").Delete()).Return(testdata.EmptyResult, nil) }, want: &v1.SizeReservationResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "1", + Name: new(""), + Description: new(""), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -697,14 +649,8 @@ func Test_CreateSizeReservationsUsage(t *testing.T) { { name: "create reservation", req: &v1.SizeReservationCreateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Description: new("a description"), - }, - }, + ID: "1", + Description: new("a description"), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -714,23 +660,17 @@ func Test_CreateSizeReservationsUsage(t *testing.T) { }, }, dbMockFn: func(mock *r.Mock) { - mock.On(r.DB("mockdb").Table("size").Get("1")).Return(metal.Size{Base: metal.Base{ID: "1"}}, nil) - mock.On(r.DB("mockdb").Table("partition")).Return(metal.Partitions{{Base: metal.Base{ID: "a"}}}, nil) + mock.On(r.DB("mockdb").Table("size").Get("1")).Return(metal.Size{ID: "1"}, nil) + mock.On(r.DB("mockdb").Table("partition")).Return(metal.Partitions{{ID: "a"}}, nil) mock.On(r.DB("mockdb").Table("sizereservation").Insert(r.MockAnything())).Return(testdata.EmptyResult, nil) }, projectMockFn: func(mock *testifymock.Mock) { mock.On("Get", testifymock.Anything, &mdmv1.ProjectGetRequest{Id: "p1"}).Return(&mdmv1.ProjectResponse{Project: &mdmv1.Project{Meta: &mdmv1.Meta{Id: "p1"}}}, nil) }, want: &v1.SizeReservationResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new("a description"), - }, - }, + ID: "1", + Name: new(""), + Description: new("a description"), SizeID: "1", PartitionIDs: []string{"a"}, ProjectID: "p1", @@ -778,33 +718,25 @@ func Test_UpdateSizeReservationsUsage(t *testing.T) { { name: "update reservation", req: &v1.SizeReservationUpdateRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ID: "1"}, - Describable: v1.Describable{Description: new("b description")}, - }, + ID: "1", + Description: new("b description"), PartitionIDs: []string{"b"}, Amount: new(4), Labels: map[string]string{"c": "d"}, }, dbMockFn: func(mock *r.Mock) { - mock.On(r.DB("mockdb").Table("size").Get("1")).Return(metal.Size{Base: metal.Base{ID: "1"}}, nil) - mock.On(r.DB("mockdb").Table("sizereservation").Get("1")).Return(metal.SizeReservation{Base: metal.Base{ID: "1"}, SizeID: "1", ProjectID: "p1"}, nil) - mock.On(r.DB("mockdb").Table("partition")).Return(metal.Partitions{{Base: metal.Base{ID: "b"}}}, nil) + mock.On(r.DB("mockdb").Table("size").Get("1")).Return(metal.Size{ID: "1"}, nil) + mock.On(r.DB("mockdb").Table("sizereservation").Get("1")).Return(metal.SizeReservation{ID: "1", SizeID: "1", ProjectID: "p1"}, nil) + mock.On(r.DB("mockdb").Table("partition")).Return(metal.Partitions{{ID: "b"}}, nil) mock.On(r.DB("mockdb").Table("sizereservation").Get("1").Replace(r.MockAnything())).Return(testdata.EmptyResult, nil) }, projectMockFn: func(mock *testifymock.Mock) { mock.On("Get", testifymock.Anything, &mdmv1.ProjectGetRequest{Id: "p1"}).Return(&mdmv1.ProjectResponse{Project: &mdmv1.Project{Meta: &mdmv1.Meta{Id: "p1"}}}, nil) }, want: &v1.SizeReservationResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new("b description"), - }, - }, + ID: "1", + Name: new(""), + Description: new("b description"), SizeID: "1", PartitionIDs: []string{"b"}, ProjectID: "p1", diff --git a/cmd/metal-api/internal/service/sizeimageconstraint-service.go b/cmd/metal-api/internal/service/sizeimageconstraint-service.go index 7269c569..149a1e6e 100644 --- a/cmd/metal-api/internal/service/sizeimageconstraint-service.go +++ b/cmd/metal-api/internal/service/sizeimageconstraint-service.go @@ -23,10 +23,8 @@ type sizeImageConstraintResource struct { // NewSize returns a webservice for size specific endpoints. func NewSizeImageConstraint(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService { r := sizeImageConstraintResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, } return r.webService() } diff --git a/cmd/metal-api/internal/service/switch-service.go b/cmd/metal-api/internal/service/switch-service.go index c8f2b0ba..a9a1bf63 100644 --- a/cmd/metal-api/internal/service/switch-service.go +++ b/cmd/metal-api/internal/service/switch-service.go @@ -31,10 +31,8 @@ type switchResource struct { // NewSwitch returns a webservice for switch specific endpoints. func NewSwitch(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService { r := switchResource{ - webResource: webResource{ - log: log, - ds: ds, - }, + log: log, + ds: ds, } return r.webService() } @@ -272,7 +270,7 @@ func (r *switchResource) notifySwitch(request *restful.Request, response *restfu } ss = &metal.SwitchStatus{ - Base: metal.Base{ID: id}, + ID: id, } } diff --git a/cmd/metal-api/internal/service/switch-service_test.go b/cmd/metal-api/internal/service/switch-service_test.go index 02ee0e62..33c7e1a2 100644 --- a/cmd/metal-api/internal/service/switch-service_test.go +++ b/cmd/metal-api/internal/service/switch-service_test.go @@ -37,19 +37,11 @@ func TestRegisterSwitch(t *testing.T) { name := "switch999" createRequest := v1.SwitchRegisterRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "switch999", - }, - Describable: v1.Describable{ - Name: &name, - }, - }, + ID: "switch999", + Name: &name, PartitionID: "1", - SwitchBase: v1.SwitchBase{ - RackID: "1", - OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, - }, + RackID: "1", + OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -83,16 +75,10 @@ func TestRegisterExistingSwitch(t *testing.T) { container := restful.NewContainer().Add(switchservice) createRequest := v1.SwitchRegisterRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Switch2.ID, - }, - }, + ID: testdata.Switch2.ID, PartitionID: testdata.Switch2.PartitionID, - SwitchBase: v1.SwitchBase{ - RackID: testdata.Switch2.RackID, - OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, - }, + RackID: testdata.Switch2.RackID, + OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -129,21 +115,19 @@ func TestRegisterExistingSwitchWithRoomChange(t *testing.T) { switchID := "switch-room-test" machine1 := &metal.Machine{ - Base: metal.Base{ID: "machine-1"}, + ID: "machine-1", Tags: []string{"tag1=value1", tag.MachineRoom + "=" + oldRoomID}, RoomID: oldRoomID, } machine2 := &metal.Machine{ - Base: metal.Base{ID: "machine-2"}, + ID: "machine-2", Tags: []string{"tag2=value2", tag.MachineRoom + "=" + oldRoomID}, RoomID: oldRoomID, } // Create existing switch with old room ID and machine connections existingSwitch := &metal.Switch{ - Base: metal.Base{ - ID: switchID, - }, + ID: switchID, PartitionID: "1", RackID: "1", RoomID: oldRoomID, @@ -182,9 +166,7 @@ func TestRegisterExistingSwitchWithRoomChange(t *testing.T) { // Create partition for the switch partition := &metal.Partition{ - Base: metal.Base{ - ID: "1", - }, + ID: "1", } // Setup mock expectations @@ -205,11 +187,7 @@ func TestRegisterExistingSwitchWithRoomChange(t *testing.T) { // Register the switch with a new room ID createRequest := v1.SwitchRegisterRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: switchID, - }, - }, + ID: switchID, Nics: v1.SwitchNics{ { Name: "swp1", @@ -221,11 +199,9 @@ func TestRegisterExistingSwitchWithRoomChange(t *testing.T) { }, }, PartitionID: "1", - SwitchBase: v1.SwitchBase{ - RackID: "1", - RoomID: newRoomID, - OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, - }, + RackID: "1", + RoomID: newRoomID, + OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -269,17 +245,11 @@ func TestRegisterExistingSwitchErrorModifyingNics(t *testing.T) { container := restful.NewContainer().Add(switchservice) createRequest := v1.SwitchRegisterRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Switch1.ID, - }, - }, + ID: testdata.Switch1.ID, Nics: v1.SwitchNics{}, PartitionID: testdata.Switch1.PartitionID, - SwitchBase: v1.SwitchBase{ - RackID: testdata.Switch1.RackID, - OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, - }, + RackID: testdata.Switch1.RackID, + OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -300,16 +270,10 @@ func TestReplaceSwitch(t *testing.T) { container := restful.NewContainer().Add(switchservice) createRequest := v1.SwitchRegisterRequest{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: testdata.Switch2.ID, - }, - }, + ID: testdata.Switch2.ID, PartitionID: testdata.Switch2.PartitionID, - SwitchBase: v1.SwitchBase{ - RackID: testdata.Switch2.RackID, - OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, - }, + RackID: testdata.Switch2.RackID, + OS: &v1.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, } js, err := json.Marshal(createRequest) require.NoError(t, err) @@ -403,7 +367,7 @@ func TestConnectMachineWithSwitches(t *testing.T) { MacAddress: "11:11:11:11:11:11", } s1 := metal.Switch{ - Base: metal.Base{ID: "1"}, + ID: "1", PartitionID: partitionID, OS: &metal.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, MachineConnections: metal.ConnectionMap{}, @@ -416,7 +380,7 @@ func TestConnectMachineWithSwitches(t *testing.T) { MacAddress: "21:11:11:11:11:11", } s2 := metal.Switch{ - Base: metal.Base{ID: "2"}, + ID: "2", PartitionID: partitionID, OS: &metal.SwitchOS{Vendor: metal.SwitchOSVendorCumulus}, MachineConnections: metal.ConnectionMap{}, @@ -433,7 +397,7 @@ func TestConnectMachineWithSwitches(t *testing.T) { { name: "Connect machine with uplinks to two distinct switches", machine: &metal.Machine{ - Base: metal.Base{ID: "1"}, + ID: "1", PartitionID: partitionID, Hardware: metal.MachineHardware{ Nics: metal.Nics{ @@ -457,7 +421,7 @@ func TestConnectMachineWithSwitches(t *testing.T) { { name: "Connect machine without neighbors on one interface", machine: &metal.Machine{ - Base: metal.Base{ID: "2"}, + ID: "2", PartitionID: partitionID, Hardware: metal.MachineHardware{ Nics: metal.Nics{ @@ -521,7 +485,7 @@ func TestSetVrfAtSwitch(t *testing.T) { vrf := "123" m := &metal.Machine{ - Base: metal.Base{ID: "1"}, + ID: "1", PartitionID: "1", } switches, err := ds.SetVrfAtSwitches(m, vrf) @@ -733,7 +697,7 @@ func TestMakeBGPFilterMachine(t *testing.T) { t.Run(tt.name, func(t *testing.T) { mock.On(r.DB("mockdb").Table("network").Get(r.MockAnything())).Return(testdata.Partition1PrivateSuperNetwork, nil) - r := switchResource{webResource: webResource{ds: ds, log: slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug}))}} + r := switchResource{ds: ds, log: slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug}))} got, _ := r.makeBGPFilterMachine(tt.args.machine, tt.args.nws, tt.args.ipsMap) @@ -801,13 +765,13 @@ func TestMakeSwitchNics(t *testing.T) { }, machines: metal.Machines{ metal.Machine{ - Base: metal.Base{ID: "m1"}, + ID: "m1", Allocation: &metal.MachineAllocation{ Project: "project", }, }, metal.Machine{ - Base: metal.Base{ID: "fw1"}, + ID: "fw1", Allocation: &metal.MachineAllocation{ Project: "p", Role: metal.RoleFirewall, @@ -1685,17 +1649,9 @@ func TestUpdateSwitch(t *testing.T) { desc := "test" updateRequest := v1.SwitchUpdateRequest{ - Common: v1.Common{ - Describable: v1.Describable{ - Description: &desc, - }, - Identifiable: v1.Identifiable{ - ID: testdata.Switch1.ID, - }, - }, - SwitchBase: v1.SwitchBase{ - Mode: string(metal.SwitchReplace), - }, + Description: &desc, + ID: testdata.Switch1.ID, + Mode: string(metal.SwitchReplace), } js, err := json.Marshal(updateRequest) require.NoError(t, err) @@ -2124,9 +2080,7 @@ func Test_SwitchDelete(t *testing.T) { name: "delete switch", mockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("switch").Get("switch-1")).Return(&metal.Switch{ - Base: metal.Base{ - ID: "switch-1", - }, + ID: "switch-1", }, nil) mock.On(r.DB("mockdb").Table("switch").Get("switch-1").Delete()).Return(testdata.EmptyResult, nil) mock.On(r.DB("mockdb").Table("switchstatus").Get("switch-1")).Return(nil, nil) @@ -2134,15 +2088,9 @@ func Test_SwitchDelete(t *testing.T) { mock.On(r.DB("mockdb").Table("network")).Return(nil, nil) }, want: &v1.SwitchResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "switch-1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "switch-1", + Name: new(""), + Description: new(""), Nics: v1.SwitchNics{}, Connections: []v1.SwitchConnection{}, }, @@ -2152,9 +2100,7 @@ func Test_SwitchDelete(t *testing.T) { name: "delete switch does not work due to machine connections", mockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("switch").Get("switch-1")).Return(&metal.Switch{ - Base: metal.Base{ - ID: "switch-1", - }, + ID: "switch-1", MachineConnections: metal.ConnectionMap{ "port-a": metal.Connections{}, }, @@ -2171,9 +2117,7 @@ func Test_SwitchDelete(t *testing.T) { name: "delete switch with force", mockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("switch").Get("switch-1")).Return(&metal.Switch{ - Base: metal.Base{ - ID: "switch-1", - }, + ID: "switch-1", MachineConnections: metal.ConnectionMap{ "port-a": metal.Connections{}, }, @@ -2185,15 +2129,9 @@ func Test_SwitchDelete(t *testing.T) { }, force: true, want: &v1.SwitchResponse{ - Common: v1.Common{ - Identifiable: v1.Identifiable{ - ID: "switch-1", - }, - Describable: v1.Describable{ - Name: new(""), - Description: new(""), - }, - }, + ID: "switch-1", + Name: new(""), + Description: new(""), Nics: v1.SwitchNics{}, Connections: []v1.SwitchConnection{}, }, diff --git a/cmd/metal-api/internal/service/tenant-service.go b/cmd/metal-api/internal/service/tenant-service.go index 5376fe58..722f1a13 100644 --- a/cmd/metal-api/internal/service/tenant-service.go +++ b/cmd/metal-api/internal/service/tenant-service.go @@ -24,9 +24,7 @@ type tenantResource struct { // NewTenant returns a webservice for tenant specific endpoints. func NewTenant(log *slog.Logger, mdc mdm.Client) *restful.WebService { r := tenantResource{ - webResource: webResource{ - log: log, - }, + log: log, mdc: mdc, } return r.webService() diff --git a/cmd/metal-api/internal/service/tenant-service_test.go b/cmd/metal-api/internal/service/tenant-service_test.go index 37de8c92..9ee0e0dc 100644 --- a/cmd/metal-api/internal/service/tenant-service_test.go +++ b/cmd/metal-api/internal/service/tenant-service_test.go @@ -68,7 +68,7 @@ func Test_tenantResource_getTenant(t *testing.T) { tenantServiceMock: func(mock *mdmv1mock.TenantServiceClient) { mock.On("Get", testifymock.Anything, &mdmv1.TenantGetRequest{Id: "122"}).Return(&mdmv1.TenantResponse{Tenant: &mdmv1.Tenant{Name: "t122"}}, nil) }, - want: &v1.TenantResponse{Tenant: v1.Tenant{Name: "t122"}}, + want: &v1.TenantResponse{Name: "t122"}, wantStatus: 200, wantErr: nil, }, @@ -79,7 +79,7 @@ func Test_tenantResource_getTenant(t *testing.T) { mock.On("Get", testifymock.Anything, &mdmv1.TenantGetRequest{Id: "123"}).Return(&mdmv1.TenantResponse{Tenant: &mdmv1.Tenant{Name: "t123"}}, nil) }, id: "123", - want: &v1.TenantResponse{Tenant: v1.Tenant{Name: "t123"}}, + want: &v1.TenantResponse{Name: "t123"}, wantStatus: 200, wantErr: nil, }, diff --git a/cmd/metal-api/internal/service/user-service.go b/cmd/metal-api/internal/service/user-service.go index 63789104..db973730 100644 --- a/cmd/metal-api/internal/service/user-service.go +++ b/cmd/metal-api/internal/service/user-service.go @@ -21,9 +21,7 @@ type userResource struct { // NewUser returns a webservice for user specific endpoints. func NewUser(log *slog.Logger, userGetter security.UserGetter) *restful.WebService { r := userResource{ - webResource: webResource{ - log: log, - }, + log: log, userGetter: userGetter, } return r.webService() diff --git a/cmd/metal-api/internal/service/v1/filesystem.go b/cmd/metal-api/internal/service/v1/filesystem.go index de8cd08c..39545a6d 100644 --- a/cmd/metal-api/internal/service/v1/filesystem.go +++ b/cmd/metal-api/internal/service/v1/filesystem.go @@ -163,9 +163,7 @@ func NewFilesystemLayout(f FilesystemLayoutCreateRequest) (*metal.FilesystemLayo lvs = append(lvs, lv) } fl := &metal.FilesystemLayout{ - Base: metal.Base{ - ID: f.ID, - }, + ID: f.ID, Filesystems: fss, Disks: ds, Raid: rs, @@ -253,25 +251,17 @@ func NewFilesystemLayoutResponse(f *metal.FilesystemLayout) *FilesystemLayoutRes lvs = append(lvs, lv) } flr := &FilesystemLayoutResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: f.ID, - }, - Describable: Describable{ - Name: &f.Name, - Description: &f.Description, - }, - }, - FilesystemLayoutBase: FilesystemLayoutBase{ - Filesystems: fss, - Disks: ds, - Raid: rs, - VolumeGroups: vgs, - LogicalVolumes: lvs, - Constraints: FilesystemLayoutConstraints{ - Sizes: f.Constraints.Sizes, - Images: f.Constraints.Images, - }, + ID: f.ID, + Name: &f.Name, + Description: &f.Description, + Filesystems: fss, + Disks: ds, + Raid: rs, + VolumeGroups: vgs, + LogicalVolumes: lvs, + Constraints: FilesystemLayoutConstraints{ + Sizes: f.Constraints.Sizes, + Images: f.Constraints.Images, }, } return flr diff --git a/cmd/metal-api/internal/service/v1/image.go b/cmd/metal-api/internal/service/v1/image.go index b4cf79a5..79d954ab 100644 --- a/cmd/metal-api/internal/service/v1/image.go +++ b/cmd/metal-api/internal/service/v1/image.go @@ -52,24 +52,14 @@ func NewImageResponse(img *metal.Image) *ImageResponse { } } return &ImageResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: img.ID, - }, - Describable: Describable{ - Name: &img.Name, - Description: &img.Description, - }, - }, - ImageBase: ImageBase{ - URL: &img.URL, - Features: features, - ExpirationDate: img.ExpirationDate, - Classification: string(img.Classification), - }, - Timestamps: Timestamps{ - Created: img.Created, - Changed: img.Changed, - }, + ID: img.ID, + Name: &img.Name, + Description: &img.Description, + URL: &img.URL, + Features: features, + ExpirationDate: img.ExpirationDate, + Classification: string(img.Classification), + Created: img.Created, + Changed: img.Changed, } } diff --git a/cmd/metal-api/internal/service/v1/ip.go b/cmd/metal-api/internal/service/v1/ip.go index 3740f071..c1f8f601 100644 --- a/cmd/metal-api/internal/service/v1/ip.go +++ b/cmd/metal-api/internal/service/v1/ip.go @@ -48,23 +48,15 @@ func NewIPResponse(ip *metal.IP) *IPResponse { tags = []string{} } return &IPResponse{ - Describable: Describable{ - Name: &ip.Name, - Description: &ip.Description, - }, - IPBase: IPBase{ - NetworkID: ip.NetworkID, - ProjectID: ip.ProjectID, - Type: ip.Type, - Tags: tags, - }, - IPIdentifiable: IPIdentifiable{ - IPAddress: ip.IPAddress, - AllocationUUID: ip.AllocationUUID, - }, - Timestamps: Timestamps{ - Created: ip.Created, - Changed: ip.Changed, - }, + Name: &ip.Name, + Description: &ip.Description, + NetworkID: ip.NetworkID, + ProjectID: ip.ProjectID, + Type: ip.Type, + Tags: tags, + IPAddress: ip.IPAddress, + AllocationUUID: ip.AllocationUUID, + Created: ip.Created, + Changed: ip.Changed, } } diff --git a/cmd/metal-api/internal/service/v1/machine.go b/cmd/metal-api/internal/service/v1/machine.go index f299e7ba..7c68b88d 100644 --- a/cmd/metal-api/internal/service/v1/machine.go +++ b/cmd/metal-api/internal/service/v1/machine.go @@ -533,13 +533,11 @@ func NewMachineResponse(m *metal.Machine, s *metal.Size, p *metal.Partition, i * } hardware = MachineHardware{ - MachineHardwareBase: MachineHardwareBase{ - Memory: m.Hardware.Memory, - Disks: disks, - MetalCPUs: cpus, - MetalGPUs: gpus, - }, - Nics: nics, + Memory: m.Hardware.Memory, + Disks: disks, + MetalCPUs: cpus, + MetalGPUs: gpus, + Nics: nics, } var allocation *MachineAllocation @@ -669,45 +667,35 @@ func NewMachineResponse(m *metal.Machine, s *metal.Size, p *metal.Partition, i * } return &MachineResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: m.ID, - }, - Describable: Describable{ - Name: &m.Name, - Description: &m.Description, - }, + ID: m.ID, + Name: &m.Name, + Description: &m.Description, + Partition: NewPartitionResponse(p), + Size: NewSizeResponse(s), + Allocation: allocation, + RackID: m.RackID, + RoomID: m.RoomID, + Hardware: hardware, + BIOS: MachineBIOS{ + Version: m.BIOS.Version, + Vendor: m.BIOS.Vendor, + Date: m.BIOS.Date, }, - MachineBase: MachineBase{ - Partition: NewPartitionResponse(p), - Size: NewSizeResponse(s), - Allocation: allocation, - RackID: m.RackID, - RoomID: m.RoomID, - Hardware: hardware, - BIOS: MachineBIOS{ - Version: m.BIOS.Version, - Vendor: m.BIOS.Vendor, - Date: m.BIOS.Date, - }, - State: MachineState{ - Value: stateValue, - Description: m.State.Description, - Issuer: m.State.Issuer, - MetalHammerVersion: m.State.MetalHammerVersion, - }, - LEDState: ChassisIdentifyLEDState{ - Value: string(m.LEDState.Value), - Description: m.LEDState.Description, - }, - Liveliness: liveliness, - RecentProvisioningEvents: *NewMachineRecentProvisioningEvents(ec), - Tags: tags, + State: MachineState{ + Value: stateValue, + Description: m.State.Description, + Issuer: m.State.Issuer, + MetalHammerVersion: m.State.MetalHammerVersion, }, - Timestamps: Timestamps{ - Created: m.Created, - Changed: m.Changed, + LEDState: ChassisIdentifyLEDState{ + Value: string(m.LEDState.Value), + Description: m.LEDState.Description, }, + Liveliness: liveliness, + RecentProvisioningEvents: *NewMachineRecentProvisioningEvents(ec), + Tags: tags, + Created: m.Created, + Changed: m.Changed, } } diff --git a/cmd/metal-api/internal/service/v1/network.go b/cmd/metal-api/internal/service/v1/network.go index 89a8ae90..66201862 100644 --- a/cmd/metal-api/internal/service/v1/network.go +++ b/cmd/metal-api/internal/service/v1/network.go @@ -110,39 +110,27 @@ func NewNetworkResponse(network *metal.Network, consumption *NetworkConsumption) } response := &NetworkResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: network.ID, - }, - Describable: Describable{ - Name: &network.Name, - Description: &network.Description, - }, - }, - NetworkBase: NetworkBase{ - PartitionID: &network.PartitionID, - ProjectID: &network.ProjectID, - Labels: labels, - Shared: &network.Shared, - }, - NetworkImmutable: NetworkImmutable{ - Prefixes: network.Prefixes.String(), - DestinationPrefixes: network.DestinationPrefixes.String(), - DefaultChildPrefixLength: network.DefaultChildPrefixLength, - Nat: network.Nat, - PrivateSuper: network.PrivateSuper, - Underlay: network.Underlay, - Vrf: &network.Vrf, - ParentNetworkID: parentNetworkID, - AdditionalAnnouncableCIDRs: network.AdditionalAnnouncableCIDRs, - NetworkType: network.NetworkType, - NATType: network.NATType, - }, - Consumption: *consumption, - Timestamps: Timestamps{ - Created: network.Created, - Changed: network.Changed, - }, + ID: network.ID, + Name: &network.Name, + Description: &network.Description, + PartitionID: &network.PartitionID, + ProjectID: &network.ProjectID, + Labels: labels, + Shared: &network.Shared, + Prefixes: network.Prefixes.String(), + DestinationPrefixes: network.DestinationPrefixes.String(), + DefaultChildPrefixLength: network.DefaultChildPrefixLength, + Nat: network.Nat, + PrivateSuper: network.PrivateSuper, + Underlay: network.Underlay, + Vrf: &network.Vrf, + ParentNetworkID: parentNetworkID, + AdditionalAnnouncableCIDRs: network.AdditionalAnnouncableCIDRs, + NetworkType: network.NetworkType, + NATType: network.NATType, + Consumption: *consumption, + Created: network.Created, + Changed: network.Changed, } if consumption.IPv4 != nil { diff --git a/cmd/metal-api/internal/service/v1/partition.go b/cmd/metal-api/internal/service/v1/partition.go index 1c1f1ef8..28bca314 100644 --- a/cmd/metal-api/internal/service/v1/partition.go +++ b/cmd/metal-api/internal/service/v1/partition.go @@ -123,30 +123,20 @@ func NewPartitionResponse(p *metal.Partition) *PartitionResponse { } return &PartitionResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: p.ID, - }, - Describable: Describable{ - Name: &p.Name, - Description: &p.Description, - }, - }, - PartitionBase: PartitionBase{ - MgmtServiceAddress: &p.MgmtServiceAddress, - DNSServers: dnsServers, - NTPServers: ntpServers, - }, + ID: p.ID, + Name: &p.Name, + Description: &p.Description, + MgmtServiceAddress: &p.MgmtServiceAddress, + DNSServers: dnsServers, + NTPServers: ntpServers, PartitionBootConfiguration: PartitionBootConfiguration{ ImageURL: &p.BootConfiguration.ImageURL, KernelURL: &p.BootConfiguration.KernelURL, CommandLine: &p.BootConfiguration.CommandLine, }, - Timestamps: Timestamps{ - Created: p.Created, - Changed: p.Changed, - }, - Labels: labels, + Created: p.Created, + Changed: p.Changed, + Labels: labels, } } diff --git a/cmd/metal-api/internal/service/v1/size.go b/cmd/metal-api/internal/service/v1/size.go index 0b828724..8fef9e8f 100644 --- a/cmd/metal-api/internal/service/v1/size.go +++ b/cmd/metal-api/internal/service/v1/size.go @@ -113,28 +113,20 @@ func NewSizeResponse(s *metal.Size) *SizeResponse { } return &SizeResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: s.ID, - }, - Describable: Describable{ - Name: &s.Name, - Description: &s.Description, - }, - }, + ID: s.ID, + Name: &s.Name, + Description: &s.Description, SizeConstraints: constraints, - Timestamps: Timestamps{ - Created: s.Created, - Changed: s.Changed, - }, - Labels: labels, + Created: s.Created, + Changed: s.Changed, + Labels: labels, } } func NewSizeReservationResponse(rv *metal.SizeReservation) *SizeReservationResponse { return &SizeReservationResponse{ - Common: Common{Identifiable: Identifiable{ID: rv.ID}, Describable: Describable{Name: &rv.Name, Description: &rv.Description}}, - Timestamps: Timestamps{Created: rv.Created, Changed: rv.Changed}, + ID: rv.ID, Name: &rv.Name, Description: &rv.Description, + Created: rv.Created, Changed: rv.Changed, SizeID: rv.SizeID, PartitionIDs: rv.PartitionIDs, ProjectID: rv.ProjectID, diff --git a/cmd/metal-api/internal/service/v1/sizeimageconstraint.go b/cmd/metal-api/internal/service/v1/sizeimageconstraint.go index 8b1fa4d4..e13e122a 100644 --- a/cmd/metal-api/internal/service/v1/sizeimageconstraint.go +++ b/cmd/metal-api/internal/service/v1/sizeimageconstraint.go @@ -36,23 +36,17 @@ func NewSizeImageConstraint(s SizeImageConstraintCreateRequest) *metal.SizeImage description = *s.Common.Describable.Description } return &metal.SizeImageConstraint{ - Base: metal.Base{ - ID: s.ID, - Name: name, - Description: description, - }, - Images: s.Images, + ID: s.ID, + Name: name, + Description: description, + Images: s.Images, } } func NewSizeImageConstraintResponse(s *metal.SizeImageConstraint) *SizeImageConstraintResponse { return &SizeImageConstraintResponse{ - Common: Common{ - Identifiable: Identifiable{ID: s.ID}, - Describable: Describable{Name: &s.Name, Description: &s.Description}, - }, - SizeImageConstraintBase: SizeImageConstraintBase{ - Images: s.Images, - }, + ID: s.ID, + Name: &s.Name, Description: &s.Description, + Images: s.Images, } } diff --git a/cmd/metal-api/internal/service/v1/switch.go b/cmd/metal-api/internal/service/v1/switch.go index 5e76c51e..fd0e96ce 100644 --- a/cmd/metal-api/internal/service/v1/switch.go +++ b/cmd/metal-api/internal/service/v1/switch.go @@ -164,33 +164,23 @@ func NewSwitchResponse(s *metal.Switch, ss *metal.SwitchStatus, p *metal.Partiti } return &SwitchResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: s.ID, - }, - Describable: Describable{ - Name: &s.Name, - Description: &s.Description, - }, - }, - SwitchBase: SwitchBase{ - RackID: s.RackID, - RoomID: s.RoomID, - Mode: string(s.Mode), - OS: os, - ManagementIP: s.ManagementIP, - ManagementUser: s.ManagementUser, - ConsoleCommand: s.ConsoleCommand, - }, - Nics: nics, - Partition: partition, - Connections: cons, - LastSync: snr.LastSync, - LastSyncError: snr.LastSyncError, - Timestamps: Timestamps{ - Created: s.Created, - Changed: s.Changed, - }, + ID: s.ID, + Name: &s.Name, + Description: &s.Description, + RackID: s.RackID, + RoomID: s.RoomID, + Mode: string(s.Mode), + OS: os, + ManagementIP: s.ManagementIP, + ManagementUser: s.ManagementUser, + ConsoleCommand: s.ConsoleCommand, + Nics: nics, + Partition: partition, + Connections: cons, + LastSync: snr.LastSync, + LastSyncError: snr.LastSyncError, + Created: s.Created, + Changed: s.Changed, } } @@ -217,15 +207,9 @@ func NewSwitchNotifyResponse(s *metal.SwitchStatus) *SwitchNotifyResponse { } return &SwitchNotifyResponse{ - Common: Common{ - Identifiable: Identifiable{ - ID: s.ID, - }, - Describable: Describable{ - Name: &s.Name, - Description: &s.Description, - }, - }, + ID: s.ID, + Name: &s.Name, + Description: &s.Description, LastSync: lastSync, LastSyncError: lastSyncError, } @@ -262,11 +246,9 @@ func NewSwitch(r SwitchRegisterRequest) *metal.Switch { } return &metal.Switch{ - Base: metal.Base{ - ID: r.ID, - Name: name, - Description: description, - }, + ID: r.ID, + Name: name, + Description: description, PartitionID: r.PartitionID, RackID: r.RackID, RoomID: r.RoomID, diff --git a/cmd/metal-api/internal/service/vpn-service.go b/cmd/metal-api/internal/service/vpn-service.go index e6ea4370..841d0314 100644 --- a/cmd/metal-api/internal/service/vpn-service.go +++ b/cmd/metal-api/internal/service/vpn-service.go @@ -33,9 +33,7 @@ func NewVPN( reasonMinLength uint, ) *restful.WebService { r := vpnResource{ - webResource: webResource{ - log: log, - }, + log: log, headscaleClient: headscaleClient, reasonMinLength: reasonMinLength, } diff --git a/cmd/metal-api/internal/service/vpn-service_test.go b/cmd/metal-api/internal/service/vpn-service_test.go index ef17161c..24cea96a 100644 --- a/cmd/metal-api/internal/service/vpn-service_test.go +++ b/cmd/metal-api/internal/service/vpn-service_test.go @@ -26,9 +26,7 @@ func Test_EvaluateVPNConnected(t *testing.T) { mockFn: func(mock *r.Mock) { mock.On(r.DB("mockdb").Table("machine")).Return(metal.Machines{ { - Base: metal.Base{ - ID: "toggle", - }, + ID: "toggle", Allocation: &metal.MachineAllocation{ Project: "p1", VPN: &metal.MachineVPN{ @@ -37,9 +35,7 @@ func Test_EvaluateVPNConnected(t *testing.T) { }, }, { - Base: metal.Base{ - ID: "already-connected", - }, + ID: "already-connected", Allocation: &metal.MachineAllocation{ Project: "p2", VPN: &metal.MachineVPN{ @@ -48,9 +44,7 @@ func Test_EvaluateVPNConnected(t *testing.T) { }, }, { - Base: metal.Base{ - ID: "no-vpn", - }, + ID: "no-vpn", Allocation: &metal.MachineAllocation{ Project: "p3", }, diff --git a/cmd/metal-api/main.go b/cmd/metal-api/main.go index b7422b6f..87446b00 100644 --- a/cmd/metal-api/main.go +++ b/cmd/metal-api/main.go @@ -1121,64 +1121,48 @@ func run() error { func enrichSwaggerObject(swo *spec.Swagger) { swo.Info = &spec.Info{ - InfoProps: spec.InfoProps{ - Title: moduleName, - Description: "API to manage and control plane resources like machines, switches, operating system images, machine sizes, networks, IP addresses and more", - Contact: &spec.ContactInfo{ - ContactInfoProps: spec.ContactInfoProps{ - Name: "metal-stack", - URL: "https://metal-stack.io", - }, - }, - License: &spec.License{ - LicenseProps: spec.LicenseProps{ - Name: "AGPL-3.0", - URL: "https://www.gnu.org/licenses/agpl-3.0.de.html", - }, - }, + Title: moduleName, + Description: "API to manage and control plane resources like machines, switches, operating system images, machine sizes, networks, IP addresses and more", + Contact: &spec.ContactInfo{ + Name: "metal-stack", + URL: "https://metal-stack.io", + }, + License: &spec.License{ + Name: "AGPL-3.0", + URL: "https://www.gnu.org/licenses/agpl-3.0.de.html", }, } swo.Tags = []spec.Tag{ - {TagProps: spec.TagProps{ + { Name: "audit", - Description: "Managing audit entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing audit entities"}, + { Name: "image", - Description: "Managing image entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing image entities"}, + { Name: "network", - Description: "Managing network entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing network entities"}, + { Name: "ip", - Description: "Managing ip entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing ip entities"}, + { Name: "size", - Description: "Managing size entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing size entities"}, + { Name: "machine", - Description: "Managing machine entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing machine entities"}, + { Name: "partition", - Description: "Managing partition entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing partition entities"}, + { Name: "project", - Description: "Managing project entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing project entities"}, + { Name: "switch", - Description: "Managing switch entities", - }}, - {TagProps: spec.TagProps{ + Description: "Managing switch entities"}, + { Name: "user", - Description: "Managing user entities", - }}, + Description: "Managing user entities"}, } hmacspec := spec.APIKeyAuth("Authorization", "header") diff --git a/test/integration.go b/test/integration.go index 3c61b129..f10dcad8 100644 --- a/test/integration.go +++ b/test/integration.go @@ -106,15 +106,13 @@ func StartNsqd(t *testing.T, log *slog.Logger) (testcontainers.Container, bus.Pu ctx := context.Background() c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ - ContainerRequest: testcontainers.ContainerRequest{ - Image: "nsqio/nsq:v1.3.0", - ExposedPorts: []string{"4150/tcp", "4151/tcp"}, - WaitingFor: wait.ForAll( - wait.ForListeningPort("4150/tcp"), - wait.ForListeningPort("4151/tcp"), - ), - Cmd: []string{"nsqd"}, - }, + Image: "nsqio/nsq:v1.3.0", + ExposedPorts: []string{"4150/tcp", "4151/tcp"}, + WaitingFor: wait.ForAll( + wait.ForListeningPort("4150/tcp"), + wait.ForListeningPort("4151/tcp"), + ), + Cmd: []string{"nsqd"}, Started: true, Logger: testlog.TestLogger(t), })