Skip to content

Commit c060552

Browse files
author
Rahul Sharma
committed
increase code coverage
1 parent a90fbde commit c060552

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

api/v1alpha2/linodevpc_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type VPCSubnetCreateOptions struct {
103103
}
104104

105105
// VPCSubnetCreateOptionsIPv6 defines the options for creating an IPv6 range in a VPC subnet.
106-
// Its copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
106+
// It's copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
107107
// Values supported by the linode API should be used here.
108108
// See https://techdocs.akamai.com/linode-api/reference/post-vpc-subnet for more details.
109109
type VPCSubnetCreateOptionsIPv6 struct {

config/crd/bases/infrastructure.cluster.x-k8s.io_linodevpcs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ spec:
145145
items:
146146
description: |-
147147
VPCSubnetCreateOptionsIPv6 defines the options for creating an IPv6 range in a VPC subnet.
148-
Its copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
148+
It's copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
149149
Values supported by the linode API should be used here.
150150
See https://techdocs.akamai.com/linode-api/reference/post-vpc-subnet for more details.
151151
properties:

docs/src/reference/out.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ _Appears in:_
12701270

12711271

12721272
VPCSubnetCreateOptionsIPv6 defines the options for creating an IPv6 range in a VPC subnet.
1273-
Its copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
1273+
It's copied from linodego.VPCSubnetCreateOptionsIPv6 and should be kept in sync.
12741274
Values supported by the linode API should be used here.
12751275
See https://techdocs.akamai.com/linode-api/reference/post-vpc-subnet for more details.
12761276

internal/controller/linodemachine_controller_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ func getVPCInterfaceConfigFromDirectID(ctx context.Context, machineScope *scope.
589589
}
590590

591591
// machineIPv6RangeConfig returns the IPv6 range configuration if subnet has IPv6 ranges.
592-
// for now, we support only a single IPv6 range for machine per subnet.
592+
// For now, we support only a single IPv6 range for machine per subnet.
593593
// If this changes, we may need to adjust this logic.
594594
func machineIPv6RangeConfig(numIPv6RangesInSubnet int) []linodego.InstanceConfigInterfaceCreateOptionsIPv6Range {
595595
if numIPv6RangesInSubnet == 0 {

internal/controller/linodemachine_controller_helpers_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ func validateInterfaceExpectations(
409409
if expectInterface {
410410
require.NotNil(t, iface)
411411
require.Equal(t, linodego.InterfacePurposeVPC, iface.Purpose)
412+
if iface.IPv6 != nil {
413+
require.Equal(t, defaultNodeIPv6CIDRRange, *iface.IPv6.Ranges[0].Range)
414+
}
412415
require.True(t, iface.Primary)
413416
require.NotNil(t, iface.SubnetID)
414417
require.Equal(t, expectSubnetID, *iface.SubnetID)
@@ -497,6 +500,11 @@ func TestGetVPCInterfaceConfigFromDirectID(t *testing.T) {
497500
{
498501
ID: 456,
499502
Label: "subnet-1",
503+
IPv6: []linodego.VPCIPv6Range{
504+
{
505+
Range: "2001:0db8::/56",
506+
},
507+
},
500508
},
501509
},
502510
}, nil)
@@ -762,6 +770,11 @@ func TestConfigureVPCInterface(t *testing.T) {
762770
{
763771
ID: 456,
764772
Label: "subnet-1",
773+
IPv6: []linodego.VPCIPv6Range{
774+
{
775+
Range: "2001:0db8::/56",
776+
},
777+
},
765778
},
766779
},
767780
}, nil)
@@ -944,6 +957,11 @@ func TestGetVPCInterfaceConfig(t *testing.T) {
944957
{
945958
SubnetID: 456,
946959
Label: "subnet-1",
960+
IPv6: []linodego.VPCIPv6Range{
961+
{
962+
Range: "2001:0db8::/56",
963+
},
964+
},
947965
},
948966
}
949967
return nil
@@ -1032,6 +1050,11 @@ func TestGetVPCInterfaceConfig(t *testing.T) {
10321050
{
10331051
SubnetID: 456,
10341052
Label: "subnet-1",
1053+
IPv6: []linodego.VPCIPv6Range{
1054+
{
1055+
Range: "2001:0db8::/56",
1056+
},
1057+
},
10351058
},
10361059
}
10371060
return nil

0 commit comments

Comments
 (0)