-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcp: refactor label key and value sanitization (#106)
The previous logic did not properly sanitize the label values, as it only ensured length was within the 64 char limit. However, there are additional restrictions on labels and they are similar to the key restrictions. The language from the GCP docs is: > Each resource can have up to 64 labels. > Each label must be a key-value pair. > Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. > Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. Keys must start with a lowercase letter or international character. The new logic attempts to follow all of these rules. The test cases have been expanded to reflect this as well.
- Loading branch information
Showing
2 changed files
with
343 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.