Skip to content

Parse custom resource quotas as a flat list for editing Namespaces#16803

Merged
rak-phillip merged 3 commits intorancher:masterfrom
rak-phillip:bugfix/16798-namespace-extended-quotas
Feb 27, 2026
Merged

Parse custom resource quotas as a flat list for editing Namespaces#16803
rak-phillip merged 3 commits intorancher:masterfrom
rak-phillip:bugfix/16798-namespace-extended-quotas

Conversation

@rak-phillip
Copy link
Copy Markdown
Member

@rak-phillip rak-phillip commented Feb 27, 2026

Summary

This parses custom resource quotas as a flat list so that any values under the "extended" key read by the namespace edit form.

Fixes #16798

Occurred changes and/or fixed issues

  • Parse extended resource quotas for namespace form
  • Add a display value for extended types
  • Unit test the new namespace resource quota behavior

Technical notes summary

This is very similar to the original approach taken in #16550, where we would flatten all of the properties under extended to produce a collection of keys prefixed with extended.. I think that this approach is safe here because this form does not deal with ArrayList.vue and we are not adding/removing resource quotas for the namespace form.

Areas or cases that should be tested

See issue for more details:

  • Create/Edit namespace for project that contains custom resource quotas
    • Namespace form should render all resource quotas
    • Network request on save should contain all resource quotas

Areas which could experience regressions

Pay attention to the functions that parse to and from flat lists. If there's an error in the logic, we could fail to render/save the form properly.

Screenshot/Video

image

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.14.0 milestone Feb 27, 2026
@rak-phillip rak-phillip marked this pull request as ready for review February 27, 2026 19:17
Copy link
Copy Markdown
Member

@codyrancher codyrancher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one thing, I don't think it'll be an issue but I wanted to bring it up just in case.

limit: {
...this.value.resourceQuota.limit,
[key]: value
this.value['resourceQuota'] = { limit: this.limitsFromFlatList(key, value) };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is actually a problem and it was already present but I figured I'd bring it up just in case I'm missing something.

If resourceQuota ever had a properties outside of limit we would clobber it here by creating a new object and assigning it to resourceQuota.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main difference here is how we populate limits, otherwise this should be the same behavior as before:

update(key, value) {
const resourceQuota = {
limit: {
...this.value.resourceQuota.limit,
[key]: value
}
};
this.value['resourceQuota'] = resourceQuota;
}

@rak-phillip rak-phillip merged commit 87d07cb into rancher:master Feb 27, 2026
112 of 120 checks passed
@rak-phillip rak-phillip deleted the bugfix/16798-namespace-extended-quotas branch February 27, 2026 20:54
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.

[BUG] Extended quotas are not being setup correctly

2 participants