-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Remove Generex dependency #6053
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
Seems to be not used 🤞 let see if the CI confirms. |
Back to draft, but we have reproducers now. |
@@ -185,8 +184,7 @@ public KubernetesList processLocally(Map<String, String> valuesMap) { | |||
} else if (Utils.isNotNullOrEmpty(parameter.getValue())) { | |||
parameterValue = parameter.getValue(); | |||
} else if (EXPRESSION.equals(parameter.getGenerate())) { | |||
Generex generex = new Generex(parameter.getFrom()); | |||
parameterValue = generex.random(); | |||
parameterValue = parameter.getFrom(); |
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.
This is not going to generate a valid template instance, at the same time:
- generating a random string can easily lead to errors
- the random string cannot be tracked
Alternatives are in:
- substitute with an alternative library, but I'm not convinced about any of those:
- Roll our own implementation, either as an external micro library or within this project: the code is not going to be much, but OpenShift Templates are deprecated, so, we can even deprecate/remove this feature
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.
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.
This is not going to generate a valid template instance
Why is this?
- generating a random string can easily lead to errors
- the random string cannot be tracked
The purpose of this method is really to process locally the templates as if they were being processed by the OpenShift cluster.
It really doesn't matter if the string can't be tracked or if the random string is invalid (maybe because the provided expression is wrong).
In the end, this would be the user's responsibility.
parameters:
- description: Password used for Redis authentication
from: '[A-Z0-9]{8}'
generate: expression
name: REDIS_PASSWORD
What we want is to be able to support this.
From the docs we can read the constraints for this expression:
generate specifies the generator to be used to generate random string from an input value specified by From field. The result string is stored into Value field. If empty, no generator is being used, leaving the result Value untouched. Optional.
The only supported generator is "expression", which accepts a "from" value in the form of a simple regular expression containing the range expression "[a-zA-Z0-9]", and the length expression "a{length}".
Examples:
from value "test[0-9]{1}x" "test7x" "[0-1]{8}" "01001100" "0x[A-F0-9]{4}" "0xB3AF" "[a-zA-Z0-9]{8}" "hW4yQU5i"
It seems that a simple library or maybe even rolling our own utility method should suffice to handle this.
|
Superseded by #6060 |
Description
Fix #6052
Type of change
test, version modification, documentation, etc.)
Checklist