Skip to content

Commit 29b547c

Browse files
feat: add kueue labels lint checks for all workload types
Extend the kueue queue-name label validation to InferenceService, LLMInferenceService, RayCluster, RayJob, and PyTorchJob workloads. Checks verify that workloads with the kueue.x-k8s.io/queue-name label are in kueue-enabled namespaces, and are only active when both the owning component and Kueue are enabled on the DSC. Also introduces shared validation logic in workloads/kueue/support.go, AddCondition/SetConditions helpers on DiagnosticResult, and GetLabel/HasLabel utilities in pkg/util/kube. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2518866 commit 29b547c

21 files changed

Lines changed: 1908 additions & 182 deletions

pkg/constants/constants.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,21 @@ const (
1111
const (
1212
ComponentDashboard = "dashboard"
1313
ComponentKServe = "kserve"
14+
ComponentRay = "ray"
1415
ComponentTrainingOperator = "trainingoperator"
16+
ComponentWorkbenches = "workbenches"
17+
)
18+
19+
// Component names for Kueue integration.
20+
const (
21+
ComponentKueue = "kueue"
22+
)
23+
24+
// Kueue-specific label keys used across workload check packages.
25+
const (
26+
LabelKueueManaged = "kueue-managed"
27+
LabelKueueOpenshiftManaged = "kueue.openshift.io/managed"
28+
LabelKueueQueueName = "kueue.x-k8s.io/queue-name"
1529
)
1630

1731
// Workload annotations used across multiple check packages.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package kserve
2+
3+
import (
4+
"github.com/opendatahub-io/odh-cli/pkg/constants"
5+
"github.com/opendatahub-io/odh-cli/pkg/lint/checks/workloads/kueue"
6+
"github.com/opendatahub-io/odh-cli/pkg/resources"
7+
)
8+
9+
const ConditionTypeISVCKueueLabels = "ISVCKueueLabels"
10+
11+
func NewKueueLabelsISVCCheck() *kueue.KueueLabelCheck {
12+
return kueue.NewCheck(kueue.CheckConfig{
13+
Kind: constants.ComponentKServe,
14+
Component: constants.ComponentKServe,
15+
Resource: resources.InferenceService,
16+
ConditionType: ConditionTypeISVCKueueLabels,
17+
KindLabel: "InferenceService",
18+
CheckID: "workloads.kserve.kueue-labels-isvc",
19+
CheckName: "Workloads :: KServe :: InferenceService Kueue Labels",
20+
})
21+
}

0 commit comments

Comments
 (0)