FetchStacks returns all the stack names present in the foundation.
()
| 20 | |
| 21 | // FetchStacks returns all the stack names present in the foundation. |
| 22 | func FetchStacks() []string { |
| 23 | session := CF("curl", "/v2/stacks") |
| 24 | |
| 25 | Eventually(session).Should(Exit(0)) |
| 26 | |
| 27 | var rawStacks ccStacks |
| 28 | err := json.Unmarshal(session.Out.Contents(), &rawStacks) |
| 29 | Expect(err).ToNot(HaveOccurred()) |
| 30 | |
| 31 | var stacks []string |
| 32 | for _, stack := range rawStacks.Resources { |
| 33 | stacks = append(stacks, stack.Entity.Name) |
| 34 | } |
| 35 | |
| 36 | return stacks |
| 37 | } |
| 38 | |
| 39 | // PreferredStack returns the cflinuxfs4 stack name if it present, otherwise cflinuxfs3 is returned. |
| 40 | func PreferredStack() string { |
no test coverage detected