Add flag to control default namespace creation#66
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 25 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdded a new boolean configuration variable Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@modules/management/tenant-space/main.tf`:
- Line 5: The current expression for namespaces always falls back to
[var.project_name] when var.namespaces is null, ignoring
var.create_default_namespace; update the ternary so that when var.namespaces ==
null it returns [var.project_name] only if var.create_default_namespace is true,
otherwise return an empty list ([]). Specifically adjust the fallback branch of
the namespaces assignment to honor var.create_default_namespace instead of
unconditionally using var.project_name (refer to the namespaces expression,
var.namespaces, var.create_default_namespace, and var.project_name).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 080b7fe4-62f1-4293-b6f7-44dcc16663f3
📒 Files selected for processing (2)
modules/management/tenant-space/main.tfmodules/management/tenant-space/variables.tf
Summary
create_default_namespace = falseimported without a project-name namespace
WSO2 Cloud) has a name that is not a valid Kubernetesnamespace identifier — auto-creation would have caused
terraform applyto fail without this opt-out
New tenants added going forward can omit the flag (defaults to
true) andwill automatically get a default namespace matching the project name.
Depends on wso2/open-cloud-datacenter# which introduces the
create_default_namespacevariable.