-
Notifications
You must be signed in to change notification settings - Fork 820
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
Fix validation bug in FleetAutoscaler #2242
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
if !runtime.FeatureEnabled(runtime.FeatureCustomFasSyncInterval) { | ||
// Do not run test if FeatureCustomFasSyncInterval is not enabled | ||
return |
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.
The FeatureGate setting in runtime is global.
I concerned that if we set FeatureGate in this test, it may affect other tests that are running in parallel.
In this case, I decided to only check if CustomFasSyncInterval is enabled in FeatureGate.
I wish there was a better way to test this...
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 return
, let's do a:
if !runtime.FeatureEnabled(runtime.FeatureCustomFasSyncInterval) { | |
// Do not run test if FeatureCustomFasSyncInterval is not enabled | |
return | |
if !runtime.FeatureEnabled(runtime.FeatureCustomFasSyncInterval) { | |
// Do not run test if FeatureCustomFasSyncInterval is not enabled | |
t.Skip() |
So we can see that it was skipped 👍🏻
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.
Thank you for your review.
I fixed it.
/assign @markmandel |
Build Failed 😱 Build Id: 8136e661-d63e-4ede-b8dc-d616d39e0916 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 996d43d8-4362-42a5-99b2-67ed07e1da9c The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Hi, I have found an additional bug. agones-controller:
|
Thanks for jumping on it! |
install/yaml/install.yaml
Outdated
- apiGroups: | ||
- autoscaling.agones.dev | ||
resources: | ||
- "fleetautoscalers" | ||
apiVersions: | ||
- "v1" | ||
operations: | ||
- CREATE | ||
- UPDATE |
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 file shows a lot of differences for some reason, but this is the only change.
@markmandel |
Build Failed 😱 Build Id: ea68baba-344a-486d-8d74-4758dbcc793d To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Sorry for the delay - to fix this issue, please run But let me do a quick review! |
@markmandel All fixes are complete! |
Build Failed 😱 Build Id: ae457bcd-91b4-4a77-bc3a-e1de3f46125f To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Sorry yes! Looks like a flakey test. Rerunning! |
I was sure I wrote a review for some extra unit and e2e tests, but now I can't find it! 🤔 (I must have messed things up somewhere). In https://github.com/googleforgames/agones/blob/main/test/e2e/fleetautoscaler_test.go#L72 Let's add a line that if the feature flag for this is enabled, check that the I'd also recommend a unit test for the agones/pkg/gameservers/controller_test.go Line 340 in 59a74c4
That way, we have coverage on automated tests to ensure that default states are handled. |
Build Failed 😱 Build Id: e9658c2b-4893-44bf-99cf-3f69eefa8055 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 1a82d51b-8030-48f7-9905-41d3cf42e9bf To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 9164de7d-197c-40e5-82a1-312877654e5f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
@cindy52 - I'd love to get this bug fix into the RC before we release stable. It's passing in its current form, but I would love a couple more automated tests (#2242 (comment)) - should we merge in its current form so we can get it in before release - or wait for the tests? |
@markmandel |
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.
Thanks for the quick fix! LGTM!
@cindy52 can we squeeze this bug fix into the stable release?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markmandel, yoshd The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Will do! |
Build Failed 😱 Build Id: 7115c350-b011-4975-857f-108bd1e248f9 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: da4993d6-31dd-4b95-a8f8-3d55d3cf7318 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
What type of PR is this?
What this PR does / Why we need it:
Relates to #2171 .
Congratulations on the release of v1.17.0-rc!
I tried this version and found a behavior that seems to be a bug.
I think it assumes that the
sync
field in FleetAutoscaler is not specified if CustomFasSyncInterval is not enabled for the feature gate.However, if you don't specify the
sync
field, it will cause a panic by dereferencing invalid nil pointer.This is the log of applying to a cluster with CustomFasSyncInterval disabled with a manifest that does not have
sync
set:agones-controller:
The following additional bugs have also been fixed.
Similarly, I deployed it on GKE and applied it without setting
sync
to FleetAutoscaler and confirmed that no error occurred.#2242 (comment)
Special notes for your reviewer:
I have installed this modified version of Agones in GKE environment and confirmed that the apply succeeds without setting
sync
in FleetAutoscaler with CustomFasSyncInterval disabled.