This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
spec: Define ACString type and use it for labels values #590
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.
This is related to discussion in #586.
I tried to put some limits on the freeform string trying to keep all the possible use cases (and only ACIs with very strange labels will be broken by this change) without limiting them to only ASCII characters . For example kubernetes has very big limits on label values and force it to be <= 63 chars (http://kubernetes.io/docs/user-guide/labels/).
About the max number of chars I just choosed 255 as a number but it can be changed.
spec: Define ACString type and use it for labels values
Having a label value being a freeform string is coumbersome to use and
query since it can contains non printable characters.
Also having it unlimited can bring to other problems.
This patch adds a ACString type that:
include letters, marks, numbers, punctuation, symbols, and the ASCII
space character, from unicode categories L, M, N, P, S and the ASCII
space character.
This patch starts using this new type for labels values.
Some notes:
unicode.IsPrint or strconv.IsPrint
the number of characters) but this assumption is done everywhere (for
example json string marshall/unmarshall) when a string is involved. So
this should probably be defined at the top of the spec?