Skip to content

fix(controller): wrap trial status errors#2676

Open
Epochex wants to merge 1 commit into
kubeflow:masterfrom
Epochex:fix-trial-error-wrapping
Open

fix(controller): wrap trial status errors#2676
Epochex wants to merge 1 commit into
kubeflow:masterfrom
Epochex:fix-trial-error-wrapping

Conversation

@Epochex

@Epochex Epochex commented Jun 17, 2026

Copy link
Copy Markdown

Fixes #2628.

This tightens the trial controller error wrapping so callers can use errors.Is / errors.As on the underlying failures:

  • use errors.New for sentinel trial-controller errors
  • wrap metric timestamp parse failures with %w
  • wrap deployed job success/failure condition unmarshal errors with %w
  • add regression coverage for the parse and JSON unmarshal error chains

Tested:

  • go test ./pkg/controller.v1beta1/trial/util
  • KUBEBUILDER_ASSETS=C:\Users\lin\AppData\Local\kubebuilder-envtest\k8s\1.34.0-windows-amd64 go test ./pkg/controller.v1beta1/trial ./pkg/controller.v1beta1/trial/util

The second command reaches PASS for the controller package tests on this Windows machine, then the command exits 1 because envtest cannot signal the local kube-apiserver and etcd processes to stop (not supported by windows).

Signed-off-by: Jianke LIN <crayozakka@gmail.com>
@github-actions

Copy link
Copy Markdown

🎉 Welcome to the Kubeflow Katib repo! 🎉

Thanks for opening your first PR! We're excited to have you onboard 🚀

Next steps:

Feel free to ask questions in the comments. Thanks again for contributing! 🙏

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andreyvelich for approval. For more information see the Kubernetes Code Review Process.

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

Details 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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect error formatting in trial controller package

1 participant