Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/apiserver/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ spec:
timeoutSeconds: 15
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
cpu: 200m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
startupProbe:
failureThreshold: 30
httpGet:
Expand Down
15 changes: 15 additions & 0 deletions test/crm/note-contact-lifecycle/00-notes-quota-grant.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: quota.miloapis.com/v1alpha1
kind: ResourceGrant
metadata:
name: crm-note-lifecycle-test-grant
namespace: milo-system
labels:
test.miloapis.com/scenario: "crm-note-contact-lifecycle"
spec:
consumerRef:
kind: ""
name: ""
allowances:
- resourceType: notes.miloapis.com/notes
buckets:
- amount: 10
16 changes: 16 additions & 0 deletions test/crm/note-contact-lifecycle/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ spec:
- Deleting a User causes owned Notes to be garbage-collected via ownerReferences

steps:
- name: setup-notes-quota-grant
description: Create a ResourceGrant granting notes quota capacity for this test
try:
- apply:
file: 00-notes-quota-grant.yaml
- wait:
apiVersion: quota.miloapis.com/v1alpha1
kind: ResourceGrant
name: crm-note-lifecycle-test-grant
namespace: milo-system
timeout: 30s
for:
condition:
name: Active
value: 'True'

- name: create-user-contact-and-notes
description: Create IAM User, Notification Contact, and CRM Notes, then verify Note status
try:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: quota.miloapis.com/v1alpha1
kind: GrantCreationPolicy
metadata:
name: cn-mc-test-project-notes-grant-policy
labels:
test.miloapis.com/notes: "clusternote-multicluster"
spec:
disabled: false
trigger:
resource:
apiVersion: "resourcemanager.miloapis.com/v1alpha1"
kind: "Project"
constraints:
- expression: 'has(trigger.metadata.labels) && "test.miloapis.com/notes" in trigger.metadata.labels && trigger.metadata.labels["test.miloapis.com/notes"] == "clusternote-multicluster"'
target:
parentContext:
apiGroup: "resourcemanager.miloapis.com"
kind: "Project"
nameExpression: "trigger.metadata.name"
resourceGrantTemplate:
metadata:
name: "auto-grant-{{trigger.metadata.name}}"
namespace: "milo-system"
labels:
quota.miloapis.com/auto-created: "true"
test.miloapis.com/notes: "clusternote-multicluster"
spec:
consumerRef:
apiGroup: "resourcemanager.miloapis.com"
kind: "Project"
name: "{{trigger.metadata.name}}"
allowances:
- resourceType: "notes.miloapis.com/notes"
buckets:
- amount: 10
31 changes: 31 additions & 0 deletions test/notes/clusternote-multicluster-subject/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ spec:
path: '{.status.phase}'
value: Active

- name: setup-grant-creation-policy
description: Create GrantCreationPolicy to provision notes quota for test projects
cluster: main
try:
- apply:
file: 02-grant-creation-policy.yaml
- wait:
apiVersion: quota.miloapis.com/v1alpha1
kind: GrantCreationPolicy
name: cn-mc-test-project-notes-grant-policy
timeout: 30s
for:
condition:
name: Ready
value: 'true'

- name: create-project
description: Create project in org control plane
cluster: org
Expand All @@ -53,6 +69,21 @@ spec:
name: Ready
value: 'true'

- name: wait-for-project-quota-grant
description: Wait for notes quota grant to appear in project control plane, confirming the proxy is reachable and quota is provisioned
cluster: project
try:
- wait:
apiVersion: quota.miloapis.com/v1alpha1
kind: ResourceGrant
name: auto-grant-cn-mc-test-project-1
namespace: milo-system
timeout: 60s
for:
condition:
name: Active
value: 'True'

- name: create-namespace-in-project
description: Create cluster-scoped Namespace in project control plane
cluster: project
Expand Down
38 changes: 38 additions & 0 deletions test/notes/note-multicluster-subject/02-grant-creation-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: quota.miloapis.com/v1alpha1
kind: GrantCreationPolicy
metadata:
name: note-mc-test-project-notes-grant-policy
labels:
test.miloapis.com/notes: "multicluster"
spec:
disabled: false
trigger:
resource:
apiVersion: "resourcemanager.miloapis.com/v1alpha1"
kind: "Project"
constraints:
- expression: 'has(trigger.metadata.labels) && "test.miloapis.com/notes" in trigger.metadata.labels && trigger.metadata.labels["test.miloapis.com/notes"] == "multicluster"'
target:
parentContext:
apiGroup: "resourcemanager.miloapis.com"
kind: "Project"
nameExpression: "trigger.metadata.name"
resourceGrantTemplate:
metadata:
name: "auto-grant-{{trigger.metadata.name}}"
namespace: "milo-system"
labels:
quota.miloapis.com/auto-created: "true"
test.miloapis.com/notes: "multicluster"
spec:
consumerRef:
apiGroup: "resourcemanager.miloapis.com"
kind: "Project"
name: "{{trigger.metadata.name}}"
allowances:
- resourceType: "notes.miloapis.com/notes"
buckets:
- amount: 10
- resourceType: "core.miloapis.com/configmaps"
buckets:
- amount: 10
31 changes: 31 additions & 0 deletions test/notes/note-multicluster-subject/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ spec:
path: '{.status.phase}'
value: Active

- name: setup-grant-creation-policy
description: Create GrantCreationPolicy to provision notes quota for test projects
cluster: main
try:
- apply:
file: 02-grant-creation-policy.yaml
- wait:
apiVersion: quota.miloapis.com/v1alpha1
kind: GrantCreationPolicy
name: note-mc-test-project-notes-grant-policy
timeout: 30s
for:
condition:
name: Ready
value: 'true'

- name: create-project
description: Create project in org control plane
cluster: org
Expand All @@ -52,6 +68,21 @@ spec:
name: Ready
value: 'true'

- name: wait-for-project-quota-grant
description: Wait for notes quota grant to appear in project control plane, confirming the proxy is reachable and quota is provisioned
cluster: project
try:
- wait:
apiVersion: quota.miloapis.com/v1alpha1
kind: ResourceGrant
name: auto-grant-note-mc-test-project-1
namespace: milo-system
timeout: 60s
for:
condition:
name: Active
value: 'True'

- name: create-configmap-in-project
description: Create ConfigMap resource in project control plane
cluster: project
Expand Down
Loading