From 0ba5aee9bc1b2065a1a4fb1966aa6c3d4815a09e Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:14:34 +0530 Subject: [PATCH 1/6] Loosen up Owner-Child resource subscription checks --- v2/internal/resolver/resource_hierarchy.go | 29 ------------------- .../resolver/resource_hierarchy_test.go | 4 +-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/v2/internal/resolver/resource_hierarchy.go b/v2/internal/resolver/resource_hierarchy.go index 5baac2d134c..194c786592b 100644 --- a/v2/internal/resolver/resource_hierarchy.go +++ b/v2/internal/resolver/resource_hierarchy.go @@ -14,7 +14,6 @@ import ( "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" ) type ResourceHierarchyRoot string @@ -144,24 +143,6 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin return "", err } - root := h[0] - - err = genruntime.VerifyResourceOwnerARMID(root) - if err != nil { - return "", err - } - - // Safe to do it this way, Claimer makes sure the owner exists and is Ready and will always have an armId annotation before we reach here. - ownerARMID, err := genruntime.GetAndParseResourceID(root) - if err != nil { - return "", err - } - - // Confirm that the subscription ID the user specified matches the subscription ID we're using from our credential - if ok := genruntime.CheckARMIDMatchesSubscription(subscriptionID, ownerARMID); !ok { - return "", core.NewSubscriptionMismatchError(ownerARMID.SubscriptionID, subscriptionID) - } - // Ensure that we have the same number of names and types if len(remainingNames) != len(resourceTypes) { return "", errors.Errorf( @@ -218,16 +199,6 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin return "", err } - ownerARMID, err := arm.ParseResourceID(armIDStr) - if err != nil { - return "", err - } - - // Confirm that the subscription ID the user specified matches the subscription ID we're using from our credential - if ok := genruntime.CheckARMIDMatchesSubscription(subscriptionID, ownerARMID); !ok { - return "", core.NewSubscriptionMismatchError(ownerARMID.SubscriptionID, subscriptionID) - } - // Rooting to an ARM ID means that some of the resourceTypes may not actually be included explicitly in our // hierarchy (because they're instead in the ARM ID itself). We filter these out of resourceTypes by // removing types that aren't included in the hierarchy. diff --git a/v2/internal/resolver/resource_hierarchy_test.go b/v2/internal/resolver/resource_hierarchy_test.go index 0cfe838de89..c4255aaec02 100644 --- a/v2/internal/resolver/resource_hierarchy_test.go +++ b/v2/internal/resolver/resource_hierarchy_test.go @@ -102,7 +102,7 @@ func Test_ResourceHierarchy_ResourceGroup_NestedResource(t *testing.T) { g.Expect(hierarchy.FullyQualifiedARMID("00000000-0000-0000-0000-000000000000")).To(Equal(expectedARMID)) } -func Test_ResourceHierarchy_ResourceGroup_NestedResource_MatchSubscriptionWithOwner(t *testing.T) { +func Test_ResourceHierarchy_ResourceGroup_NestedResource_CanBeInDistinctSubscriptions(t *testing.T) { t.Parallel() g := NewGomegaWithT(t) @@ -114,7 +114,7 @@ func Test_ResourceHierarchy_ResourceGroup_NestedResource_MatchSubscriptionWithOw uuid := uuid.New().String() _, err := hierarchy.FullyQualifiedARMID(uuid) - g.Expect(err).To(MatchError(fmt.Sprintf("resource subscription \"%s\" does not match parent subscription \"00000000-0000-0000-0000-000000000000\"", uuid))) + g.Expect(err).To(BeNil()) } func Test_ResourceHierarchy_ExtensionOnResourceGroup(t *testing.T) { From 281820bb84d7e49aa18428660aaf909c83a2472f Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:07:14 +0530 Subject: [PATCH 2/6] Update test cases --- v2/internal/resolver/resource_hierarchy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/internal/resolver/resource_hierarchy_test.go b/v2/internal/resolver/resource_hierarchy_test.go index c4255aaec02..6d6d63b20d6 100644 --- a/v2/internal/resolver/resource_hierarchy_test.go +++ b/v2/internal/resolver/resource_hierarchy_test.go @@ -297,7 +297,7 @@ func Test_ResourceHierarchy_OwnerARMIDAnotherWrongType_ReturnsError(t *testing.T g.Expect(err).To(MatchError("expected owner ARM ID to be for a resource group, but was \"Microsoft.Storage/cats\"")) } -func Test_ResourceHierarchy_OwnerARMIDWrongSubscription_ReturnsError(t *testing.T) { +func Test_ResourceHierarchy_OwnerARMIDDistinctSubscription_ReturnsSuccess(t *testing.T) { t.Parallel() g := NewGomegaWithT(t) @@ -310,7 +310,7 @@ func Test_ResourceHierarchy_OwnerARMIDWrongSubscription_ReturnsError(t *testing. hierarchy := resolver.ResourceHierarchy{resource} _, err := hierarchy.FullyQualifiedARMID("00000000-0000-0000-0000-000000000000") - g.Expect(err).To(MatchError(fmt.Sprintf("resource subscription \"00000000-0000-0000-0000-000000000000\" does not match parent subscription \"%s\"", uuid))) + g.Expect(err).To(BeNil()) } func Test_ResourceHierarchy_OwnerARMIDWithExtension(t *testing.T) { From 782c1797ce74a7e44c5c50d6c563ac0f786b2cb8 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:20:12 +0530 Subject: [PATCH 3/6] Add back the nestedResource check --- v2/internal/resolver/resource_hierarchy.go | 19 +++++++++++++++++++ .../resolver/resource_hierarchy_test.go | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/v2/internal/resolver/resource_hierarchy.go b/v2/internal/resolver/resource_hierarchy.go index 194c786592b..886b57e8c39 100644 --- a/v2/internal/resolver/resource_hierarchy.go +++ b/v2/internal/resolver/resource_hierarchy.go @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" ) type ResourceHierarchyRoot string @@ -143,6 +144,24 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin return "", err } + root := h[0] + + err = genruntime.VerifyResourceOwnerARMID(root) + if err != nil { + return "", err + } + + // Safe to do it this way, Claimer makes sure the owner exists and is Ready and will always have an armId annotation before we reach here. + ownerARMID, err := genruntime.GetAndParseResourceID(root) + if err != nil { + return "", err + } + + // Confirm that the subscription ID the user specified matches the subscription ID we're using from our credential + if ok := genruntime.CheckARMIDMatchesSubscription(subscriptionID, ownerARMID); !ok { + return "", core.NewSubscriptionMismatchError(ownerARMID.SubscriptionID, subscriptionID) + } + // Ensure that we have the same number of names and types if len(remainingNames) != len(resourceTypes) { return "", errors.Errorf( diff --git a/v2/internal/resolver/resource_hierarchy_test.go b/v2/internal/resolver/resource_hierarchy_test.go index 6d6d63b20d6..c9fb505c348 100644 --- a/v2/internal/resolver/resource_hierarchy_test.go +++ b/v2/internal/resolver/resource_hierarchy_test.go @@ -102,7 +102,7 @@ func Test_ResourceHierarchy_ResourceGroup_NestedResource(t *testing.T) { g.Expect(hierarchy.FullyQualifiedARMID("00000000-0000-0000-0000-000000000000")).To(Equal(expectedARMID)) } -func Test_ResourceHierarchy_ResourceGroup_NestedResource_CanBeInDistinctSubscriptions(t *testing.T) { +func Test_ResourceHierarchy_ResourceGroup_NestedResource_MatchSubscriptionWithOwner(t *testing.T) { t.Parallel() g := NewGomegaWithT(t) @@ -114,7 +114,7 @@ func Test_ResourceHierarchy_ResourceGroup_NestedResource_CanBeInDistinctSubscrip uuid := uuid.New().String() _, err := hierarchy.FullyQualifiedARMID(uuid) - g.Expect(err).To(BeNil()) + g.Expect(err).To(MatchError(fmt.Sprintf("resource subscription \"%s\" does not match parent subscription \"00000000-0000-0000-0000-000000000000\"", uuid))) } func Test_ResourceHierarchy_ExtensionOnResourceGroup(t *testing.T) { From 40f3263bebbabcd43b53302bc0cf75e4dd0058af Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:19:51 +0530 Subject: [PATCH 4/6] modify test to use kuberef --- .../controllers/owner_arm_id_negative_test.go | 5 +- ...omDifferentSubscription_ResourceFails.yaml | 141 ------------ ...omDifferentSubscription_ResourceFails.yaml | 217 ++++++++++++++++++ 3 files changed, 218 insertions(+), 145 deletions(-) delete mode 100644 v2/internal/controllers/recordings/Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails.yaml create mode 100644 v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml diff --git a/v2/internal/controllers/owner_arm_id_negative_test.go b/v2/internal/controllers/owner_arm_id_negative_test.go index d0c128516d5..889d82ccca1 100644 --- a/v2/internal/controllers/owner_arm_id_negative_test.go +++ b/v2/internal/controllers/owner_arm_id_negative_test.go @@ -53,7 +53,7 @@ func Test_OwnerIsARMIDOfWrongType_Rejected(t *testing.T) { tc.Expect(err).To(MatchError(ContainSubstring("expected owner ARM ID to be for a resource group, but was \"Microsoft.Compute/virtualMachines\""))) } -func Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails(t *testing.T) { +func Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails(t *testing.T) { t.Parallel() tc := globalTestContext.ForTest(t) @@ -63,15 +63,12 @@ func Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails(t *testing.T) { // Create a resource group rg := tc.CreateTestResourceGroupAndWait() - // Get the rg's ARM ID tc.Expect(rg.Status.Id).ToNot(BeNil()) - armID := *rg.Status.Id scopedCredentialName := "other-subscription-secret" // Now create a storage account acct := newStorageAccount20230101(tc, rg) - acct.Spec.Owner = testcommon.AsARMIDOwner(armID) acct.Annotations = map[string]string{annotations.PerResourceSecret: scopedCredentialName} uuid, err := tc.Namer.GenerateUUID() diff --git a/v2/internal/controllers/recordings/Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails.yaml b/v2/internal/controllers/recordings/Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails.yaml deleted file mode 100644 index 099704dd859..00000000000 --- a/v2/internal/controllers/recordings/Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails.yaml +++ /dev/null @@ -1,141 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"location":"westus2","name":"asotest-rg-fnsbef","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "93" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-fnsbef?api-version=2020-06-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-fnsbef","name":"asotest-rg-fnsbef","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "276" - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Cache: - - CONFIG_NOCACHE - X-Content-Type-Options: - - nosniff - X-Msedge-Ref: - - 'Ref A: F66590153E6C4156ABB9D5376ABFF5F9 Ref B: CO6AA3150219019 Ref C: 2023-11-28T18:50:12Z' - status: 201 Created - code: 201 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-fnsbef?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-fnsbef","name":"asotest-rg-fnsbef","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "276" - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Cache: - - CONFIG_NOCACHE - X-Content-Type-Options: - - nosniff - X-Msedge-Ref: - - 'Ref A: A534FC6B9B69441793F7DC00A9D9B0BD Ref B: CO6AA3150219019 Ref C: 2023-11-28T18:50:12Z' - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-fnsbef?api-version=2020-06-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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRGTlNCRUYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638367942203763579&c=MIIHHjCCBgagAwIBAgITfwI8ooo2761TEgO3SgAEAjyiijANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjMxMTAxMTc1NTI2WhcNMjQxMDI2MTc1NTI2WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0WQLjgbZj70uXwL_AnKvEas1GVvOB7Og4giEY7H0L78RFiY2-CzzgMKyZV8H3ACZxqQoBMWsq9XAf4iUNAer7s23VPyWkoVdr2uTc8SCvur4qja77OTMKiRVU277ViRu_Mb-fJvQKeRO3Q8A4Sg1A63a2VQ_WlyOCHPBj-gUF0zU4SYnlqSYGcNmuhCjtHpVvF_N3CGz0JlGTo3ia0wmks2y95IHeD0lcr0AgP73_eafbKafZn4Z56GdC3lngKdhyEiQi_kPyxaydv1PfV2xX9OLKvB19e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Wg6iltlHcohZUg&h=2j1CsrYkbV1eLlhUIr2pm0Io1APKkgq1SKb4H3klgL4 - Pragma: - - no-cache - Retry-After: - - "15" - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Cache: - - CONFIG_NOCACHE - X-Content-Type-Options: - - nosniff - X-Msedge-Ref: - - 'Ref A: 6227CAB3FCC142779A7334ACF0461656 Ref B: CO6AA3150219019 Ref C: 2023-11-28T18:50:20Z' - status: 202 Accepted - code: 202 - duration: "" -- request: - body: "" - form: {} - headers: - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRGTlNCRUYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638367942203763579&c=MIIHHjCCBgagAwIBAgITfwI8ooo2761TEgO3SgAEAjyiijANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjMxMTAxMTc1NTI2WhcNMjQxMDI2MTc1NTI2WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0WQLjgbZj70uXwL_AnKvEas1GVvOB7Og4giEY7H0L78RFiY2-CzzgMKyZV8H3ACZxqQoBMWsq9XAf4iUNAer7s23VPyWkoVdr2uTc8SCvur4qja77OTMKiRVU277ViRu_Mb-fJvQKeRO3Q8A4Sg1A63a2VQ_WlyOCHPBj-gUF0zU4SYnlqSYGcNmuhCjtHpVvF_N3CGz0JlGTo3ia0wmks2y95IHeD0lcr0AgP73_eafbKafZn4Z56GdC3lng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KQXpRnv7Y5jF22lTMjjDES8fc93Y2_BrWg6iltlHcohZUg&h=2j1CsrYkbV1eLlhUIr2pm0Io1APKkgq1SKb4H3klgL4 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Cache: - - CONFIG_NOCACHE - X-Content-Type-Options: - - nosniff - X-Msedge-Ref: - - 'Ref A: 37B21FF8379342419052B4B6D7214CBB Ref B: CO6AA3150219019 Ref C: 2023-11-28T18:50:35Z' - status: 200 OK - code: 200 - duration: "" diff --git a/v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml b/v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml new file mode 100644 index 00000000000..a8217d29f1e --- /dev/null +++ b/v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml @@ -0,0 +1,217 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-ommdsa","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Hash: + - 117a9f6531c7573039fa423a7f9ffa3842b4cb226ebfa970fbb87f86defbc33a + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa","name":"asotest-rg-ommdsa","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 360152F229514C76B53E654EB21FF161 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:00Z' + status: 201 Created + code: 201 + duration: 1.882480333s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa","name":"asotest-rg-ommdsa","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 5ACB3CBB80214A49A61915C69B3D37C1 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:03Z' + status: 200 OK + code: 200 + duration: 465.662833ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPTU1EU0EtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638657551352983786&c=MIIHhzCCBm-gAwIBAgITHgVsohlR2527oAb3YwAABWyiGTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwOTIyMTIzNzU1WhcNMjUwMzIxMTIzNzU1WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMhrLEJmsmtpzYzyjkwosX72drFxelF_0kAmuW7jzqQUwb3Vbkmt3AMdawBA7iPG-j-_iaEVRdn5iaEuJE6hSge15_CbeDkRt-qHgospNLcjh6GjynbLyFCQH_IkKY4Mc0yIlKxilQSCf2V6ah2w7S1CyC5zwZroBYavu5w0ZL02jRKMTNVzB03DnGh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CJXUHbC-1G0JOu1YeOtv7vfVQ75fMnB3MJlQY-sBt3dzdJ2kW5zE4Sp6TcjA3sjB4kaQFjcOVXPqKGv9rB_CY9Gic1IG2wppqdU6Wk3AQTB9NGWsGI1EtDwno8Wgr1d6sFddcF8CS-oGPL4-LdKUewqAjVWB4f1i7hi-_H-NUSFxX7xPBtKwY1z21DE7-ah0T2Gdr0FMZw_kxEDpWtiGWMIwFNSSW90S0nQb-NlKwS87Va-4175UP0_IAeilmH7psxfxBxXnb2spg&h=VBKbGrDOiNHHR2ULs1XGezb0mbBlDA2XgMM_OQlu1fk + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 65299501264E4581ACEA4F068577B7B0 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:11Z' + status: 202 Accepted + code: 202 + duration: 3.968154667s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPTU1EU0EtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638657551352983786&c=MIIHhzCCBm-gAwIBAgITHgVsohlR2527oAb3YwAABWyiGTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwOTIyMTIzNzU1WhcNMjUwM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AzYVOwolJBj3EcX1bxxIqeEgLvHNmYOr4D5MZFv14TGMHziu0TzPAbbVe9-DmMbrqs1mszrnuUiHTsmKE2oNmv4gjZMYSJAdsUzkjxQEa8t1t7FUEvbDkWkYSdqK0-OoTDVLsRVwRNk9XJ04coDgWql1-iv6bYNXyhC0L_-bdTOs_Gnzu-tFEA2we7Zkew_fhDuJwGTDnhaqvhush0SPJuFmoYBvmEzEJsc_Bjay2DrOHiLTopNoBJVrt8&s=AhDCr_EKIpXDthIOjl6R0DiG66nUnH4JbLpRYjHKwzC9l37gjjttQyHUFBIz8FuAYfCvUGt5RCJXUHbC-1G0JOu1YeOtv7vfVQ75fMnB3MJlQY-sBt3dzdJ2kW5zE4Sp6TcjA3sjB4kaQFjcOVXPqKGv9rB_CY9Gic1IG2wppqdU6Wk3AQTB9NGWsGI1EtDwno8Wgr1d6sFddcF8CS-oGPL4-LdKUewqAjVWB4f1i7hi-_H-NUSFxX7xPBtKwY1z21DE7-ah0T2Gdr0FMZw_kxEDpWtiGWMIwFNSSW90S0nQb-NlKwS87Va-4175UP0_IAeilmH7psxfxBxXnb2spg&h=VBKbGrDOiNHHR2ULs1XGezb0mbBlDA2XgMM_OQlu1fk + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: A9C2B7951EEA49D295A49502A235739A Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:34Z' + status: 200 OK + code: 200 + duration: 1.2401495s From fd4c12ec3e13c27d7106fe84b012fbe1d4f7aa30 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:27:38 +0530 Subject: [PATCH 5/6] update test name; add comment --- .../controllers/owner_arm_id_negative_test.go | 2 +- ...mDifferentSubscription_ResourceFails.yaml} | 34 +++++++++---------- v2/internal/resolver/resource_hierarchy.go | 6 +++- 3 files changed, 23 insertions(+), 19 deletions(-) rename v2/internal/controllers/recordings/{Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml => Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails.yaml} (53%) diff --git a/v2/internal/controllers/owner_arm_id_negative_test.go b/v2/internal/controllers/owner_arm_id_negative_test.go index 889d82ccca1..6db711ef383 100644 --- a/v2/internal/controllers/owner_arm_id_negative_test.go +++ b/v2/internal/controllers/owner_arm_id_negative_test.go @@ -53,7 +53,7 @@ func Test_OwnerIsARMIDOfWrongType_Rejected(t *testing.T) { tc.Expect(err).To(MatchError(ContainSubstring("expected owner ARM ID to be for a resource group, but was \"Microsoft.Compute/virtualMachines\""))) } -func Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails(t *testing.T) { +func Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails(t *testing.T) { t.Parallel() tc := globalTestContext.ForTest(t) diff --git a/v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml b/v2/internal/controllers/recordings/Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails.yaml similarity index 53% rename from v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml rename to v2/internal/controllers/recordings/Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails.yaml index a8217d29f1e..2d29c89fe72 100644 --- a/v2/internal/controllers/recordings/Test_OwnerIsNotARMIDFromDifferentSubscription_ResourceFails.yaml +++ b/v2/internal/controllers/recordings/Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails.yaml @@ -12,7 +12,7 @@ interactions: host: management.azure.com remote_addr: "" request_uri: "" - body: '{"location":"westus2","name":"asotest-rg-ommdsa","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + body: '{"location":"westus2","name":"asotest-rg-vdvrrk","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' form: {} headers: Accept: @@ -22,8 +22,8 @@ interactions: Content-Type: - application/json Test-Request-Hash: - - 117a9f6531c7573039fa423a7f9ffa3842b4cb226ebfa970fbb87f86defbc33a - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + - 9a1044574c8f78993b0b5be66632cc688c41157fb3b387b2b5e459bb1b0b9cb3 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vdvrrk?api-version=2020-06-01 method: PUT response: proto: HTTP/2.0 @@ -33,7 +33,7 @@ interactions: trailer: {} content_length: 276 uncompressed: false - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa","name":"asotest-rg-ommdsa","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vdvrrk","name":"asotest-rg-vdvrrk","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -54,10 +54,10 @@ interactions: X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: - "11999" X-Msedge-Ref: - - 'Ref A: 360152F229514C76B53E654EB21FF161 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:00Z' + - 'Ref A: EACE5B4C0BB0478B9224CD69D2D7431F Ref B: MAA201060516051 Ref C: 2024-10-30T10:34:49Z' status: 201 Created code: 201 - duration: 1.882480333s + duration: 2.602743541s - id: 1 request: proto: HTTP/1.1 @@ -76,7 +76,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vdvrrk?api-version=2020-06-01 method: GET response: proto: HTTP/2.0 @@ -86,7 +86,7 @@ interactions: trailer: {} content_length: 276 uncompressed: false - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa","name":"asotest-rg-ommdsa","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vdvrrk","name":"asotest-rg-vdvrrk","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -107,10 +107,10 @@ interactions: X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: - "16499" X-Msedge-Ref: - - 'Ref A: 5ACB3CBB80214A49A61915C69B3D37C1 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:03Z' + - 'Ref A: D4E12344EEA54293A23F649CB810DEC8 Ref B: MAA201060516051 Ref C: 2024-10-30T10:34:54Z' status: 200 OK code: 200 - duration: 465.662833ms + duration: 270.022ms - id: 2 request: proto: HTTP/1.1 @@ -129,7 +129,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ommdsa?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vdvrrk?api-version=2020-06-01 method: DELETE response: proto: HTTP/2.0 @@ -148,7 +148,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPTU1EU0EtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638657551352983786&c=MIIHhzCCBm-gAwIBAgITHgVsohlR2527oAb3YwAABWyiGTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwOTIyMTIzNzU1WhcNMjUwMzIxMTIzNzU1WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMhrLEJmsmtpzYzyjkwosX72drFxelF_0kAmuW7jzqQUwb3Vbkmt3AMdawBA7iPG-j-_iaEVRdn5iaEuJE6hSge15_CbeDkRt-qHgospNLcjh6GjynbLyFCQH_IkKY4Mc0yIlKxilQSCf2V6ah2w7S1CyC5zwZroBYavu5w0ZL02jRKMTNVzB03DnGhQGJ7gJbtKJ9AbjVcFwFTpT0Z0Yo-sLpwoVvADWng0JznFSekROEXCF_U3gHMssCctipkbrivaRFNKL3OjHjvuPxD8gsBo2BR_swq3Eyj-68_1B2-zYVD0d811pP8URR-43YYAMXO2Us1Uw6dn-b351XnW8JECAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChld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IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAUCr0q5wDvmcQmw5la8KMFO7bmmYkEp0jdFoaVgTEKWWk_VmL05UBKDAZNZ1Tect9BahkSSPDLo4PiHocbvdJN0bZ91V_GN9LHUKdy8-oXa6ai_B8HLcUhvpHXnmW8opONEs6mzT0wc1DFAglsuujyzZSFqif-9ARhhAlepT0oH4PAr96rZ0fPR6vkMTKAmprNFJQZbSgiz44FcxGBEctsuaEUxAp_AwQYTICmJQAQPbuoB3tZdUFJXogQBY47e7ZeTDWJ5GiWHKp2xbyASebOD4XFr6SpdmHmwddtWFB3zlcnLZnA32HeK6NpHRe6nMRkzBs1vxE6CdzR8HAcLEOE&s=vPcOGZWyeILq_ZL2va1AlyMMF8GvKPgGohvhermcK6rSWf4Ky2XR-mmJl5IqcW1dvIWfTOqDHfhPmrUjgKNS88ciZ-sVFKm6BvTon4cZzzXzfkd4dL4w9265iMkmcCM1bajuHQaNu07QHOQJe1uZf8P-kgPBVtGz6t6FSFN2LMnDg8gymtyf2yimr9CV_p0R-CD4k7RW5E-B2TNWz8zOQQ-pwFzim_HwGwH9RPdKn92llJXqI0bAfuWBEeFE1VCMln-tw_bnOvzU-bJ7aMgcKM80OVjEI4FVRvQLOPYsnyEQzwlSX7qTJKagx-vxETibl1hyOItxeqxjZB_iMc3c-A&h=_U_gEv3_WhrTJNTLjGnqMKR2VqFeWYORJdonHyXFv9U Pragma: - no-cache Retry-After: @@ -162,10 +162,10 @@ interactions: X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: - "11999" X-Msedge-Ref: - - 'Ref A: 65299501264E4581ACEA4F068577B7B0 Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:11Z' + - 'Ref A: 907421129EE5498DBBEDF7CBE5B0A17F Ref B: MAA201060516051 Ref C: 2024-10-30T10:35:02Z' status: 202 Accepted code: 202 - duration: 3.968154667s + duration: 2.827165584s - id: 3 request: proto: HTTP/1.1 @@ -182,7 +182,7 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPTU1EU0EtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638657551352983786&c=MIIHhzCCBm-gAwIBAgITHgVsohlR2527oAb3YwAABWyiGTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwOTIyMTIzNzU1WhcNMjUwMzIxMTIzNzU1WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMhrLEJmsmtpzYzyjkwosX72drFxelF_0kAmuW7jzqQUwb3Vbkmt3AMdawBA7iPG-j-_iaEVRdn5iaEuJE6hSge15_CbeDkRt-qHgospNLcjh6GjynbLyFCQH_IkKY4Mc0yIlKxilQSCf2V6ah2w7S1CyC5zwZroBYavu5w0ZL02jRKMTNVzB03DnGhQGJ7gJbtKJ9AbjVcFwFTpT0Z0Yo-sLpwoVvADWng0JznFSekROEXCF_U3gHMssCctipkbrivaRFNKL3OjHjvuPxD8gsBo2BR_swq3Eyj-68_1B2-zYVD0d811pP8URR-43YYAMXO2Us1Uw6dn-b351XnW8J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-LdKUewqAjVWB4f1i7hi-_H-NUSFxX7xPBtKwY1z21DE7-ah0T2Gdr0FMZw_kxEDpWtiGWMIwFNSSW90S0nQb-NlKwS87Va-4175UP0_IAeilmH7psxfxBxXnb2spg&h=VBKbGrDOiNHHR2ULs1XGezb0mbBlDA2XgMM_OQlu1fk + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWRFZSUkstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638658813056507057&c=MIIHhzCCBm-gAwIBAgITfAWKQyvXag-zjrQDfwAABYpDKzANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI0MDE0MzE0WhcNMjUwMzIzMDE0MzE0WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANDwk3_kcyceqIl7dgtMLkPtJd0Dkb9mue4uwDFpqUeJaLV0ILbYclblqNCzMKtUostgBu5GVS8MBzN_L23IehFdX5s2G8MFBRyoCv31VkR6xTNcprlL3ApSlAkYLNKWQvNzETl23UISuvkG7qeDh6Bx2DFiOd37MurICLjYCCvXbYPN5hdGA_IniW-OEEwq2bSF3s80KjkyMJcA0SyUADASZFM9vhy05mEs6DRa8avMylzn8ybLp7xnm21jaUxNBKPMilAwIeUIvOpmwW_VU86n3T5Yj-2dJ2D2naHhWtci5pE7z8BGdasl5V1hoQdHsniY-G90XE0Qm6AYpDp7IU0CAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwY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EI4FVRvQLOPYsnyEQzwlSX7qTJKagx-vxETibl1hyOItxeqxjZB_iMc3c-A&h=_U_gEv3_WhrTJNTLjGnqMKR2VqFeWYORJdonHyXFv9U method: GET response: proto: HTTP/2.0 @@ -211,7 +211,7 @@ interactions: X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: - "16499" X-Msedge-Ref: - - 'Ref A: A9C2B7951EEA49D295A49502A235739A Ref B: MAA201060515023 Ref C: 2024-10-28T23:32:34Z' + - 'Ref A: 5F7C0243A3D34DE3A82CE96F90783CCF Ref B: MAA201060516051 Ref C: 2024-10-30T10:35:23Z' status: 200 OK code: 200 - duration: 1.2401495s + duration: 1.40114525s diff --git a/v2/internal/resolver/resource_hierarchy.go b/v2/internal/resolver/resource_hierarchy.go index 886b57e8c39..7368290fd72 100644 --- a/v2/internal/resolver/resource_hierarchy.go +++ b/v2/internal/resolver/resource_hierarchy.go @@ -217,7 +217,11 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin if err != nil { return "", err } - + // We used to have a check here ensuring that the owner ARM ID matched the referenced credential/secret + // ARM ID. That check was removed as with ARM ID-based owners the subscription the resource is being + // deployed to is pretty obvious (it's directly in the ID) so we felt the chances of mistakenly deploying to + // an incorrect subscription with kube-based ownership. + // Rooting to an ARM ID means that some of the resourceTypes may not actually be included explicitly in our // hierarchy (because they're instead in the ARM ID itself). We filter these out of resourceTypes by // removing types that aren't included in the hierarchy. From 2ac1284281b107f0ef5c8e0188d32cdacc322552 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 3 Dec 2024 04:41:15 +0530 Subject: [PATCH 6/6] format code --- v2/internal/resolver/resource_hierarchy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/internal/resolver/resource_hierarchy.go b/v2/internal/resolver/resource_hierarchy.go index c06e8803b86..b6aa9612a26 100644 --- a/v2/internal/resolver/resource_hierarchy.go +++ b/v2/internal/resolver/resource_hierarchy.go @@ -227,7 +227,7 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin // ARM ID. That check was removed as with ARM ID-based owners the subscription the resource is being // deployed to is pretty obvious (it's directly in the ID) so we felt the chances of mistakenly deploying to // an incorrect subscription with kube-based ownership. - + // Rooting to an ARM ID means that some of the resourceTypes may not actually be included explicitly in our // hierarchy (because they're instead in the ARM ID itself). We filter these out of resourceTypes by // removing types that aren't included in the hierarchy.