Open medains opened 3 years ago
terraform 0.13.2
Probably all resources that have string fields that it is valid to be the empty string.
Using gocenter.io as a remote for the purposes of this example
Initial state
resource "artifactory_remote_repository" "someremote" { url = "https://gocenter.io" key = "gocenter" package_type = "go" repo_layout_ref = "go-default" proxy = "someproxy" }
Second apply
resource "artifactory_remote_repository" "someremote" { url = "https://gocenter.io" key = "gocenter" package_type = "go" repo_layout_ref = "go-default" proxy = "" }
Proxy should have been removed with a change of
proxy "someproxy" -> ""
Proxy field not passed to the API, as it got reduced to null
proxy "someproxy" => null
This retains the value "someproxy" in the remote.
This affects any string field in which changing the field to "" in the API would be a valid change.
terraform apply
At https://github.com/atlassian/terraform-provider-artifactory/blob/master/pkg/artifactory/util.go#L15 d.GetOk(key) should perhaps be d.GetOkExists(key) so that empty strings are not treated as null
migrated -> https://github.com/jfrog/terraform-provider-artifactory/issues/18
Community Note
Terraform Version
terraform 0.13.2
Affected Resource(s)
Probably all resources that have string fields that it is valid to be the empty string.
Terraform Configuration Files
Using gocenter.io as a remote for the purposes of this example
Initial state
Second apply
Expected Behavior
Proxy should have been removed with a change of
proxy "someproxy" -> ""
Actual Behavior
Proxy field not passed to the API, as it got reduced to null
proxy "someproxy" => null
This retains the value "someproxy" in the remote.
Steps to Reproduce
This affects any string field in which changing the field to "" in the API would be a valid change.
terraform apply
with initial stateterraform apply
after changing a string field to ""Possible fix
At https://github.com/atlassian/terraform-provider-artifactory/blob/master/pkg/artifactory/util.go#L15 d.GetOk(key) should perhaps be d.GetOkExists(key) so that empty strings are not treated as null