Conversation
…ainers#792) * feat(logging): centralize K8s error logging in MCP tool handler Move HandleK8sError calls from individual tool handlers to the central ServerToolToGoSdkTool dispatch point in gosdk.go. This eliminates duplicated logging across ~20 call sites and ensures consistent error categorization for all tools automatically. Add errors.As guard in HandleK8sError fallback to only log actual K8s API errors, silently ignoring non-K8s errors (e.g. access control denials). Extract README logging section into docs/logging.md. Add unit tests for HandleK8sError covering all K8s error types, wrapped error chain traversal, and non-K8s error filtering. Add integration tests verifying non-K8s errors produce no log notifications (pods, helm) and K8s forbidden errors from Helm produce correct notifications. Add RequireNoLogNotification test helper. Signed-off-by: Marc Nuri <marc@marcnuri.com> * test(logging): assert on log level and message in K8s error tests Extract classifyK8sError to make error-to-log mapping directly testable. Unit tests now verify the correct Level and message for each K8s error type instead of only asserting NotPanics. Signed-off-by: Marc Nuri <marc@marcnuri.com> --------- Signed-off-by: Marc Nuri <marc@marcnuri.com>
* feat(validation): add pre-execution validation layer Add validation middleware that catches errors before they reach the Kubernetes API. Signed-off-by: Nader Ziada <nziada@redhat.com> * simplify config and merge into AccessControlRoundTripper Signed-off-by: Nader Ziada <nziada@redhat.com> * remove redundant ResourceValidator and simplify validation cleanup up unused func and fields Signed-off-by: Nader Ziada <nziada@redhat.com> --------- Signed-off-by: Nader Ziada <nziada@redhat.com>
…60223-1731 Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
|
@swghosh: This pull request explicitly references no jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/assign @matzew |
|
@swghosh: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, swghosh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sync with upstream containers@9a33b10 and i.e. pull in containers#764.
Adding this PR as #51 depends on the
func CanI(..)that was added recently upstream.