Skip to content

Commit

Permalink
More superuser debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Apr 3, 2024
1 parent f317ff4 commit 0a2b37f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
9 changes: 6 additions & 3 deletions cmd/metal-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

v1 "github.com/metal-stack/metal-api/pkg/api/v1"
metalgo "github.com/metal-stack/metal-go"
"github.com/metal-stack/metal-go/api/client/machine"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
Expand All @@ -18,7 +19,7 @@ import (
type MetalAPIClient struct {
log *slog.Logger
conn grpc.ClientConnInterface
Driver metalgo.Client
driver metalgo.Client
}

// NewMetalAPIClient fetches the address,hmac and certificates from pixie needed to communicate with metal-api,
Expand Down Expand Up @@ -71,10 +72,12 @@ func NewMetalAPIClient(log *slog.Logger, spec *Specification) (*MetalAPIClient,
return &MetalAPIClient{
log: log,
conn: conn,
Driver: driver,
driver: driver,
}, nil
}

func (c *MetalAPIClient) Machine() machine.ClientService {
return c.driver.Machine()
}
func (c *MetalAPIClient) Event() v1.EventServiceClient {
return v1.NewEventServiceClient(c.conn)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func Run(log *slog.Logger, spec *Specification, hal hal.InBand) (*event.EventEmi
return eventEmitter, fmt.Errorf("register %w", err)
}

resp, err := metalAPIClient.Driver.Machine().FindMachine(machine.NewFindMachineParams().WithID(spec.MachineUUID), nil)
resp, err := metalAPIClient.Machine().FindMachine(machine.NewFindMachineParams().WithID(spec.MachineUUID), nil)
if err != nil {
return eventEmitter, fmt.Errorf("fetch %w", err)
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func Run(log *slog.Logger, spec *Specification, hal hal.InBand) (*event.EventEmi
if err != nil {
return eventEmitter, fmt.Errorf("wait for installation %w", err)
}
resp, err = metalAPIClient.Driver.Machine().FindMachine(machine.NewFindMachineParams().WithID(spec.MachineUUID), nil)
resp, err = metalAPIClient.Machine().FindMachine(machine.NewFindMachineParams().WithID(spec.MachineUUID), nil)
if err != nil {
return eventEmitter, fmt.Errorf("wait for installation %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/supwd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (h *Hammer) createBmcSuperuser() error {
return fmt.Errorf("failed to fetch SuperUser password %w", err)
}

if resp.FeatureDisabled {
if resp.GetFeatureDisabled() {
h.log.Info("creation of superuser disabled")
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ require (
github.com/google/uuid v1.6.0
github.com/grafana/loki-client-go v0.0.0-20230116142646-e7494d0ef70c
github.com/jaypipes/ghw v0.12.0
github.com/metal-stack/go-hal v0.5.3-0.20240328071240-5aafa89c768c
github.com/metal-stack/go-hal v0.5.3
github.com/metal-stack/go-lldpd v0.4.7
github.com/metal-stack/metal-api v0.28.2-0.20240319082832-bdc302de00b8
github.com/metal-stack/metal-go v0.28.3
github.com/metal-stack/metal-api v0.28.5-0.20240403094725-20bcbd64cbe0
github.com/metal-stack/metal-go v0.28.4
github.com/metal-stack/pixie v0.3.2
github.com/metal-stack/v v1.0.3
// archiver must stay in version v2.1.0, see replace below
Expand Down Expand Up @@ -94,7 +94,7 @@ require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5 // indirect
github.com/metal-stack/metal-lib v0.16.1 // indirect
github.com/metal-stack/metal-lib v0.16.2 // indirect
github.com/metal-stack/security v0.8.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -911,16 +911,16 @@ github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5 h1:i4JJtLb5iDVsncU7s
github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5/go.mod h1:IZAsRpRUv/4B6NhGzofHK/+I+N31NTUz/hrEm4ssUwA=
github.com/mdlayher/packet v1.0.0/go.mod h1:eE7/ctqDhoiRhQ44ko5JZU2zxB88g+JH/6jmnjzPjOU=
github.com/mdlayher/socket v0.2.1/go.mod h1:QLlNPkFR88mRUNQIzRBMfXxwKal8H7u1h3bL1CV+f0E=
github.com/metal-stack/go-hal v0.5.3-0.20240328071240-5aafa89c768c h1:VH+3V7DRqyGkobpi3em5UBt1WvDm61W8cJ1PjwW1B5U=
github.com/metal-stack/go-hal v0.5.3-0.20240328071240-5aafa89c768c/go.mod h1:KPE7VCWLu1tEv7eRXTY67+awuXx4qeYlDhOnnaL8J7I=
github.com/metal-stack/go-hal v0.5.3 h1:5XzutD0Y81f3qCYzAjtXMGHUwvdYGLJ1jLyUDUVh4yw=
github.com/metal-stack/go-hal v0.5.3/go.mod h1:KPE7VCWLu1tEv7eRXTY67+awuXx4qeYlDhOnnaL8J7I=
github.com/metal-stack/go-lldpd v0.4.7 h1:Y3FALidODscleqJCS6sGgBunxyLX1scNT7cMoKn6b1Q=
github.com/metal-stack/go-lldpd v0.4.7/go.mod h1:CYKuwnjSZ6zYmAMKLy45/QAQJKj5xZnkfv2zyi+B33o=
github.com/metal-stack/metal-api v0.28.2-0.20240319082832-bdc302de00b8 h1:TBfJomO1wN3jhiFbbW7PzA9BPWgtRLluOpcy7IqMcxI=
github.com/metal-stack/metal-api v0.28.2-0.20240319082832-bdc302de00b8/go.mod h1:hjVDdt8RJcW3EXpf/Yp7r/oXSfuvLic5T16+yVpUaQE=
github.com/metal-stack/metal-go v0.28.3 h1:mK9PMGbT8Ea/h/3QlhwH5zt3Ffi2rP2U/dqZ5uJ3mk4=
github.com/metal-stack/metal-go v0.28.3/go.mod h1:gYLZX3umsoZLWZ5d4MJdVbnR8eFXUTlLTK7tyx638As=
github.com/metal-stack/metal-lib v0.16.1 h1:4iw2cQxS1pcQnuTVlXRvtmR0oCa6OCX6rIiZalfwSZY=
github.com/metal-stack/metal-lib v0.16.1/go.mod h1:nyNGI4DZFOcWbSoq2Y6V3SHpFxuXBIqYBZHTb6cy//s=
github.com/metal-stack/metal-api v0.28.5-0.20240403094725-20bcbd64cbe0 h1:UckVVdn+eqF30MmKNQHE5rufG+JsvdlXzF0bIy/4kyo=
github.com/metal-stack/metal-api v0.28.5-0.20240403094725-20bcbd64cbe0/go.mod h1:qYszTnPPN4xchKIWFwORRsWlAjIBOE8Okx0KZCKrHA4=
github.com/metal-stack/metal-go v0.28.4 h1:cTI2jZqn59FNw0RkPAD7TYeK5YKJjj94YFJiuRl8eDo=
github.com/metal-stack/metal-go v0.28.4/go.mod h1:gYLZX3umsoZLWZ5d4MJdVbnR8eFXUTlLTK7tyx638As=
github.com/metal-stack/metal-lib v0.16.2 h1:RJls/Spai4h5xr3BEmQt9UdWNN4RB9+SOINoZcjYaA8=
github.com/metal-stack/metal-lib v0.16.2/go.mod h1:nyNGI4DZFOcWbSoq2Y6V3SHpFxuXBIqYBZHTb6cy//s=
github.com/metal-stack/pixie v0.3.2 h1:lipPweVZ6oyJxgT/zHm7YUEXT+ZrgJ/6VPa7yMaCVVw=
github.com/metal-stack/pixie v0.3.2/go.mod h1:XW7GLW5aHBUEfz6jOsZ6UQiO1dvNNZoZjkgrOksOdQg=
github.com/metal-stack/security v0.8.0 h1:tVaSDB9m5clwYrnLyaXfPy7mQlJTnmeoHscG+RUy/xo=
Expand Down

0 comments on commit 0a2b37f

Please sign in to comment.