mirror of
https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git
synced 2024-12-04 21:08:11 +00:00
removed unintuitive fallback if repo owner does not exist
This commit is contained in:
parent
b23c36a25f
commit
13d3ed85ad
6 changed files with 7 additions and 21 deletions
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
|
|||
|
||||
GOFMT ?= gofmt -s
|
||||
|
||||
VERSION = 0.11.0
|
||||
VERSION = 0.11.1
|
||||
|
||||
test: fmt-check
|
||||
go test -i $(TEST) || exit 1
|
||||
|
|
|
@ -17,7 +17,7 @@ terraform {
|
|||
required_providers {
|
||||
gitea = {
|
||||
source = "Lerentis/gitea"
|
||||
version = "0.11.0"
|
||||
version = "0.11.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ terraform {
|
|||
required_providers {
|
||||
gitea = {
|
||||
source = "Lerentis/gitea"
|
||||
version = "0.11.0"
|
||||
version = "0.11.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
gitea = {
|
||||
source = "terraform.local/lerentis/gitea"
|
||||
version = "0.11.0"
|
||||
version = "0.11.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
gitea = {
|
||||
source = "Lerentis/gitea"
|
||||
version = "0.11.0"
|
||||
version = "0.11.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,16 +78,6 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||
client := meta.(*gitea.Client)
|
||||
|
||||
var repo *gitea.Repository
|
||||
var resp *gitea.Response
|
||||
var orgRepo bool
|
||||
|
||||
_, resp, err = client.GetOrg(d.Get(repoOwner).(string))
|
||||
|
||||
if resp.StatusCode == 404 {
|
||||
orgRepo = false
|
||||
} else {
|
||||
orgRepo = true
|
||||
}
|
||||
|
||||
if (d.Get(repoMirror)).(bool) {
|
||||
|
||||
|
@ -144,15 +134,11 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) {
|
|||
TrustModel: "default",
|
||||
}
|
||||
|
||||
if orgRepo {
|
||||
repo, _, err = client.CreateOrgRepo(d.Get(repoOwner).(string), opts)
|
||||
} else {
|
||||
repo, _, err = client.CreateRepo(opts)
|
||||
}
|
||||
repo, _, err = client.CreateOrgRepo(d.Get(repoOwner).(string), opts)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
return err
|
||||
}
|
||||
|
||||
err = setRepoResourceData(repo, d)
|
||||
|
|
Loading…
Reference in a new issue