mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 01:34:01 +00:00
Allow dash in resource labels.
This commit is contained in:
parent
44f128640a
commit
f7424e5c95
|
@ -292,7 +292,7 @@ const MetadataSchema = `{
|
|||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z/.0-9_*]+$": { "type": "string" }
|
||||
"^[a-zA-Z/.0-9_*-]+$": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1986,7 +1986,7 @@ const RoleSpecV3SchemaDefinitions = `
|
|||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z/.0-9_*]+$": { "anyOf": [{"type": "string"}, { "type": "array", "items": {"type": "string"}}]}
|
||||
"^[a-zA-Z/.0-9_*-]+$": { "anyOf": [{"type": "string"}, { "type": "array", "items": {"type": "string"}}]}
|
||||
}
|
||||
},
|
||||
"logins": {
|
||||
|
@ -2034,7 +2034,7 @@ const RoleSpecV2SchemaTemplate = `{
|
|||
"node_labels": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z/.0-9_]$": { "type": "string" }
|
||||
"^[a-zA-Z/.0-9_-]$": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"namespaces": {
|
||||
|
|
|
@ -215,7 +215,7 @@ func (s *RoleSuite) TestRoleParse(c *C) {
|
|||
in: `{
|
||||
"kind": "role",
|
||||
"version": "v3",
|
||||
"metadata": {"name": "name1"},
|
||||
"metadata": {"name": "name1", "labels": {"a-b": "c"}},
|
||||
"spec": {
|
||||
"options": {
|
||||
"cert_format": "standard",
|
||||
|
@ -225,7 +225,7 @@ func (s *RoleSuite) TestRoleParse(c *C) {
|
|||
"disconnect_expired_cert": "yes"
|
||||
},
|
||||
"allow": {
|
||||
"node_labels": {"a": "b"},
|
||||
"node_labels": {"a": "b", "c-d": "e"},
|
||||
"namespaces": ["default"],
|
||||
"rules": [
|
||||
{
|
||||
|
@ -249,6 +249,7 @@ func (s *RoleSuite) TestRoleParse(c *C) {
|
|||
Metadata: Metadata{
|
||||
Name: "name1",
|
||||
Namespace: defaults.Namespace,
|
||||
Labels: map[string]string{"a-b": "c"},
|
||||
},
|
||||
Spec: RoleSpecV3{
|
||||
Options: RoleOptions{
|
||||
|
@ -259,7 +260,7 @@ func (s *RoleSuite) TestRoleParse(c *C) {
|
|||
DisconnectExpiredCert: NewBool(true),
|
||||
},
|
||||
Allow: RoleConditions{
|
||||
NodeLabels: Labels{"a": []string{"b"}},
|
||||
NodeLabels: Labels{"a": []string{"b"}, "c-d": []string{"e"}},
|
||||
Namespaces: []string{"default"},
|
||||
Rules: []Rule{
|
||||
Rule{
|
||||
|
|
Loading…
Reference in a new issue