From 9095628ee3cf3cebe2954068eb9f8e8756b97ed4 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Fri, 28 May 2021 00:04:40 +0000 Subject: [PATCH] Add v2 VNet CRUD test --- .../controllers/crd_virtualnetwork_test.go | 58 ++ .../recordings/Test_VirtualNetwork_CRUD.yaml | 589 ++++++++++++++++++ hack/generated/pkg/testcommon/test_context.go | 2 +- hack/generator/azure-arm.yaml | 5 + 4 files changed, 653 insertions(+), 1 deletion(-) create mode 100644 hack/generated/controllers/crd_virtualnetwork_test.go create mode 100644 hack/generated/controllers/recordings/Test_VirtualNetwork_CRUD.yaml diff --git a/hack/generated/controllers/crd_virtualnetwork_test.go b/hack/generated/controllers/crd_virtualnetwork_test.go new file mode 100644 index 00000000000..51d6012c9d5 --- /dev/null +++ b/hack/generated/controllers/crd_virtualnetwork_test.go @@ -0,0 +1,58 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +package controllers_test + +import ( + "context" + "testing" + + . "github.com/onsi/gomega" + + network "github.com/Azure/azure-service-operator/hack/generated/_apis/microsoft.network/v1alpha1api20171001" + "github.com/Azure/azure-service-operator/hack/generated/pkg/testcommon" +) + +func Test_VirtualNetwork_CRUD(t *testing.T) { + t.Parallel() + + g := NewGomegaWithT(t) + ctx := context.Background() + testContext, err := testContext.ForTest(t) + g.Expect(err).ToNot(HaveOccurred()) + + rg, err := testContext.CreateNewTestResourceGroup(testcommon.WaitForCreation) + g.Expect(err).ToNot(HaveOccurred()) + + vn := &network.VirtualNetwork{ + ObjectMeta: testContext.MakeObjectMetaWithName(testContext.Namer.GenerateName("vn")), + Spec: network.VirtualNetworks_Spec{ + Owner: testcommon.AsOwner(rg.ObjectMeta), + Location: &testcommon.DefaultTestRegion, + Properties: network.VirtualNetworkPropertiesFormat{ + AddressSpace: &network.AddressSpace{ + AddressPrefixes: []string{"10.0.0.0/8"}, + }, + }, + }, + } + + // Create + g.Expect(testContext.KubeClient.Create(ctx, vn)).To(Succeed()) + g.Eventually(vn, remainingTime(t)).Should(testContext.Match.BeProvisioned(ctx)) + + g.Expect(vn.Status.Id).ToNot(BeNil()) + armId := *vn.Status.Id + + // Delete + g.Expect(testContext.KubeClient.Delete(ctx, vn)).To(Succeed()) + g.Eventually(vn, remainingTime(t)).Should(testContext.Match.BeDeleted(ctx)) + + // Ensure that the resource was really deleted in Azure + exists, retryAfter, err := testContext.AzureClient.HeadResource(ctx, armId, "2017-10-01") + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(retryAfter).To(BeZero()) + g.Expect(exists).To(BeFalse()) +} diff --git a/hack/generated/controllers/recordings/Test_VirtualNetwork_CRUD.yaml b/hack/generated/controllers/recordings/Test_VirtualNetwork_CRUD.yaml new file mode 100644 index 00000000000..0e5efc5e119 --- /dev/null +++ b/hack/generated/controllers/recordings/Test_VirtualNetwork_CRUD.yaml @@ -0,0 +1,589 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","location":"westus","Properties":{"Error":null,"debugSetting":{"detailLevel":"requestContent,responseContent"},"mode":"Incremental","template":{"$schema":"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#","contentVersion":"1.0.0.0","resources":[{"apiVersion":"2020-06-01","name":"asotest-rg-sbiboa","location":"westus","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"type":"Microsoft.Resources/resourceGroups"}],"outputs":{"resourceId":{"type":"string","value":"[resourceId(''Microsoft.Resources/resourceGroups'', + ''asotest-rg-sbiboa'')]"}}}}}' + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42?api-version=2019-10-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","name":"k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateHash":"926305044460170549","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Accepted","timestamp":"2001-02-03T04:05:06Z","duration":"PT3.088676S","correlationId":"524cc473-dad1-4566-a5b7-9b64f5a208ee","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42/operationStatuses/08585794467927010937?api-version=2019-10-01 + Cache-Control: + - no-cache + Content-Length: + - "688" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","name":"k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateHash":"926305044460170549","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Accepted","timestamp":"2001-02-03T04:05:06Z","duration":"PT3.088676S","correlationId":"524cc473-dad1-4566-a5b7-9b64f5a208ee","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "5" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","name":"k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42","type":"Microsoft.Resources/deployments","location":"westus","properties":{"templateHash":"926305044460170549","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Succeeded","timestamp":"2001-02-03T04:05:06Z","duration":"PT7.3494075S","correlationId":"524cc473-dad1-4566-a5b7-9b64f5a208ee","providers":[{"namespace":"Microsoft.Resources","resourceTypes":[{"resourceType":"resourceGroups","locations":["westus"]}]}],"dependencies":[],"outputs":{"resourceId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/resourceGroups/asotest-rg-sbiboa"}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa"}]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa","name":"asotest-rg-sbiboa","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deployments/k8s_872c0e5e-ab95-5d6d-ae7d-214a32f3ae42?api-version=2019-10-01 + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtLUs4Uzo1Rjg3MkMwRTVFOjJEQUI5NToyRDVENkQ6MkRBRTdEOjJEMjE0QTMyRjNBRTQyLSIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-10-01 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Deletes: + - "14999" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: '{"name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","Properties":{"Error":null,"debugSetting":{"detailLevel":"requestContent,responseContent"},"mode":"Incremental","template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","resources":[{"apiVersion":"2017-10-01","location":"westus","name":"asotest-vn-fhyuzx","properties":{"addressSpace":{"addressPrefixes":["10.0.0.0/8"]}},"type":"Microsoft.Network/virtualNetworks"}],"outputs":{"resourceId":{"type":"string","value":"[resourceId(''Microsoft.Network/virtualNetworks'', + ''asotest-vn-fhyuzx'')]"}}}}}' + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Accepted","timestamp":"2001-02-03T04:05:06Z","duration":"PT1.3791196S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646/operationStatuses/08585794467763890191?api-version=2019-10-01 + Cache-Control: + - no-cache + Content-Length: + - "702" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Accepted","timestamp":"2001-02-03T04:05:06Z","duration":"PT1.3791196S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "5" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Running","timestamp":"2001-02-03T04:05:06Z","duration":"PT2.3615877S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "5" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Running","timestamp":"2001-02-03T04:05:06Z","duration":"PT2.3615877S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "5" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Running","timestamp":"2001-02-03T04:05:06Z","duration":"PT2.3615877S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "5" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Running","timestamp":"2001-02-03T04:05:06Z","duration":"PT10.6582425S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "13" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646","name":"k8s_4bc0b700-92b9-539a-a027-3bb76588f646","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7641734148876281173","mode":"Incremental","debugSetting":{"detailLevel":"RequestContent, + ResponseContent"},"provisioningState":"Succeeded","timestamp":"2001-02-03T04:05:06Z","duration":"PT15.1724781S","correlationId":"1c5c92dc-7f6e-457c-a6ff-f0756ee9f5eb","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]}]}],"dependencies":[],"outputs":{"resourceId":{"type":"String","value":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx"}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx"}]}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx?api-version=2017-10-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-vn-fhyuzx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx\",\r\n + \ \"etag\": \"W/\\\"c98a42a1-33aa-494c-a341-07b6bc26c128\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"2c3d1533-18fb-4f65-bd6b-a8fa566cc1ed\",\r\n + \ \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/8\"\r\n + \ ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\": + [],\r\n \"enableDdosProtection\": false\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"c98a42a1-33aa-494c-a341-07b6bc26c128" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Arm-Service-Request-Id: + - 22aefd3a-ffbc-4065-821b-0cb0b625f899 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Resources/deployments/k8s_4bc0b700-92b9-539a-a027-3bb76588f646?api-version=2019-10-01 + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IkRlcGxveW1lbnREZWxldGlvbkpvYi1HTlMtQVNPVEVTVDoyRFJHOjJEU0JJQk9BLUs4Uzo1RjRCQzBCNzAwOjJEOTJCOToyRDUzOUE6MkRBMDI3OjJEM0JCNzY1ODhGNjQ2LSIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-10-01 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Deletes: + - "14998" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx?api-version=2017-10-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/100bd4ab-23f9-4b25-9faf-e263cfbc565e?api-version=2017-10-01 + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/100bd4ab-23f9-4b25-9faf-e263cfbc565e?api-version=2017-10-01 + Pragma: + - no-cache + Retry-After: + - "10" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Arm-Service-Request-Id: + - eed75c00-830c-46a4-ae67-afd6e67ebd73 + X-Ms-Ratelimit-Remaining-Subscription-Deletes: + - "14997" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx?api-version=2017-10-01 + method: GET + response: + body: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": + \"Resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx + not found.\",\r\n \"details\": []\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Length: + - "253" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Arm-Service-Request-Id: + - 6b2dc12f-8dd4-48b1-bbf1-c670044b46b6 + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Content-Type: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx?api-version=2017-10-01 + method: GET + response: + body: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": + \"Resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-sbiboa/providers/Microsoft.Network/virtualNetworks/asotest-vn-fhyuzx + not found.\",\r\n \"details\": []\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Length: + - "253" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Arm-Service-Request-Id: + - 98fee53e-3c90-4ee0-8ea1-422b08c018eb + status: 404 Not Found + code: 404 + duration: "" diff --git a/hack/generated/pkg/testcommon/test_context.go b/hack/generated/pkg/testcommon/test_context.go index 262fab6391c..9fda1b572bf 100644 --- a/hack/generated/pkg/testcommon/test_context.go +++ b/hack/generated/pkg/testcommon/test_context.go @@ -25,7 +25,7 @@ import ( "github.com/pkg/errors" ) -const ( +var ( DefaultTestRegion = "westus" // Could make this an env variable if we wanted ) diff --git a/hack/generator/azure-arm.yaml b/hack/generator/azure-arm.yaml index d9e1b51683b..ace152f8ff8 100644 --- a/hack/generator/azure-arm.yaml +++ b/hack/generator/azure-arm.yaml @@ -128,6 +128,11 @@ exportFilters: version: v*api20180101preview name: NamespacesTopic because: "including Service Bus topics" + - action: include-transitive + group: microsoft.network + version: v*api20171001 + name: VirtualNetwork* + because: "including all Virtual Network things" # Exclude everything else as we are operating on an opt-in basis at the moment: - action: exclude