mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
csi-addons: address golangci-lint issues
addressed golangci-lint issues in csi-addons code. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
a362ef6bd4
commit
29a9114409
@ -348,7 +348,7 @@ type Cidrs []*fence.CIDR
|
||||
func GetCIDR(cidrs Cidrs) ([]string, error) {
|
||||
var cidrList []string
|
||||
for _, cidr := range cidrs {
|
||||
cidrList = append(cidrList, cidr.Cidr)
|
||||
cidrList = append(cidrList, cidr.GetCidr())
|
||||
}
|
||||
if len(cidrList) < 1 {
|
||||
return nil, errors.New("the CIDR cannot be empty")
|
||||
|
@ -19,7 +19,7 @@ package networkfence
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetIPRange(t *testing.T) {
|
||||
@ -47,10 +47,10 @@ func TestGetIPRange(t *testing.T) {
|
||||
t.Run(ts.cidr, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
got, err := getIPRange(ts.cidr)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
// validate if number of IPs in the range is same as expected, if not, fail.
|
||||
assert.ElementsMatch(t, ts.expectedIPs, got)
|
||||
require.ElementsMatch(t, ts.expectedIPs, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user