Skip to content

Commit

Permalink
Add HEAD method to generic_client (#3526)
Browse files Browse the repository at this point in the history
* Refactor existing method called Head, as it was using GET not HEAD.
  • Loading branch information
matthchr authored Nov 7, 2023
1 parent 0a2cf81 commit dfe220b
Show file tree
Hide file tree
Showing 74 changed files with 256 additions and 111 deletions.
5 changes: 3 additions & 2 deletions v2/internal/controllers/crd_aks_fleet_20230315preview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ package controllers_test
import (
"testing"

. "github.com/onsi/gomega"

aks "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230202preview"
fleet "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230315preview"
"github.com/Azure/azure-service-operator/v2/internal/testcommon"
"github.com/Azure/azure-service-operator/v2/internal/util/to"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
. "github.com/onsi/gomega"
)

func Test_AKS_Fleet_20230315_CRUD(t *testing.T) {
Expand Down Expand Up @@ -115,7 +116,7 @@ func Test_AKS_Fleet_20230315_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(flt)

// Ensure that fleet was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(fleet.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(fleet.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func Test_AKS_ManagedCluster_20210501_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(cluster)

// Ensure that the cluster was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(aks.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(aks.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func Test_AKS_ManagedCluster_20230202Preview_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(cluster)

// Ensure that the cluster was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(aks.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(aks.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Test_AppConfiguration_ConfigurationStore_CRUD(t *testing.T) {

tc.DeleteResourceAndWait(cs)

exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(appconfig.APIVersion_Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Test_Authorization_RoleAssignment_OnResourceGroup_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(roleAssignment)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(authorization.APIVersion_Value))
Expand Down Expand Up @@ -163,7 +163,7 @@ func Test_Authorization_RoleAssignment_OnStorageAccount_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(roleAssignment)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(authorization.APIVersion_Value))
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_batch_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func Test_Batch_Account_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(account)

// Ensure that the account was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(batch.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(batch.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_cache_redis_20201201_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func Test_Cache_Redis_20201201_CRUD(t *testing.T) {
tc.DeleteResourcesAndWait(redis1, redis2)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(cache.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(cache.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_cache_redis_20230401_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func Test_Cache_Redis_20230401_CRUD(t *testing.T) {
tc.DeleteResourcesAndWait(redis1, redis2)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(cache.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(cache.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Test_Cache_RedisEnterprise_20210301_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(&redis)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(cache.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(cache.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Test_Cache_RedisEnterprise_20230701_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(&redis)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(cache.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(cache.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_cdn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func Test_CDN_Profile_CRUD(t *testing.T) {
armId := *profile.Status.Id
tc.DeleteResourceAndWait(profile)

exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(cdn.APIVersion_Value))
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Test_Compute_Disk_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(disk)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(compute.APIVersion_Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func Test_Compute_DiskEncryptionSet_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(diskEncryptionSet)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(compute.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(compute.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_image_20210701_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func Test_Compute_Image_20210701_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(image)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, imageARMId, string(compute2021.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, imageARMId, string(compute2021.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_image_20220301_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func Test_Compute_Image_20220301_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(image)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, imageARMId, string(compute2022.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, imageARMId, string(compute2022.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func Test_Compute_Snapshot_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(snapshot)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(compute.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(compute.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_vm_20201201_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func Test_Compute_VM_20201201_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(vm)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(compute2020.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(compute2020.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_compute_vm_20220301_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func Test_Compute_VM_20220301_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(vm)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(compute2022.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(compute2022.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func Test_ContainerInstance_ContainerGroup_CRUD(t *testing.T) {
tc.DeleteResourcesAndWait(&cg)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(containerinstance.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(containerinstance.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
5 changes: 3 additions & 2 deletions v2/internal/controllers/crd_datafactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (

. "github.com/onsi/gomega"

v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

datafactory "github.com/Azure/azure-service-operator/v2/api/datafactory/v1api20180601"
"github.com/Azure/azure-service-operator/v2/internal/testcommon"
"github.com/Azure/azure-service-operator/v2/internal/util/to"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

func Test_Data_Factory_CRUD(t *testing.T) {
Expand Down Expand Up @@ -57,7 +58,7 @@ func Test_Data_Factory_CRUD(t *testing.T) {

tc.DeleteResourceAndWait(factory)
// Ensure that the data factory was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
factoryArmId,
string(datafactory.APIVersion_Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func Test_Dataprotection_Backuppolicy_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(backupPolicy)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(dataprotection.APIVersion_Value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Test_Dataprotection_Backupvault_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(backupVault)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(dataprotection.APIVersion_Value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func Test_DBForMySQL_FlexibleServer_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(flexibleServer)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(mysql.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(mysql.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func Test_DBForPostgreSQL_FlexibleServer_20210601_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(flexibleServer)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(ctx, armId, string(postgresql.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(ctx, armId, string(postgresql.APIVersion_Value))
g.Expect(err).ToNot(HaveOccurred())
g.Expect(retryAfter).To(BeZero())
g.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func Test_DBForPostgreSQL_FlexibleServer_20220120preview_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(flexibleServer)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(ctx, armId, string(postgresql.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(ctx, armId, string(postgresql.APIVersion_Value))
g.Expect(err).ToNot(HaveOccurred())
g.Expect(retryAfter).To(BeZero())
g.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_devices_iothub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Test_Devices_IotHub_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(iothub)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(devices.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(devices.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_eventgrid_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func Test_EventGrid_Domain(t *testing.T) {
tc.DeleteResourceAndWait(domain)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(eventgrid.APIVersion_Value))
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_eventgrid_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Test_EventGrid_Topic(t *testing.T) {
tc.DeleteResourceAndWait(topic)

// Ensure that the resource group was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(eventgrid.APIVersion_Value))
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_insights_actiongroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Test_Insights_ActionGroup_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(actionGroup)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(insights.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(insights.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func Test_Insights_Autoscalesetting_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(setting)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(insights.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(insights.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
6 changes: 3 additions & 3 deletions v2/internal/controllers/crd_insights_component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Test_Insights_Component_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(component)

// Ensure that the resource was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(insights.APIVersion_Value))
Expand Down Expand Up @@ -115,7 +115,7 @@ func Insights_WebTest_CRUD(tc *testcommon.KubePerTestContext, rg *resources.Reso
tc.DeleteResourceAndWait(webtest)

// Ensure that the resource was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(insightswebtest.APIVersion_Value))
Expand Down Expand Up @@ -155,7 +155,7 @@ func Test_Insights_Component_ExportConfigMap(t *testing.T) {
tc.DeleteResourceAndWait(component)

// Ensure that the resource was really deleted in Azure
exists, _, err := tc.AzureClient.HeadByID(
exists, _, err := tc.AzureClient.CheckExistenceWithGetByID(
tc.Ctx,
armId,
string(insights.APIVersion_Value))
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_insights_metricalert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func Test_Insights_MetricAlert_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(alert)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(insights.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(insights.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Test_Insights_ScheduledQueryRule_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(rule)

// Ensure delete
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(insights.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(insights.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func Test_ManagedIdentity_UserAssignedIdentity_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(mi)

// Ensure that the resource group was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(managedidentity2018.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(managedidentity2018.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down Expand Up @@ -108,7 +108,7 @@ func FederatedIdentityCredentials_CRUD(tc *testcommon.KubePerTestContext, umi *m
tc.DeleteResourceAndWait(fic)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(managedidentity2022.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(managedidentity2022.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func Test_Networking_ApplicationGateway_CRUD(t *testing.T) {
armId := *applicationGateway.Status.Id
tc.DeleteResourcesAndWait(applicationGateway, publicIPAddress, subnet, vnet)
// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armId, string(network.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(network.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/controllers/crd_networking_bastionhost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Test_Networking_BastionHost_CRUD(t *testing.T) {
tc.DeleteResourceAndWait(publicIPAddress)

// Ensure that the resource was really deleted in Azure
exists, retryAfter, err := tc.AzureClient.HeadByID(tc.Ctx, armID, string(network.APIVersion_Value))
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armID, string(network.APIVersion_Value))
tc.Expect(err).ToNot(HaveOccurred())
tc.Expect(retryAfter).To(BeZero())
tc.Expect(exists).To(BeFalse())
Expand Down
Loading

0 comments on commit dfe220b

Please sign in to comment.