Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"k8s.io/client-go/tools/clientcmd"
cloudprovider "k8s.io/cloud-provider"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/linode/linode-cloud-controller-manager/cloud/annotations"
"github.com/linode/linode-cloud-controller-manager/cloud/linode/client"
Expand Down Expand Up @@ -1506,7 +1505,7 @@ func makeLoadBalancerStatus(service *v1.Service, nb *linodego.NodeBalancer) *v1.
if useHostnameOnly == nil {
val := envBoolOptions("LINODE_HOSTNAME_ONLY_INGRESS")
klog.Infof("LINODE_HOSTNAME_ONLY_INGRESS: (%v)", val)
useHostnameOnly = ptr.To(envBoolOptions("LINODE_HOSTNAME_ONLY_INGRESS"))
useHostnameOnly = new(envBoolOptions("LINODE_HOSTNAME_ONLY_INGRESS"))
}
if *useHostnameOnly {
return &v1.LoadBalancerStatus{
Expand All @@ -1521,7 +1520,7 @@ func makeLoadBalancerStatus(service *v1.Service, nb *linodego.NodeBalancer) *v1.
// Check for per-service IPv6 annotation first, then fall back to global setting if not set
useIPv6 := getServiceBoolAnnotation(service, annotations.AnnLinodeEnableIPv6Ingress)
if useIPv6 == nil {
useIPv6 = ptr.To(options.Options.EnableIPv6ForLoadBalancers)
useIPv6 = new(options.Options.EnableIPv6ForLoadBalancers)
}

// When IPv6 is enabled (either per-service or globally), include both IPv4 and IPv6
Expand Down Expand Up @@ -1569,7 +1568,7 @@ func getServiceBoolAnnotation(service *v1.Service, name string) *bool {
return nil
}
boolValue, err := strconv.ParseBool(value)
return ptr.To(err == nil && boolValue)
return new(err == nil && boolValue)
}

// validateNodeBalancerBackendIPv4Range validates the NodeBalancerBackendIPv4Range
Expand Down
5 changes: 2 additions & 3 deletions cloud/linode/route_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
cloudprovider "k8s.io/cloud-provider"
"k8s.io/utils/ptr"

linodeClient "github.com/linode/linode-cloud-controller-manager/cloud/linode/client"
"github.com/linode/linode-cloud-controller-manager/cloud/linode/client/mocks"
Expand Down Expand Up @@ -362,7 +361,7 @@ func TestCreateRoute(t *testing.T) {
}

instanceConfigIntfWithVPCAndRoute := linodego.InstanceConfigInterface{
VPCID: ptr.To(services.VpcIDs["dummy"]),
VPCID: new(services.VpcIDs["dummy"]),
IPv4: &linodego.VPCIPv4{VPC: vpcIP},
IPRanges: []string{"10.10.10.0/24"},
}
Expand Down Expand Up @@ -564,7 +563,7 @@ func TestDeleteRoute(t *testing.T) {
}

instanceConfigIntfWithVPCAndNoRoute := linodego.InstanceConfigInterface{
VPCID: ptr.To(services.VpcIDs["dummy"]),
VPCID: new(services.VpcIDs["dummy"]),
IPv4: &linodego.VPCIPv4{VPC: vpcIP},
IPRanges: []string{},
}
Expand Down
5 changes: 2 additions & 3 deletions cloud/nodeipam/ipam/cloud_allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"k8s.io/kubernetes/pkg/controller/testutil"
"k8s.io/kubernetes/test/utils/ktesting"
netutils "k8s.io/utils/net"
"k8s.io/utils/ptr"

"github.com/linode/linode-cloud-controller-manager/cloud/linode/client/mocks"
"github.com/linode/linode-cloud-controller-manager/cloud/linode/options"
Expand Down Expand Up @@ -839,7 +838,7 @@ func TestAllocateOrOccupyCIDRSuccess(t *testing.T) {
{
Interfaces: []linodego.InstanceConfigInterface{
{
VPCID: ptr.To(12345),
VPCID: new(12345),
Purpose: linodego.InterfacePurposeVPC,
IPv6: &linodego.InstanceConfigInterfaceIPv6{
Ranges: []linodego.InstanceConfigInterfaceIPv6Range{
Expand Down Expand Up @@ -1265,7 +1264,7 @@ func TestReleaseCIDRSuccess(t *testing.T) {
{
Interfaces: []linodego.InstanceConfigInterface{
{
VPCID: ptr.To(12345),
VPCID: new(12345),
Purpose: linodego.InterfacePurposeVPC,
IPv6: &linodego.InstanceConfigInterfaceIPv6{
Ranges: []linodego.InstanceConfigInterfaceIPv6Range{
Expand Down
Loading