Skip to content

Commit

Permalink
Use correct route to prefill hawkular hostname
Browse files Browse the repository at this point in the history
Plural `get_routes` ignores `:name`, was querying /oapi/v1/routes and
returning all routes in all namespaces, and we were picking a random one.

`get_route` queries
/oapi/v1/namespaces/openshift-infra/routes/hawkular-metrics
giving the right route or nil.
  • Loading branch information
cben committed Jan 27, 2017
1 parent 4534348 commit 3878963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def set_ems_record_vars(ems, mode = nil)

def get_hostname_from_routes(ems, hostname, port, token)
client = ems.class.raw_connect(hostname, port, :bearer => token)
client.get_routes(:name=>'hawkular-metrics').first.try(:spec).try(:host)
client.get_route('hawkular-metrics', 'openshift-infra').try(:spec).try(:host)
end

def build_connection(ems, endpoints, mode)
Expand Down

0 comments on commit 3878963

Please sign in to comment.