Skip to content

Commit

Permalink
Add new ErrMaintenanceInfoConflict failure response
Browse files Browse the repository at this point in the history
- used when broker receives a request to update / provision a plan with a maintenance info which does not match the broker's catalog

[#161178125]

Signed-off-by: Kieron Browne <[email protected]>
Co-authored-by: Kieron Browne <[email protected]>
  • Loading branch information
jacknewberry and Kieron Browne committed Dec 7, 2018
1 parent ee812b2 commit 103135e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const (
invalidServiceID = "invalid-service-id"
invalidPlanID = "invalid-plan-id"
concurrentAccessKey = "get-instance-during-update"
maintenanceInfoConflictKey = "maintenance-info-conflict"
)

var (
Expand Down
5 changes: 5 additions & 0 deletions service_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const (
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"
)

var (
Expand Down Expand Up @@ -259,4 +260,8 @@ var (
ErrConcurrentInstanceAccess = NewFailureResponseBuilder(
errors.New(concurrentInstanceAccessMsg), http.StatusUnprocessableEntity, concurrentAccessKey,
).WithErrorKey("ConcurrencyError")

ErrMaintenanceInfoConflict = NewFailureResponseBuilder(
errors.New(maintenanceInfoConflictMsg), http.StatusUnprocessableEntity, maintenanceInfoConflictKey,
).WithErrorKey("MaintenanceInfoConflict").Build()
)

0 comments on commit 103135e

Please sign in to comment.