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

Properly sort consul configuration #411

Merged
merged 2 commits into from
Feb 9, 2017
Merged

Conversation

kamaradclimber
Copy link
Contributor

@kamaradclimber kamaradclimber commented Feb 8, 2017

Simple sort compare key & values. It fails for hash values.

For instance:

{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}

will raise ArgumentError: comparison of Array with Array failed.

Sorting by keys is sufficient

Fix #410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a

@kamaradclimber
Copy link
Contributor Author

kamaradclimber commented Feb 8, 2017

I've fixed tests (I thought I had actually)

@codecov-io
Copy link

codecov-io commented Feb 8, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@558baf3). Click here to learn what that means.

@@            Coverage Diff            @@
##             master     #411   +/-   ##
=========================================
  Coverage          ?   66.86%           
=========================================
  Files             ?        7           
  Lines             ?      341           
  Branches          ?        0           
=========================================
  Hits              ?      228           
  Misses            ?      113           
  Partials          ?        0
Impacted Files Coverage Δ
libraries/helpers.rb 54.05% <ø> (ø)
libraries/consul_config.rb 97.39% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 558baf3...b9f7fe5. Read the comment docs.

@kamaradclimber
Copy link
Contributor Author

tests are really flaky, I'll try to make them pass but they should be corrected.

Simple sort compare key & values. It fails for hash values.

For instance:

```
{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}
```

will raise `ArgumentError: comparison of Array with Array failed`.

Sorting by keys is sufficient

Fix sous-chefs#410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a
@legal90
Copy link
Contributor

legal90 commented Feb 9, 2017

@kamaradclimber I've just tried to rebase your branch onto current master state to get everything fixed. Don't you mind I finish it and merge this PR then?

@kamaradclimber
Copy link
Contributor Author

go ahead @legal90. I was quite suprised my branch has been rebased actually :)

Thanks for your help

Change-Id: I4a772cefa861f3c364d828c2cba03fea6f4bac23
@legal90 legal90 merged commit 82fac06 into sous-chefs:master Feb 9, 2017
@legal90
Copy link
Contributor

legal90 commented Feb 9, 2017

Thank you for the contribution!

@kamaradclimber kamaradclimber deleted the fix_410 branch February 9, 2017 13:32
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be more flexible on configuration accepted by this cookbook
3 participants