Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskery committed Nov 15, 2023
1 parent 2ca8e6f commit 3a89420
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/slurm-agent/slurm.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (ji *JobInfo) fillFromSlurmFields(fields map[string]string) error {
case runTime, timeLimit:
d, err := ParseDuration(sField)
if err != nil {
if err == ErrDurationIsUnlimited {
if errors.Is(err, ErrDurationIsUnlimited) {
continue
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/slurm-agent/slurm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func TestJobInfoFromScontrolResponse(t *testing.T) {
BatchHost: "",
NumNodes: "1-1",
ArrayJobID: "192",
Reason: "Resources",
},
{
ID: "196",
Expand All @@ -263,6 +264,7 @@ func TestJobInfoFromScontrolResponse(t *testing.T) {
BatchHost: "vagrant",
NumNodes: "1",
ArrayJobID: "192",
Reason: "None",
},
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/slurm-bridge-operator/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (r *SlurmBridgeJobReconciler) newSizeCarPodForSJ(sjb *v1alpha1.SlurmBridgeJ
Containers: []corev1.Container{
{
Name: sjb.Name,
Image: "useless-image",
Resources: corev1.ResourceRequirements{Requests: resourceList, Limits: resourceList},
Command: []string{sjb.Spec.SbatchScript},
SecurityContext: &corev1.SecurityContext{RunAsUser: sjb.Spec.RunAsUser},
Expand Down
1 change: 1 addition & 0 deletions pkg/slurm-bridge-operator/slurmbridgejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ func (r *SlurmBridgeJobReconciler) newWorkerPodForSJ(sizecarPod *corev1.Pod, sjb
sc := r.getWorkerPodContainerSecurityContext(jobInfo)
containers = append(containers, corev1.Container{
Name: jobInfo.Id,
Image: "useless-image",
SecurityContext: sc,
WorkingDir: jobInfo.WorkingDir,
})
Expand Down

0 comments on commit 3a89420

Please sign in to comment.