Skip to content

Conversation

ashwindasr
Copy link
Contributor

Create a new priority class for OCP cluster

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

```diff
--- a/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
@@ -0,0 +1,70 @@
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-1
+value: 1000
+description: "Priority level 1 (highest)"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-2
+value: 900
+description: "Priority level 2"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-3
+value: 800
+description: "Priority level 3"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-4
+value: 700
+description: "Priority level 4"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-5
+value: 600
+description: "Priority level 5"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-6
+value: 500
+description: "Priority level 6"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-7
+value: 400
+description: "Priority level 7"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-8
+value: 300
+description: "Priority level 8"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-9
+value: 200
+description: "Priority level 9"
+---
+apiVersion: kueue.x-k8s.io/v1beta1
+kind: WorkloadPriorityClass
+metadata:
+  name: priority-10
+value: 100
+description: "Priority level 10 (lowest)"
+\ No newline at end of file

Issue: Missing newline at the end of the file.

Suggestion: Add a newline character at the end of the file workload-priority-class.yaml.

--- a/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
@@ -68,4 +68,5 @@
 kind: WorkloadPriorityClass
 metadata:
   name: priority-10
-value: 100
-description: "Priority level 10 (lowest)"
\ No newline at end of file
+  value: 100
+  description: "Priority level 10 (lowest)"
+

@hugares hugares requested a review from gbenhaim September 3, 2025 14:38
Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

## Code Review

### `components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml`

**Improvement:**

For better logical grouping and readability, it is often preferred to list foundational resources like `WorkloadPriorityClass` before other queue configurations or resources that might implicitly depend on them. While not strictly necessary for functionality in this case, reordering can improve clarity.

**Suggested Change:**

```diff
--- a/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
@@ -1,9 +1,10 @@
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
+- workload-priority-class.yaml
 - cluster-queue.yaml
 - ../../base/queue-config
-- workload-priority-class.yaml
 
 # ensure that installation starts after the installation of kueue complete
 commonAnnotations:

components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml

Review:

The workload-priority-class.yaml file is well-formed and correctly defines ten WorkloadPriorityClass resources for Kueue. The apiVersion, kind, metadata.name, value, and description fields are all correctly specified according to the Kueue API. The priority values are consistently decreasing, establishing a clear hierarchy. No bugs or critical issues were found in this file.

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

### components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml

**Issue:** Inconsistent naming convention for `WorkloadPriorityClass` resources. Some names are specific (`konflux-release`, `konflux-tenant-release`, `konflux-default`), while others are generic (`priority-3` through `priority-9`). This can lead to confusion and make it harder to manage the priority levels.

**Improvement:** Standardize the naming convention to improve clarity and consistency.

```diff
--- a/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/workload-priority-class.yaml
@@ -13,37 +13,37 @@
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-3
+  name: konflux-priority-3
 value: 800
 description: "Priority level 3"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-4
+  name: konflux-priority-4
 value: 700
 description: "Priority level 4"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-5
+  name: konflux-priority-5
 value: 600
 description: "Priority level 5"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-6
+  name: konflux-priority-6
 value: 500
 description: "Priority level 6"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-7
+  name: konflux-priority-7
 value: 400
 description: "Priority level 7"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-8
+  name: konflux-priority-8
 value: 300
 description: "Priority level 8"
 ---
 apiVersion: kueue.x-k8s.io/v1beta1
 kind: WorkloadPriorityClass
 metadata:
-  name: priority-9
+  name: konflux-priority-9
 value: 200
 description: "Priority level 9"
 ---

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

Here are the suggested changes:

### File: `components/kueue/production/kflux-ocp-p01/kustomization.yaml`

**Issue**: The `ocp-build-workload-priority-class.yaml` file is located in the `queue-config` subdirectory, but it is being referenced directly in this parent `kustomization.yaml`. This will lead to a Kustomize error as the file is not found at this path.

**Suggested change**: Remove the line referencing `ocp-build-workload-priority-class.yaml` from this file.

```diff
--- a/components/kueue/production/kflux-ocp-p01/kustomization.yaml
+++ b/components/kueue/production/kflux-ocp-p01/kustomization.yaml
@@ -1,8 +1,7 @@
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
 - ../base
 - queue-config
-- ocp-build-workload-priority-class.yaml
 
 commonAnnotations:
   argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true

File: components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml

Issue: This kustomization.yaml is attempting to add workload-priority-class.yaml, but the new file created is named ocp-build-workload-priority-class.yaml. There is a mismatch in the filename.

Suggested change: Update the filename to correctly reference ocp-build-workload-priority-class.yaml.

--- a/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
@@ -1,9 +1,9 @@
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
 - cluster-queue.yaml
 - ../../base/queue-config
-- workload-priority-class.yaml
+- ocp-build-workload-priority-class.yaml
 
 # ensure that installation starts after the installation of kueue complete
 commonAnnotations:

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

--- a/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
+++ b/components/kueue/production/kflux-ocp-p01/queue-config/kustomization.yaml
@@ -1,9 +1,9 @@
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
 - cluster-queue.yaml
 - ../../base/queue-config
-- workload-priority-class.yaml
+- ocp-build-workload-priority-class.yaml
 
 # ensure that installation starts after the installation of kueue complete
 commonAnnotations:

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Code Review by Gemini

There are no bugs or issues found in the provided code changes. The new WorkloadPriorityClass definitions are syntactically correct and properly added to the Kustomization file. The priority values are distinct and ordered as expected.

@gbenhaim
Copy link
Member

gbenhaim commented Sep 4, 2025

in order for this to work #7958 is needed as well

@gbenhaim
Copy link
Member

gbenhaim commented Sep 4, 2025

/approve
/lgtm

Copy link

openshift-ci bot commented Sep 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashwindasr, gbenhaim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Sep 4, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit fa432b3 into redhat-appstudio:main Sep 4, 2025
8 checks passed
@ashwindasr ashwindasr deleted the add-priority-ocp branch September 4, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants