| 245 | } |
| 246 | |
| 247 | func (c *client) ListReleases(ctx devspacecontext.Context, namespace string) ([]*types.Release, error) { |
| 248 | args := []string{ |
| 249 | "list", |
| 250 | "--max", |
| 251 | strconv.Itoa(0), |
| 252 | "--output", |
| 253 | "json", |
| 254 | } |
| 255 | if namespace != "" { |
| 256 | args = append(args, "--namespace", namespace) |
| 257 | } |
| 258 | |
| 259 | out, err := c.genericHelm.Exec(ctx, args) |
| 260 | if err != nil { |
| 261 | return nil, err |
| 262 | } |
| 263 | |
| 264 | releases := []*types.Release{} |
| 265 | err = yaml.Unmarshal(out, &releases) |
| 266 | if err != nil { |
| 267 | return nil, err |
| 268 | } |
| 269 | |
| 270 | return releases, nil |
| 271 | } |