summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2014-05-22 22:10:06 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2014-05-22 22:10:06 +0100
commitbebaa220449e1a12dc2122a2f75934d92322a135 (patch)
tree0346f1fb1ce7159a0d5715bd700d2cf6dafdda47
parent92519eb2cf7ae1b362f22d5710a229c5809a47cc (diff)
downloadchef-bebaa220449e1a12dc2122a2f75934d92322a135.tar.gz
Doc fix to highlight that -E is not respected by knife ssh [search]
I noticed this when my production server host names were being listed in Chef activity after switching to a new deployment tactic. For example, it's fairly safe to assume that the command below will only run on staging: $ knife ssh -E stag "role:api" "foo" Actually it runs on ANY node with role:api, which is not only unexpected but ludicrously dangerous in the case of deployments. You can do this: $ knife ssh "chef_environment:stag AND role:api" "foo" I did that after doing an emergency rollback. I'd like this documentation change to be done to avoid that happening to others. Happy to change wording of course.
-rw-r--r--distro/common/markdown/man1/knife.mkd2
-rw-r--r--lib/chef/application/knife.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/distro/common/markdown/man1/knife.mkd b/distro/common/markdown/man1/knife.mkd
index 8c97cc97e1..61e0c7f8b9 100644
--- a/distro/common/markdown/man1/knife.mkd
+++ b/distro/common/markdown/man1/knife.mkd
@@ -41,7 +41,7 @@ documentation using `knife help TOPIC`.
* `-c`, `--config` CONFIG:
The configuration file to use
* `-E`, `--environment ENVIRONMENT`:
- Set the Chef environment
+ Set the Chef environment (except for in searches, where this will be flagrantly ignored)
* `-e`, `--editor` EDITOR:
Set the editor to use for interactive commands
* `-F`, `--format` FORMAT:
diff --git a/lib/chef/application/knife.rb b/lib/chef/application/knife.rb
index 5f2456311c..1eac4b55f3 100644
--- a/lib/chef/application/knife.rb
+++ b/lib/chef/application/knife.rb
@@ -51,7 +51,7 @@ class Chef::Application::Knife < Chef::Application
option :environment,
:short => "-E ENVIRONMENT",
:long => "--environment ENVIRONMENT",
- :description => "Set the Chef environment"
+ :description => "Set the Chef environment (except for in searches, where this will be flagrantly ignored)"
option :editor,
:short => "-e EDITOR",