Skip to content

Commit

Permalink
Better string sanitize before comparing (#274)
Browse files Browse the repository at this point in the history
Signed-off-by: Max Shaposhnyk <[email protected]>
  • Loading branch information
mshaposhnik authored Apr 18, 2024
1 parent 6185859 commit c214c7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/component_build_controller_pac.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ func (r *ComponentBuildReconciler) lookupPaCSecret(ctx context.Context, componen
r.EventRecorder.Event(&corev1.Secret{}, "Warning", "ErrorParsingPACRepo", err.Error())
return nil, fmt.Errorf("failed to parse component's source URL: %w", err)
}
// cut off .git suffix and leading slash
componentRepo, _ := strings.CutSuffix(url.Path, ".git")
componentRepo = strings.TrimPrefix(componentRepo, "/")

log.Info("Looking for Pipelines as Code SCM secret", "host", url.Hostname(), "repo", componentRepo)

Expand Down

0 comments on commit c214c7e

Please sign in to comment.