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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/krane/cli/deploy_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ 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,
desc: "Path to file or directory that contains the configuration to apply" },
"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" },
Comment on lines +16 to +18
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

"global-timeout" => { type: :string, banner: "duration", default: DEFAULT_DEPLOY_TIMEOUT,
desc: "Max duration to monitor workloads correctly deployed" },
"protected-namespaces" => { type: :array, banner: "namespace1 namespace2 namespaceN",
Expand Down Expand Up @@ -51,7 +52,7 @@ def self.from_options(namespace, context, options)
protected_namespaces = []
end

KubernetesDeploy::OptionsHelper.with_processed_template_paths([options[:filenames]],
KubernetesDeploy::OptionsHelper.with_processed_template_paths(options[:filenames],
require_explicit_path: true) do |paths|
deploy = ::Krane::DeployTask.new(
namespace: namespace,
Expand Down
5 changes: 3 additions & 2 deletions lib/krane/cli/render_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ module Krane
module CLI
class RenderCommand
OPTIONS = {
bindings: { type: :array, desc: 'Bindings for erb' },
filenames: { type: :array, required: true, aliases: 'f', desc: 'Directories and files to render' },
bindings: { type: :array, banner: "foo=bar abc=def", desc: 'Bindings for erb' },
filenames: { type: :array, banner: 'config/deploy/production config/deploy/my-extra-resource.yml',
required: true, aliases: 'f', desc: 'Directories and files to render' },
}

def self.from_options(options)
Expand Down