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

Commit

Permalink
Merge pull request #51 from secondsun/mdc2ups
Browse files Browse the repository at this point in the history
chore:replace mdc with ups
  • Loading branch information
secondsun authored Nov 22, 2019
2 parents e028b17 + 39bba7a commit a26935b
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 102 deletions.
23 changes: 12 additions & 11 deletions cmd/broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import (
"context"
"flag"
"fmt"
"os"
"os/signal"
"path"
"strconv"
"syscall"

"github.com/integr8ly/managed-service-broker/pkg/deploys/apicurio"
"github.com/integr8ly/managed-service-broker/pkg/deploys/che"
"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"
"path"
"strconv"
"syscall"
"github.com/integr8ly/managed-service-broker/pkg/deploys/unifiedpush"

"github.com/integr8ly/managed-service-broker/pkg/broker"
"github.com/integr8ly/managed-service-broker/pkg/broker/controller"
Expand Down Expand Up @@ -65,7 +66,7 @@ const (
fuseManagedServiceName = "fuse-managed"
rhssoServiceName = "rhsso"
userRHSSOServiceName = "user-rhsso"
mdcServiceName = "mdc"
unifiedpushServiceName = "unifiedpush"
)

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

Expand Down Expand Up @@ -175,8 +176,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") != ""
case unifiedpushServiceName:
return os.Getenv("UNIFIEDPUSH_DASHBOARD_URL") != ""
}
return false
}
50 changes: 0 additions & 50 deletions pkg/deploys/mdc/deployer.go

This file was deleted.

37 changes: 0 additions & 37 deletions pkg/deploys/mdc/objects.go

This file was deleted.

50 changes: 50 additions & 0 deletions pkg/deploys/unifiedpush/deployer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package unifiedpush

import (
"net/http"
"os"

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

type UnifiedpushDeployer struct {
id string
}

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

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

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

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

dashboardUrl := os.Getenv("UNIFIEDPUSH_DASHBOARD_URL")

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

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

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

return &brokerapi.LastOperationResponse{
State: brokerapi.StateSucceeded,
Description: "unifiedpush deployed successfully",
}, nil
}
Loading

0 comments on commit a26935b

Please sign in to comment.