-
Notifications
You must be signed in to change notification settings - Fork 513
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
GEP: Unknown Field Management (aka Dead Fields) #3624
Comments
#1804 may be relevant here as well, linking. |
I definitely agree this is a problem we need to address.
While the former scenario can be solved by adding a dedicated condition to the resource, the latter is the complex one and definitely requires some work and definition. |
One thing to consider is status writing as well. If an implementation uses The same has been seen with mutating webhooks before; they would accidentally remove fields due to using an older client-go version |
The tip about using |
"is NOT unique"
This isn't even just a CRD thing: NetworkPolicy has had to worry about this too. If your NP implementation is compiled against an older version of
I can't find the discussion now (it's not in kubernetes/enhancements#2137 which is where I would have expected it) but I had thought about something very similar for NetworkPolicy. ("Schema checking" makes it sound more difficult than it really is; you just need to notice whether the JSON had any fields in it that couldn't be deserialized into the generated struct type.)
A simple (if not efficient) way to do this without having a real API for it is to use the dynamic client rather than a generated type-specific client, and then do the comparison post-hoc; you get an |
This is also being discussed in sig-arch, specifically in the context of some DRA fields (https://docs.google.com/document/d/1sCfO4hJUUhZpzld-_wEZi85XqSclEVvjUfsEe2-duZs/edit). (More-generic discussion later on in the doc.) |
Sounds like we have significant support to at least see what can be done here, so we can move forward: /triage accepted I'll try and drive the first iteration of this (but welcome collaborators): /assign @shaneutt |
Definition
The "Unknown Fields" situation (colloquially we've often referred to this as the "Dead Fields" situation as well) is the situation where the API provides one or more fields that an implementation doesn't actually support, but that implementation is otherwise schema-compatible with the rest of the fields.
In the best case the user doesn't need or use the dead fields, and the problem is non-impacting (at least for that moment).
In the bad case the user utilizes the fields and the API accepts them, but the implementation doesn't support them and so they are "dropped silently". This is not axiomatic for the user. The implementation problematically provisions something that is only a partial reflection of the users' intent.
The worst case is the same as the bad case, except those dropped fields are critical and it is broken and/or unsafe to provision the rest without them. For instance, if some security related fields like authentication were populated and the implementation drops them and exposes a route without its intended authentication (and the user has no way to tell).
What?
I'm advocating for an upstream solution to the "dead fields" problem to help Gateway API implementations and Kubernetes platforms create a safer and more consistent experience for users. This should include both documentation and tooling.
Why?
In Gateway API, we have several dimensions where the "dead fields" problem comes into play:
We'll explain each of these situations in more detail.
Clusters housing multiple implementations
The Gateway API CRDs have become ubiquitous, and as such the situation where multiple implementations on the same cluster is a thing that needs to be supported is becoming more and more common. Consequentially, platforms are inclined to provide the Gateway API CRDs as "core-like" APIs on these clusters.
This gives implementations at least two obvious choices. They can either:
a) crash until the schema that matches is present
b) accept the CRDs as long as they are newer than the minimum required, and forward compatible (e.g. same major release)
A is nobody's favorite. The implication is that implementations might need to (across a matrix of platform versions and the corresponding Gateway API version) create specific releases that target a combination of platforms and their versions, and while doing so match the Gateway API version there exactly. This pushes implementations to B which is where the dead fields dragons lie.
Extended feature support
We have a concept in Gateway API called "Support Levels". This explicitly adds fields that implementations are not required to support. These are not exactly the same as "unknown fields", but relate.
A result of this enhancement should be to define the standard for what implementations do when they have a field populated which they can't use, whether that comes from an "unknown field" or an "known field" (i.e. extended field).
Experimental channel
This is probably one of the least problematic situations, since we anticipate if you're using something labeled
Experimental
then what you're doing is testing or something adjacent to that, so the impact of dropped fields is limited to non-production cases here. This is mainly a problem because we originally "layered" experimental features on top of the same GVK as standard and had users choose which one to deploy. A solution to that problem is being discussed.How?
I'm open to suggestion on the "how".
The text was updated successfully, but these errors were encountered: