Fix missing definitions

pull/2972/head
ssbkang 2019-06-27 22:00:25 +12:00
parent ba9838296e
commit 1a387228b0
4 changed files with 9 additions and 2 deletions

View File

@ -674,6 +674,7 @@ func main() {
ResourceControlService: store.ResourceControlService, ResourceControlService: store.ResourceControlService,
SettingsService: store.SettingsService, SettingsService: store.SettingsService,
RegistryService: store.RegistryService, RegistryService: store.RegistryService,
DeploymentKeyService: store.DeploymentKeyService,
DockerHubService: store.DockerHubService, DockerHubService: store.DockerHubService,
StackService: store.StackService, StackService: store.StackService,
ScheduleService: store.ScheduleService, ScheduleService: store.ScheduleService,

View File

@ -33,7 +33,7 @@ func (handler *Handler) deploymentkeyCreate(w http.ResponseWriter, r *http.Reque
return &httperror.HandlerError{http.StatusNotFound, "Unable to find a deployment key with the specified identifier inside the database", err} return &httperror.HandlerError{http.StatusNotFound, "Unable to find a deployment key with the specified identifier inside the database", err}
} else if err != nil { } else if err != nil {
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find a deployment key with the specified identifier inside the database", err} return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find a deployment key with the specified identifier inside the database", err}
} }
// Add a function to call and create public key and private key // Add a function to call and create public key and private key

View File

@ -9,7 +9,7 @@ import (
"github.com/portainer/portainer/api/http/security" "github.com/portainer/portainer/api/http/security"
) )
// Handler is the HTTP handler used to handle webhook operations. // Handler is the HTTP handler used to handle deploymentkey operations.
type Handler struct { type Handler struct {
*mux.Router *mux.Router
DeploymentKeyService portainer.DeploymentKeyService DeploymentKeyService portainer.DeploymentKeyService

View File

@ -9,6 +9,7 @@ import (
"github.com/portainer/portainer/api/docker" "github.com/portainer/portainer/api/docker"
"github.com/portainer/portainer/api/http/handler" "github.com/portainer/portainer/api/http/handler"
"github.com/portainer/portainer/api/http/handler/auth" "github.com/portainer/portainer/api/http/handler/auth"
"github.com/portainer/portainer/api/http/handler/deploymentkeys"
"github.com/portainer/portainer/api/http/handler/dockerhub" "github.com/portainer/portainer/api/http/handler/dockerhub"
"github.com/portainer/portainer/api/http/handler/endpointgroups" "github.com/portainer/portainer/api/http/handler/endpointgroups"
"github.com/portainer/portainer/api/http/handler/endpointproxy" "github.com/portainer/portainer/api/http/handler/endpointproxy"
@ -51,6 +52,7 @@ type Server struct {
JobScheduler portainer.JobScheduler JobScheduler portainer.JobScheduler
Snapshotter portainer.Snapshotter Snapshotter portainer.Snapshotter
RoleService portainer.RoleService RoleService portainer.RoleService
DeploymentKeyService portainer.DeploymentKeyService
DockerHubService portainer.DockerHubService DockerHubService portainer.DockerHubService
EndpointService portainer.EndpointService EndpointService portainer.EndpointService
EndpointGroupService portainer.EndpointGroupService EndpointGroupService portainer.EndpointGroupService
@ -222,9 +224,13 @@ func (server *Server) Start() error {
webhookHandler.EndpointService = server.EndpointService webhookHandler.EndpointService = server.EndpointService
webhookHandler.DockerClientFactory = server.DockerClientFactory webhookHandler.DockerClientFactory = server.DockerClientFactory
var deploymentKeyHandler = deploymentkeys.NewHandler(requestBouncer)
deploymentKeyHandler.DeploymentKeyService = server.DeploymentKeyService
server.Handler = &handler.Handler{ server.Handler = &handler.Handler{
RoleHandler: roleHandler, RoleHandler: roleHandler,
AuthHandler: authHandler, AuthHandler: authHandler,
DeploymentKeyHandler: deploymentKeyHandler,
DockerHubHandler: dockerHubHandler, DockerHubHandler: dockerHubHandler,
EndpointGroupHandler: endpointGroupHandler, EndpointGroupHandler: endpointGroupHandler,
EndpointHandler: endpointHandler, EndpointHandler: endpointHandler,