Skip to content

Commit 3ecd34b

Browse files
Merge branch 'main' into regex-validaton
2 parents 25c39e2 + d49fbee commit 3ecd34b

File tree

4 files changed

+44
-38
lines changed

4 files changed

+44
-38
lines changed

ibm_catalog.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"support_details": "This product is in the community registry, as such support is handled through the originated repo. If you experience issues please open an issue in the repository [https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/issues](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/issues). Please note this product is not supported via the IBM Cloud Support Center.",
3131
"flavors": [
3232
{
33-
"label": "Fully Configurable",
33+
"label": "Fully configurable",
3434
"name": "fully-configurable",
3535
"index": 1,
3636
"working_directory": "solutions/fully-configurable",
@@ -928,7 +928,7 @@
928928
"name": "deploy-arch-ibm-cloud-monitoring",
929929
"description": "Sets up a Cloud Monitoring instance to gain operational visibility on applications running on OpenShift Cluster.",
930930
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
931-
"version": "v1.6.4",
931+
"version": "v1.7.2",
932932
"flavors": [
933933
"fully-configurable"
934934
],
@@ -966,7 +966,7 @@
966966
"name": "deploy-arch-ibm-scc-workload-protection",
967967
"description": "Configure an IBM Cloud Security and Compliance Center Workload Protection instance to help you manage security and compliance for your organization.",
968968
"id": "4322cf44-2289-49aa-a719-dd79e39b14dc-global",
969-
"version": "v1.11.4",
969+
"version": "v1.12.3",
970970
"flavors": [
971971
"fully-configurable"
972972
],
@@ -1094,7 +1094,7 @@
10941094
"reference_version": true
10951095
}
10961096
],
1097-
"version": "v3.58.2"
1097+
"version": "v3.63.1"
10981098
}
10991099
],
11001100
"dependency_version_2": true,

tests/go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ go 1.24.0
55
toolchain go1.25.3
66

77
require (
8-
github.com/IBM/go-sdk-core v1.1.0
98
github.com/gruntwork-io/terratest v0.51.0
109
github.com/stretchr/testify v1.11.1
1110
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.60.13
@@ -30,7 +29,6 @@ require (
3029
github.com/cloudflare/circl v1.6.1 // indirect
3130
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
3231
github.com/davecgh/go-spew v1.1.1 // indirect
33-
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
3432
github.com/emirpasic/gods v1.18.1 // indirect
3533
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
3634
github.com/ghodss/yaml v1.0.0 // indirect
@@ -100,7 +98,6 @@ require (
10098
golang.org/x/sys v0.37.0 // indirect
10199
golang.org/x/text v0.30.0 // indirect
102100
golang.org/x/tools v0.37.0 // indirect
103-
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
104101
gopkg.in/warnings.v0 v0.1.2 // indirect
105102
gopkg.in/yaml.v2 v2.4.0 // indirect
106103
gopkg.in/yaml.v3 v3.0.1 // indirect

tests/go.sum

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ github.com/IBM-Cloud/power-go-client v1.13.0 h1:TqxPlkJe0VkNdV9hYOD5NRepxEFhhyKX
66
github.com/IBM-Cloud/power-go-client v1.13.0/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
77
github.com/IBM/cloud-databases-go-sdk v0.8.1 h1:ULQ5L8V/9z79/qS185LqbIK2LD4kMtk3Hdhp4lFMVcw=
88
github.com/IBM/cloud-databases-go-sdk v0.8.1/go.mod h1:JYucI1PdwqbAd8XGdDAchxzxRP7bxOh1zUnseovHKsc=
9-
github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY=
10-
github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY=
119
github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE=
1210
github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk=
1311
github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw=
@@ -50,8 +48,6 @@ github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL
5048
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5149
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5250
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
53-
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
54-
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
5551
github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
5652
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
5753
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
@@ -110,11 +106,9 @@ github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3Bum
110106
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
111107
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
112108
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
113-
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
114109
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
115110
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
116111
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
117-
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
118112
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
119113
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
120114
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
@@ -201,7 +195,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
201195
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
202196
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
203197
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
204-
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
205198
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
206199
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
207200
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
@@ -519,10 +512,7 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
519512
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
520513
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
521514
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
522-
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
523515
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
524-
gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
525-
gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
526516
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
527517
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
528518
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

tests/pr_test.go

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ package test
33

44
import (
55
"fmt"
6+
"log"
67
"math/rand/v2"
78
"os"
89
"strings"
910
"testing"
1011

11-
"github.com/IBM/go-sdk-core/core"
1212
"github.com/gruntwork-io/terratest/modules/files"
1313
"github.com/gruntwork-io/terratest/modules/logger"
1414
"github.com/gruntwork-io/terratest/modules/random"
1515
"github.com/gruntwork-io/terratest/modules/terraform"
1616
"github.com/stretchr/testify/assert"
1717
"github.com/stretchr/testify/require"
1818
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
19+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
1920
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
2021
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
2122
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
@@ -26,8 +27,12 @@ const fullyConfigurableSolutionDir = "solutions/fully-configurable"
2627
const fullyConfigurableSolutionKubeconfigDir = "solutions/fully-configurable/kubeconfig"
2728
const terraformDirMonitoringAgentIKS = "examples/obs-agent-iks"
2829
const terraformDirMonitoringAgentROKS = "examples/obs-agent-ocp"
30+
const terraformVersion = "terraform_v1.10" // This should match the version in the ibm_catalog.json
31+
// Define a struct with fields that match the structure of the YAML data
32+
const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-resources.yaml"
2933

3034
var sharedInfoSvc *cloudinfo.CloudInfoService
35+
var permanentResources map[string]interface{}
3136

3237
var validRegions = []string{
3338
"au-syd",
@@ -54,6 +59,12 @@ var IgnoreAdds = []string{"module.scc_wp.restapi_object.cspm"}
5459
func TestMain(m *testing.M) {
5560
sharedInfoSvc, _ = cloudinfo.NewCloudInfoServiceFromEnv("TF_VAR_ibmcloud_api_key", cloudinfo.CloudInfoServiceOptions{})
5661

62+
var err error
63+
permanentResources, err = common.LoadMapFromYaml(yamlLocation)
64+
if err != nil {
65+
log.Fatal(err)
66+
}
67+
5768
os.Exit(m.Run())
5869
}
5970

@@ -113,6 +124,7 @@ func TestFullyConfigurableSolution(t *testing.T) {
113124
DeleteWorkspaceOnFail: false,
114125
WaitJobCompleteMinutes: 60,
115126
Region: region,
127+
TerraformVersion: terraformVersion,
116128
})
117129
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
118130
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
@@ -198,6 +210,8 @@ func TestFullyConfigurableUpgradeSolution(t *testing.T) {
198210
IgnoreUpdates: testhelper.Exemptions{ // Ignore for consistency check
199211
List: IgnoreUpdates,
200212
},
213+
TerraformVersion: terraformVersion,
214+
CheckApplyResultForUpgrade: true,
201215
})
202216

203217
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
@@ -278,12 +292,6 @@ func TestRunAgentClassicKubernetes(t *testing.T) {
278292

279293
func TestAgentDefaultConfiguration(t *testing.T) {
280294

281-
/*
282-
Skipping this test because auto-approve is not working as expected in projects
283-
Config gets stuck in approved state and doesn't move to deployment
284-
https://github.ibm.com/epx/projects/issues/4814
285-
*/
286-
t.Skip("Skipping because of projects issue")
287295
t.Parallel()
288296

289297
options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
@@ -297,26 +305,37 @@ func TestAgentDefaultConfiguration(t *testing.T) {
297305
"deploy-arch-ibm-monitoring-agent",
298306
"fully-configurable",
299307
map[string]interface{}{
300-
"prefix": options.Prefix,
301-
"secrets_manager_service_plan": "trial",
302-
"region": "eu-de",
308+
"prefix": options.Prefix,
309+
"region": "eu-de",
303310
},
304311
)
305312

306-
/*
307-
Event notifications is manually disabled in this test because event notifications DA creates kms keys and during undeploy the order of key protect and event notifications
308-
is not considered by projects as EN is not a direct dependency of VSI DA. So undeploy fails, because
309-
key protect instance can't be deleted because of active keys created by EN. Hence for now, we don't want to deploy
310-
EN.
311-
312-
Issue has been created for projects team. https://github.ibm.com/epx/projects/issues/4750
313-
Once that is fixed, we can remove the logic to disable EN
314-
*/
315313
options.AddonConfig.Dependencies = []cloudinfo.AddonConfig{
314+
// use existing secrets manager instance to help prevent hitting trial instance limit in account
315+
{
316+
OfferingName: "deploy-arch-ibm-secrets-manager",
317+
OfferingFlavor: "fully-configurable",
318+
Inputs: map[string]interface{}{
319+
"existing_secrets_manager_crn": permanentResources["privateOnlySecMgrCRN"],
320+
"service_plan": "__NULL__", // no plan value needed when using existing SM
321+
"skip_secrets_manager_iam_auth_policy": true, // since using an existing Secrets Manager instance, attempting to re-create auth policy can cause conflicts if the policy already exists
322+
"secret_groups": []string{}, // passing empty array for secret groups as default value is creating general group and it will cause conflicts as we are using an existing SM
323+
},
324+
},
325+
// // Disable target / route creation to help prevent hitting quota in account
326+
{
327+
OfferingName: "deploy-arch-ibm-cloud-monitoring",
328+
OfferingFlavor: "fully-configurable",
329+
Inputs: map[string]interface{}{
330+
"enable_metrics_routing_to_cloud_monitoring": false,
331+
},
332+
},
316333
{
317-
OfferingName: "deploy-arch-ibm-event-notifications",
334+
OfferingName: "deploy-arch-ibm-activity-tracker",
318335
OfferingFlavor: "fully-configurable",
319-
Enabled: core.BoolPtr(false), // explicitly disabled
336+
Inputs: map[string]interface{}{
337+
"enable_activity_tracker_event_routing_to_cloud_logs": false,
338+
},
320339
},
321340
}
322341

0 commit comments

Comments
 (0)