-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Refactor API group validation and error reporting #133466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Aug 11 10:25:10 UTC 2025. |
b31e476 to
15c6e61
Compare
|
/test pull-kubernetes-integration |
15c6e61 to
b61da1f
Compare
|
/test pull-kubernetes-integration |
b61da1f to
b82fd7a
Compare
1d77400 to
b169e8b
Compare
|
/test pull-kubernetes-integration |
|
/retest |
|
/triage accepted |
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
|
/remove-lifecycle stale /assign @siyuanfoundation Can we move forward this? @siyuanfoundation, please reassign if you don't want to or can't review. |
staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go
Outdated
Show resolved
Hide resolved
b169e8b to
8489bbc
Compare
staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go
Outdated
Show resolved
Hide resolved
8230dc7 to
ab72796
Compare
| if len(groups) != 0 { | ||
| errors = append(errors, fmt.Errorf("unknown api groups %s", strings.Join(groups, ","))) | ||
| if len(unknownGroupVersions) != 0 { | ||
| errors = append(errors, fmt.Errorf("unknown api groups %s", strings.Join(unknownGroupVersions.UnsortedList(), ","))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use sets.List(unknownGroupVersions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
/retest |
Updated API group validation logic to improve error reporting. The Validate method now provides more descriptive error messages when unknown API groups are encountered. Unit test cases are updated to match the new error messages. Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
ab72796 to
392bb8e
Compare
|
/lgtm |
|
LGTM label has been added. Git tree hash: 406eeabac413ebc4db076297a0c97f39ab96666f
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bart0sh, liggitt 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 |
|
/retest |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This is a fix for validation error messages produced by the
APIEnablementOptions.Validate. Error message for unknown API groups didn't contain versions, which could be confusing. Here is an example of the latest one from this failing ci-node-e2e-crio-cgrpv2-dra-1-34 job:F0810 13:37:19.210421 2969 services.go:119] Failed to run e2e services: failed to validate ServerRunOptions: unknown api groups api. With this fix the error would be more descriptive and easier to understand:Failed to run e2e services: failed to validate ServerRunOptions: unknown api groups api/stable1Updated API group validation logic to improve error reporting. The Validate method now checks for unknown API groups using group versions and provides more descriptive error messages when invalid or unknown API groups are encountered.
Unit test cases are updated to match the new error messages.
Which issue(s) this PR is related to:
#133460
Does this PR introduce a user-facing change?