You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When talking to a real chef server (in that case hosted chef) - and running the following queries. I get the following results (there are about 60 other nodes in this hosted chef account).
chef > search(:node, "role:api_server AND chef_environment:#{node.chef_environment} NOT tags:hidden", :filter_result => { 'ip' => ['ipaddress'] })
=> [{"ip"=>"1.1.1.1"}]
chef > search(:node, "role:api_server AND chef_environment:#{node.chef_environment} AND NOT tags:hidden", :filter_result => { 'ip' => ['ipaddress'] })
=> [{"ip"=>"1.1.1.1"}]
Works as I would expect
Also here i'm using filter results - but have confirmed the issue with both normal search and "partial" search.
On a test server - (using test-kichen with chef zero provisioner), and pre-populating node data, I see the following:
pry(#<Chef::Recipe>)> search(:node, "role:api_server AND chef_environment:#{node.chef_environment} NOT tags:hidden", :filter_result => { 'ip' => ['ipaddress'] })
=> [{"ip"=>"172.33.33.34"},{"ip"=>"172.33.33.50"}]
pry(#<Chef::Recipe>)> search(:node, "role:api_server AND chef_environment:#{node.chef_environment} AND NOT tags:hidden", :filter_result => { 'ip' => ['ipaddress'] })
=> [{"ip"=>"172.33.33.34"}]
pry(#<Chef::Recipe>)> search(:node, "role:api_server AND chef_environment:#{node.chef_environment}", :filter_result => { 'ip' => ['ipaddress'] })
=> [{"ip"=>"172.33.33.34"}]
So in this case it seems to be the AND or AND NOT at the end. This is easy for us to work around by using AND NOT in our cookbooks since that seems to work for both, but there might be a chef-zero or localmode bug.
The text was updated successfully, but these errors were encountered:
I suspect this is another instance of #92 - @petecheslock if you do "role:api_server AND chef_environment:#{node.chef_environment} OR NOT tags:hidden" do you still get both nodes returned?
@thommay yea - same thing (using latest 12.12.15 version of chef), if I do the query: role:api_server AND chef_environment:#{node.chef_environment} OR NOT tags:hidden then both nodes are still returned.
I just hit this bug too. In solr as far as I can tell the proper search query is: role:A AND chef_environment:B NOT tags:C. That NOT behaves as an AND NOT. However, that NOT seems to behave as an OR NOT in chef-zero instead. I'm able to workaround the issue by replacing the NOT with AND NOT.
This is with both Chef
12.0.0
and12.1.1
When talking to a real chef server (in that case hosted chef) - and running the following queries. I get the following results (there are about 60 other nodes in this hosted chef account).
Works as I would expect
Also here i'm using filter results - but have confirmed the issue with both normal search and "partial" search.
On a test server - (using test-kichen with chef zero provisioner), and pre-populating node data, I see the following:
Node Data
Then running queries against:
So in this case it seems to be the
AND
orAND NOT
at the end. This is easy for us to work around by usingAND NOT
in our cookbooks since that seems to work for both, but there might be a chef-zero or localmode bug.The text was updated successfully, but these errors were encountered: