Skip to content
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

Merged
merged 3 commits into from
Oct 28, 2019
Merged

Conversation

dturn
Copy link
Contributor

@dturn dturn commented Oct 28, 2019

What are you trying to accomplish with this PR?

Currently the -f flag in for krane 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.

@dturn dturn requested review from timothysmith0609 and a team October 28, 2019 19:49
Copy link
Contributor

@timothysmith0609 timothysmith0609 left a 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.rbs 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.

@@ -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,
Copy link
Contributor

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

Comment on lines +16 to +18
"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" },
Copy link
Contributor

@timothysmith0609 timothysmith0609 Oct 28, 2019

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

@dturn dturn merged commit 8066fed into master Oct 28, 2019
@dturn dturn deleted the krane-multi-file-name branch October 28, 2019 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants