Skip to content

Commit

Permalink
Fix job type check (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon authored Jan 10, 2025
1 parent a2a3a39 commit eed33db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/e2e/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"io"
"os"

"github.com/aws/aws-k8s-tester/internal/e2e/mpioperator"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -128,10 +130,10 @@ func GetJobLogs(restConfig *rest.Config, job k8s.Object) (string, error) {
return "", err
}
var jobLabel string
switch job.GetObjectKind().GroupVersionKind().Kind {
case "MPIJob":
switch job.(type) {
case *mpioperator.MPIJobFacade:
jobLabel = fmt.Sprintf("job-name=%s-launcher", job.GetName())
case "Job":
case *batchv1.Job:
jobLabel = fmt.Sprintf("job-name=%s", job.GetName())
default:
return "", fmt.Errorf("unsupported job type %T", job)
Expand Down

0 comments on commit eed33db

Please sign in to comment.