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

Commit

Permalink
Apicurio fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sedroche committed Dec 7, 2018
1 parent f583d2d commit 8635a57
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TAG = 1.0.3
TAG = 1.0.4
DOCKERORG = quay.io/integreatly
BROKER_IMAGE_NAME = managed-service-broker

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $ oc process -f templates/broker.template.yaml \
-p CHE_DASHBOARD_URL=<cheDashBoardUrl> \
-p LAUNCHER_DASHBOARD_URL=<launcherDashBoardUrl> \
-p THREESCALE_DASHBOARD_URL=<3scaleDashBoardUrl> \
-p APICURIO_DASHBOARD_URL=<apiCurioDashBoardUrl> \
| oc create -f -

# Verify that the broker has been registered correctly and STATUS is 'Ready'
Expand All @@ -52,7 +53,8 @@ $ svcat get brokers
$ oc describe clusterservicebroker managed-service-broker
```

__NOTE:__ Che and Launcher do not need to be deployed to deploy the managed-service-broker, `CHE_DASHBOARD_URL` and `LAUNCHER_DASHBOARD_URL` just need to be set to a non-empty value.
__NOTE:__ The services requiring `X_DASHBOARD_URL` parameters do not need to be installed to run the broker, the parameters just need to be set to a non-empty value to deploy the template.

#### Add syndesis-crd:

```
Expand Down
26 changes: 9 additions & 17 deletions pkg/deploys/apicurio/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,16 @@ import (
"net/http"
"os"

"k8s.io/api/authentication/v1"

brokerapi "github.com/integr8ly/managed-service-broker/pkg/broker"
"github.com/integr8ly/managed-service-broker/pkg/clients/openshift"
glog "github.com/sirupsen/logrus"
"k8s.io/client-go/kubernetes"
)

type ApiCurioDeployer struct {
id string
}

func NewDeployer(id string) *ApiCurioDeployer {
return &ApiCurioDeployer{id: id}
}

func (ac *ApiCurioDeployer) IsForService(serviceID string) bool {
return serviceID == "apicurio-service-id"
func NewDeployer() *ApiCurioDeployer {
return &ApiCurioDeployer{}
}

func (ac *ApiCurioDeployer) GetCatalogEntries() []*brokerapi.Service {
Expand All @@ -33,23 +25,23 @@ func (ac *ApiCurioDeployer) GetID() string {
return ac.id
}

func (ac *ApiCurioDeployer) Deploy(instanceID, brokerNamespace string, contextProfile brokerapi.ContextProfile, parameters map[string]interface{}, userInfo v1.UserInfo, k8sclient kubernetes.Interface, osClientFactory *openshift.ClientFactory) (*brokerapi.CreateServiceInstanceResponse, error) {
glog.Infof("Deploying apicurio from deployer, id: %s", instanceID)
func (ac *ApiCurioDeployer) Deploy(req *brokerapi.ProvisionRequest, async bool) (*brokerapi.ProvisionResponse, error) {
glog.Infof("Deploying apicurio from deployer, id: %s", req.InstanceId)

dashboardUrl := os.Getenv("APICURIO_DASHBOARD_URL")

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

func (ac *ApiCurioDeployer) RemoveDeploy(serviceInstanceId string, namespace string, k8sclient kubernetes.Interface) error {
return nil
func (ac *ApiCurioDeployer) RemoveDeploy(req *brokerapi.DeprovisionRequest, async bool) (*brokerapi.DeprovisionResponse, error) {
return &brokerapi.DeprovisionResponse{Operation: "remove"}, nil
}

func (ac *ApiCurioDeployer) LastOperation(instanceID string, k8sclient kubernetes.Interface, osclient *openshift.ClientFactory, operation string) (*brokerapi.LastOperationResponse, error) {
glog.Infof("Getting last operation for %s", instanceID)
func (ac *ApiCurioDeployer) ServiceInstanceLastOperation(req *brokerapi.LastOperationRequest) (*brokerapi.LastOperationResponse, error) {
glog.Infof("Getting last operation for %s", req.InstanceId)

return &brokerapi.LastOperationResponse{
State: brokerapi.StateSucceeded,
Expand Down
2 changes: 1 addition & 1 deletion templates/broker.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ parameters:

- name: IMAGE_TAG
description: Tag of the broker image
value: "1.0.2"
value: "1.0.4"

- name: IMAGE_PULL_POLICY
value: "Always"
Expand Down
5 changes: 3 additions & 2 deletions tests/managedServicesBroker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
var (
envBrokerURL = os.Getenv(BROKER_URL)
envToken = os.Getenv(KUBERNETES_API_TOKEN)
numServices = 5
)

var (
Expand Down Expand Up @@ -77,8 +78,8 @@ func TestManagedBroker(t *testing.T) {
}
t.Fatal(fmt.Sprintf("Error getting Catalog: %s", message))
}
if len(sc.Services) != 4 {
t.Fatal("There should be 4 managed services")
if len(sc.Services) != numServices {
t.Fatalf("There should be %d managed services", numServices)
}

// Generic broker tests
Expand Down

0 comments on commit 8635a57

Please sign in to comment.