diff --git a/pkg/controller/provider/ova-setup.go b/pkg/controller/provider/ova-setup.go index d137beb6f..1bb9213cb 100644 --- a/pkg/controller/provider/ova-setup.go +++ b/pkg/controller/provider/ova-setup.go @@ -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) + + err = liberr.Wrap(err) + r.Log.Error(err, "Failed to parse NFS server and path from provider URL") + return nil, err + } nfsServer := splitted[0] nfsPath := splitted[1] labels := map[string]string{"provider": provider.Name, "app": "forklift", "subapp": ovaServer}