You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These checks cover only the metastore database fields, but HiveServer2DeploymentDependent also appends the CR-provided metastore.externalUri, llap.serviceHosts, and zookeeper.quorum to the same SERVICE_OPTS string (at its lines 117-139). Values containing whitespace or other rejected characters can therefore still reach the generated startup command, so the stated validation boundary can be bypassed. Route every CR value used to build SERVICE_OPTS through the same validator, or validate them before constructing it.
This accepts an empty string, but callers treat any non-null driverJarUrl as configured and externalJars may also contain empty items. The value then falls through to the non-HTTP branch and generates hadoop fs -copyToLocal '', so malformed input still produces a failing init command instead of being rejected here. Reject empty (and null) locations before building the command.
if (containsUnsafeShellChars(jarUrl)) {
throw new IllegalArgumentException("external JAR location must not contain whitespace, quotes, backslashes or "
+ "control characters: " + jarUrl);
Adding this CRD pattern changes the user-visible behavior: Kubernetes now rejects an invalid database type at admission instead of accepting the CR and letting reconciliation fail later. That conflicts with the PR description's Does this PR introduce any user-facing change? No; please update the description to document the validation behavior.
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
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.
…eing injected into k8s operator generated bash commands
What changes were proposed in this pull request?
Validate HiveCluster CR string fields before adding them into bash commands
Why are the changes needed?
To prevent any additional non-intended values being injected into specific HiveCluster CR string fields
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manual Testing