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

Fix crash when upgrading from 1.12.0 to >=1.15.0 #145

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.0.2 (November 1, 2023). Tested on Artifactory 7.71.3 and Xray 3.83.10

BUG FIXES:

* resource/xray_repository_config: fix provider crash after upgrading from 1.12.0 to >=1.15.0.

PR: [#145](https://github.com/jfrog/terraform-provider-xray/pull/145)
Issue: [#141](https://github.com/jfrog/terraform-provider-xray/issues/141) and [#144](https://github.com/jfrog/terraform-provider-xray/issues/144)

## 2.0.1 (October 12, 2023). Tested on Artifactory 7.71.3 and Xray 3.83.10

SECURITY:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0
github.com/hashicorp/terraform-plugin-testing v1.4.0
github.com/jfrog/terraform-provider-shared v1.18.0
github.com/jfrog/terraform-provider-shared v1.20.2
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/text v0.13.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jfrog/terraform-provider-shared v1.18.0 h1:wH+cCL7DPmIp1bQlSfrMG+67tDExMj/MlCQOQgFZuQQ=
github.com/jfrog/terraform-provider-shared v1.18.0/go.mod h1:JvTKRAXMQyX6gQjESY+YK2lJLeW8uKTVHar5HDTnvp0=
github.com/jfrog/terraform-provider-shared v1.20.2 h1:PAHPn0H1CkMWApPaEM5QXYILMOmzgtLuE/clfcQp5Mc=
github.com/jfrog/terraform-provider-shared v1.20.2/go.mod h1:37QaQbp1XSbA/Lnk6HAdh6D2EzUBK+Rk9ZCasQ0BJr4=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand Down
2 changes: 1 addition & 1 deletion pkg/xray/resource_xray_repository_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func resourceXrayRepositoryConfig() *schema.Resource {
m["vuln_contextual_analysis"] = *repoConfig.VulnContextualAnalysis
}

if slices.Contains(exposuresPackageTypes(xrayVersion), packageType) {
if repoConfig.Exposures != nil && slices.Contains(exposuresPackageTypes(xrayVersion), packageType) {
m["exposures"] = packExposures(repoConfig.Exposures, packageType)
}

Expand Down
Loading