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

fix(api): Allow to get every service through getServiceHandler #5173

Merged
merged 2 commits into from
May 12, 2020

Conversation

sguiheux
Copy link
Collaborator

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

@ovh-cds
Copy link
Collaborator

ovh-cds commented May 11, 2020

CDS Report build-all-cds#13214.0 ✘

  • Build
    • Build and Package All ✔
    • Build Debpacker ✔
    • Build OS-Ansible-Inventory ✔
    • Build SMTPMock ✔
    • Lint UI Translate ✔
    • Test CLI ✔
    • Test Engine ✘
    • Test SDK ✔
    • Test SDK Rust ✔
    • Test UI ✔

if err != nil {
return actionplugin.Fail("Unable to get clair configuration: %s", err)
}
serv := servs[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check length before

@@ -423,7 +423,7 @@ func (api *API) InitRouter() {
// Engine µServices
r.Handle("/services/register", Scope(sdk.AuthConsumerScopeService), r.POST(api.postServiceRegisterHandler, MaintenanceAware()))
r.Handle("/services/heartbeat", Scope(sdk.AuthConsumerScopeService), r.POST(api.postServiceHearbeatHandler))
r.Handle("/services/{type}", Scope(sdk.AuthConsumerScopeService), r.GET(api.getExternalServiceHandler))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/services?type=clair should be better no ?

@@ -11,8 +12,26 @@ import (
"github.com/ovh/cds/sdk/log"
)

// ExternalService represents an external service
type ExternalService struct {
sdk.Service `json:"-"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We realy need this?

@@ -11,8 +12,26 @@ import (
"github.com/ovh/cds/sdk/log"
)

// ExternalService represents an external service
type ExternalService struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this type can be removed, ServiceConfiguration will be enough.

@richardlt richardlt merged commit 21b845b into master May 12, 2020
@richardlt richardlt deleted the getServicehandler branch May 20, 2020 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants