Skip to content

Commit

Permalink
Add MaintenanceInfo to UpdateDetails
Browse files Browse the repository at this point in the history
[#161178125]

Signed-off-by: Kieron Browne <[email protected]>
Co-authored-by: Kieron Browne <[email protected]>
  • Loading branch information
Derik Evangelista and Kieron Browne committed Dec 6, 2018
1 parent bfda5bd commit ee812b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 10 additions & 0 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,12 @@ var _ = Describe("Service Broker API", func() {
"context": map[string]interface{}{
"new-context": "new-context-value",
},
"maintenance_info": map[string]interface{}{
"public": map[string]string{
"k8s-version": "0.0.1-alpha2",
},
"private": "just a sha thing",
},
}
queryString = "?accept_incomplete=true"
})
Expand Down Expand Up @@ -888,6 +894,10 @@ var _ = Describe("Service Broker API", func() {
},
))
Expect(fakeServiceBroker.UpdateDetails.RawParameters).To(Equal(json.RawMessage(`{"new-param":"new-param-value"}`)))
Expect(fakeServiceBroker.UpdateDetails.MaintenanceInfo).To(Equal(brokerapi.MaintenanceInfo{
Public: map[string]string{"k8s-version": "0.0.1-alpha2"},
Private: "just a sha thing"},
))
})

It("calls update with details with raw parameters", func() {
Expand Down
11 changes: 6 additions & 5 deletions service_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ type DeprovisionDetails struct {
}

type UpdateDetails struct {
ServiceID string `json:"service_id"`
PlanID string `json:"plan_id"`
RawParameters json.RawMessage `json:"parameters,omitempty"`
PreviousValues PreviousValues `json:"previous_values"`
RawContext json.RawMessage `json:"context,omitempty"`
ServiceID string `json:"service_id"`
PlanID string `json:"plan_id"`
RawParameters json.RawMessage `json:"parameters,omitempty"`
PreviousValues PreviousValues `json:"previous_values"`
RawContext json.RawMessage `json:"context,omitempty"`
MaintenanceInfo MaintenanceInfo `json:"maintenance_info,omitempty"`
}

type PreviousValues struct {
Expand Down

0 comments on commit ee812b2

Please sign in to comment.