-
Notifications
You must be signed in to change notification settings - Fork 115
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
Support multiple filenames in krane deploy #606
Conversation
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.
Tested things locally and it makes sense. Since -f
is already working for render_command
, and there's some overlap between how those 2 tasks work, that's not surprising.
The formatting between the various X_command.rb
s are all different: e.g symbol vs string keys, line-per-arg vs fit-per-line. Might be a good tidy-up to make sure these are all consistent, but that's not related to this PR.
lib/krane/cli/deploy_command.rb
Outdated
@@ -13,7 +13,7 @@ class DeployCommand | |||
"bindings" => { type: :array, banner: "foo=bar abc=def", | |||
desc: "Expose additional variables to ERB templates (format: k1=v1 k2=v2, JSON string or file "\ | |||
"(JSON or YAML) path prefixed by '@')" }, | |||
"filenames" => { type: :string, banner: '/tmp/my-resource.yml', aliases: :f, required: true, | |||
"filenames" => { type: :array, banner: '/tmp/my-resource.yml', aliases: :f, required: true, |
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.
style nit (scope might be beyond this PR): The formatting for each X_command.rb
is different for each command. E.g. render
uses symbolized keys, run
uses line-per-field, etc. Would be nice to have these be consistent
"filenames" => { type: :array, banner: 'config/deploy/production config/deploy/my-extra-resource.yml', | ||
aliases: :f, required: true, | ||
desc: "Directories and files that contains the configuration to apply" }, |
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.
For consistency let's add this to render
as well. Edit: by 'this', I mean the banner
description
What are you trying to accomplish with this PR?
Currently the
-f
flag in forkrane deploy
only supports a single filename or directly. This appears to be an oversight from waiting for thor to handle repeated flags.Krane render
supports the multiple files/directories.How is this accomplished?
Change thor type to an array.
What could go wrong?
We don't support csv only white space separated.