Skip to content

Commit

Permalink
update import for converting to pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chandankumar4 committed Sep 26, 2023
1 parent 22ac8c8 commit 6f43cfb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 28 deletions.
9 changes: 4 additions & 5 deletions azure/services/bastionhosts/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
Expand All @@ -31,7 +30,7 @@ var (
fakeSKU = armnetwork.BastionHostSKUName("fake-SKU")
fakeBastionHost = armnetwork.BastionHost{
Location: &fakeAzureBastionSpec.Location,
Name: to.Ptr("my-bastion-host"),
Name: ptr.To("my-bastion-host"),
SKU: &armnetwork.SKU{Name: &fakeSKU},
}
fakeAzureBastionSpec1 = AzureBastionSpec{
Expand All @@ -45,9 +44,9 @@ var (
}

fakeBastionHostTags = map[string]*string{
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": to.Ptr("owned"),
"sigs.k8s.io_cluster-api-provider-azure_role": to.Ptr("Bastion"),
"Name": to.Ptr("my-bastion"),
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": ptr.To("owned"),
"sigs.k8s.io_cluster-api-provider-azure_role": ptr.To("Bastion"),
"Name": ptr.To("my-bastion"),
}
)

Expand Down
5 changes: 2 additions & 3 deletions azure/services/natgateways/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
Expand All @@ -46,8 +45,8 @@ var (
NatGatewayIP: infrav1.PublicIPSpec{Name: "pip-node-subnet"},
}
fakeNatGatewaysTags = map[string]*string{
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": to.Ptr("owned"),
"Name": to.Ptr("my-node-natgateway-1"),
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": ptr.To("owned"),
"Name": ptr.To("my-node-natgateway-1"),
}
)

Expand Down
7 changes: 3 additions & 4 deletions azure/services/roleassignments/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
)

var (
fakeRoleAssignment = armauthorization.RoleAssignment{
ID: to.Ptr("fake-id"),
Name: to.Ptr("fake-name"),
Type: to.Ptr("fake-type"),
ID: ptr.To("fake-id"),
Name: ptr.To("fake-name"),
Type: ptr.To("fake-type"),
}
fakeRoleAssignmentSpec = RoleAssignmentSpec{
PrincipalID: ptr.To("fake-principal-id"),
Expand Down
13 changes: 6 additions & 7 deletions azure/services/routetables/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
)

var (
fakeRouteTable = armnetwork.RouteTable{
ID: to.Ptr("fake-id"),
Location: to.Ptr("fake-location"),
Name: to.Ptr("fake-name"),
ID: ptr.To("fake-id"),
Location: ptr.To("fake-location"),
Name: ptr.To("fake-name"),
}
fakeRouteTableSpec = RouteTableSpec{
Name: "test-rt-1",
Expand All @@ -41,9 +40,9 @@ var (
},
}
fakeRouteTableTags = map[string]*string{
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": to.Ptr("owned"),
"foo": to.Ptr("bar"),
"Name": to.Ptr("test-rt-1"),
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": ptr.To("owned"),
"foo": ptr.To("bar"),
"Name": ptr.To("test-rt-1"),
}
)

Expand Down
9 changes: 4 additions & 5 deletions azure/services/virtualnetworks/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
Expand Down Expand Up @@ -71,10 +70,10 @@ var (
AdditionalTags: map[string]string{"foo": "bar"},
}
fakeVNetTags = map[string]*string{
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": to.Ptr("owned"),
"sigs.k8s.io_cluster-api-provider-azure_role": to.Ptr("common"),
"foo": to.Ptr("bar"),
"Name": to.Ptr("test-vnet"),
"sigs.k8s.io_cluster-api-provider-azure_cluster_cluster": ptr.To("owned"),
"sigs.k8s.io_cluster-api-provider-azure_role": ptr.To("common"),
"foo": ptr.To("bar"),
"Name": ptr.To("test-vnet"),
}
)

Expand Down
7 changes: 3 additions & 4 deletions azure/services/vnetpeerings/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
. "github.com/onsi/gomega"
"k8s.io/utils/ptr"
Expand All @@ -29,9 +28,9 @@ import (

var (
fakeVnetPeering = armnetwork.VirtualNetworkPeering{
ID: to.Ptr("fake-id"),
Name: to.Ptr("fake-name"),
Type: to.Ptr("fake-type"),
ID: ptr.To("fake-id"),
Name: ptr.To("fake-name"),
Type: ptr.To("fake-type"),
}
fakeVnetPeeringSpec = VnetPeeringSpec{
PeeringName: "hub-to-spoke",
Expand Down

0 comments on commit 6f43cfb

Please sign in to comment.