Skip to content

Commit

Permalink
fix: correctly retrieve helm service id (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe authored Mar 11, 2024
1 parent 1930315 commit 1275aab
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions utils/qovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ func GetEnvironmentServicesById(id string) ([]EnvironmentService, error) {
})
}

for _, service := range environmentServices.Helms {
services = append(services, EnvironmentService{
ID: service.Id,
Type: HelmType,
})
}

return services, nil
}

Expand Down Expand Up @@ -2135,15 +2142,15 @@ func RedeployService(client *qovery.APIClient, envId string, serviceId string, s
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

app := FindByApplicationName(apps.GetResults(), serviceName);
app := FindByApplicationName(apps.GetResults(), serviceName)
if app == nil {
PrintlnError(fmt.Errorf("application %s not found", serviceName))
PrintlnInfo("You can list all applications with: qovery application list")
os.Exit(1)
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

deployRequest := qovery.DeployRequest{ GitCommitId: *app.GitRepository.DeployedCommitId}
deployRequest := qovery.DeployRequest{GitCommitId: *app.GitRepository.DeployedCommitId}

_, _, err := client.ApplicationActionsAPI.DeployApplication(context.Background(), serviceId).DeployRequest(deployRequest).Execute()
if err != nil {
Expand Down Expand Up @@ -2177,7 +2184,7 @@ func RedeployService(client *qovery.APIClient, envId string, serviceId string, s
if container.Id == serviceId && IsTerminalState(container.State) {
containerDeployRequest := qovery.ContainerDeployRequest{}

_, _, err := client.ContainerActionsAPI.DeployContainer(context.Background(), serviceId).ContainerDeployRequest(containerDeployRequest) .Execute()
_, _, err := client.ContainerActionsAPI.DeployContainer(context.Background(), serviceId).ContainerDeployRequest(containerDeployRequest).Execute()
if err != nil {
return "", err
}
Expand Down

0 comments on commit 1275aab

Please sign in to comment.