@@ -503,7 +503,10 @@ func (r *HelmChartReconciler) buildFromHelmRepository(ctx context.Context, obj *
503
503
ctxTimeout , cancel := context .WithTimeout (ctx , repo .Spec .Timeout .Duration )
504
504
defer cancel ()
505
505
506
- normalizedURL := repository .NormalizeURL (repo .Spec .URL )
506
+ normalizedURL , err := repository .NormalizeURL (repo .Spec .URL )
507
+ if err != nil {
508
+ return chartRepoConfigErrorReturn (err , obj )
509
+ }
507
510
// Construct the Getter options from the HelmRepository data
508
511
clientOpts := []helmgetter.Option {
509
512
helmgetter .WithURL (normalizedURL ),
@@ -1009,7 +1012,10 @@ func (r *HelmChartReconciler) namespacedChartRepositoryCallback(ctx context.Cont
1009
1012
authenticator authn.Authenticator
1010
1013
keychain authn.Keychain
1011
1014
)
1012
- normalizedURL := repository .NormalizeURL (url )
1015
+ normalizedURL , err := repository .NormalizeURL (url )
1016
+ if err != nil {
1017
+ return nil , err
1018
+ }
1013
1019
repo , err := r .resolveDependencyRepository (ctx , url , namespace )
1014
1020
if err != nil {
1015
1021
// Return Kubernetes client errors, but ignore others
@@ -1180,8 +1186,8 @@ func (r *HelmChartReconciler) indexHelmRepositoryByURL(o client.Object) []string
1180
1186
if ! ok {
1181
1187
panic (fmt .Sprintf ("Expected a HelmRepository, got %T" , o ))
1182
1188
}
1183
- u := repository .NormalizeURL (repo .Spec .URL )
1184
- if u != "" {
1189
+ u , err := repository .NormalizeURL (repo .Spec .URL )
1190
+ if u != "" && err != nil {
1185
1191
return []string {u }
1186
1192
}
1187
1193
return nil
0 commit comments