-
Notifications
You must be signed in to change notification settings - Fork 823
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
In-place Agones Upgrades: Storage Compatibility #3771
Comments
Apply DefaultI like the approach. But you would want to agones/pkg/gameservers/controller.go Lines 389 to 396 in 4bb6731
Rather than where you specified, as enqueing only enque's the Everything else.LGTM! I like the approach 👍🏻 |
You're right. It might be nice if we had a helper function here that's basically "Get and Default" (for the case of inline changes like you just did for the migration controller), but agreed on the placement. |
A couple of proposed changes on this: We should create a new policy that any new required CRD fields must be non-nullable, and have a default specified in the CRD itself. This means on install all custom resources will immediately have the new field with the default.
I don’t think we need to update the
And a few additional comments:
|
'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions ' |
Note
Milestone of #3766, which we are seeking feedback on. We will move forward with pieces that seem non-contentious, though.
Storage Compatibility
Defaulting
Right now, Agones defaults values in the webhook, e.g. GameServer defaulting is the only real thing the GameServer mutation webhook does. Defaulting serves a couple of purposes:
kubectl describe
. This increases discoverability for new API elements, asdescribe
is a common UI element.The problem is that defaulting in the webhook alone is not safe across configuration changes. Example using
eviction.safe
:SafeToEvict
disabled.foo
created.eviction.safe
is not defaulted because the feature gate was not enabled.SafeToEvict
enabled.eviction.safe
is defaulted on new objects.The reason for the failure is that the hook blindly assumes the value was defaulted by the webhook, but the webhook never had a chance to run. Note that for this particular case, the gap here is very narrow in time - in particular t1 and t2 need to occur such that defaulting of the GameServer occurs on a 1.29
agones-extensions
container, but a 1.30agones-controller
container attempts to create the Pod. That said, this condition could easily occur during rollout of 1.30, though, and cause a multi-second hiccup.To solve this problem, I propose we:
Get
in the controller - probably via helper function). This effectively ensures defaulting on creation and on subsequent update, but it relies on idempotent defaulting.Unknown or Disabled Fields
A similar problem exists for API fields that should not be present but have already been set, which typically only occurs if a feature gate has been disabled (either due to downgrade or explicit disablement). This takes a couple of forms:
eviction.safe
, imagine downgrading from 1.30 (where the feature gate is Beta and therefore the API is defaulted) to 1.28 (prior toeviction.safe
even existing).In either of these cases, we need to ensure that on "first touch", the controller drops the unknown fields, rather than preserving them. In general, this is a safer handling of latent unknown fields - otherwise when the feature gate is reenabled, a preserved field could surprise the user. (Note that the first case, where the field is not present at all in the CRD, is generally covered by field pruning, so mostly this is figuring out logic for the latter case.)
Update vs Patch for controllers
Note that controllers have a similar problem to the SDK of using
Update
vsPatch
, mentioned here - different controller versions may drop fields. However:sdk-server
, which requires a full rollout.The text was updated successfully, but these errors were encountered: