konstructio / kubefirst

The Kubefirst Open Source Platform
https://kubefirst.konstruct.io/docs
MIT License
1.81k stars 141 forks source link

Repository creation failed. [{Resource:Repository Field:name Code:custom Message:name already exists on this account}] #2153

Open simontechdev opened 7 months ago

simontechdev commented 7 months ago

Which version of kubefirst are you using?

v2.4.3

Which cloud provider?

DigitalOcean

Which DNS?

Cloudflare

Which installation type?

UI (Console app)

Which distributed Git provider?

GitHub

Did you use a fork of gitops-template?

No

Which Operating System?

None specific

What is the issue?

When importing existing repo, it won't allow me and claims the name already exist: Legend: [organisation] = redacted [reponame] = redacted

running "/atlantis-data/bin/terraform1.3.8 apply -input=false \"/atlantis-data/repos/[organisation]/gitops/16/default/terraform/github/default.tfplan\"" in "/atlantis-data/repos/[organisation]/gitops/16/default/terraform/github": exit status 1 module.[reponame].github_repository.repo: Creating... ╷ │ Error: POST https://api.github.com/orgs/organisation/repos: 422 Repository creation failed. [{Resource:Repository Field:name Code:custom Message:name already exists on this account}] │ │ with module.[reponame].github_repository.repo, │ on modules/repository/main.tf line 1, in resource "github_repository" "repo": │ 1: resource "github_repository" "repo" { │ ╵

Code of Conduct

fharper commented 7 months ago

Following-up with you on Slack. I will report the conclusion of our discussion in this issue for transparency and making the information available for all.

simontechdev commented 7 months ago

I believe I misunderstood how it works, and had an expectation that currently is outside of the scope of Kubefirst and Terraform with gitops.

Maybe this should've been a feature request instead, for the ability to import existing repositories into terraform through something like a declaration in repos.tf without terraform creating the repository if it already exist, but accepting it as a part of the cluster and applications managed through kubefirst technology stack anyhow.