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

Allow running without cluster.yml when tf_json present #1418

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
4 changes: 2 additions & 2 deletions lib/pharos/command_options/load_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def default_config_yaml
Pharos::YamlFile.new($stdin, force_erb: true, override_filename: '<stdin>')
else
cluster_config = Dir.glob('cluster.{yml,yml.erb}').first
signal_usage_error 'File does not exist: cluster.yml' if cluster_config.nil?
Pharos::YamlFile.new(cluster_config)
signal_usage_error 'File does not exist: cluster.yml' if cluster_config.nil? && !tf_json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is tf_json always available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it checks .nil?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant: will self.respond_to?(:tf_json) always?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in terraform apply, it only has --config.

Pharos::YamlFile.new(cluster_config || StringIO.new(''))
end
end

Expand Down