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

xray_webhook provider existing headers not recognized during plan step #290

Closed
3 tasks done
EitanJoseph opened this issue Dec 18, 2024 · 1 comment · Fixed by #291
Closed
3 tasks done

xray_webhook provider existing headers not recognized during plan step #290

EitanJoseph opened this issue Dec 18, 2024 · 1 comment · Fixed by #291
Assignees
Labels
bug Something isn't working

Comments

@EitanJoseph
Copy link

EitanJoseph commented Dec 18, 2024

Describe the bug
Terraform: 1.9.8
Artifactory: 7.59.9
Xray: 3.74.8

Providers:
jfrog/xray version: 3.0.2
jfrog/artifactory version: 12.3.2

The xray_webhook provider offers the headers field however this field is not properly analyzed by the terraform plan step. In particular, when you initialize terraform and import your existing xray webhook, the terraform plan step incorrectly claims that changes will be made to the headers field of your xray_webhook resource.

To recreate this issue create an xray webhook with headers (in my case specifically Authorization) and import the resource to a terraform configuration that is an exact match.

resource "xray_webhook" "xray_webhook" {
    name = "AdoWebhook"
    url = "url"
    use_proxy = true
    description =  "Description"
    headers = { Authorization = "Basic auth_token" }
}

Then run terraform plan and see that there is a claim of headers requiring an update.

Additionally, if you apply your terraform configuration, then re-initialize and re-import the resource, then run terraform plan, you will once again see the claim that the webhook's headers are going to be "added (+)"

Requirements for and issue

  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
  • Your version of Artifactory and Xray (you can curl Artifactory version at $host/artifactory/api/system/version and Xray version at
    $host/xray/api/v1/system/version
  • Your version of terraform

Expected behavior
I expect that when I terraform plan an xray_webhook configuration that is a 1 to 1 match with the real configuration that terraform does not report a (+) change.

Additional context
Only tried this with the header Authorization and terraform plan seems to work correctly right after you apply your changed but don't re-import the resource.

@EitanJoseph EitanJoseph added the bug Something isn't working label Dec 18, 2024
@alexhung
Copy link
Member

@EitanJoseph Thanks for the report! I've added this to our plan to investigate and fix.

alexhung added a commit that referenced this issue Dec 19, 2024
…orted-correctly

Fix xray_webhook headers not being imported correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants