Skip to content

Commit

Permalink
feat: add helm in helm set (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
pggb25 authored Dec 22, 2023
1 parent 85e03f6 commit 6eb3515
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils/qovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ func SelectService(environment Id) (*Service, error) {
return nil, errors.New("Received " + res.Status + " response while listing containers. ")
}

helms, res, err := client.HelmsAPI.ListHelms(context.Background(), string(environment)).Execute()
if err != nil {
return nil, err
}
if res.StatusCode >= 400 {
return nil, errors.New("Received " + res.Status + " response while listing helms. ")
}

var servicesNames []string
var services = make(map[string]Service)

Expand Down Expand Up @@ -523,6 +531,15 @@ func SelectService(environment Id) (*Service, error) {
}
}

for _, helm := range helms.GetResults() {
servicesNames = append(servicesNames, helm.Name)
services[helm.Name] = Service{
ID: Id(helm.Id),
Name: Name(helm.Name),
Type: HelmType,
}
}

if len(servicesNames) < 1 {
return nil, errors.New("No services found. ")
}
Expand Down

0 comments on commit 6eb3515

Please sign in to comment.