feat(console): add GET/PUT tenant YAML API endpoint and PR template#96
Open
feat(console): add GET/PUT tenant YAML API endpoint and PR template#96
Conversation
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
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.
Type of Change
Related Issues
N/A
Summary of Changes
Add GET/PUT
/api/v1/namespaces/{namespace}/tenants/{name}/yamlAPI endpoints for reading and editing the full Tenant CR as YAML, similar to the MinIO operator's tenant YAML feature.managedFieldsstripped for readability.spec,labels,annotations, andfinalizerswhile preservingresourceVersionand immutable metadata.TenantYAMLstruct ({ yaml: string })..github/scoped agent instructions with rule precedence, PR baseline, and security rules..github/pull_request_template.mdfollowing RustFS project conventions.Checklist
make pre-commit(fmt-check + clippy + test + console-lint + console-fmt-check)[Unreleased](if user-visible change)Impact
Verification
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 overwritesspec,labels,annotations, andfinalizersfrom 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.