(ctx context.Context, config InstallConfig)
| 109 | } |
| 110 | |
| 111 | func (c *Client) getInstallPath(ctx context.Context, config InstallConfig) (string, error) { |
| 112 | if config.Path != "" { |
| 113 | return config.Path, nil |
| 114 | } |
| 115 | resp, err := c.IntrospectionService().Plugins(ctx, "id==opt") |
| 116 | if err != nil { |
| 117 | return "", err |
| 118 | } |
| 119 | if len(resp.Plugins) != 1 { |
| 120 | return "", errors.New("opt service not enabled") |
| 121 | } |
| 122 | path := resp.Plugins[0].Exports["path"] |
| 123 | if path == "" { |
| 124 | return "", errors.New("opt path not exported") |
| 125 | } |
| 126 | return path, nil |
| 127 | } |
no test coverage detected