diff --git a/cmd/internal/core/phone-home.go b/cmd/internal/core/phone-home.go index 4f968f06..4d1f8691 100644 --- a/cmd/internal/core/phone-home.go +++ b/cmd/internal/core/phone-home.go @@ -10,9 +10,10 @@ import ( "sync" "time" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/metal-stack/go-lldpd/pkg/lldp" v1 "github.com/metal-stack/metal-api/pkg/api/v1" - "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -111,7 +112,7 @@ func (c *Core) send(ctx context.Context, event *v1.EventServiceSendRequest) (*v1 return nil, err } if s != nil { - c.log.Info("event", "send", s.Events, "failed", s.Failed) + c.log.Info("event", "send", s.GetEvents(), "failed", s.GetFailed()) } return s, err } @@ -137,7 +138,7 @@ func (c *Core) phoneHome(ctx context.Context, msgs []phoneHomeMessage) { c.metrics.CountError("send-provisioning") } if s != nil { - c.log.Info("phonehome sent", "machines", s.Events) + c.log.Info("phonehome sent", "machines", s.GetEvents()) } } diff --git a/cmd/internal/switcher/templates/template_test.go b/cmd/internal/switcher/templates/template_test.go index 887092e7..7a43c3d6 100644 --- a/cmd/internal/switcher/templates/template_test.go +++ b/cmd/internal/switcher/templates/template_test.go @@ -89,10 +89,10 @@ func renderToString(t *testing.T, tpl *template.Template, c *types.Conf) string func readConf(t *testing.T, i string) types.Conf { c := types.Conf{} b, err := os.ReadFile(i) - require.Nil(t, err, "unexpected error when reading testing input") + require.NoError(t, err, "unexpected error when reading testing input") err = yaml.Unmarshal(b, &c) - require.Nil(t, err, "unexpected error when unmarshalling testing input") + require.NoError(t, err, "unexpected error when unmarshalling testing input") return c } diff --git a/cmd/internal/switcher/types/conf_test.go b/cmd/internal/switcher/types/conf_test.go index fd8c4932..495ca3c1 100644 --- a/cmd/internal/switcher/types/conf_test.go +++ b/cmd/internal/switcher/types/conf_test.go @@ -20,7 +20,7 @@ func TestFillVLANIDs(t *testing.T) { }, } err := c.FillVLANIDs(m) - require.Nil(t, err) + require.NoError(t, err) require.Equal(t, uint16(1001), c.Ports.Vrfs["101001"].VLANID) require.Equal(t, uint16(1002), c.Ports.Vrfs["101002"].VLANID) require.Equal(t, uint16(1003), c.Ports.Vrfs["101003"].VLANID)