Skip to content

Commit

Permalink
feat: Use service keys for Route configuration keys (#3247)
Browse files Browse the repository at this point in the history
closes #3246

Signed-off-by: lenny <leonard.goodell@intel.com>
  • Loading branch information
lenny-goodell authored Mar 10, 2021
1 parent fb188d2 commit c48b5c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions cmd/security-proxy-setup/res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,44 @@ RetryWaitPeriod = "1s"
AuthType = "X-Vault-Token"

[Routes]
[Routes.CoreData]
[Routes.edgex-core-data]
Name = "coredata"
Protocol = "http"
Host = "localhost"
Port = 48080

[Routes.Metadata]
[Routes.edgex-core-metadata]
Name = "metadata"
Protocol = "http"
Host = "localhost"
Port = 48081

[Routes.Command]
[Routes.edgex-core-command]
Name = "command"
Protocol = "http"
Host = "localhost"
Port = 48082

[Routes.Notifications]
[Routes.edgex-support-notifications]
Name = "notifications"
Protocol = "http"
Host = "localhost"
Port = 48060

[Routes.Scheduler]
[Routes.edgex-support-scheduler]
Name = "scheduler"
Protocol = "http"
Host = "localhost"
Port = 48085

[Routes.RulesEngine]
[Routes.rules-engine]
Name = "rulesengine"
Protocol = "http"
Host = "localhost"
Port = 48075

[Routes.VirtualDevice]
[Routes.device-virtual]
Name = "virtualdevice"
Protocol = "http"
Host = "localhost"
Port = 49990
Port = 49990
4 changes: 2 additions & 2 deletions internal/security/proxy/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (s *Service) initKongService(service *models.KongService) error {

switch resp.StatusCode {
case http.StatusOK, http.StatusCreated:
s.loggingClient.Info(fmt.Sprintf("successful to set up proxy service for %s", service.Name))
s.loggingClient.Info(fmt.Sprintf("successful to set up proxy service for `%s` at `%s:%d`", service.Name, service.Host, service.Port))
break
case http.StatusConflict:
s.loggingClient.Info(fmt.Sprintf("proxy service for %s has been set up", service.Name))
Expand Down Expand Up @@ -382,7 +382,7 @@ func (s *Service) initKongRoutes(r *models.KongRoute, name string) error {
switch resp.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusConflict:
s.routes[name] = r
s.loggingClient.Info(fmt.Sprintf("successful to set up route for %s", name))
s.loggingClient.Info(fmt.Sprintf("successful to set up route for `%s` at `%v`", name, r.Paths))
break
default:
e := fmt.Sprintf("failed to set up route for %s with error %s", name, resp.Status)
Expand Down

0 comments on commit c48b5c6

Please sign in to comment.