Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descriptions and internal notes don't get removed when changed to empty/null/undefined #72

Open
kubiak95 opened this issue Mar 4, 2020 · 1 comment

Comments

@kubiak95
Copy link

kubiak95 commented Mar 4, 2020

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.21
terraform-provider-artifactory 2.0.0-alpha1

Affected Resource(s)

  • artifactory_group
  • artifactory_local_repository
  • artifactory_remote_repository
  • artifactory_virtual_repository

Terraform Configuration Files

provider "artifactory" {
  url = var.auth_url
  api_key = var.auth_api_key
}

resource "artifactory_local_repository" "local_repository" {
  key = "test-repo"
  package_type = "pypi"
}

resource "artifactory_remote_repository" "remote_repository" {
  key = "test-remote-repo"
  url = "https://files.pythonhosted.org"
  package_type = "pypi"
  repo_layout_ref = "maven-2-default"
}

resource "artifactory_virtual_repository" "virtual_repository" {
  key = "test-virtual-repo"
  repositories = [ "test-remote-repo", "test-repo" ]
  package_type = "pypi"
}

resource "artifactory_group" "group" {
  name = "test-group"
}

Debug Output

https://gist.github.com/kubiak95/1757694835c8cd2b71544351d4b99861

Expected Behavior

Based on the excerpt from terraform-plan output

# artifactory_group.group will be updated in-place
~ resource "artifactory_group" "group" {
      admin_privileges = false
      auto_join        = false
    - description      = "Group test description" -> null
      id               = "test-group"
      name             = "test-group"
      realm            = "internal"
  }

This test group's description should be removed after running terrafrom-apply

Actual Behavior

Upon running terraform-apply, terraform shows that it's going to remove the description e.g.

- description = "Group test description" -> null

And it confirms the changes afterwards:

Apply complete! Resources: 0 added, 4 changed, 0 destroyed.

However running terraform-plan again afterwards reveals that descriptions remain unchanged:

- description = "Group test description" -> null

Steps to Reproduce

  1. Have an Artifactory group or a (local|remote|virutal) repository, state of which you track in Terraform. It also must have a non-empty description or internal note.
  2. In your terraform config for these groups/repositories, remove the description. description = null, description = "" or not having description in the configuration should do it.
  3. run terraform-plan and look at pending changes to the description field, should be a deletion e.g. - description = "Group test description" -> null.
  4. run terraform-apply to confirm.
  5. run terraform-plan again and see that description has not changed.
@NootN00t
Copy link

I have noticed similar behaviour with smart NuGet repos and the feed_context_path attribute.

Terraform will detect that it should be set to an empty string (to support the smart repo behavior), sets it on apply. When running plan again it is not persisted and it defaults back to api/v2 which breaks the smart repo behavior.

Setting it manually via the UI persists the setting as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants