Add some limits to os-features - #29
Conversation
eb1ec17 to
c615a79
Compare
c615a79 to
e073215
Compare
|
cc @estesp @dmcgowan @sudo-bmitch These are just some arbitrary limits, and probably should be discussed to see what limits we think are reasonable. We could also consider adding a new
My main goal with this PR was to prevent situations where (e.g.) Maybe it's also worth considering defining a list of "well-known" os-features as part of the OCI specs somewhere; this preserves the existing flexibility (not all features have to be "well-known"), but could define that implementers MAY omit, ignore, or discard options not in the "well-known" list. |
e073215 to
328b4b4
Compare
|
I think its reasonable to add some limits here. I don't think its up to this project to default "well-known" ones, right now only "win32k" is defined in oci-spec and thats the only one we may need special logic for. Otherwise, this list should be small, large numbers of these in images would make them difficult to find a match anyway. |
328b4b4 to
a59a685
Compare
| const ( | ||
| maxFeatures = 16 // maxFeatures is the maximum number of features allowed. | ||
| maxFeatureLen = 64 // maxFeatureLen is the maximum length per feature. | ||
| maxOSOptionsLen = 256 // maxOSOptionsLen is the maximum length for OS options (OS-version + options). |
There was a problem hiding this comment.
16 * 64 = 1024, but maxOSOptionLen == 256? Seems the max total len should have some extra room based on the other max options given that it also includes the version string.
There was a problem hiding this comment.
Good one! It's been a while since I wrote it, and I only just rebased. Perhaps I had some thinking behind that (maximum number of features or a maximum length? 😂).
I can extend it! I think I also just put up some numbers that seemed arbitrary (but reasonable / to be expected) limits, but mostly to start the discussions "what is a good limit".
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
a59a685 to
f131d87
Compare
Add some limits to os-features
Baseline -> #30 -> this PR;
Compared to baseline (before #30)
Details