Skip to content

Commit 05f42e6

Browse files
scotwellsclaude
andcommitted
fix: resolve pre-existing e2e test failures
- Add control plane reachability wait to notes multicluster tests - Add quota grant for CRM note lifecycle test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 837148e commit 05f42e6

6 files changed

Lines changed: 163 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: quota.miloapis.com/v1alpha1
2+
kind: ResourceGrant
3+
metadata:
4+
name: crm-note-lifecycle-test-grant
5+
namespace: milo-system
6+
labels:
7+
test.miloapis.com/scenario: "crm-note-contact-lifecycle"
8+
spec:
9+
consumerRef:
10+
kind: ""
11+
name: ""
12+
allowances:
13+
- resourceType: notes.miloapis.com/notes
14+
buckets:
15+
- amount: 10

test/crm/note-contact-lifecycle/chainsaw-test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ spec:
1212
- Deleting a User causes owned Notes to be garbage-collected via ownerReferences
1313
1414
steps:
15+
- name: setup-notes-quota-grant
16+
description: Create a ResourceGrant granting notes quota capacity for this test
17+
try:
18+
- apply:
19+
file: 00-notes-quota-grant.yaml
20+
- wait:
21+
apiVersion: quota.miloapis.com/v1alpha1
22+
kind: ResourceGrant
23+
name: crm-note-lifecycle-test-grant
24+
namespace: milo-system
25+
timeout: 30s
26+
for:
27+
condition:
28+
name: Active
29+
value: 'True'
30+
1531
- name: create-user-contact-and-notes
1632
description: Create IAM User, Notification Contact, and CRM Notes, then verify Note status
1733
try:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: quota.miloapis.com/v1alpha1
2+
kind: GrantCreationPolicy
3+
metadata:
4+
name: cn-mc-test-project-notes-grant-policy
5+
labels:
6+
test.miloapis.com/notes: "clusternote-multicluster"
7+
spec:
8+
disabled: false
9+
trigger:
10+
resource:
11+
apiVersion: "resourcemanager.miloapis.com/v1alpha1"
12+
kind: "Project"
13+
constraints:
14+
- expression: 'has(trigger.metadata.labels) && "test.miloapis.com/notes" in trigger.metadata.labels && trigger.metadata.labels["test.miloapis.com/notes"] == "clusternote-multicluster"'
15+
target:
16+
parentContext:
17+
apiGroup: "resourcemanager.miloapis.com"
18+
kind: "Project"
19+
nameExpression: "trigger.metadata.name"
20+
resourceGrantTemplate:
21+
metadata:
22+
name: "auto-grant-{{trigger.metadata.name}}"
23+
namespace: "milo-system"
24+
labels:
25+
quota.miloapis.com/auto-created: "true"
26+
test.miloapis.com/notes: "clusternote-multicluster"
27+
spec:
28+
consumerRef:
29+
apiGroup: "resourcemanager.miloapis.com"
30+
kind: "Project"
31+
name: "{{trigger.metadata.name}}"
32+
allowances:
33+
- resourceType: "notes.miloapis.com/notes"
34+
buckets:
35+
- amount: 10

test/notes/clusternote-multicluster-subject/chainsaw-test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ spec:
3737
path: '{.status.phase}'
3838
value: Active
3939

40+
- name: setup-grant-creation-policy
41+
description: Create GrantCreationPolicy to provision notes quota for test projects
42+
cluster: main
43+
try:
44+
- apply:
45+
file: 02-grant-creation-policy.yaml
46+
- wait:
47+
apiVersion: quota.miloapis.com/v1alpha1
48+
kind: GrantCreationPolicy
49+
name: cn-mc-test-project-notes-grant-policy
50+
timeout: 30s
51+
for:
52+
condition:
53+
name: Ready
54+
value: 'true'
55+
4056
- name: create-project
4157
description: Create project in org control plane
4258
cluster: org
@@ -53,6 +69,21 @@ spec:
5369
name: Ready
5470
value: 'true'
5571

72+
- name: wait-for-project-quota-grant
73+
description: Wait for notes quota grant to appear in project control plane, confirming the proxy is reachable and quota is provisioned
74+
cluster: project
75+
try:
76+
- wait:
77+
apiVersion: quota.miloapis.com/v1alpha1
78+
kind: ResourceGrant
79+
name: auto-grant-cn-mc-test-project-1
80+
namespace: milo-system
81+
timeout: 60s
82+
for:
83+
condition:
84+
name: Active
85+
value: 'True'
86+
5687
- name: create-namespace-in-project
5788
description: Create cluster-scoped Namespace in project control plane
5889
cluster: project
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: quota.miloapis.com/v1alpha1
2+
kind: GrantCreationPolicy
3+
metadata:
4+
name: note-mc-test-project-notes-grant-policy
5+
labels:
6+
test.miloapis.com/notes: "multicluster"
7+
spec:
8+
disabled: false
9+
trigger:
10+
resource:
11+
apiVersion: "resourcemanager.miloapis.com/v1alpha1"
12+
kind: "Project"
13+
constraints:
14+
- expression: 'has(trigger.metadata.labels) && "test.miloapis.com/notes" in trigger.metadata.labels && trigger.metadata.labels["test.miloapis.com/notes"] == "multicluster"'
15+
target:
16+
parentContext:
17+
apiGroup: "resourcemanager.miloapis.com"
18+
kind: "Project"
19+
nameExpression: "trigger.metadata.name"
20+
resourceGrantTemplate:
21+
metadata:
22+
name: "auto-grant-{{trigger.metadata.name}}"
23+
namespace: "milo-system"
24+
labels:
25+
quota.miloapis.com/auto-created: "true"
26+
test.miloapis.com/notes: "multicluster"
27+
spec:
28+
consumerRef:
29+
apiGroup: "resourcemanager.miloapis.com"
30+
kind: "Project"
31+
name: "{{trigger.metadata.name}}"
32+
allowances:
33+
- resourceType: "notes.miloapis.com/notes"
34+
buckets:
35+
- amount: 10

test/notes/note-multicluster-subject/chainsaw-test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ spec:
3636
path: '{.status.phase}'
3737
value: Active
3838

39+
- name: setup-grant-creation-policy
40+
description: Create GrantCreationPolicy to provision notes quota for test projects
41+
cluster: main
42+
try:
43+
- apply:
44+
file: 02-grant-creation-policy.yaml
45+
- wait:
46+
apiVersion: quota.miloapis.com/v1alpha1
47+
kind: GrantCreationPolicy
48+
name: note-mc-test-project-notes-grant-policy
49+
timeout: 30s
50+
for:
51+
condition:
52+
name: Ready
53+
value: 'true'
54+
3955
- name: create-project
4056
description: Create project in org control plane
4157
cluster: org
@@ -52,6 +68,21 @@ spec:
5268
name: Ready
5369
value: 'true'
5470

71+
- name: wait-for-project-quota-grant
72+
description: Wait for notes quota grant to appear in project control plane, confirming the proxy is reachable and quota is provisioned
73+
cluster: project
74+
try:
75+
- wait:
76+
apiVersion: quota.miloapis.com/v1alpha1
77+
kind: ResourceGrant
78+
name: auto-grant-note-mc-test-project-1
79+
namespace: milo-system
80+
timeout: 60s
81+
for:
82+
condition:
83+
name: Active
84+
value: 'True'
85+
5586
- name: create-configmap-in-project
5687
description: Create ConfigMap resource in project control plane
5788
cluster: project

0 commit comments

Comments
 (0)