Skip to content

Commit 5ca1854

Browse files
Fix linter rule violations (#21)
1 parent 635e5f9 commit 5ca1854

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

dhcp4/conn_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"testing"
2121
"time"
2222

23-
"github.com/stretchr/testify/assert"
23+
"github.com/stretchr/testify/require"
2424
)
2525

2626
func testConn(t *testing.T, impl conn, addr string) {
@@ -55,7 +55,7 @@ func testConn(t *testing.T, impl conn, addr string) {
5555

5656
go func() {
5757
_, err := s.Write(bs)
58-
assert.NoError(t, err)
58+
require.NoError(t, err)
5959
}()
6060
if err = c.SetReadDeadline(time.Now().Add(time.Second)); err != nil {
6161
t.Fatal(err)
@@ -86,7 +86,7 @@ func testConn(t *testing.T, impl conn, addr string) {
8686
ch := make(chan *Packet, 1)
8787
go func() {
8888
err := s.SetReadDeadline(time.Now().Add(time.Second))
89-
assert.NoError(t, err)
89+
require.NoError(t, err)
9090
var buf [1500]byte
9191
n, err := s.Read(buf[:])
9292
if err != nil {

dhcp6/pool/random_address_pool_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/stretchr/testify/assert"
8+
"github.com/stretchr/testify/require"
99
)
1010

1111
func TestReserveAddress(t *testing.T) {
@@ -60,7 +60,7 @@ func TestReserveAddressUpdatesAddressPool(t *testing.T) {
6060
pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime)
6161
pool.timeNow = func() time.Time { return expectedTime }
6262
_, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID})
63-
assert.NoError(t, err)
63+
require.NoError(t, err)
6464

6565
expectedIdx := pool.calculateIAIDHash(expectedClientID, expectedIAID)
6666

@@ -83,7 +83,7 @@ func TestReserveAddressKeepsTrackOfUsedAddresses(t *testing.T) {
8383
pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime)
8484
pool.timeNow = func() time.Time { return expectedTime }
8585
_, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID})
86-
assert.NoError(t, err)
86+
require.NoError(t, err)
8787
_, exists := pool.usedIps[0x01]
8888
if !exists {
8989
t.Fatal("'2001:db8:f00f:cafe::1' should be marked as in use")
@@ -99,8 +99,8 @@ func TestReserveAddressKeepsTrackOfAssociationExpiration(t *testing.T) {
9999
pool := NewRandomAddressPool(net.ParseIP("2001:db8:f00f:cafe::1"), 1, expectedMaxLifetime)
100100
pool.timeNow = func() time.Time { return expectedTime }
101101
_, err := pool.ReserveAddresses(expectedClientID, [][]byte{expectedIAID})
102-
assert.NoError(t, err)
103-
102+
require.NoError(t, err)
103+
104104
expiration := pool.identityAssociationExpirations.Peek().(*associationExpiration)
105105
if expiration == nil {
106106
t.Fatal("Expected an identity association expiration, but got nil")

pixiecore/booters.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ import (
2828
"text/template"
2929
"time"
3030

31+
"go.uber.org/zap"
32+
3133
v1 "github.com/metal-stack/metal-api/pkg/api/v1"
3234
"github.com/metal-stack/pixie/api"
33-
"go.uber.org/zap"
3435
)
3536

3637
// APIBooter gets a BootSpec from a remote server over HTTP.
@@ -111,14 +112,14 @@ func (g *grpcbooter) BootSpec(m Machine) (*Spec, error) {
111112
}
112113
g.log.Infow("boot", "resp", resp)
113114

114-
cmdline := []string{*resp.Cmdline, fmt.Sprintf("PIXIE_API_URL=%s", g.config.PixieAPIURL)}
115+
cmdline := []string{resp.GetCmdline(), fmt.Sprintf("PIXIE_API_URL=%s", g.config.PixieAPIURL)}
115116
if g.config.Debug {
116117
cmdline = append(cmdline, "DEBUG=1")
117118
}
118119

119120
r = rawSpec{
120-
Kernel: resp.Kernel,
121-
Initrd: resp.InitRamDisks,
121+
Kernel: resp.GetKernel(),
122+
Initrd: resp.GetInitRamDisks(),
122123
Cmdline: strings.Join(cmdline, " "),
123124
}
124125
}

0 commit comments

Comments
 (0)