Skip to content

Commit 13ae9aa

Browse files
committed
eliminate imports of Kueue's podset package
1 parent 20d938a commit 13ae9aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/controller/appwrapper/resource_management.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"sigs.k8s.io/controller-runtime/pkg/client"
3636
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
3737
"sigs.k8s.io/controller-runtime/pkg/log"
38-
"sigs.k8s.io/kueue/pkg/podset"
3938
)
4039

4140
func parseComponent(raw []byte, expectedNamespace string) (*unstructured.Unstructured, error) {
@@ -241,7 +240,7 @@ func (r *AppWrapperReconciler) createComponent(ctx context.Context, aw *awv1beta
241240
if len(toInject.Annotations) > 0 {
242241
existing := toMap(metadata["annotations"])
243242
if err := utilmaps.HaveConflict(existing, toInject.Annotations); err != nil {
244-
return podset.BadPodSetsUpdateError("annotations", err), true
243+
return fmt.Errorf("conflict updating annotations: %w", err), true
245244
}
246245
metadata["annotations"] = utilmaps.MergeKeepFirst(existing, toInject.Annotations)
247246
}
@@ -250,15 +249,15 @@ func (r *AppWrapperReconciler) createComponent(ctx context.Context, aw *awv1beta
250249
mergedLabels := utilmaps.MergeKeepFirst(toInject.Labels, awLabels)
251250
existing := toMap(metadata["labels"])
252251
if err := utilmaps.HaveConflict(existing, mergedLabels); err != nil {
253-
return podset.BadPodSetsUpdateError("labels", err), true
252+
return fmt.Errorf("conflict updating labels: %w", err), true
254253
}
255254
metadata["labels"] = utilmaps.MergeKeepFirst(existing, mergedLabels)
256255

257256
// NodeSelectors
258257
if len(toInject.NodeSelector) > 0 {
259258
existing := toMap(spec["nodeSelector"])
260259
if err := utilmaps.HaveConflict(existing, toInject.NodeSelector); err != nil {
261-
return podset.BadPodSetsUpdateError("nodeSelector", err), true
260+
return fmt.Errorf("conflict updating nodeSelector: %w", err), true
262261
}
263262
spec["nodeSelector"] = utilmaps.MergeKeepFirst(existing, toInject.NodeSelector)
264263
}

internal/util/maps.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ limitations under the License.
1515
*/
1616

1717
/*
18-
This file contains a copy of the functions from https://github.com/kubernetes-sigs/kueue/blob/main/pkg/util/maps/maps.go
18+
This file contains a copy of the two map utility functions from
19+
https://github.com/kubernetes-sigs/kueue/blob/main/pkg/util/maps/maps.go
1920
that are used by the AppWrapper controlller.
2021
21-
We copy the used functions to eliminate our go dependency on Kueue, which simplifies bundling AppWrapper
22-
in the codeflare-operator in RedHat OpenShift AI.
22+
We "vendor" the used functions to eliminate our go dependency on Kueue.
23+
This simplifies bundling AppWrapper in the codeflare-operator in RedHat OpenShift AI.
2324
*/
2425

2526
package maps

0 commit comments

Comments
 (0)