-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Counter and List Priorities: Set Default to Ascending for Fleet and G… #3736
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -18,16 +18,17 @@ import ( | |||
"errors" | ||||
"fmt" | ||||
|
||||
"agones.dev/agones/pkg/apis" | ||||
agonesv1 "agones.dev/agones/pkg/apis/agones/v1" | ||||
"agones.dev/agones/pkg/util/runtime" | ||||
"github.com/mitchellh/hashstructure/v2" | ||||
corev1 "k8s.io/api/core/v1" | ||||
apivalidation "k8s.io/apimachinery/pkg/api/validation" | ||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" | ||||
"k8s.io/apimachinery/pkg/labels" | ||||
"k8s.io/apimachinery/pkg/util/validation/field" | ||||
|
||||
"agones.dev/agones/pkg/apis" | ||||
agonesv1 "agones.dev/agones/pkg/apis/agones/v1" | ||||
"agones.dev/agones/pkg/util/runtime" | ||||
) | ||||
|
||||
const ( | ||||
|
@@ -564,6 +565,13 @@ type GameServerMetadata struct { | |||
|
||||
// ApplyDefaults applies the default values to this GameServerAllocation | ||||
func (gsa *GameServerAllocation) ApplyDefaults() { | ||||
if len(gsa.Spec.Priorities) == 0 { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add tests to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This implementation isn't correct unfortunately - #3734 has it correct - need to loop around each one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't seen the other PR. Since the correct approach is in the above mentioned PR, I will close this PR. |
||||
defaultPriority := agonesv1.Priority{ | ||||
Order: "Ascending", | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than a string, use: agones/pkg/apis/agones/v1/common.go Line 46 in e696b03
|
||||
} | ||||
gsa.Spec.Priorities = []agonesv1.Priority{defaultPriority} | ||||
} | ||||
|
||||
if gsa.Spec.Scheduling == "" { | ||||
gsa.Spec.Scheduling = apis.Packed | ||||
} | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to run
make gen-install
please 😄