Closed GrahamDumpleton closed 3 years ago
BTW, when would -f
not be a mandatory option with kapp deploy
. So why shouldn't it just outright error when it is missing based on that?
BTW, when would -f not be a mandatory option with kapp deploy. So why shouldn't it just outright error when it is missing based on that?
that's a good point. ill have to think why isnt the case right now...
Another example to take into consideration when changing this.
When piping from ytt
and the error is in ytt
you will get:
$ ytt -f templates-v2 --data-values-file override-values.yaml | kapp deploy -a website -f - -y
ytt: Error:
- string has no .hostname field or method
in <toplevel>
ingress.yaml:3 | #@ if data.values.website.ingress.hostname and data.values.website.ingress.domain:
Target cluster 'https://10.96.0.1:443'
kapp: Error: Trying to apply empty set of resources will result in deletion of resources on cluster. Refusing to continue unless --dangerous-allow-empty-list-of-resources is specified.
You aren't going to avoid the cascading errors in this case, so just need to be mindful of how changes in the message will appear in this sort of situation.
Things we are planning to do as part of this issue:
@cppforlife , Is the file option not mandatory, because we want to support --dangerous-allow-empty-list-of-resources?
because we want to support --dangerous-allow-empty-list-of-resources?
nah, that flag just indicates that its ok if given file(s) has 0 resources inside. i think i just never added a validation check for -f for no good reason.
Describe the problem/challenge you have
Run:
One will get an error message saying:
This isn't useful in understanding the obvious mistake you likely made.
Describe the solution you'd like
Reword the message to something like:
In other words suggest maybe the issue is they forgot to provide the
-f
or--file
option.In this case what was actually required was
-f -
and if it can detect thatstdin
wasn't closed but something was being piped tokapp
then maybe it can be even more specific and ask if-f -
was forgotten.Anything else you would like to add:
I get confused by this message every time when I forget the
-f
option. :-(Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
cc @jorgemoralespou