🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@xigang
Copy link
Member

@xigang xigang commented Nov 22, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

The namespace GroupKind was incorrectly constructed using the Resourcequota v1 API group. Fix it to use the core API group (corev1.GroupName) instead.

This ensures namespace creation is properly excluded from quota admission evaluation, as namespace resources themselves should not be subject to ResourceQuota constraints.

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 22, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 22, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 22, 2025
@xigang
Copy link
Member Author

xigang commented Nov 22, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Nov 22, 2025
@xigang
Copy link
Member Author

xigang commented Nov 22, 2025

/cc @liggitt @wojtek-t

@lmktfy
Copy link
Member

lmktfy commented Nov 22, 2025

Let's changelog this; it's something cluster administrators would be keen to track (in terms of "when was this fixed?")

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 22, 2025
@xigang
Copy link
Member Author

xigang commented Nov 22, 2025

Thanks @lmktfy. The changelog has been added. I think this PR needs to be cherry-picked to a previous version.

@carlory
Copy link
Member

carlory commented Nov 24, 2025

It was caused by #95012

@xigang
Copy link
Member Author

xigang commented Nov 24, 2025

/cc @pohly PTAL.

@k8s-ci-robot k8s-ci-robot requested a review from pohly November 24, 2025 13:43
@xigang
Copy link
Member Author

xigang commented Nov 25, 2025

/assign @liggitt @wojtek-t

Please take a look. thanks.

Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

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

I think the fix can be smaller to simply switch to the correct package SchemeGroupVersion

I don't think we need a release note, a namespace create would only have been subjected to quota if the namespace already existed and a ResourceQuota object in the namespace was trying to limit namespaces, but if it already existed, the create would fail already

{
"namespace creation",
admission.NewAttributesRecord(nil, nil, v1.SchemeGroupVersion.WithKind("Namespace"), "namespace", "namespace", schema.GroupVersionResource{}, "", admission.Create, nil, false, nil),
admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{Group: corev1.GroupName, Version: "v1", Kind: "Namespace"}, "namespace", "namespace", schema.GroupVersionResource{}, "", admission.Create, nil, false, nil),
Copy link
Member

Choose a reason for hiding this comment

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

use corev1.SchemeGroupVersion

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


var (
namespaceGVK = v1.SchemeGroupVersion.WithKind("Namespace").GroupKind()
namespaceGVK = schema.GroupKind{Group: corev1.GroupName, Kind: "Namespace"}
Copy link
Member

Choose a reason for hiding this comment

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

corev1.SchemeGroupVersion.WithKind("Namespace").GroupKind()

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: xigang <wangxigang2014@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 25, 2025
@liggitt
Copy link
Member

liggitt commented Nov 25, 2025

/lgtm
/approve
/milestone v1.36

@k8s-ci-robot k8s-ci-robot added this to the v1.36 milestone Nov 25, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 25, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a1d7eb94532407297f311fd8551174a7516d27a3

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, xigang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2025
@xigang
Copy link
Member Author

xigang commented Nov 25, 2025

Thanks @liggitt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants