From 103135e312594f6d47a51cc1044940b26deca294 Mon Sep 17 00:00:00 2001 From: Jack Newberry Date: Fri, 7 Dec 2018 15:04:36 +0000 Subject: [PATCH] Add new ErrMaintenanceInfoConflict failure response - 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 Co-authored-by: Kieron Browne --- api.go | 1 + service_broker.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/api.go b/api.go index 170b7e01..27ccbebe 100644 --- a/api.go +++ b/api.go @@ -62,6 +62,7 @@ const ( invalidServiceID = "invalid-service-id" invalidPlanID = "invalid-plan-id" concurrentAccessKey = "get-instance-during-update" + maintenanceInfoConflictKey = "maintenance-info-conflict" ) var ( diff --git a/service_broker.go b/service_broker.go index 711f05ca..586eba18 100644 --- a/service_broker.go +++ b/service_broker.go @@ -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 ( @@ -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() )