-
Notifications
You must be signed in to change notification settings - Fork 35
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
MTV-1856 | Protect OVA URL parsing #1287
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1287 +/- ##
==========================================
- Coverage 15.47% 15.44% -0.04%
==========================================
Files 112 112
Lines 23399 23399
==========================================
- Hits 3621 3613 -8
- Misses 19490 19501 +11
+ Partials 288 285 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: yaacov <[email protected]>
d0d2715
to
dc40900
Compare
Quality Gate passedIssues Measures |
@@ -70,6 +70,13 @@ func (r Reconciler) CreateOVAServerDeployment(provider *api.Provider, ctx contex | |||
|
|||
func (r *Reconciler) createPvForNfs(provider *api.Provider, ctx context.Context, pvNamePrefix string) (pv *core.PersistentVolume, err error) { | |||
splitted := strings.Split(provider.Spec.URL, ":") | |||
if len(splitted) < 2 { | |||
err = fmt.Errorf("invalid provider URL format: %s", provider.Spec.URL) |
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.
can the URL be a secret we don't want to expose in the logs ?
Issue:
we do not handle the case of missing ":" in the NFS URL
this will create an unhanded error:
{"level":"info","ts":"2024-12-29 10:46:32.872","msg":"Observed a panic in reconciler: runtime error: index out of range [1] with length 1","controller":"provider","object":{"name":"ova-server","namespace":"ova-server"}
,"namespace":"ova-server","name":"ova-server","reconcileID":"6322e786-c0cd-42eb-b05c-32d644704caa"}
Fix:
check for the number of splits when splitting the URL string using ":"
Ref:
https://issues.redhat.com/browse/MTV-1856