`gitlab_repository_file` returns an error when `file_path` contains `./`
Created by: phoban01
GitLab Provider version
3.14.0
GitLab version
GitLab Enterprise Edition 15.0.0-pre 83043afc0a9
Terraform version
v1.1.7
Relevant Terraform Configuration
terraform {
required_providers {
gitlab = {
source = "gitlabhq/gitlab"
version = ">= 3.14.0"
}
}
}
resource "gitlab_project" "main" {
name = "test-repo"
visibility_level = "private"
initialize_with_readme = true
}
resource "gitlab_repository_file" "foo" {
project = gitlab_project.main.id
file_path = "a/foo.txt"
content = "This is some text"
branch = "main"
commit_message = "updated by Terraform"
}
resource "gitlab_repository_file" "bar" {
project = gitlab_project.main.id
file_path = "./a/bar.txt"
content = "This is some text"
branch = "main"
commit_message = "updated by Terraform"
}
Relevant log output
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to gitlab_repository_file.bar, provider
│ "provider[\"registry.terraform.io/gitlabhq/gitlab\"]" produced an unexpected new value: Root resource was
│ present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
Description
The provider returns an error whenever the file_path
begins with a period ./
.
The file is created in GitLab despite the error.
I believe the provider should be able to handle file paths starting with ./
as this is a common notation to indicate root directory.
Edited by Timo Furrer