Skip to content

Commit

Permalink
Pass partition id during machine register (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Nov 12, 2024
1 parent f054754 commit ffa8a0c
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 70 deletions.
5 changes: 4 additions & 1 deletion cmd/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ import (
// Register the Machine
type Register struct {
machineUUID string
partitionID string
client v1.BootServiceClient
emitter *event.EventEmitter
network *network.Network
inband hal.InBand
log *slog.Logger
}

func New(log *slog.Logger, machineID string, bootClient v1.BootServiceClient, emitter *event.EventEmitter, network *network.Network, inband hal.InBand) *Register {
func New(log *slog.Logger, machineID, partitionID string, bootClient v1.BootServiceClient, emitter *event.EventEmitter, network *network.Network, inband hal.InBand) *Register {
return &Register{
machineUUID: machineID,
partitionID: partitionID,
client: bootClient,
emitter: emitter,
network: network,
Expand Down Expand Up @@ -216,6 +218,7 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error)

request := &v1.BootServiceRegisterRequest{
Uuid: r.machineUUID,
PartitionId: r.partitionID,
Hardware: hardware,
Bios: bios,
Ipmi: ipmi,
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func Run(log *slog.Logger, spec *Specification, hal hal.InBand) (*event.EventEmi
// Set Time from ntp
network.NtpDate(log, spec.MetalConfig.NTPServers)

reg := register.New(log, spec.MachineUUID, bootService, eventEmitter, n, hal)
reg := register.New(log, spec.MachineUUID, spec.MetalConfig.Partition, bootService, eventEmitter, n, hal)

err = reg.RegisterMachine()
if err != nil {
Expand Down
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ require (
github.com/jaypipes/ghw v0.13.0
github.com/metal-stack/go-hal v0.5.5
github.com/metal-stack/go-lldpd v0.4.8
github.com/metal-stack/metal-api v0.39.1
github.com/metal-stack/metal-go v0.39.1
github.com/metal-stack/pixie v0.3.4
github.com/metal-stack/metal-api v0.39.3
github.com/metal-stack/metal-go v0.39.2
github.com/metal-stack/pixie v0.3.5
github.com/metal-stack/v v1.0.3
// archiver must stay in version v2.1.0, see replace below
github.com/mholt/archiver v3.1.1+incompatible
github.com/moby/sys/mountinfo v0.7.2
github.com/pierrec/lz4/v4 v4.1.21
github.com/prometheus/common v0.60.1
github.com/samber/slog-loki/v3 v3.5.0
github.com/samber/slog-loki/v3 v3.5.1
github.com/samber/slog-multi v1.2.4
github.com/u-root/u-root v0.14.0
github.com/vishvananda/netlink v1.3.0
Expand All @@ -46,11 +46,11 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coreos/go-oidc/v3 v3.11.0 // indirect
github.com/creack/pty v1.1.23 // indirect
github.com/creack/pty v1.1.24 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/gliderlabs/ssh v0.3.7 // indirect
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
Expand All @@ -75,7 +75,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20240912152814-63e84b476a9a // indirect
github.com/grafana/loki/pkg/push v0.0.0-20241112092511-947a66f35e1e // indirect
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
github.com/jaypipes/pcidb v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand Down Expand Up @@ -106,10 +106,10 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/prometheus v0.54.1 // indirect
github.com/prometheus/prometheus v0.55.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/samber/slog-common v0.17.1 // indirect
Expand All @@ -118,19 +118,19 @@ require (
github.com/stmcginnis/gofish v0.19.0 // indirect
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/vishvananda/netns v0.0.5 // indirect
github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/text v0.20.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
howett.net/plist v1.0.1 // indirect
)
Loading

0 comments on commit ffa8a0c

Please sign in to comment.