Skip to content

Commit f6295e9

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
tests: update test code
1 parent cd8dcf7 commit f6295e9

File tree

5 files changed

+60
-52
lines changed

5 files changed

+60
-52
lines changed

.secrets.baseline

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-01-24T16:49:18Z",
6+
"generated_at": "2025-02-11T22:49:03Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,18 +76,7 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {
80-
"solutions/deploy/README.md": [
81-
{
82-
"hashed_secret": "2254481e1661d8f017a712b0d1ad9a14fd9460a3",
83-
"is_secret": false,
84-
"is_verified": false,
85-
"line_number": 134,
86-
"type": "Secret Keyword",
87-
"verified_result": null
88-
}
89-
]
90-
},
79+
"results": {},
9180
"version": "0.13.1+ibm.62.dss",
9281
"word_list": {
9382
"file": null,

solutions/deploy/README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,23 @@ You need the following permissions to run this module:
129129

130130
| Name | Description | Type | Default | Required |
131131
|------|-------------|------|---------|:--------:|
132-
| <a name="input_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#input\_cloud\_pak\_deployer\_image) | Cloud Pak Deployer image location. If not defined, it will build the image via code engine | `string` | `null` | no |
132+
| <a name="input_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#input\_cloud\_pak\_deployer\_image) | Cloud Pak Deployer image to use. If null, the image will be built using Code Engine. | `string` | `null` | no |
133133
| <a name="input_cloud_pak_deployer_release"></a> [cloud\_pak\_deployer\_release](#input\_cloud\_pak\_deployer\_release) | Release of Cloud Pak Deployer version to use. View releases at: https://github.com/IBM/cloud-pak-deployer/releases. | `string` | `"v3.1.2"` | no |
134-
| <a name="input_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#input\_cloud\_pak\_deployer\_secret) | Image pull secret for the cloud pak deployer image | <pre>object({<br/> username = string<br/> password = string<br/> server = string<br/> email = string<br/> })</pre> | `null` | no |
135-
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of Red Hat OpenShift cluster to install watsonx onto | `string` | n/a | yes |
134+
| <a name="input_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#input\_cloud\_pak\_deployer\_secret) | Secret for accessing the Cloud Pak Deployer image. If null, a default secret will be created. | `map(string)` | `null` | no |
135+
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the OpenShift cluster. | `string` | n/a | yes |
136136
| <a name="input_code_engine_project_id"></a> [code\_engine\_project\_id](#input\_code\_engine\_project\_id) | If you want to use an existing project, you can pass the code engine project id and the cloud pak deployer build will be built within the existing project vs a new one being created. | `string` | `null` | no |
137137
| <a name="input_code_engine_project_name"></a> [code\_engine\_project\_name](#input\_code\_engine\_project\_name) | If the variable cloud\_pak\_deployer\_image is null, it will build the image with code engine and store it within a private icr registry. Provide a name if you want to set the name. If not defined, default will be {prefix}-cpd-{random-suffix} | `string` | `null` | no |
138-
| <a name="input_cpd_accept_license"></a> [cpd\_accept\_license](#input\_cpd\_accept\_license) | When set to 'true', it is understood that the user has read the terms of the Cloud Pak license(s) and agrees to the terms outlined | `bool` | `false` | no |
139-
| <a name="input_cpd_admin_password"></a> [cpd\_admin\_password](#input\_cpd\_admin\_password) | Password to be used by the admin user to access the Cloud Pak for Data UI. | `string` | n/a | yes |
140-
| <a name="input_cpd_entitlement_key"></a> [cpd\_entitlement\_key](#input\_cpd\_entitlement\_key) | Cloud Pak for Data entitlement key for access to the IBM Entitled Registry. Can be fetched from https://myibm.ibm.com/products-services/containerlibrary. | `string` | n/a | yes |
138+
| <a name="input_cpd_accept_license"></a> [cpd\_accept\_license](#input\_cpd\_accept\_license) | Accept the Cloud Pak for Data license. | `bool` | `false` | no |
139+
| <a name="input_cpd_admin_password"></a> [cpd\_admin\_password](#input\_cpd\_admin\_password) | Password for the Cloud Pak for Data admin user. | `string` | n/a | yes |
140+
| <a name="input_cpd_entitlement_key"></a> [cpd\_entitlement\_key](#input\_cpd\_entitlement\_key) | Entitlement key for Cloud Pak for Data. | `string` | n/a | yes |
141141
| <a name="input_cpd_version"></a> [cpd\_version](#input\_cpd\_version) | Cloud Pak for Data version to install. Only version 5.x.x is supported | `string` | `"5.0.3"` | no |
142-
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | APIkey that's associated with the account to use | `string` | n/a | yes |
142+
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud platform API key needed to deploy IAM enabled resources. | `string` | n/a | yes |
143143
| <a name="input_install_odf_cluster_addon"></a> [install\_odf\_cluster\_addon](#input\_install\_odf\_cluster\_addon) | Install the odf cluster addon | `bool` | `true` | no |
144144
| <a name="input_odf_config"></a> [odf\_config](#input\_odf\_config) | Version of ODF to install | `map(string)` | <pre>{<br/> "addSingleReplicaPool": "false",<br/> "billingType": "essentials",<br/> "clusterEncryption": "false",<br/> "disableNoobaaLB": "false",<br/> "enableNFS": "false",<br/> "encryptionInTransit": "false",<br/> "hpcsBaseUrl": "",<br/> "hpcsEncryption": "false",<br/> "hpcsInstanceId": "",<br/> "hpcsSecretName": "",<br/> "hpcsServiceName": "",<br/> "hpcsTokenUrl": "",<br/> "ignoreNoobaa": "true",<br/> "numOfOsd": "1",<br/> "ocsUpgrade": "false",<br/> "odfDeploy": "true",<br/> "osdDevicePaths": "",<br/> "osdSize": "512Gi",<br/> "osdStorageClassName": "ibmc-vpc-block-metro-10iops-tier",<br/> "prepareForDisasterRecovery": "false",<br/> "resourceProfile": "balanced",<br/> "taintNodes": "false",<br/> "useCephRBDAsDefaultStorageClass": "false",<br/> "workerNodes": "all",<br/> "workerPool": ""<br/>}</pre> | no |
145145
| <a name="input_odf_version"></a> [odf\_version](#input\_odf\_version) | Version of ODF to install | `string` | `"4.16.0"` | no |
146-
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters. | `string` | n/a | yes |
147-
| <a name="input_region"></a> [region](#input\_region) | Region where resources wills be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
148-
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group to provision services within. If not defined, a resource group called {prefix}-cpd will be created | `string` | `null` | no |
146+
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 13 or fewer characters. | `string` | `"lz-roks-cp4d"` | no |
147+
| <a name="input_region"></a> [region](#input\_region) | Region where resources will be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
148+
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group to provision services within. If not defined, a resource group called {prefix}-cpd will be created. | `string` | `null` | no |
149149
| <a name="input_resource_group_exists"></a> [resource\_group\_exists](#input\_resource\_group\_exists) | Resource group exists or not within the account. | `bool` | `false` | no |
150150
| <a name="input_watson_assistant_install"></a> [watson\_assistant\_install](#input\_watson\_assistant\_install) | If watsonx.ai is being installed, also install watson assistant | `bool` | `false` | no |
151151
| <a name="input_watson_discovery_install"></a> [watson\_discovery\_install](#input\_watson\_discovery\_install) | If watsonx.ai is being installed, also install watson discovery | `bool` | `false` | no |
@@ -155,7 +155,11 @@ You need the following permissions to run this module:
155155

156156
### Outputs
157157

158-
No outputs.
158+
| Name | Description |
159+
|------|-------------|
160+
| <a name="output_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#output\_cloud\_pak\_deployer\_image) | The Cloud Pak Deployer image used. |
161+
| <a name="output_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#output\_cloud\_pak\_deployer\_secret) | The secret used for accessing the Cloud Pak Deployer image. |
162+
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | The name of the OpenShift cluster. |
159163
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
160164

161165
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->

solutions/deploy/main.tf

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data "ibm_container_vpc_cluster" "cluster_info" {
1616
}
1717

1818
module "build_cpd_image" {
19-
count = var.cloud_pak_deployer_image == null ? 1 : 0
19+
for_each = var.cloud_pak_deployer_image == null ? { "build" = 1 } : {}
2020
source = "./cpd-image-build"
2121
ibmcloud_api_key = var.ibmcloud_api_key
2222
prefix = var.prefix
@@ -29,7 +29,7 @@ module "build_cpd_image" {
2929
}
3030

3131
resource "ibm_container_addons" "odf_cluster_addon" {
32-
count = var.install_odf_cluster_addon ? 1 : 0
32+
for_each = var.install_odf_cluster_addon ? { "odf" = 1 } : {}
3333
cluster = var.cluster_name
3434
manage_all_addons = false
3535
addons {
@@ -55,8 +55,12 @@ module "watsonx_data" {
5555
}
5656

5757
module "cloud_pak_deployer" {
58-
depends_on = [module.watsonx_ai, module.watsonx_data, module.build_cpd_image]
59-
source = "./cloud-pak-deployer"
58+
depends_on = [
59+
module.watsonx_ai,
60+
module.watsonx_data,
61+
module.build_cpd_image
62+
]
63+
source = "./cloud-pak-deployer"
6064
cloud_pak_deployer_config = merge(
6165
module.config.cloud_pak_deployer_config_base,
6266
{
@@ -72,10 +76,10 @@ module "cloud_pak_deployer" {
7276
)]
7377
}
7478
)
75-
cloud_pak_deployer_image = var.cloud_pak_deployer_image != null ? var.cloud_pak_deployer_image : module.build_cpd_image[0].container_registry_output_image
79+
cloud_pak_deployer_image = var.cloud_pak_deployer_image != null ? var.cloud_pak_deployer_image : module.build_cpd_image["build"].container_registry_output_image
7680

7781
cloud_pak_deployer_secret = var.cloud_pak_deployer_secret != null ? var.cloud_pak_deployer_secret : (var.cloud_pak_deployer_image == null ?
78-
{ username : "iamapikey", password : var.ibmcloud_api_key, server : module.build_cpd_image[0].container_registry_server, email : "none" } : null)
82+
{ username : "iamapikey", password : var.ibmcloud_api_key, server : module.build_cpd_image["build"].container_registry_server, email : "none" } : null)
7983

8084
cluster_name = var.cluster_name
8185
cpd_accept_license = var.cpd_accept_license

solutions/deploy/outputs.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
output "cloud_pak_deployer_image" {
2+
description = "The Cloud Pak Deployer image used."
3+
value = var.cloud_pak_deployer_image != null ? var.cloud_pak_deployer_image : module.build_cpd_image["build"].container_registry_output_image
4+
5+
}
6+
7+
output "cloud_pak_deployer_secret" {
8+
description = "The secret used for accessing the Cloud Pak Deployer image."
9+
value = var.cloud_pak_deployer_secret != null ? var.cloud_pak_deployer_secret : (var.cloud_pak_deployer_image == null ?
10+
{ username : "iamapikey", password : var.ibmcloud_api_key, server : module.build_cpd_image["build"].container_registry_server, email : "none" } : null)
11+
sensitive = true
12+
}
13+
14+
output "cluster_name" {
15+
description = "The name of the OpenShift cluster."
16+
value = var.cluster_name
17+
}

solutions/deploy/variables.tf

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
variable "ibmcloud_api_key" {
2-
description = "APIkey that's associated with the account to use"
2+
description = "The IBM Cloud platform API key needed to deploy IAM enabled resources."
33
type = string
44
sensitive = true
55
}
66

77
variable "prefix" {
8-
description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters."
8+
description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 13 or fewer characters."
99
type = string
10+
default = "lz-roks-cp4d"
1011

1112
validation {
12-
error_message = "Prefix must begin and end with a letter and contain only letters, numbers, and - characters."
13-
condition = can(regex("^([A-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix))
13+
error_message = "Prefix must begin with a letter and contain only lowercase letters, numbers, and - characters. Prefixes must end with a lowercase letter or number and be 13 or fewer characters."
14+
condition = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix)) && length(var.prefix) <= 13
1415
}
1516
}
1617

1718
variable "region" {
18-
description = "Region where resources wills be created. To find your VPC region, use `ibmcloud is regions` command to find available regions."
19+
description = "Region where resources will be created. To find your VPC region, use `ibmcloud is regions` command to find available regions."
1920
type = string
2021
}
2122

2223
variable "resource_group" {
23-
description = "Resource group to provision services within. If not defined, a resource group called {prefix}-cpd will be created"
24+
description = "Resource group to provision services within. If not defined, a resource group called {prefix}-cpd will be created."
2425
type = string
2526
default = null
2627
}
@@ -44,7 +45,7 @@ variable "code_engine_project_id" {
4445
}
4546

4647
variable "cloud_pak_deployer_image" {
47-
description = "Cloud Pak Deployer image location. If not defined, it will build the image via code engine"
48+
description = "Cloud Pak Deployer image to use. If null, the image will be built using Code Engine."
4849
type = string
4950
default = null
5051
}
@@ -56,19 +57,13 @@ variable "cloud_pak_deployer_release" {
5657
}
5758

5859
variable "cloud_pak_deployer_secret" {
59-
description = "Image pull secret for the cloud pak deployer image"
60-
type = object({
61-
username = string
62-
password = string
63-
server = string
64-
email = string
65-
})
66-
67-
default = null
60+
description = "Secret for accessing the Cloud Pak Deployer image. If null, a default secret will be created."
61+
type = map(string)
62+
default = null
6863
}
6964

7065
variable "cluster_name" {
71-
description = "Name of Red Hat OpenShift cluster to install watsonx onto"
66+
description = "Name of the OpenShift cluster."
7267
type = string
7368
}
7469

@@ -116,21 +111,20 @@ variable "odf_config" {
116111
}
117112
}
118113

119-
120114
variable "cpd_accept_license" {
121-
default = false
122-
description = "When set to 'true', it is understood that the user has read the terms of the Cloud Pak license(s) and agrees to the terms outlined"
115+
description = "Accept the Cloud Pak for Data license."
123116
type = bool
117+
default = false
124118
}
125119

126120
variable "cpd_admin_password" {
127-
description = "Password to be used by the admin user to access the Cloud Pak for Data UI."
121+
description = "Password for the Cloud Pak for Data admin user."
128122
sensitive = true
129123
type = string
130124
}
131125

132126
variable "cpd_entitlement_key" {
133-
description = "Cloud Pak for Data entitlement key for access to the IBM Entitled Registry. Can be fetched from https://myibm.ibm.com/products-services/containerlibrary."
127+
description = "Entitlement key for Cloud Pak for Data."
134128
sensitive = true
135129
type = string
136130
}

0 commit comments

Comments
 (0)