feat: allow commas in --image-label but not multiple labels
Resolves #622
Context
Currently, --image-label expects a list of key=value labels separated by commas. This means it is impossible to have labels whose value contain commas.
This is problematic for descriptions (as shown in #622) but also labels that mandate commas like moby.buildkit.frontend.caps (e.g. moby.buildkit.frontend.caps=moby.buildkit.frontend.inputs,moby.buildkit.frontend.contexts).
Those commas also can't be escaped to make pflag keep the values as one label.
Fix
TL;DR: this change might be considered a breaking change due to CLI flags not doing the exact same thing as before.
The issue can be solved easily by replacing StringSliceVar with StringArrayVar. However, it does mean --image-label foo=bar,baz=qux will stay as ["foo=bar,baz=qux"] instead of the current ["foo=bar", "baz=qux"] which might be unexpected for current users of --image-label.
From the name (--image-label) I did expect it to take only a single value instead of a comma-separated one but the description (Which labels (key=value) to add to the image.) seems to say the opposite.
Alternative
Trying to support both options in one flag (--image-label) seems difficult and quite error-prone so might it be possible to consider adding a new option (e.g. --image-add-label, --image-single-label, etc) which can support label with commas?