Repository navigation
fix: Return an error instead of panicking on an invalid TrinoCluster name - #973
Merged
Merged
Conversation
…name A TrinoCluster name that is valid for Kubernetes but not a valid cluster name, for example longer than 40 characters, made the operator panic while predicting the coordinator pods. The panic crash-looped the operator, so no TrinoCluster was reconciled while the object existed. The name is now validated before anything uses it, and the coordinator pods are predicted from the already validated role groups, so neither the cluster name nor the role group names are parsed with expect.
lfrancke
marked this pull request as ready for review
November 11, 2026 22:00
siegfriedweber
self-requested a review
November 12, 2026 08:19
siegfriedweber
approved these changes
Nov 12, 2026
siegfriedweber
left a comment
Member
There was a problem hiding this comment.
LGTM
PASS: kuttl/harness/smoke_trino-483_hive-4.2.1_opa-latest-1.20.2_hdfs-3.5.0_zookeeper-3.9.6_openshift-false (583.12s)
I also checked the other operators and they are not affected by this bug. However, the airflow-operator has a similar shape as this one had, but the cluster name is checked before the call:
However, it should be fixed nevertheless.
Member
Author
Release notePreviously, a TrinoCluster whose name was not a valid cluster name, for example one longer than 40 characters, crashed the trino-operator, which then restarted in a loop and reconciled no TrinoCluster at all. With this release, such a TrinoCluster fails its own reconcile with an error and all other TrinoClusters are reconciled as usual. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Found this by accident.
A TrinoCluster name longer than 40 characters crashloops the operator with a panic. That's worse than not reconciling an object I'd say.
This fixes it by using the "cleanup" methods from operator-rs everywhere to validate the name before anything toutches it.
This moves the
coordinator_podsmethod because it worked on the custom resource (it parsedmetadata.namedirectly which caused this issue) and we didn't validate the name before we handed it over. The method is now moved to where it's actually used and we hand it the already validated strings. Only the name was a problem right now, but the role group names no longer haveexpecteither.Definition of Done Checklist
Author
Reviewer
Acceptance