mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-10 12:44:16 +00:00
feat(labels): add support for service and container labels in uc run and inspect commands
This commit is contained in:
@@ -74,7 +74,14 @@ func TestServiceSpec_Validate_Labels(t *testing.T) {
|
||||
{name: "nil labels"},
|
||||
{name: "valid labels", labels: map[string]string{"com.example.team": "web", "tier": ""}},
|
||||
{name: "prefix without dot", labels: map[string]string{"uncloudfoo": "bar"}},
|
||||
{name: "whitespace in value", labels: map[string]string{"tier": "value with spaces"}},
|
||||
{name: "empty key", labels: map[string]string{"": "bar"}, wantErr: "must not be empty"},
|
||||
{name: "only whitespace in key", labels: map[string]string{" ": "bar"}, wantErr: "must not be empty"},
|
||||
{name: "space in key", labels: map[string]string{"my label": "bar"}, wantErr: "must not contain whitespace"},
|
||||
{name: "leading space in key", labels: map[string]string{" tier": "bar"}, wantErr: "must not contain whitespace"},
|
||||
{name: "trailing space in key", labels: map[string]string{"tier ": "bar"}, wantErr: "must not contain whitespace"},
|
||||
{name: "tab in key", labels: map[string]string{"my\tlabel": "bar"}, wantErr: "must not contain whitespace"},
|
||||
{name: "newline in key", labels: map[string]string{"my\nlabel": "bar"}, wantErr: "must not contain whitespace"},
|
||||
{name: "reserved prefix", labels: map[string]string{LabelManaged: ""}, wantErr: "reserved prefix"},
|
||||
{name: "reserved daemon prefix", labels: map[string]string{"uncloudd.foo": "bar"}, wantErr: "reserved prefix"},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user