Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
mdc service
Browse files Browse the repository at this point in the history
  • Loading branch information
odra committed Aug 7, 2019
1 parent 787eb1f commit b326c2a
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/integr8ly/managed-service-broker/pkg/deploys/fuse"
"github.com/integr8ly/managed-service-broker/pkg/deploys/fuse_managed"
"github.com/integr8ly/managed-service-broker/pkg/deploys/launcher"
"github.com/integr8ly/managed-service-broker/pkg/deploys/mdc"
"github.com/integr8ly/managed-service-broker/pkg/deploys/sso"
"os"
"os/signal"
Expand Down Expand Up @@ -64,6 +65,7 @@ const (
fuseManagedServiceName = "fuse-managed"
rhssoServiceName = "rhsso"
userRHSSOServiceName = "user-rhsso"
mdcServiceName = "mdc"
)

func runWithContext(ctx context.Context) error {
Expand Down Expand Up @@ -126,6 +128,9 @@ func runWithContext(ctx context.Context) error {
if shouldRegisterService(userRHSSOServiceName) {
deployers = append(deployers, sso.NewUserDeployer())
}
if shouldRegisterService(mdcServiceName) {
deployers = append(deployers, mdc.NewDeployer())
}
ctrlr := controller.CreateController(deployers)

ctrlr.Catalog()
Expand Down Expand Up @@ -170,6 +175,8 @@ func shouldRegisterService(serviceName string) bool {
return os.Getenv(sso.DefaultManagedURLEnv) != ""
case userRHSSOServiceName:
return os.Getenv(sso.DefaultUserURLEnv) != ""
case mdcServiceName:
return os.Getenv("MDC_DASHBOARD_URL") != ""
}
return false
}
50 changes: 50 additions & 0 deletions pkg/deploys/mdc/deployer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package mdc

import (
"net/http"
"os"

brokerapi "github.com/integr8ly/managed-service-broker/pkg/broker"
glog "github.com/sirupsen/logrus"
)

type MDCDeployer struct {
id string
}

func NewDeployer() *MDCDeployer {
return &MDCDeployer{}
}

func (md *MDCDeployer) GetCatalogEntries() []*brokerapi.Service {
glog.Infof("Getting mdc catalog entries")
return getCatalogServicesObj()
}

func (md *MDCDeployer) GetID() string {
return md.id
}

func (md *MDCDeployer) Deploy(req *brokerapi.ProvisionRequest, async bool) (*brokerapi.ProvisionResponse, error) {
glog.Infof("Deploying mdc from deployer, id: %s", req.InstanceId)

dashboardUrl := os.Getenv("MDC_DASHBOARD_URL")

return &brokerapi.ProvisionResponse{
Code: http.StatusAccepted,
DashboardURL: dashboardUrl,
}, nil
}

func (md *MDCDeployer) RemoveDeploy(req *brokerapi.DeprovisionRequest, async bool) (*brokerapi.DeprovisionResponse, error) {
return &brokerapi.DeprovisionResponse{Operation: "remove"}, nil
}

func (ac *MDCDeployer) ServiceInstanceLastOperation(req *brokerapi.LastOperationRequest) (*brokerapi.LastOperationResponse, error) {
glog.Infof("Getting last operation for %s", req.InstanceId)

return &brokerapi.LastOperationResponse{
State: brokerapi.StateSucceeded,
Description: "mdc deployed successfully",
}, nil
}
37 changes: 37 additions & 0 deletions pkg/deploys/mdc/objects.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package mdc

import (
brokerapi "github.com/integr8ly/managed-service-broker/pkg/broker"
)

// MDC plan
func getCatalogServicesObj() []*brokerapi.Service {
return []*brokerapi.Service{
{
Name: "mdc",
ID: "mdc-service-id",
Description: "mobile developer console",
Metadata: map[string]string{
"serviceName": "mdc",
"serviceType": "mdc",
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAABYlAAAWJQFJUiTwAAAVZklEQVR4nO2df3Bc1XXHv3d3Zck/ZWKGH8FCBjyxoCZ1itNAyBSR8qt/tDYDhpCmQYQWmOm0FXUmmUwA20MyCaQe3Jl26tJpkTNpfrkZmzLTEgipmOGHB2wQP0yEB4xkGVM8uLGQLFta7d7OWd0nP+19b/e9fb/ue3s+M8LLfbv7nnbfV+ece849V0gpwYTLYKdYCmANgBXqx/p/qMe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6YknpiWWKodZFIDdTykpm5J5ze8khqBWLy8XOyalFjH1iRdqDUcjwftlRs3qRMI2JqkjrRZDTupFIgFxSaTZXy9DBS0g0zi0M5OtHlNGmINN1ItEKiZrpLEDk4umgUl/WjbM5NnqLyQeoFYkNtVlNhZlDhHO8jEBm21TLvJptGdciIzArHY2yF6ixKbOD6JF4ozaJN+v/uQm07mBGLBQomHrArDIrMCsWChREPWhWGReYFYUG1XSeK7XLYSDCoPyQt829TaqbBpGoFYUDBfkvhOUeJKnh72Bk3Xtgg8nxe4LyvBt1eaTiB2KI8yLdHDM1/O0IxUQaAvzXmMoDS1QCwol1IG7i9KfLnZy+up/LxF4Mc54MG05zDCgAVSBblgZYmNJeDyZrEsZCnywJ6cwNZmc6HqwQKpAVkWCdxTktgwLdGZlZiFYoqCwHBeYKcAtrOlcIcF4oOKdQF6yhLdJeCTaXHHyG3KA0dyAv05oI+thHdYIAGhPIuUuKoMXFoGliWdb6H8RA44lgPeEALPZj1PETUskAhQrtmNElgtJVZKoL0MrKAzSaC1UctDlkAAk5hxk4YEMCoE3hHAmwLYxa5SyAD4fyxrGNFMaTxAAAAAAElFTkSuQmCC",
},
Plans: []brokerapi.ServicePlan{
brokerapi.ServicePlan{
Name: "default-mdc",
ID: "default-mdc",
Description: "default mdc plan",
Free: true,
Schemas: &brokerapi.Schemas{
ServiceBinding: &brokerapi.ServiceBindingSchema{
Create: &brokerapi.RequestResponseSchema{},
},
ServiceInstance: &brokerapi.ServiceInstanceSchema{
Create: &brokerapi.InputParametersSchema{},
},
},
},
},
},
}
}
6 changes: 6 additions & 0 deletions templates/broker.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ objects:
value: ${SHARED_FUSE_DASHBOARD_URL}
- name: SSO_URL
value: ${SSO_URL}
- name: MDC_DASHBOARD_URL
value: ${MDC_DASHBOARD_URL}
- name: USER_SSO_URL
value: ${USER_SSO_URL}
ports:
Expand Down Expand Up @@ -485,6 +487,10 @@ parameters:
description: User RH-SSO Url
required: true

- name: MDC_DASHBOARD_URL
description: Mobile Developer Console url
default: ""

- name: MONITORING_KEY
description: This value is applied to fuse namespaces to allow monitoring
required: true
Expand Down

0 comments on commit b326c2a

Please sign in to comment.