fix(cmd): prevent adding connection with invalid identities file#26042
fix(cmd): prevent adding connection with invalid identities file#26042axel7083 wants to merge 1 commit intocontainers:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: axel7083 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Code LGTM |
| case errors.Is(err, os.ErrNotExist): | ||
| logrus.Warnf("%q does not exist", entities.Identity) | ||
| case errors.Is(err, os.ErrPermission): | ||
| logrus.Warnf("You do not have permission to read %q", entities.Identity) |
There was a problem hiding this comment.
Why print a warning? Your commit says prevent adding but this doesn't prevent it at all.
IMO simply returning the error is the easiest and there is no need for us to special case each error, the orginal error should have enough information.
There was a problem hiding this comment.
unthoughtful copy paste from the line bellow :p
podman/cmd/podman/system/connection/add.go
Lines 162 to 169 in ae1f0b4
anyway I applied your suggestion
f06f112 to
ae1f0b4
Compare
|
please add a test |
ae1f0b4 to
3755d3d
Compare
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
3755d3d to
98575e5
Compare
|
LGTM |
|
A friendly reminder that this PR had no activity for 30 days. |
Fixes #26016
Does this PR introduce a user-facing change?