MCPcopy Create free account
hub / github.com/cloudfoundry/cli / findPlan

Method findPlan

cf/commands/service/update_service.go:156–171  ·  view source on GitHub ↗
(serviceInstance models.ServiceInstance, planName string)

Source from the content-addressed store, hash-verified

154}
155
156func (cmd *UpdateService) findPlan(serviceInstance models.ServiceInstance, planName string) (plan models.ServicePlanFields, err error) {
157 plans, err := cmd.planBuilder.GetPlansForServiceForOrg(serviceInstance.ServiceOffering.GUID, cmd.config.OrganizationFields().Name)
158 if err != nil {
159 return
160 }
161
162 for _, p := range plans {
163 if p.Name == planName {
164 plan = p
165 return
166 }
167 }
168 err = errors.New(T("Plan does not exist for the {{.ServiceName}} service",
169 map[string]interface{}{"ServiceName": serviceInstance.ServiceOffering.Label}))
170 return
171}
172
173func (cmd *UpdateService) printUpdatingServiceInstanceMessage(serviceInstanceName string) {
174 cmd.ui.Say(T("Updating service instance {{.ServiceName}} as {{.UserName}}...",

Callers 1

ExecuteMethod · 0.95

Calls 2

OrganizationFieldsMethod · 0.65

Tested by

no test coverage detected