(c flags.FlagContext)
| 62 | } |
| 63 | |
| 64 | func (cmd *UnbindService) Execute(c flags.FlagContext) error { |
| 65 | app := cmd.appReq.GetApplication() |
| 66 | instance := cmd.serviceInstanceReq.GetServiceInstance() |
| 67 | |
| 68 | cmd.ui.Say(T("Unbinding app {{.AppName}} from service {{.ServiceName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.CurrentUser}}...", |
| 69 | map[string]interface{}{ |
| 70 | "AppName": terminal.EntityNameColor(app.Name), |
| 71 | "ServiceName": terminal.EntityNameColor(instance.Name), |
| 72 | "OrgName": terminal.EntityNameColor(cmd.config.OrganizationFields().Name), |
| 73 | "SpaceName": terminal.EntityNameColor(cmd.config.SpaceFields().Name), |
| 74 | "CurrentUser": terminal.EntityNameColor(cmd.config.Username()), |
| 75 | })) |
| 76 | |
| 77 | found, err := cmd.serviceBindingRepo.Delete(instance, app.GUID) |
| 78 | if err != nil { |
| 79 | return err |
| 80 | } |
| 81 | |
| 82 | cmd.ui.Ok() |
| 83 | |
| 84 | if !found { |
| 85 | cmd.ui.Warn(T("Binding between {{.InstanceName}} and {{.AppName}} did not exist", |
| 86 | map[string]interface{}{"InstanceName": instance.Name, "AppName": app.Name})) |
| 87 | } |
| 88 | return nil |
| 89 | } |
nothing calls this directly
no test coverage detected