Skip to content

Commit

Permalink
Increase string attribute max length to 256 chars
Browse files Browse the repository at this point in the history
Increase the maximum supported length for string type
resource attributes from 255 to 256 characters, to allow
creating string attributes on resources that accept values
of such length (e.g. Swift container names).
  • Loading branch information
Callum027 committed Jan 21, 2025
1 parent b28f215 commit 28522a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gnocchi/resource_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def __init__(self, min_length, max_length, *args, **kwargs):

meta_schema_ext = {
voluptuous.Required('min_length', default=0):
voluptuous.All(int, voluptuous.Range(min=0, max=255)),
voluptuous.Required('max_length', default=255):
voluptuous.All(int, voluptuous.Range(min=1, max=255))
voluptuous.All(int, voluptuous.Range(min=0, max=256)),
voluptuous.Required('max_length', default=256):
voluptuous.All(int, voluptuous.Range(min=1, max=256))
}

@property
Expand Down
4 changes: 2 additions & 2 deletions gnocchi/tests/functional/gabbits/resource-type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ tests:
foobar:
type: string
required: False
max_length: 255
max_length: 256
min_length: 0
uuid:
type: uuid
Expand Down Expand Up @@ -200,7 +200,7 @@ tests:
type: string
required: False
min_length: 0
max_length: 255
max_length: 256
uuid:
type: uuid
required: True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
The maximum allowed length for string-type resource attributes has been
increased from 255 to 256 characters. This allows creating attributes
that accept values up to 256 characters long e.g. Swift container names.

0 comments on commit 28522a5

Please sign in to comment.