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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external_dependencies_patterns incorrectly forces new on go virtual repos #1004

Closed
1 of 5 tasks
jamestoyer opened this issue Jun 25, 2024 · 4 comments · Fixed by #1005 or #1051
Closed
1 of 5 tasks

external_dependencies_patterns incorrectly forces new on go virtual repos #1004

jamestoyer opened this issue Jun 25, 2024 · 4 comments · Fixed by #1005 or #1051
Assignees
Labels
bug Something isn't working

Comments

@jamestoyer
Copy link
Contributor

Describe the bug
Changing the value of external_dependencies_patterns for a go virtual repository causes the resource to be replaced. This is cause by

begin true.

This behaviour is inconsistent with the UI which does allow you to change the patterns after repository creation.

Requirements for an issue

  • A description of the bug
  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue). If this is not supplied, this issue will likely be closed without any effort expended.
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
  • Your version of terraform
  • Your version of terraform provider

Expected behavior
Setting external_dependencies_patterns should not cause the go virtual repository resource to be recreated.

Additional context
Add any other context about the problem here.

@jamestoyer jamestoyer added the bug Something isn't working label Jun 25, 2024
@alexhung
Copy link
Member

alexhung commented Jun 25, 2024

@jamestoyer Thanks for the report. I don't recall the reason this attribute is set with ForceNew but I'm sure that it was correct.

Its behavior in Artifactory probably has changed since then, so I'll update this in our next sprint.

alexhung added a commit that referenced this issue Jun 25, 2024
…-patterns-force-new

Remove 'ForceNew' setting from external_dependencies_patterns attribute
@gjasny
Copy link

gjasny commented Aug 12, 2024

Hi @alexhung,

Even with latest v11.5.1 the golang virtual repo would be replaced when I add an entry to external_dependencies_patterns:

  # artifactory_virtual_go_repository.test-tf-go must be replaced
-/+ resource "artifactory_virtual_go_repository" "test-tf-go" {
      ~ external_dependencies_patterns                     = [ # forces replacement
            # (1 unchanged element hidden)
            "**/github.com/**",
          + "**/github.comic/**",
        ]
      ~ id                                                 = "test-tf-go" -> (known after apply)
      ~ package_type                                       = "go" -> (known after apply)
      ~ project_environments                               = [] -> (known after apply)
        # (11 unchanged attributes hidden)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Do you have an idea what's going on?

Thanks,
Gregor

@alexhung
Copy link
Member

@gjasny I overlooked this in my last PR.

I'll push out a fix soon.

@alexhung alexhung reopened this Aug 12, 2024
alexhung added a commit that referenced this issue Aug 12, 2024
…-go-repo-external-dependencies-patterns-force-new
alexhung added a commit that referenced this issue Aug 12, 2024
…nal-dependencies-patterns-force-new

Fix virtual go repo external_dependencies_patterns still force replacement on update
@gjasny
Copy link

gjasny commented Aug 13, 2024

Works like a charm! Thank you for the fast fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment