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

SSE: kubernetes.go: fix return of empty job list in getJobsByIdentifier() #103

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions internal/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (k *Kubernetes) getJobsByIdentifier(ctx context.Context, client *kubernetes
// Try different labels for backward compatibility:
// - etos.eiffel-community.github.io/id is v1alpha+
// - id is v0 legacy
var jobs *v1.JobList
for _, label := range []string{"etos.eiffel-community.github.io/id", "id"} {
jobs, err := client.BatchV1().Jobs(k.namespace).List(
ctx,
Expand All @@ -88,7 +87,7 @@ func (k *Kubernetes) getJobsByIdentifier(ctx context.Context, client *kubernetes
return jobs, nil
}
}
return jobs, nil
return &v1.JobList{Items: []v1.Job{}}, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return &v1.JobList{Items: []v1.Job{}}, nil
return &v1.JobList{}, nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

// IsFinished checks if an ESR job is finished.
Expand Down
Loading