Skip to content

Commit

Permalink
some misc fixes for create-repo
Browse files Browse the repository at this point in the history
fix username of the gitea checkout
and don't error when repo is not there on first run
  • Loading branch information
chmouel committed Oct 9, 2023
1 parent 63fbe23 commit 0fa6be9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hack/dev/kind/gitea/create-repo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func create(ctx context.Context, args *Args) error {
}

parsed, _ := url.Parse(repoInfo.HTMLURL)
userPasswordURL := fmt.Sprintf("http://git:%s@%s%s", *provider.Token, parsed.Host, parsed.Path)
userPasswordURL := fmt.Sprintf("http://pac:%s@%s%s", *provider.Token, parsed.Host, parsed.Path)

targetNS := *args.targetNS
if targetNS == "" {
Expand All @@ -63,8 +63,8 @@ func create(ctx context.Context, args *Args) error {
_ = pacrepo.CreateNS(ctx, topts.TargetNS, topts.ParamsRun)
err = run.Clients.PipelineAsCode.PipelinesascodeV1alpha1().Repositories(topts.TargetNS).Delete(
ctx, targetNS, metav1.DeleteOptions{})
if err != nil {
return err
if err == nil {
run.Clients.Log.Infof("repository %s/%s deleted", topts.TargetNS, targetNS)
}
_ = run.Clients.Kube.CoreV1().Secrets(topts.TargetNS).Delete(ctx, "gitea-secret", metav1.DeleteOptions{})
if err := tgitea.CreateCRD(ctx, topts); err != nil {
Expand Down

0 comments on commit 0fa6be9

Please sign in to comment.