File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
docs/v3/source/includes/concepts
spec/unit/messages/validators Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ Only annotations with a prefix (e.g. `company.com/contacts`) are sent to service
3737
3838Examples may include (but are not limited to):
3939
40- - `"contact info": "bob@example.com jane@example.com"`
41- - `"library versions": "Spring: 5.1, Redis Client: a184098. yaml parser: 38"`
40+ - `"contact- info": "bob@example.com jane@example.com"`
41+ - `"library- versions": "Spring: 5.1, Redis Client: a184098. yaml parser: 38"`
4242- `"git-sha": "d56fe0367554ae5e878e37ed6c5b9a82f5995512"`
4343
4444#### Annotation keys
Original file line number Diff line number Diff line change @@ -81,6 +81,15 @@ def annotations
8181 end
8282
8383 describe 'invalid keys' do
84+ context 'when the key contains a space' do
85+ let ( :labels ) { { 'potato mashed' => 'value' } }
86+
87+ it 'is invalid' do
88+ expect ( subject ) . not_to be_valid
89+ expect ( subject . errors_on ( :metadata ) ) . to include ( "label key error: 'potato mashed' contains invalid characters" )
90+ end
91+ end
92+
8493 context 'when the key contains one invalid character' do
8594 # for the 32nd-126th characters, excluding the ones inside of the %r()
8695 ( 32 . chr ..126 . chr ) . to_a . reject { |c | %r{[\w \- ._/\s ]} . match ( c ) } . each do |c |
@@ -366,6 +375,15 @@ def annotations
366375 end
367376 end
368377
378+ context 'when the annotations key contains a space' do
379+ let ( :annotations ) { { 'potato mashed' => 'value' } }
380+
381+ it 'is invalid' do
382+ expect ( subject ) . not_to be_valid
383+ expect ( subject . errors_on ( :metadata ) ) . to include ( "annotation key error: 'potato mashed' contains invalid characters" )
384+ end
385+ end
386+
369387 context 'when the annotations key is an empty string' do
370388 let ( :annotations ) do
371389 {
You can’t perform that action at this time.
0 commit comments