Skip to content

Commit

Permalink
Add tests for distinct multikueues operating with different adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
mszadkow committed Jun 19, 2024
1 parent 5da30da commit ee5a798
Show file tree
Hide file tree
Showing 3 changed files with 458 additions and 11 deletions.
11 changes: 9 additions & 2 deletions pkg/controller/admissionchecks/multikueue/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"

kueuealpha "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
"sigs.k8s.io/kueue/pkg/constants"
"sigs.k8s.io/kueue/pkg/controller/jobframework"
)

Expand Down Expand Up @@ -82,14 +83,20 @@ func WithControllerName(controllerName string) SetupOption {
}
}

// WithAdapters - sets the controller name for which the multikueue
// admission check match.
// WithAdapters - sets all the MultiKueue adaptors.
func WithAdapters(adapters map[string]jobframework.MultiKueueAdapter) SetupOption {
return func(o *SetupOptions) {
o.adapters = adapters
}
}

// WithAdapters - sets or updates the adadpter of the MultiKueue adaptors.
func WithAdapter(adapter jobframework.MultiKueueAdapter) SetupOption {
return func(o *SetupOptions) {
o.adapters[adapter.GVK().String()] = adapter
}
}

func NewSetupOptions() *SetupOptions {
return &SetupOptions{
gcInterval: defaultGCInterval,
Expand Down
Loading

0 comments on commit ee5a798

Please sign in to comment.