Skip to content

Conversation

@thaJeztah
Copy link
Member

This error was originally introduced ErrBadEnvVariable in moby/moby@500c8ba, but merely for convenience, and not used as a sentinel error. After the code was moved from the daemon to the cli repository, it was renamed to be more generic ErrBadKey in commit 2b17f4c.

A search on GitHub shows that there's no consumers using this error as sentinel error, and it's not used in our own code as such, so it should be safe to remove this error.

This patch removes the ErrBadKey error-type; it also removes the prefix (poorly formatted environment:) to make the error more generic, because the same function was used both for env-files and label-files.

- What I did

- How I did it

- How to verify it

- Description for the changelog

opts: remove ErrBadKey as it's not used as a sentinel error

- A picture of a cute animal (not mandatory but encouraged)

This error was originally introduced `ErrBadEnvVariable` in [moby/moby@500c8ba],
but merely for convenience, and not used as a sentinel error. After the code
was moved from the daemon to the cli repository, it was renamed to be more
generic `ErrBadKey` in commit 2b17f4c.

A search on GitHub shows that there's no consumers using this error as
sentinel error, and it's not used in our own code as such, so it should
be safe to remove this error.

This patch removes the `ErrBadKey` error-type; it also removes the prefix
(`poorly formatted environment:`) to make the error more generic, because
the same function was used both for env-files and label-files.

[moby/moby@500c8ba]: vdemeester/moby@500c8ba

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Oct 3, 2024
@thaJeztah thaJeztah added this to the 28.0.0 milestone Oct 3, 2024
@thaJeztah thaJeztah self-assigned this Oct 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.09%. Comparing base (7c85db6) to head (95e221e).
Report is 64 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5495      +/-   ##
==========================================
- Coverage   60.10%   60.09%   -0.01%     
==========================================
  Files         345      345              
  Lines       23447    23445       -2     
==========================================
- Hits        14092    14090       -2     
  Misses       8381     8381              
  Partials      974      974              

@thaJeztah thaJeztah requested a review from a team October 3, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code process/cherry-picked status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants