-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Clarifiy error message when using an improperly formatted secret with kube #26586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarifiy error message when using an improperly formatted secret with kube #26586
Conversation
Failing because this PR doesn't add any tests. I don't think this PR requires a new test since its just tweaking an existing error message. Let me know if I'm wrong and I'll whip up a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test case would be good to just to make sure we keep it working and this is indeed the right place. You could have a look at "secret as volume support - simple" in test/e2e/play_kube_test.go and then instead add a case where you created the secret with podman secret create and make sure it errors with the proper message.
Also FYI please add Fixes: #26561
as part of the commit message itself not just in the PR description.
https://github.com/containers/podman/blob/main/CONTRIBUTING.md#describe-your-changes-in-commit-messages
6a035f2
to
0894cb1
Compare
…h kube Fixes: containers#26586 Signed-off-by: Craig Spencer craig.spencer812@gmail.com
0894cb1
to
7400fc4
Compare
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
…h kube Fixes: containers#26586 Signed-off-by: Craig Spencer craig.spencer812@gmail.com
0e38d8a
to
b69d5fd
Compare
I copied the test
I could definitely slim the test down a bit but I'm curious what you guys think. |
Also a spent a long time trying to solve a bug on my end where podman didn't recognize crun. Turns out I had an old version installed that was messing things up so I reinstalled it from source manually. Not sure if this is a common issue but I figured I'd mention it somewhere since it blocked me for a while. But lessons learned and now my debugging and testing setup is running smoothly! |
Restarted 3 flakes. |
DCO check is complaining about one of your commits, though. |
One nit, code LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please squash all commits into one as we merge commit as is and there should be no wip commits and the likes. And we prefer chnage and test to be part of the same commit.
There seem to be some weird merge commits in here. Our general workflow is to rebase PRs again main to keep it up to date with the latest changes.
…h kube Fixes: containers#26586 Signed-off-by: Craig Spencer craig.spencer812@gmail.com
fcfd0fc
to
343452a
Compare
…h kube Fixes: containers#26586 Signed-off-by: Craig Spencer craig.spencer812@gmail.com
343452a
to
4917c09
Compare
…h kube Fixes: containers#26586 Signed-off-by: Craig Spencer <craig.spencer812@gmail.com>
4917c09
to
5e44c17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thank you
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Craig-Spencer-12, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Using an improperly formatted secret with kube returns a generic error message
Error: failed to create volume "my-volume": error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.Secret
This PR updates the error message to include why the failure occured:
Error: failed to create volume "my-volume": only secrets created via the kube yaml file are supported: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.Secret
Closes: #26561
Does this PR introduce a user-facing change?