Closed giveadamakick closed 11 months ago
On this line in resource_repository.go
, we don't error out if getting the pipeline config returns a 404:
if err := handleClientError(err); err != nil && res.StatusCode != http.StatusNotFound {
return diag.FromErr(err)
}
In the equivalent line in resource_forked_repository.go
, we do error out:
if err := handleClientError(err); err != nil {
return diag.FromErr(err)
}
My guess would be that the fix for this is as simple as adding the extra && res.StatusCode != http.StatusNotFound
check to resource_forked_repository.go
.
Created PR https://github.com/DrFaust92/terraform-provider-bitbucket/pull/179 to fix.
Terraform Version
1.6.1
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/giveadamakick/be9c6f3a820da7fa916c2b6562720bf2
Panic Output
N/A
Expected Behavior
terraform plan
shows that the forked Bitbucket repo will be imported.Actual Behavior
terraform plan
fails with a crypticError: 404 Not Found: Not found
message.Steps to Reproduce
terraform plan
.Important Factoids
With the forked repo to be imported, if you enable pipelines and then immediately disable again (via the Bitbucket Cloud UI), then the error no longer occurs.
Running in Terraform Cloud.
References
N/A