jboueckegus commented on code in PR #6873:
URL: https://github.com/apache/camel-k/pull/6873#discussion_r4219375497


##########
pkg/util/gitops/gitops.go:
##########
@@ -499,6 +503,13 @@ func GitToken(ctx context.Context, c client.Client, 
namespace, secret string) (s
 // CloneGitProject is in charge to clone the project from a given Git repo 
configuration.
 // If no secretToken is provided, then, it is assumed the project is public.
 func CloneGitProject(gitConf v1.GitConfigSpec, dir, secretToken string) 
(*git.Repository, error) {
+       return CloneGitProjectWithUsername(gitConf, dir, "", secretToken)
+}
+
+// CloneGitProjectWithUsername is in charge to clone the project from a given 
Git repo configuration,
+// authenticating with the given username and secretToken. If no username is 
provided, then, DefaultGitUsername is used.
+// If no secretToken is provided, then, it is assumed the project is public.
+func CloneGitProjectWithUsername(gitConf v1.GitConfigSpec, dir, username, 
secretToken string) (*git.Repository, error) {

Review Comment:
   Done in bc22d7332: `CloneGitProjectWithUsername` is removed, 
`CloneGitProject` now takes the username as a parameter. The gitops trait 
passes `gitops.username` (or the default), the builder passes 
`DefaultGitUsername`.
   
   _Claude Code on behalf of Jan Bouecke_



##########
pkg/util/gitops/gitops.go:
##########
@@ -527,8 +538,11 @@ func CloneGitProject(gitConf v1.GitConfigSpec, dir, 
secretToken string) (*git.Re
        }
 
        if secretToken != "" {
+               if username == "" {

Review Comment:
   Removed in bc22d7332, the callers now provide the value.
   
   _Claude Code on behalf of Jan Bouecke_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to