Skip to content

[Request]: Enhance error handling and input validation in K8sHelper image parsing #2306

Description

@denizguney

Feature or enhancement request details

Description

While reviewing the image management implementation in K8sHelper, I noticed that image reference parsing uses try? within isShortName and fqReference, silently swallowing parsing errors. Additionally, ensureImage handles .notFound errors specifically, but broader operational errors during image fetching or parsing could benefit from more robust validation and explicit logging to prevent unexpected behavior with malformed image references.

Proposed Changes

  1. Robust Error Handling: Improve error visibility during Reference.parse failures instead of silently ignoring them with try?.
  2. Input Validation & Logging: Add stricter checks and informative debug/error logs for edge cases where image references are malformed or invalid.
  3. Error Categorization: Ensure ensureImage catches and distinguishes other potential ContainerizationError types gracefully.

Benefit

This will improve the overall stability, diagnostic capability, and security posture of the container image management workflow.


I would love to submit a Pull Request addressing these improvements if this direction sounds good to the maintainers!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions