Skip to content

Commit

Permalink
Merge pull request #2 from redBorder/bugfix/#18334_registered_in_cons…
Browse files Browse the repository at this point in the history
…ul_with_wrong_port_and_ip

Bugfix/#18334 registered in consul with wrong port and ip
  • Loading branch information
JPeraltaNic authored Aug 29, 2024
2 parents 74d6120 + 8c2bbf4 commit a36c22e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@

action :register do
begin
ipaddress = new_resource.ipaddress

unless node['redborder-ai']['registered']
query = {}
query['ID'] = "redborder-ai-#{node['hostname']}"
query['Name'] = 'redborder-ai'
query['Address'] = "#{node['ipaddress']}"
query['Port'] = 5000
query['Address'] = ipaddress
query['Port'] = 50505
json_query = Chef::JSONCompat.to_json(query)

execute 'Register service in consul' do
Expand All @@ -119,7 +121,7 @@
node.normal['redborder-ai']['registered'] = true
Chef::Log.info('redborder-ai service has been registered to consul')
end
rescue => e
rescue StandardError => e
Chef::Log.error(e.message)
end
end
Expand Down
1 change: 1 addition & 0 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
attribute :user, kind_of: String, default: 'redborder-ai'
attribute :cdomain, kind_of: String, default: 'redborder.cluster'
attribute :ai_selected_model, kind_of: String
attribute :ipaddress, kind_of: String, default: '127.0.0.1'

0 comments on commit a36c22e

Please sign in to comment.