Skip to content

Commit ef759bd

Browse files
anujhydrabadiclaude
andcommitted
fix: align mongo/k8s/0.2 size schema with TF and make service host-anti-affinity optional
Two module-schema bugs that caused false-positive pre-flight validation errors (raptor create release) while the platform/Deployer accepts the specs fine. mongo/k8s/0.2: the size schema declared `cpu`/`memory` (required), but the v0.2 Terraform (facets-iac .../1_input_instance/mongodb/main.tf) reads `cpu_requests`/`memory_requests` behind a `contains(keys, "cpu_requests")` guard. The `cpu`/`memory` naming only belongs to the 0.3 TF. As a result a blueprint following the 0.2 schema would silently get NO resource requests, and a correct blueprint (using cpu_requests/memory_requests, as prod does) fails validation with "spec.size.memory required field is missing". Rename the request fields to cpu_requests/memory_requests so the schema matches the v0.2 module and real usage; limit fields and their x-ui-compare refs updated to match. service/deployment/0.1: `enable_host_anti_affinity` was in the spec `required` list with no default, but the shared app-chart helm template guards it with `hasKey` and treats absence as "no anti-affinity". The field is behaviorally optional, so requiring it rejects valid specs (e.g. service/control-plane-ui). Remove it from `required` (kept in properties and x-ui-order). Follows the precedent of #520 (health_checks made optional). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 212dd21 commit ef759bd

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

modules/mongo/k8s/0.2/facets.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
maximum: 10
4343
x-ui-placeholder: "e.g., 1 or 3"
4444
x-ui-error-message: "Instance count must be between 1 and 10."
45-
cpu:
45+
cpu_requests:
4646
type: string
4747
title: CPU Request
4848
description: Number of CPU cores required.
@@ -54,7 +54,7 @@ spec:
5454
x-ui-error-message: "CPU cannot be more than CPU limit"
5555
x-ui-placeholder: "e.g., '500m' or '1'"
5656
x-ui-error-message: "Value doesn't match pattern, it should be number ranging from 1 to 32 or 1m to 32000m"
57-
memory:
57+
memory_requests:
5858
type: string
5959
title: Memory Request
6060
description: Amount of memory required.
@@ -73,7 +73,7 @@ spec:
7373
minLength: 1
7474
pattern: "^([1-9]|[12][0-9]|3[0-2])$|^(3[0-1][0-9]{3}|[1-2][0-9]{4}|[1-9][0-9]{0,3}|32000)m$"
7575
x-ui-compare:
76-
field: spec.size.cpu
76+
field: spec.size.cpu_requests
7777
comparator: ">="
7878
x-ui-error-message: "CPU limit cannot be less than CPU"
7979
x-ui-placeholder: "e.g., '500m' or '1'"
@@ -85,7 +85,7 @@ spec:
8585
minLength: 1
8686
pattern: "^(0\\.[1-9]|[1-9](\\.[0-9]+)?|[1-5][0-9](\\.[0-9]+)?|6[0-4])Gi$|^([1-9](\\.[0-9]+)?|[1-9][0-9]{1,3}(\\.[0-9]+)?|[1-5][0-9]{4}(\\.[0-9]+)?|6[0-3][0-9]{3}(\\.[0-9]+)?|64000)Mi$"
8787
x-ui-compare:
88-
field: spec.size.memory
88+
field: spec.size.memory_requests
8989
comparator: ">="
9090
x-ui-error-message: "Memory limit cannot be less than memory"
9191
x-ui-placeholder: "e.g., '800Mi' or '1.5Gi'"
@@ -100,8 +100,8 @@ spec:
100100
x-ui-error-message: "Volume must be specified in the correct format with integer only (e.g., '10Gi' or '50Gi')."
101101
required:
102102
- instance_count
103-
- cpu
104-
- memory
103+
- cpu_requests
104+
- memory_requests
105105
backup_configuration:
106106
type: object
107107
title: Backup Configuration
@@ -161,7 +161,7 @@ sample:
161161
authenticated: true
162162
mongodb_version: 6.0.2
163163
size:
164-
cpu: 2001m
165-
memory: 900MiB
164+
cpu_requests: 2001m
165+
memory_requests: 900Mi
166166
volume: 8G
167167
instance_count: 3

modules/service/deployment/0.1/facets.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,6 @@ spec:
17571757
- runtime
17581758
required:
17591759
- restart_policy
1760-
- enable_host_anti_affinity
17611760
- runtime
17621761
x-ui-order:
17631762
- restart_policy

0 commit comments

Comments
 (0)