iuliana commented on code in PR #1333:
URL: https://github.com/apache/brooklyn-server/pull/1333#discussion_r913809021
##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/ContainerTaskFactory.java:
##########
@@ -68,10 +68,8 @@ public Task<RET> newTask() {
final String containerName = (Strings.isBlank(containerNameFromCfg)
? ( (Strings.isNonBlank(this.tag) ? this.tag + "-" :
"").concat(cleanImageName).concat("-").concat(Strings.makeRandomId(10)))
- : containerNameFromCfg).replace(" ", "-")
- .replace("/", "-")
- .replace("_", "-")
- .replaceAll("[^a-z0-9-]", "") // remove other symbols
+ : containerNameFromCfg)
+ .replaceAll("[^A-Za-z0-9-]", "") // remove all symbols
Review Comment:
The lowercase call at the end ensures that we have no upper-case characters,
but you cannot just remove them, because they might be relevant for something.
For example tags can be used to discern between a job being run in a sensor and
one in an effector. With your change you removed that completely and I had a
lot of pods with `--` in them and their names containing mostly gibberish. ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]