-
Notifications
You must be signed in to change notification settings - Fork 432
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
Conversation
CDS Report build-all-cds#13214.0 ✘
|
if err != nil { | ||
return actionplugin.Fail("Unable to get clair configuration: %s", err) | ||
} | ||
serv := servs[0] |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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:"-"` |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
@ovh/cds