From 5c6b1a13aab2be7be1dc7b0b7959abfe97b4f6c8 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 31 Oct 2023 14:48:03 -0700 Subject: [PATCH 1/3] Fix crash when upgrading from 1.12.0 to >=1.15.0 --- go.mod | 2 +- go.sum | 4 ++-- pkg/xray/resource_xray_repository_config.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index b7d2b16c..fd7c8221 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 517dc5e3..51304601 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/xray/resource_xray_repository_config.go b/pkg/xray/resource_xray_repository_config.go index a92a9465..6bbfbfa4 100644 --- a/pkg/xray/resource_xray_repository_config.go +++ b/pkg/xray/resource_xray_repository_config.go @@ -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) } From 33d973a56af891d9c60fb3ac20bf38166700bb38 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 31 Oct 2023 14:49:03 -0700 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b6fde6..a3c79fc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 2.0.2 (November 1, 2023) + +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: From e6d8f715b8a31b283000b39c761b7a80863c8066 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Tue, 31 Oct 2023 22:35:11 +0000 Subject: [PATCH 3/3] JFrog Pipelines - Add Artifactory and Xray versions to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c79fc8..c3068dc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.0.2 (November 1, 2023) +## 2.0.2 (November 1, 2023). Tested on Artifactory 7.71.3 and Xray 3.83.10 BUG FIXES: