Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Use BatchJobName instead of JobName (#669) #670

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api/environments/job_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (eh EnvironmentHandler) RestartJob(ctx context.Context, appName, envName, j
if err != nil {
return err
}
if _, err = findJobInRadixBatch(radixBatch, jobName); err != nil {
if _, err = findJobInRadixBatch(radixBatch, batchJobName); err != nil {
return err
}
return jobSchedulerBatch.RestartRadixBatchJob(ctx, eh.accounts.UserAccount.RadixClient, radixBatch, batchJobName)
Expand Down Expand Up @@ -282,11 +282,11 @@ func getActiveRadixDeployment(appName string, envName string, radixDeploymentMap
return nil, fmt.Errorf("no active deployment found for the app %s, environment %s", appName, envName)
}

func findJobInRadixBatch(radixBatch *radixv1.RadixBatch, jobName string) (*radixv1.RadixBatchJob, error) {
if job, ok := slice.FindFirst(radixBatch.Spec.Jobs, func(job radixv1.RadixBatchJob) bool { return job.Name == jobName }); ok {
func findJobInRadixBatch(radixBatch *radixv1.RadixBatch, batchJobName string) (*radixv1.RadixBatchJob, error) {
if job, ok := slice.FindFirst(radixBatch.Spec.Jobs, func(job radixv1.RadixBatchJob) bool { return job.Name == batchJobName }); ok {
return &job, nil
}
return nil, jobNotFoundError(jobName)
return nil, jobNotFoundError(batchJobName)
}

func (eh EnvironmentHandler) getDeploymentMapAndDeployJobComponents(ctx context.Context, appName string, envName string, jobComponentName string, radixBatch *radixv1.RadixBatch) (map[string]radixv1.RadixDeployment, *radixv1.RadixDeployJobComponent, *radixv1.RadixDeployJobComponent, error) {
Expand Down
Loading