-
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
Conversation
…ameServerAllocation
Build Failed 😱 Build Id: c03f8c6b-8407-4125-8f72-abab9979899f To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
@@ -132,6 +132,7 @@ spec: | |||
enum: | |||
- Ascending | |||
- Descending | |||
default: Ascending |
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 😄
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests to:
func TestGameServerAllocationApplyDefaults(t *testing.T) { |
@@ -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 { | |||
defaultPriority := agonesv1.Priority{ | |||
Order: "Ascending", |
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.
Rather than a string, use:
agones/pkg/apis/agones/v1/common.go
Line 46 in e696b03
GameServerPriorityAscending string = "Ascending" |
@@ -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 comment
The 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 comment
The 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.
…ameServerAllocation
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Which issue(s) this PR fixes:
Closes #3683
Special notes for your reviewer: