fix: align mongo/k8s/0.2 size schema with TF & make service enable_host_anti_affinity optional#555
Merged
anujhydrabadi merged 1 commit intoJun 26, 2026
Conversation
…ti-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>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughThe PR updates MongoDB k8s size schema fields from ChangesMongoDB k8s size schema
Service deployment spec
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two module-schema bugs that cause false-positive pre-flight validation errors in
raptor create release, while the platform/Deployer accepts the same specs fine. Both were surfaced during asaas-cp / productionrelease.1.
mongo/k8s/0.2— size schema didn't match its own Terraformcpu/memory(both required), but the v0.2 Terraform (facets-iac/.../modules/1_input_instance/mongodb/main.tf, whichmodule.jsondeclares asprovides: mongo, flavors: [default, k8s], version: 0.2) readscpu_requests/memory_requestsbehind acontains(keys(local.size), "cpu_requests")guard. Thecpu/memorynaming only belongs to the 0.3 TF (mongodb/0.3/main.tf).cpu/memory) would silently get no resource requests — the TF guard is never satisfied.cpu_requests/memory_requests(as prod does) fails validation:spec.size.memory: required field is missing.cpu_requests/memory_requestsso the v0.2 schema matches the v0.2 module and real usage. Updated therequiredlist, thecpu_limit/memory_limitx-ui-comparereferences, and the sample.2.
service/deployment/0.1—enable_host_anti_affinitywrongly requiredrequiredlist with no default, but the shared app-chart helm template guards it with{{- if and (hasKey .Values.spec "enable_host_anti_affinity") ... }}and treats absence as "no anti-affinity". The field is behaviorally optional.service/control-plane-ui, flavordefault, which resolves to this schema).required(kept inpropertiesandx-ui-order). Follows the precedent of fix: make health_checks optional in service deployment module #520 (make health_checks optional).Notes / scope
service/statefulset/0.1andservice/vm/0.1carry the sameenable_host_anti_affinityin theirrequiredlists. Left untouched here to keep blast radius to the reported (deployment-lineage) failure — happy to extend if desired.Test
🤖 Generated with Claude Code
Summary by CodeRabbit