Skip to content
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: Default to Ascending. #3683

Closed
markmandel opened this issue Mar 7, 2024 · 2 comments · Fixed by #3734
Closed

Counter and List Priorities: Default to Ascending. #3683

markmandel opened this issue Mar 7, 2024 · 2 comments · Fixed by #3734
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones

Comments

@markmandel
Copy link
Member

Is your feature request related to a problem? Please describe.

A small quality of life improvement - it would be really nice for Fleet.Spec.Priorities and GameServerAllocation.Spec.Priorities the default for order as Ascending.

Describe the solution you'd like

If not defined, make the order Ascending.

Describe alternatives you've considered

Leave it alone and let people be explicit with their ordering.

Additional context

We have the following in our CRD:

order:
type: string
description: Ascending or Descending sort order. Default is "Ascending" so remove smaller total capacity first. "Descending" would remove larger total capacity first.
enum:
- Ascending
- Descending

So at some point, someone figured we should do this 😄

@markmandel markmandel added kind/feature New features for Agones area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc labels Mar 7, 2024
@markmandel
Copy link
Member Author

@igooch - see any issue with this?

@markmandel markmandel added help wanted We would love help on these issues. Please come help us! good first issue These are great first issues. If you are looking for a place to start, start here! labels Mar 7, 2024
@markmandel
Copy link
Member Author

For Fleet the default should be part of the CRD schema (I believe).

For the GameServerAllocation, this would be part of the function:

func (gsa *GameServerAllocation) ApplyDefaults() {
if gsa.Spec.Scheduling == "" {
gsa.Spec.Scheduling = apis.Packed
}
if len(gsa.Spec.Selectors) == 0 {
gsa.Spec.Required.ApplyDefaults()
for i := range gsa.Spec.Preferred {
gsa.Spec.Preferred[i].ApplyDefaults()
}
} else {
for i := range gsa.Spec.Selectors {
gsa.Spec.Selectors[i].ApplyDefaults()
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones
Projects
None yet
1 participant