Skip to content

Commit

Permalink
final nit comments addressed and changed Eviction constant to be Work…
Browse files Browse the repository at this point in the history
…loadEvictedByDeactivation
  • Loading branch information
vicentefb committed Nov 30, 2023
1 parent af747a6 commit 10b35fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apis/kueue/v1beta1/workload_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const (

// WorkloadEvictedByAcitveField indicates that the workload was evicted
// because spec.active is set to false.
WorkloadEvictedByAcitveField = "WorkloadIsNotActive"
WorkloadEvictedByDeactivation = "InactiveWorkload"
)

// +genclient
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/jobframework/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (r *JobReconciler) ReconcileGenericJob(ctx context.Context, req ctrl.Reques

// 8. handle workload is deactivated.
if !ptr.Deref(wl.Spec.Active, true) {
workload.SetEvictedCondition(wl, kueue.WorkloadEvictedByAcitveField, "The workload is deactivated")
workload.SetEvictedCondition(wl, kueue.WorkloadEvictedByDeactivation, "The workload is deactivated")
err := workload.ApplyAdmissionStatus(ctx, r.client, wl, true)
if err != nil {
return ctrl.Result{}, fmt.Errorf("setting eviction: %w", err)
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/jobs/job/job_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func TestReconciler(t *testing.T) {
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
Status: metav1.ConditionTrue,
Reason: "WorkloadIsNotActive",
Reason: "InactiveWorkload",
Message: "The workload is deactivated",
}).
AdmissionCheck(kueue.AdmissionCheckState{
Expand Down Expand Up @@ -515,7 +515,7 @@ func TestReconciler(t *testing.T) {
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
Status: metav1.ConditionTrue,
Reason: "WorkloadIsNotActive",
Reason: "InactiveWorkload",
Message: "The workload is deactivated",
}).
AdmissionCheck(kueue.AdmissionCheckState{
Expand Down Expand Up @@ -554,7 +554,7 @@ func TestReconciler(t *testing.T) {
Condition(metav1.Condition{
Type: kueue.WorkloadEvicted,
Status: metav1.ConditionTrue,
Reason: "WorkloadIsNotActive",
Reason: "InactiveWorkload",
Message: "The workload is deactivated",
}).
AdmissionCheck(kueue.AdmissionCheckState{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var (
// +kubebuilder:docs-gen:collapse=Imports

var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {

ginkgo.BeforeAll(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
Expand Down

0 comments on commit 10b35fb

Please sign in to comment.