Skip to content

Commit 79d125c

Browse files
authored
Loosen up Owner-Child resource subscription checks (#4343)
* Loosen up Owner-Child resource subscription checks * Update test cases * Add back the nestedResource check * modify test to use kuberef * update test name; add comment * format code
1 parent 8850de9 commit 79d125c

5 files changed

+224
-157
lines changed

v2/internal/controllers/owner_arm_id_negative_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func Test_OwnerIsARMIDOfWrongType_Rejected(t *testing.T) {
5353
tc.Expect(err).To(MatchError(ContainSubstring("expected owner ARM ID to be for a resource group, but was \"Microsoft.Compute/virtualMachines\"")))
5454
}
5555

56-
func Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails(t *testing.T) {
56+
func Test_OwnerIsKubernetesResourceFromDifferentSubscription_ResourceFails(t *testing.T) {
5757
t.Parallel()
5858
tc := globalTestContext.ForTest(t)
5959

@@ -63,15 +63,12 @@ func Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails(t *testing.T) {
6363
// Create a resource group
6464
rg := tc.CreateTestResourceGroupAndWait()
6565

66-
// Get the rg's ARM ID
6766
tc.Expect(rg.Status.Id).ToNot(BeNil())
68-
armID := *rg.Status.Id
6967

7068
scopedCredentialName := "other-subscription-secret"
7169

7270
// Now create a storage account
7371
acct := newStorageAccount20230101(tc, rg)
74-
acct.Spec.Owner = testcommon.AsARMIDOwner(armID)
7572
acct.Annotations = map[string]string{annotations.PerResourceSecret: scopedCredentialName}
7673

7774
uuid, err := tc.Namer.GenerateUUID()

v2/internal/controllers/recordings/Test_OwnerIsARMIDFromDifferentSubscription_ResourceFails.yaml

-141
This file was deleted.

0 commit comments

Comments
 (0)