Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
<!> Work in progress <!>
Currently, we store several important pieces of information inside annotations (and also labels).
Concretely: labels (and annotations) are used as a state storage system.
That information is currently retrieved directly from the container state annotations map, or the container labels, leading to a situation where individual code component are parsing or serializing the labels on their own.
This is problematic, as changing anything in how the data is being stored requires many changes in different places.
Generally speaking, we use the annotation/label storage as an API, leaking the storage specifics and limitations into unrelated abstractions, instead of providing a clean high-level API to interact with that stored data.
As fixing #3663 will require significant changes in the serialized format, including handling of backward compatibility for existing labels, it feels necessary to shake this up and rewrite it.
This is unfortunately going to be massive - and highly impactful.
I am going to try and split this in as many simple atomic PR as possible.
This first PR is focused on:
internalLabels
struct used in create, and replace it with a publicAnnotations
structAnnotations
state.Annotations
map, by access to theAnnotations
structIf we are OK with the direction this is going to, subsequent PRs will focus on:
nerdctl run
andnerdctl compose up
#3663Create
, which is currently baroque at over 1000+ lines