Skip to content

Incorrect error formatting in trial controller package #2628

@ruskaruma

Description

@ruskaruma

What happened?

Three error formatting issues in pkg/controller.v1beta1/trial/:

  1. trial_controller_util.go:229 uses %e (scientific notation for floats) instead of %w. Produces garbage output like &{%!e(string=connection refused)} on timestamp parse errors.

  2. trial_controller.go:61-63 sentinel errors use fmt.Errorf() instead of errors.New(). These are compared with errors.Is() so they should be immutable sentinels

  3. trial/util/job_util.go:82,103 uses %v instead of %w, breaking the error chain for errors.Is() and errors.As() callers

What did you expect to happen?

Errors should use correct format verbs and follow Go error handling conventions.

Environment

Spotted while reading through the trial controller code

Impacted by this bug?

Give it a 👍 We prioritize the issues with most 👍

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions