Repository: kubernetes-sigs/kueue
Pull request #123 (2022-03-17 02:20:12)

Rename ResourceFlavor to Flavor

#### What type of PR is this?

/kind cleanup

#### What this PR does / why we need it:

This is in preparation to introduce the ResourceFlavor CRD type.

#### Which issue(s) this PR fixes:
Part of #https://github.com/kubernetes-sigs/kueue/issues/59

#### Special notes for your reviewer:




Patch:
diff --git a/api/v1alpha1/clusterqueue_types.go b/api/v1alpha1/clusterqueue_types.go
index b8f022660..0bd05f591 100644
--- a/api/v1alpha1/clusterqueue_types.go
+++ b/api/v1alpha1/clusterqueue_types.go
@@ -222,10 +222,10 @@ type Resource struct {
 	//
 	// +listType=map
 	// +listMapKey=name
-	Flavors []ResourceFlavor `json:"flavors,omitempty"`
+	Flavors []Flavor `json:"flavors,omitempty"`
 }
 
-type ResourceFlavor struct {
+type Flavor struct {
 	// name is the type name, e.g., nvidia-tesla-k80.
 	// +kubebuilder:default=default
 	Name string `json:"name"`
diff --git a/api/v1alpha1/queuedworkload_types.go b/api/v1alpha1/queuedworkload_types.go
index 52272bd0d..9f3008e4b 100644
--- a/api/v1alpha1/queuedworkload_types.go
+++ b/api/v1alpha1/queuedworkload_types.go
@@ -56,8 +56,8 @@ type PodSetFlavors struct {
 	// +kubebuilder:default=main
 	Name string `json:"name"`
 
-	// ResourceFlavors are the flavors assigned to the workload for each resource.
-	ResourceFlavors map[corev1.ResourceName]string `json:"resourceFlavors,omitempty"`
+	// Flavors are the flavors assigned to the workload for each resource.
+	Flavors map[corev1.ResourceName]string `json:"flavors,omitempty"`
 }
 
 type WorkloadReference struct {
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
index 0ea177f1e..42a81abec 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -167,6 +167,36 @@ func (in *ClusterQueueStatus) DeepCopy() *ClusterQueueStatus {
 	return out
 }
 
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Flavor) DeepCopyInto(out *Flavor) {
+	*out = *in
+	in.Quota.DeepCopyInto(&out.Quota)
+	if in.Labels != nil {
+		in, out := &in.Labels, &out.Labels
+		*out = make(map[string]string, len(*in))
+		for key, val := range *in {
+			(*out)[key] = val
+		}
+	}
+	if in.Taints != nil {
+		in, out := &in.Taints, &out.Taints
+		*out = make([]corev1.Taint, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flavor.
+func (in *Flavor) DeepCopy() *Flavor {
+	if in == nil {
+		return nil
+	}
+	out := new(Flavor)
+	in.DeepCopyInto(out)
+	return out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *PodSet) DeepCopyInto(out *PodSet) {
 	*out = *in
@@ -186,8 +216,8 @@ func (in *PodSet) DeepCopy() *PodSet {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *PodSetFlavors) DeepCopyInto(out *PodSetFlavors) {
 	*out = *in
-	if in.ResourceFlavors != nil {
-		in, out := &in.ResourceFlavors, &out.ResourceFlavors
+	if in.Flavors != nil {
+		in, out := &in.Flavors, &out.Flavors
 		*out = make(map[corev1.ResourceName]string, len(*in))
 		for key, val := range *in {
 			(*out)[key] = val
@@ -442,7 +472,7 @@ func (in *Resource) DeepCopyInto(out *Resource) {
 	*out = *in
 	if in.Flavors != nil {
 		in, out := &in.Flavors, &out.Flavors
-		*out = make([]ResourceFlavor, len(*in))
+		*out = make([]Flavor, len(*in))
 		for i := range *in {
 			(*in)[i].DeepCopyInto(&(*out)[i])
 		}
@@ -459,36 +489,6 @@ func (in *Resource) DeepCopy() *Resource {
 	return out
 }
 
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResourceFlavor) DeepCopyInto(out *ResourceFlavor) {
-	*out = *in
-	in.Quota.DeepCopyInto(&out.Quota)
-	if in.Labels != nil {
-		in, out := &in.Labels, &out.Labels
-		*out = make(map[string]string, len(*in))
-		for key, val := range *in {
-			(*out)[key] = val
-		}
-	}
-	if in.Taints != nil {
-		in, out := &in.Taints, &out.Taints
-		*out = make([]corev1.Taint, len(*in))
-		for i := range *in {
-			(*in)[i].DeepCopyInto(&(*out)[i])
-		}
-	}
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFlavor.
-func (in *ResourceFlavor) DeepCopy() *ResourceFlavor {
-	if in == nil {
-		return nil
-	}
-	out := new(ResourceFlavor)
-	in.DeepCopyInto(out)
-	return out
-}
-
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *Usage) DeepCopyInto(out *Usage) {
 	*out = *in
diff --git a/config/crd/bases/kueue.x-k8s.io_queuedworkloads.yaml b/config/crd/bases/kueue.x-k8s.io_queuedworkloads.yaml
index 1c7854b8e..729c08e5b 100644
--- a/config/crd/bases/kueue.x-k8s.io_queuedworkloads.yaml
+++ b/config/crd/bases/kueue.x-k8s.io_queuedworkloads.yaml
@@ -51,17 +51,17 @@ spec:
                       of the .spec.podSets entries.
                     items:
                       properties:
+                        flavors:
+                          additionalProperties:
+                            type: string
+                          description: Flavors are the flavors assigned to the workload
+                            for each resource.
+                          type: object
                         name:
                           default: main
                           description: Name is the name of the podSet. It should match
                             one of the names in .spec.podSets.
                           type: string
-                        resourceFlavors:
-                          additionalProperties:
-                            type: string
-                          description: ResourceFlavors are the flavors assigned to
-                            the workload for each resource.
-                          type: object
                       required:
                       - name
                       type: object
diff --git a/pkg/controller/workload/job/job_controller.go b/pkg/controller/workload/job/job_controller.go
index d57b89548..5f3a419ac 100644
--- a/pkg/controller/workload/job/job_controller.go
+++ b/pkg/controller/workload/job/job_controller.go
@@ -257,22 +257,22 @@ func (r *JobReconciler) startJob(ctx context.Context, w *kueue.QueuedWorkload, j
 }
 
 func getNodeSelectors(cq *kueue.ClusterQueue, w *kueue.QueuedWorkload) map[string]string {
-	if len(w.Spec.Admission.PodSetFlavors[0].ResourceFlavors) == 0 {
+	if len(w.Spec.Admission.PodSetFlavors[0].Flavors) == 0 {
 		return nil
 	}
 
 	// Create a map of resources-to-flavors.
 	// May be cache this?
-	flavors := make(map[corev1.ResourceName]map[string]*kueue.ResourceFlavor, len(cq.Spec.RequestableResources))
+	flavors := make(map[corev1.ResourceName]map[string]*kueue.Flavor, len(cq.Spec.RequestableResources))
 	for _, r := range cq.Spec.RequestableResources {
-		flavors[r.Name] = make(map[string]*kueue.ResourceFlavor, len(r.Flavors))
+		flavors[r.Name] = make(map[string]*kueue.Flavor, len(r.Flavors))
 		for j := range r.Flavors {
 			flavors[r.Name][r.Flavors[j].Name] = &r.Flavors[j]
 		}
 	}
 
 	nodeSelector := map[string]string{}
-	for res, flvr := range w.Spec.Admission.PodSetFlavors[0].ResourceFlavors {
+	for res, flvr := range w.Spec.Admission.PodSetFlavors[0].Flavors {
 		if cqRes, existRes := flavors[res]; existRes {
 			if cqFlvr, existFlvr := cqRes[flvr]; existFlvr {
 				for k, v := range cqFlvr.Labels {
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index ff2b9bbd2..ff027425c 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -223,8 +223,8 @@ func (s *Scheduler) admit(ctx context.Context, e *entry) error {
 	}
 	for i := range e.TotalRequests {
 		admission.PodSetFlavors[i] = kueue.PodSetFlavors{
-			Name:            e.Obj.Spec.PodSets[i].Name,
-			ResourceFlavors: e.TotalRequests[i].Flavors,
+			Name:    e.Obj.Spec.PodSets[i].Name,
+			Flavors: e.TotalRequests[i].Flavors,
 		}
 	}
 	newWorkload.Spec.Admission = admission
diff --git a/pkg/workload/workload.go b/pkg/workload/workload.go
index e6de96f02..cf6f2b4ac 100644
--- a/pkg/workload/workload.go
+++ b/pkg/workload/workload.go
@@ -61,7 +61,7 @@ func totalRequests(spec *kueue.QueuedWorkloadSpec) []PodSetResources {
 	if spec.Admission != nil {
 		podSetFlavors = make(map[string]map[corev1.ResourceName]string, len(spec.Admission.PodSetFlavors))
 		for _, ps := range spec.Admission.PodSetFlavors {
-			podSetFlavors[ps.Name] = ps.ResourceFlavors
+			podSetFlavors[ps.Name] = ps.Flavors
 		}
 	}
 	for _, ps := range spec.PodSets {


Test patch:
diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go
index e620fb1d5..5ebebbe92 100644
--- a/pkg/cache/cache_test.go
+++ b/pkg/cache/cache_test.go
@@ -59,7 +59,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 							RequestableResources: []kueue.Resource{
 								{
 									Name: corev1.ResourceCPU,
-									Flavors: []kueue.ResourceFlavor{
+									Flavors: []kueue.Flavor{
 										{
 											Name: "default",
 											Quota: kueue.Quota{
@@ -79,7 +79,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 							RequestableResources: []kueue.Resource{
 								{
 									Name:    corev1.ResourceCPU,
-									Flavors: []kueue.ResourceFlavor{{Name: "default"}},
+									Flavors: []kueue.Flavor{{Name: "default"}},
 								}},
 							Cohort: "one",
 						},
@@ -145,7 +145,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 							RequestableResources: []kueue.Resource{
 								{
 									Name: corev1.ResourceCPU,
-									Flavors: []kueue.ResourceFlavor{
+									Flavors: []kueue.Flavor{
 										{
 											Name: "default",
 											Quota: kueue.Quota{
@@ -275,7 +275,7 @@ func TestCacheWorkloadOperations(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: "cpu",
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{Name: "on-demand"},
 							{Name: "spot"},
 						},
@@ -289,7 +289,7 @@ func TestCacheWorkloadOperations(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: "cpu",
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{Name: "on-demand"},
 							{Name: "spot"},
 						},
@@ -319,13 +319,13 @@ func TestCacheWorkloadOperations(t *testing.T) {
 	podSetFlavors := []kueue.PodSetFlavors{
 		{
 			Name: "driver",
-			ResourceFlavors: map[corev1.ResourceName]string{
+			Flavors: map[corev1.ResourceName]string{
 				corev1.ResourceCPU: "on-demand",
 			},
 		},
 		{
 			Name: "workers",
-			ResourceFlavors: map[corev1.ResourceName]string{
+			Flavors: map[corev1.ResourceName]string{
 				corev1.ResourceCPU: "spot",
 			},
 		},
@@ -735,7 +735,7 @@ func TestClusterQueueUsage(t *testing.T) {
 			RequestableResources: []kueue.Resource{
 				{
 					Name: corev1.ResourceCPU,
-					Flavors: []kueue.ResourceFlavor{
+					Flavors: []kueue.Flavor{
 						{
 							Name: "default",
 							Quota: kueue.Quota{
@@ -747,7 +747,7 @@ func TestClusterQueueUsage(t *testing.T) {
 				},
 				{
 					Name: "example.com/gpu",
-					Flavors: []kueue.ResourceFlavor{
+					Flavors: []kueue.Flavor{
 						{
 							Name: "model_a",
 							Quota: kueue.Quota{
@@ -786,7 +786,7 @@ func TestClusterQueueUsage(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "main",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "default",
 								"example.com/gpu":  "model_a",
 							},
@@ -813,7 +813,7 @@ func TestClusterQueueUsage(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "main",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "default",
 								"example.com/gpu":  "model_b",
 							},
diff --git a/pkg/cache/snapshot_test.go b/pkg/cache/snapshot_test.go
index 93a38b4d6..3b3d13e86 100644
--- a/pkg/cache/snapshot_test.go
+++ b/pkg/cache/snapshot_test.go
@@ -51,7 +51,7 @@ func TestSnapshot(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "demand",
 								Quota: kueue.Quota{
@@ -80,7 +80,7 @@ func TestSnapshot(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "spot",
 								Quota: kueue.Quota{
@@ -91,7 +91,7 @@ func TestSnapshot(t *testing.T) {
 					},
 					{
 						Name: "example.com/gpu",
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "default",
 								Quota: kueue.Quota{
@@ -111,7 +111,7 @@ func TestSnapshot(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "default",
 								Quota: kueue.Quota{
@@ -149,7 +149,7 @@ func TestSnapshot(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "main",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "demand",
 							},
 						},
@@ -175,7 +175,7 @@ func TestSnapshot(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "main",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "spot",
 								"example.com/gpu":  "default",
 							},
@@ -202,7 +202,7 @@ func TestSnapshot(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "main",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "spot",
 								"example.com/gpu":  "default",
 							},
diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go
index 8808bacba..b2788205a 100644
--- a/pkg/scheduler/scheduler_test.go
+++ b/pkg/scheduler/scheduler_test.go
@@ -65,7 +65,7 @@ func TestSchedule(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "default",
 								Quota: kueue.Quota{
@@ -94,7 +94,7 @@ func TestSchedule(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "on-demand",
 								Quota: kueue.Quota{
@@ -130,7 +130,7 @@ func TestSchedule(t *testing.T) {
 				RequestableResources: []kueue.Resource{
 					{
 						Name: corev1.ResourceCPU,
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "on-demand",
 								Quota: kueue.Quota{
@@ -149,7 +149,7 @@ func TestSchedule(t *testing.T) {
 					},
 					{
 						Name: "example.com/gpu",
-						Flavors: []kueue.ResourceFlavor{
+						Flavors: []kueue.Flavor{
 							{
 								Name: "model-a",
 								Quota: kueue.Quota{
@@ -237,7 +237,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "default",
 							},
 						},
@@ -286,7 +286,7 @@ func TestSchedule(t *testing.T) {
 							PodSetFlavors: []kueue.PodSetFlavors{
 								{
 									Name: "one",
-									ResourceFlavors: map[corev1.ResourceName]string{
+									Flavors: map[corev1.ResourceName]string{
 										corev1.ResourceCPU: "default",
 									},
 								},
@@ -301,7 +301,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "default",
 							},
 						},
@@ -382,7 +382,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "default",
 							},
 						},
@@ -393,7 +393,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 							},
 						},
@@ -447,7 +447,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 							},
 						},
@@ -458,7 +458,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 							},
 						},
@@ -502,14 +502,14 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 								"example.com/gpu":  "model-a",
 							},
 						},
 						{
 							Name: "two",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "spot",
 							},
 						},
@@ -563,7 +563,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 							},
 						},
@@ -640,7 +640,7 @@ func TestSchedule(t *testing.T) {
 							PodSetFlavors: []kueue.PodSetFlavors{
 								{
 									Name: "one",
-									ResourceFlavors: map[corev1.ResourceName]string{
+									Flavors: map[corev1.ResourceName]string{
 										corev1.ResourceCPU: "on-demand",
 									},
 								},
@@ -655,7 +655,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "spot",
 							},
 						},
@@ -666,7 +666,7 @@ func TestSchedule(t *testing.T) {
 					PodSetFlavors: []kueue.PodSetFlavors{
 						{
 							Name: "one",
-							ResourceFlavors: map[corev1.ResourceName]string{
+							Flavors: map[corev1.ResourceName]string{
 								corev1.ResourceCPU: "on-demand",
 							},
 						},
diff --git a/pkg/util/testing/wrappers.go b/pkg/util/testing/wrappers.go
index c93b3470e..afd9fae9a 100644
--- a/pkg/util/testing/wrappers.go
+++ b/pkg/util/testing/wrappers.go
@@ -162,8 +162,8 @@ func MakeAdmission(cq string) *AdmissionWrapper {
 		ClusterQueue: kueue.ClusterQueueReference(cq),
 		PodSetFlavors: []kueue.PodSetFlavors{
 			{
-				Name:            "main",
-				ResourceFlavors: make(map[corev1.ResourceName]string),
+				Name:    "main",
+				Flavors: make(map[corev1.ResourceName]string),
 			},
 		},
 	}}
@@ -174,7 +174,7 @@ func (w *AdmissionWrapper) Obj() *kueue.Admission {
 }
 
 func (w *AdmissionWrapper) Flavor(r corev1.ResourceName, f string) *AdmissionWrapper {
-	w.PodSetFlavors[0].ResourceFlavors[r] = f
+	w.PodSetFlavors[0].Flavors[r] = f
 	return w
 }
 
@@ -263,17 +263,17 @@ func (r *ResourceWrapper) Obj() *kueue.Resource {
 }
 
 // Flavor appends a flavor.
-func (r *ResourceWrapper) Flavor(f *kueue.ResourceFlavor) *ResourceWrapper {
+func (r *ResourceWrapper) Flavor(f *kueue.Flavor) *ResourceWrapper {
 	r.Flavors = append(r.Flavors, *f)
 	return r
 }
 
 // FlavorWrapper wraps a resource flavor.
-type FlavorWrapper struct{ kueue.ResourceFlavor }
+type FlavorWrapper struct{ kueue.Flavor }
 
 // MakeFlavor creates a wrapper for a resource flavor.
 func MakeFlavor(name, guaranteed string) *FlavorWrapper {
-	return &FlavorWrapper{kueue.ResourceFlavor{
+	return &FlavorWrapper{kueue.Flavor{
 		Name: name,
 		Quota: kueue.Quota{
 			Guaranteed: resource.MustParse(guaranteed),
@@ -284,8 +284,8 @@ func MakeFlavor(name, guaranteed string) *FlavorWrapper {
 }
 
 // Obj returns the inner resource flavor.
-func (f *FlavorWrapper) Obj() *kueue.ResourceFlavor {
-	return &f.ResourceFlavor
+func (f *FlavorWrapper) Obj() *kueue.Flavor {
+	return &f.Flavor
 }
 
 // Ceiling updates the flavor ceiling.
diff --git a/pkg/workload/workload_test.go b/pkg/workload/workload_test.go
index 9d0039607..d14a15537 100644
--- a/pkg/workload/workload_test.go
+++ b/pkg/workload/workload_test.go
@@ -130,7 +130,7 @@ func TestNewInfo(t *testing.T) {
 				PodSetFlavors: []kueue.PodSetFlavors{
 					{
 						Name: "driver",
-						ResourceFlavors: map[corev1.ResourceName]string{
+						Flavors: map[corev1.ResourceName]string{
 							corev1.ResourceCPU: "on-demand",
 						},
 					},
diff --git a/test/integration/controller/job/job_controller_test.go b/test/integration/controller/job/job_controller_test.go
index bd1eeba8f..b9e35e17e 100644
--- a/test/integration/controller/job/job_controller_test.go
+++ b/test/integration/controller/job/job_controller_test.go
@@ -114,7 +114,7 @@ var _ = ginkgo.Describe("Job controller", func() {
 		createdWorkload.Spec.Admission = &kueue.Admission{
 			ClusterQueue: kueue.ClusterQueueReference(clusterQueue.Name),
 			PodSetFlavors: []kueue.PodSetFlavors{{
-				ResourceFlavors: map[corev1.ResourceName]string{
+				Flavors: map[corev1.ResourceName]string{
 					corev1.ResourceCPU: flavorOnDemand,
 				},
 			}},
@@ -168,7 +168,7 @@ var _ = ginkgo.Describe("Job controller", func() {
 		createdWorkload.Spec.Admission = &kueue.Admission{
 			ClusterQueue: kueue.ClusterQueueReference(clusterQueue.Name),
 			PodSetFlavors: []kueue.PodSetFlavors{{
-				ResourceFlavors: map[corev1.ResourceName]string{
+				Flavors: map[corev1.ResourceName]string{
 					corev1.ResourceCPU: flavorSpot,
 				},
 			}},