Skip to content

Commit

Permalink
Make format
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes Mogren authored and mogren committed Oct 4, 2019
1 parent 9c4aa8f commit 04a795f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
1 change: 0 additions & 1 deletion client/health-check/grpc_health_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,3 @@ func main() {
}
log.Printf("status: %v", resp.GetStatus().String())
}

30 changes: 15 additions & 15 deletions ipamd/ipamd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,18 +436,18 @@ func TestIPAMContext_nodeIPPoolTooLow(t *testing.T) {
defer ctrl.Finish()

type fields struct {
maxIPsPerENI int
warmENITarget int
warmIPTarget int
datastore *datastore.DataStore
maxIPsPerENI int
warmENITarget int
warmIPTarget int
datastore *datastore.DataStore
}

tests := []struct {
name string
fields fields
want bool
}{
{"Test new ds, all defaults", fields{14, 1, 0, datastore.NewDataStore()}, true},
{"Test new ds, all defaults", fields{14, 1, 0, datastore.NewDataStore()}, true},
{"Test new ds, 0 ENIs", fields{14, 0, 0, datastore.NewDataStore()}, true},
{"Test new ds, 3 warm IPs", fields{14, 0, 3, datastore.NewDataStore()}, true},
{"Test 3 unused IPs, 1 warm", fields{3, 1, 1, datastoreWith3FreeIPs()}, false},
Expand All @@ -459,16 +459,16 @@ func TestIPAMContext_nodeIPPoolTooLow(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &IPAMContext{
awsClient: mockAWS,
dataStore: tt.fields.datastore,
k8sClient: mockK8S,
useCustomNetworking: false,
eniConfig: mockENIConfig,
networkClient: mockNetwork,
maxIPsPerENI: tt.fields.maxIPsPerENI,
maxENI: -1,
warmENITarget: tt.fields.warmENITarget,
warmIPTarget: tt.fields.warmIPTarget,
awsClient: mockAWS,
dataStore: tt.fields.datastore,
k8sClient: mockK8S,
useCustomNetworking: false,
eniConfig: mockENIConfig,
networkClient: mockNetwork,
maxIPsPerENI: tt.fields.maxIPsPerENI,
maxENI: -1,
warmENITarget: tt.fields.warmENITarget,
warmIPTarget: tt.fields.warmIPTarget,
}
if got := c.nodeIPPoolTooLow(); got != tt.want {
t.Errorf("nodeIPPoolTooLow() = %v, want %v", got, tt.want)
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Test_copyFileContents(t *testing.T) {
dst := os.TempDir() + "/" + tt.args.dst

err := copyFileContents(tt.args.src, dst)
if err != nil {
if err != nil {
if !tt.wantErr {
t.Errorf("copyFileContents() error = %v, wantErr %v", err, tt.wantErr)
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/networkutils/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ import (
)

const (
testMAC1 = "01:23:45:67:89:a0"
testMAC2 = "01:23:45:67:89:a1"
testTable = 10
testeniIP = "10.10.10.20"
testeniSubnet = "10.10.0.0/16"
testMAC1 = "01:23:45:67:89:a0"
testMAC2 = "01:23:45:67:89:a1"
testTable = 10
testeniIP = "10.10.10.20"
testeniSubnet = "10.10.0.0/16"
// Default MTU of ENI and veth
// defined in plugins/routed-eni/driver/driver.go, pkg/networkutils/network.go
testMTU = 9001
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package retry

import (
"context"

"github.com/aws/amazon-vpc-cni-k8s/pkg/utils/ttime"
)

Expand Down

0 comments on commit 04a795f

Please sign in to comment.