()
| 157 | var CcRootCache *ccRoot |
| 158 | |
| 159 | func fetchAPIVersion() ccRoot { |
| 160 | cacheLock.Lock() |
| 161 | defer cacheLock.Unlock() |
| 162 | if CcRootCache == nil { |
| 163 | session := CF("curl", "/") |
| 164 | Eventually(session).Should(Exit(0)) |
| 165 | var result ccRoot |
| 166 | err := json.Unmarshal(session.Out.Contents(), &result) |
| 167 | Expect(err).ToNot(HaveOccurred()) |
| 168 | CcRootCache = &result |
| 169 | } |
| 170 | return *CcRootCache |
| 171 | } |
| 172 | |
| 173 | func getAPIVersionV3() string { |
| 174 | return fetchAPIVersion().Links.CloudControllerV3.Meta.Version |
no test coverage detected