Skip to content

Commit

Permalink
Add MaintenanceInfo to provision request struct
Browse files Browse the repository at this point in the history
[#162013007]
  • Loading branch information
jacknewberry committed Dec 19, 2018
1 parent 4a9ce97 commit 588de80
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
18 changes: 18 additions & 0 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ var _ = Describe("Service Broker API", func() {
"plan_id": "plan-id",
"organization_guid": "organization-guid",
"space_guid": "space-guid",
"maintenance_info": map[string]interface{}{
"public": map[string]string{
"k8s-version": "0.0.1-alpha2",
},
"private": "just a sha thing",
},
}
})

Expand All @@ -358,6 +364,12 @@ var _ = Describe("Service Broker API", func() {
PlanID: "plan-id",
OrganizationGUID: "organization-guid",
SpaceGUID: "space-guid",
MaintenanceInfo: brokerapi.MaintenanceInfo{
Public: map[string]string{
"k8s-version": "0.0.1-alpha2",
},
Private: "just a sha thing",
},
}))
})

Expand Down Expand Up @@ -630,6 +642,12 @@ var _ = Describe("Service Broker API", func() {
PlanID: "plan-id",
OrganizationGUID: "organization-guid",
SpaceGUID: "space-guid",
MaintenanceInfo: brokerapi.MaintenanceInfo{
Public: map[string]string{
"k8s-version": "0.0.1-alpha2",
},
Private: "just a sha thing",
},
}))

Expect(fakeServiceBroker.ProvisionedInstanceIDs).To(ContainElement(instanceID))
Expand Down
29 changes: 15 additions & 14 deletions service_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type ProvisionDetails struct {
SpaceGUID string `json:"space_guid"`
RawContext json.RawMessage `json:"context,omitempty"`
RawParameters json.RawMessage `json:"parameters,omitempty"`
MaintenanceInfo MaintenanceInfo `json:"maintenance_info,omitempty"`
}

type ProvisionedServiceSpec struct {
Expand Down Expand Up @@ -197,20 +198,20 @@ type SharedDevice struct {
}

const (
instanceExistsMsg = "instance already exists"
instanceDoesntExistMsg = "instance does not exist"
serviceLimitReachedMsg = "instance limit for this service has been reached"
servicePlanQuotaExceededMsg = "The quota for this service plan has been exceeded. Please contact your Operator for help."
serviceQuotaExceededMsg = "The quota for this service has been exceeded. Please contact your Operator for help."
bindingExistsMsg = "binding already exists"
bindingDoesntExistMsg = "binding does not exist"
bindingNotFoundMsg = "binding cannot be fetched"
asyncRequiredMsg = "This service plan requires client support for asynchronous service operations."
planChangeUnsupportedMsg = "The requested plan migration cannot be performed"
rawInvalidParamsMsg = "The format of the parameters is not valid JSON"
appGuidMissingMsg = "app_guid is a required field but was not provided"
concurrentInstanceAccessMsg = "instance is being updated and cannot be retrieved"
maintenanceInfoConflictMsg = "passed maintenance_info does not match the catalog maintenance_info"
instanceExistsMsg = "instance already exists"
instanceDoesntExistMsg = "instance does not exist"
serviceLimitReachedMsg = "instance limit for this service has been reached"
servicePlanQuotaExceededMsg = "The quota for this service plan has been exceeded. Please contact your Operator for help."
serviceQuotaExceededMsg = "The quota for this service has been exceeded. Please contact your Operator for help."
bindingExistsMsg = "binding already exists"
bindingDoesntExistMsg = "binding does not exist"
bindingNotFoundMsg = "binding cannot be fetched"
asyncRequiredMsg = "This service plan requires client support for asynchronous service operations."
planChangeUnsupportedMsg = "The requested plan migration cannot be performed"
rawInvalidParamsMsg = "The format of the parameters is not valid JSON"
appGuidMissingMsg = "app_guid is a required field but was not provided"
concurrentInstanceAccessMsg = "instance is being updated and cannot be retrieved"
maintenanceInfoConflictMsg = "passed maintenance_info does not match the catalog maintenance_info"
maintenanceInfoNilConflictMsg = "maintenance_info was passed, but the broker catalog contains no maintenance_info"
)

Expand Down

0 comments on commit 588de80

Please sign in to comment.