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
Truncate job name of the osd prepare job further to avoid pod generation failure on K8s 1.22 #9312
Conversation
pkg/operator/k8sutil/k8sutil.go
Outdated
|
||
// truncateNodeName takes the max length desired for a string and hashes the value if needed to shorten it. | ||
func truncateNodeName(format, nodeName string, maxLength int) string { | ||
if len(nodeName)+len(fmt.Sprintf(format, "")) > maxLength { | ||
hashed := Hash(nodeName) | ||
logger.Infof("format and nodeName longer than %d chars, nodeName %s will be %s", validation.DNS1035LabelMaxLength, nodeName, hashed) |
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.
Should the log info message be updated too with maxLength
instead of validation.DNS1035LabelMaxLength
?
In K8s 1.22 there is a bug in the job name generation that the job name is truncated an additional 10 characters. This can cause an issue in the generated pod name if it then ends in a non-alphanumeric character. In that case, we more aggressively generate a hashed job name. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
The generation of a long node name in the integration tests was being done based on the k8s version. In the past, older K8s versions did not support the changing name. Now it's more maintainable if we generate the long name depending on the test suite. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
bc8314b
to
9d2aa1f
Compare
This pull request has merge conflicts that must be resolved before it can be merged. @travisn please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork |
Truncate job name of the osd prepare job further to avoid pod generation failure on K8s 1.22 (backport #9312)
Truncate job name of the osd prepare job further to avoid pod generation failure on K8s 1.22 (backport #9312)
Description of your changes:
Which issue is resolved by this Pull Request:
Resolves #9294
Checklist:
make codegen
) has been run to update object specifications, if necessary.