Skip to content

Commit

Permalink
[Bug] Allow creating queues with preempt permission verb
Browse files Browse the repository at this point in the history
Signed-off-by: JamesMurkin <[email protected]>
  • Loading branch information
JamesMurkin committed Jun 17, 2024
1 parent 5530e50 commit 437045f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/client/queue/permission_verb.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const (
)

// NewPermissionVerb returns PermissionVerb from input string. If input string doesn't match
// one of allowed verb values ["submit", "cancel", "reprioritize", "watch"], and error is returned.
// one of allowed verb values ["submit", "cancel", "preempt", "reprioritize", "watch"], and error is returned.
func NewPermissionVerb(in string) (PermissionVerb, error) {
switch verb := PermissionVerb(in); verb {
case PermissionVerbSubmit, PermissionVerbCancel, PermissionVerbReprioritize, PermissionVerbWatch:
case PermissionVerbSubmit, PermissionVerbCancel, PermissionVerbPreempt, PermissionVerbReprioritize, PermissionVerbWatch:
return verb, nil
default:
return "", fmt.Errorf("invalid queue permission verb: %s", in)
Expand Down Expand Up @@ -76,6 +76,7 @@ func AllPermissionVerbs() PermissionVerbs {
return []PermissionVerb{
PermissionVerbSubmit,
PermissionVerbCancel,
PermissionVerbPreempt,
PermissionVerbReprioritize,
PermissionVerbWatch,
}
Expand Down
1 change: 1 addition & 0 deletions pkg/client/queue/permission_verb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestPermissionVerbUnmarshal(t *testing.T) {
Verbs: []PermissionVerb{
PermissionVerbCancel,
PermissionVerbReprioritize,
PermissionVerbPreempt,
PermissionVerbSubmit,
PermissionVerbWatch,
},
Expand Down

0 comments on commit 437045f

Please sign in to comment.