-
Notifications
You must be signed in to change notification settings - Fork 53
Fix Azure ARM VM names #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
neykov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - some minor comments.
| return null; | ||
| } | ||
|
|
||
| protected String generateNewIdOfLength(ConfigBag setup, int len) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @Override.
| "vmNameMaxLength", "Maximum length of VM name", 60); | ||
|
|
||
| public static final ConfigKey<String> VM_NAME_DISALLOWED_PATTERN = ConfigKeys.newStringConfigKey( | ||
| "vmNameAllowedChars", "The character pattern to remove from a VM name", "[^a-zA-Z0-9\\-_]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name mismatch - VM_NAME_DISALLOWED_PATTERN, vmNameAllowedChars. Also not obvious it's a regex, figured it out after looking at the default value.
Prefer to have a white-list rather than a black list. I see that's a bit tricky to do with regexes. Could iterate through the characters of the string and match each one against the regex. wdyt?
|
Addressed comments and again tested with Tomcat 7 on Azure ARM, AWS and OpenStack |
|
Thanks @drigodwin , merging. |
Fix Azure ARM VM names Azure ARM only allows alphanumeric characters in it's naming. The default for Brooklyn is to use `-` characters to split up blocks of alphanumeric chars which breaks this. This adds an exception for `azurecompute-arm` in the same style as VM name length. Tested with Tomcat 7 on Azure ARM, AWS and OpenStack
Azure ARM only allows alphanumeric characters in it's naming. The default for Brooklyn is to use
-characters to split up blocks of alphanumeric chars which breaks this. This adds an exception forazurecompute-armin the same style as VM name length.Tested with Tomcat 7 on Azure ARM, AWS and OpenStack