Skip to content

feat(console): add GET/PUT tenant YAML API endpoint and PR template#96

Open
GatewayJ wants to merge 1 commit intomainfrom
console-yaml
Open

feat(console): add GET/PUT tenant YAML API endpoint and PR template#96
GatewayJ wants to merge 1 commit intomainfrom
console-yaml

Conversation

@GatewayJ
Copy link
Member

@GatewayJ GatewayJ commented Mar 8, 2026

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

N/A

Summary of Changes

Add GET/PUT /api/v1/namespaces/{namespace}/tenants/{name}/yaml API endpoints for reading and editing the full Tenant CR as YAML, similar to the MinIO operator's tenant YAML feature.

  • GET: Returns the complete Tenant CR serialized as YAML with managedFields stripped for readability.
  • PUT: Accepts edited YAML, validates name/namespace match and pool uniqueness, then safely updates only spec, labels, annotations, and finalizers while preserving resourceVersion and immutable metadata.
  • Model: New TenantYAML struct ({ yaml: string }).
  • OpenAPI: Documentation stubs added for both endpoints.
  • AGENTS.md: Added global and .github/ scoped agent instructions with rule precedence, PR baseline, and security rules.
  • PR Template: Added .github/pull_request_template.md following RustFS project conventions.
  • Prettier: Applied formatting to existing console-web files (no functional changes).

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (if user-visible change)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Verification

make pre-commit
# Test the new endpoint (after deploying):
# GET:
curl -b cookies.txt http://localhost:9090/api/v1/namespaces/rustfs-system/tenants/example-tenant/yaml
# PUT:
curl -b cookies.txt -X PUT http://localhost:9090/api/v1/namespaces/rustfs-system/tenants/example-tenant/yaml \
  -H "Content-Type: application/json" \
  -d '{"yaml": "..."}'

Additional Notes

The PUT endpoint follows the same safety pattern as the MinIO operator: it fetches the current Tenant from the cluster (preserving resourceVersion), then only overwrites spec, labels, annotations, and finalizers from the user-provided YAML. This prevents accidental modification of immutable metadata fields.


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

Add /api/v1/namespaces/{namespace}/tenants/{name}/yaml for reading and
editing the full Tenant CR as YAML (similar to MinIO operator).

GET: returns the complete Tenant CR serialized as YAML (managedFields
stripped for readability).

PUT: accepts edited YAML, validates name/namespace match, pool
uniqueness, and safely updates only spec/labels/annotations/finalizers
while preserving resourceVersion and immutable metadata.

Also applies Prettier formatting to existing console-web files.

Made-with: Cursor
@GatewayJ GatewayJ changed the title feat(console): add GET/PUT tenant YAML API endpoint feat(console): add GET/PUT tenant YAML API endpoint and PR template Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant