Skip to content

Commit 694985b

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
fix: catalog id
1 parent 265d675 commit 694985b

File tree

7 files changed

+30
-72
lines changed

7 files changed

+30
-72
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"ibmcloud_api_key": $VALIDATION_APIKEY,
33
"prefix": $PREFIX,
4-
"region": "us-south"
4+
"region": "us-south",
5+
"cpd_entitlement_key": $CPD_ENTITLEMENT_KEY
56
}

tests/pr_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ func TestRunStandardSolution(t *testing.T) {
100100
// Do not hard fail the test if the implicit destroy steps fail to allow a full destroy of resource to occur
101101
ImplicitRequired: false,
102102
TerraformVars: map[string]any{
103-
"prefix": prefix,
104-
"region": region,
105-
"cluster_name": terraform.Output(t, existingTerraformOptions, "cluster_id"),
106-
"cluster_rg_id": terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"),
107-
"cloud_pak_deployer_image": "quay.io/cloud-pak-deployer/cloud-pak-deployer",
108-
"cpd_admin_password": GetRandomAdminPassword(t),
109-
"cpd_entitlement_key": *cpdEntitlementKey,
110-
"install_odf_cluster_addon": true,
103+
"prefix": prefix,
104+
"region": region,
105+
"existing_cluster_name": terraform.Output(t, existingTerraformOptions, "cluster_name"),
106+
"existing_resource_group_name": terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"),
107+
"cloud_pak_deployer_image": "quay.io/cloud-pak-deployer/cloud-pak-deployer",
108+
"cpd_admin_password": GetRandomAdminPassword(t),
109+
"cpd_entitlement_key": *cpdEntitlementKey,
110+
"install_odf_cluster_addon": true,
111111
},
112112
})
113113

@@ -188,14 +188,14 @@ func TestRunStandardUpgradeSolution(t *testing.T) {
188188
// Do not hard fail the test if the implicit destroy steps fail to allow a full destroy of resource to occur
189189
ImplicitRequired: false,
190190
TerraformVars: map[string]any{
191-
"prefix": prefix,
192-
"region": region,
193-
"cluster_name": terraform.Output(t, existingTerraformOptions, "cluster_id"),
194-
"cluster_rg_id": terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"),
195-
"cloud_pak_deployer_image": "quay.io/cloud-pak-deployer/cloud-pak-deployer",
196-
"cpd_admin_password": GetRandomAdminPassword(t),
197-
"cpd_entitlement_key": *cpdEntitlementKey,
198-
"install_odf_cluster_addon": true,
191+
"prefix": prefix,
192+
"region": region,
193+
"existing_cluster_name": terraform.Output(t, existingTerraformOptions, "cluster_name"),
194+
"existing_resource_group_name": terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"),
195+
"cloud_pak_deployer_image": "quay.io/cloud-pak-deployer/cloud-pak-deployer",
196+
"cpd_admin_password": GetRandomAdminPassword(t),
197+
"cpd_entitlement_key": *cpdEntitlementKey,
198+
"install_odf_cluster_addon": true,
199199
},
200200
})
201201

tests/resources/main.tf

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,3 @@ module "ocp_base" {
7373
worker_pools = local.worker_pools
7474
access_tags = []
7575
}
76-
77-
##############################################################################
78-
# Monitoring:
79-
# - Cloud Monitoring instance
80-
##############################################################################
81-
82-
module "watsonx_self_managed_ocp" {
83-
source = "../.."
84-
ibmcloud_api_key = var.ibmcloud_api_key
85-
prefix = var.prefix
86-
region = var.region
87-
cluster_name = module.ocp_base.cluster_name
88-
cluster_rg_id = module.ocp_base.resource_group_id
89-
cloud_pak_deployer_image = "quay.io/cloud-pak-deployer/cloud-pak-deployer"
90-
cpd_admin_password = var.cpd_admin_password
91-
cpd_entitlement_key = var.cpd_entitlement_key
92-
install_odf_cluster_addon = true
93-
}

tests/resources/outputs.tf

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
output "cloud_pak_deployer_image" {
2-
description = "The Cloud Pak Deployer image used."
3-
value = module.watsonx_self_managed_ocp.cloud_pak_deployer_image
4-
}
5-
6-
output "cloud_pak_deployer_secret" {
7-
description = "The secret used for accessing the Cloud Pak Deployer image."
8-
value = module.watsonx_self_managed_ocp.cloud_pak_deployer_secret
9-
sensitive = true
10-
}
11-
121
output "cluster_name" {
132
description = "The name of the OpenShift cluster."
14-
value = module.watsonx_self_managed_ocp.cluster_name
15-
}
16-
17-
output "code_engine_project_name" {
18-
description = "The name of the code engine project that was created"
19-
value = module.watsonx_self_managed_ocp.code_engine_project_name
3+
value = module.ocp_base.cluster_name
204
}
215

226
output "cluster_id" {

tests/resources/variables.tf

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,3 @@ variable "resource_group" {
2727
description = "The name of an existing resource group to provision resources in. If not specified, a new resource group is created with the `prefix` variable."
2828
default = null
2929
}
30-
31-
variable "cpd_admin_password" {
32-
type = string
33-
description = "The password for the Cloud Pak for Data admin user."
34-
sensitive = true
35-
default = "cpd-admin-password" # pragma: allowlist secret
36-
}
37-
38-
variable "cpd_entitlement_key" {
39-
type = string
40-
description = "The entitlement key for Cloud Pak for Data."
41-
sensitive = true
42-
}

tests/scripts/post-validation-destroy-ocp-and-scc-wp-instances.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22

33
########################################################################################################################
4-
## This script is used by the catalog pipeline to destroy the SLZ ROKS Cluster, which was provisioned as a ##
4+
## This script is used by the catalog pipeline to destroy the OCP Cluster, which was provisioned as a ##
55
## prerequisite for the WAS extension that is published to the catalog ##
66
########################################################################################################################
77

@@ -12,7 +12,7 @@ TF_VARS_FILE="terraform.tfvars"
1212

1313
(
1414
cd ${TERRAFORM_SOURCE_DIR}
15-
echo "Destroying prerequisite OCP and Watson instances .."
15+
echo "Destroying prerequisite OCP instances .."
1616
terraform destroy -input=false -auto-approve -var-file=${TF_VARS_FILE} || exit 1
1717

1818
echo "Post-validation completed successfully"

tests/scripts/pre-validation-deploy-ocp-and-scc-wp-instances.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22

33
############################################################################################################
4-
## This script is used by the catalog pipeline to deploy the SLZ ROKS and SCC workload protection instances,
4+
## This script is used by the catalog pipeline to deploy the OCP instances,
55
## which are the prerequisites for the SCC workload protection standard fullstack.
66
############################################################################################################
77

@@ -16,32 +16,36 @@ TF_VARS_FILE="terraform.tfvars"
1616
(
1717
cwd=$(pwd)
1818
cd ${TERRAFORM_SOURCE_DIR}
19-
echo "Provisioning prerequisite OCP and Watson instances .."
19+
echo "Provisioning prerequisite OCP instances .."
2020
terraform init || exit 1
2121
# $VALIDATION_APIKEY is available in the catalog runtime
2222
{
2323
echo "ibmcloud_api_key=\"${VALIDATION_APIKEY}\""
24+
echo "cpd_entitlement_key=\"${CPD_ENTITLEMENT_KEY}\""
2425
echo "region=\"${REGION}\""
25-
echo "prefix=\"slz-$(openssl rand -hex 2)\""
26+
echo "prefix=\"ocp-$(openssl rand -hex 2)\""
2627
} >> ${TF_VARS_FILE}
2728
terraform apply -input=false -auto-approve -var-file=${TF_VARS_FILE} || exit 1
2829

2930
region_var_name="region"
31+
cpd_entitlement_key_var_name="cpd_entitlement_key"
3032
cluster_name_var_name="existing_cluster_name"
3133
cluster_name_value=$(terraform output -state=terraform.tfstate -raw cluster_name)
3234
cluster_resource_group_id_var_name="existing_resource_group_name"
3335
cluster_resource_group_id_value=$(terraform output -state=terraform.tfstate -raw cluster_resource_group_id)
3436

35-
echo "Appending '${cluster_name_var_name}', '${cluster_resource_group_id_var_name}', and '${region_var_name}' input variable values to ${JSON_FILE}.."
37+
echo "Appending '${cpd_entitlement_key_var_name}', ${cluster_name_var_name}', '${cluster_resource_group_id_var_name}', and '${region_var_name}' input variable values to ${JSON_FILE}.."
3638

3739
cd "${cwd}"
3840
jq -r --arg region_var_name "${region_var_name}" \
3941
--arg region_var_value "${REGION}" \
42+
--arg cpd_entitlement_key_var_name "${cpd_entitlement_key_var_name}" \
43+
--arg cpd_entitlement_key_var_value "${CPD_ENTITLEMENT_KEY}" \
4044
--arg cluster_name_var_name "${cluster_name_var_name}" \
4145
--arg cluster_name_value "${cluster_name_value}" \
4246
--arg cluster_resource_group_id_var_name "${cluster_resource_group_id_var_name}" \
4347
--arg cluster_resource_group_id_value "${cluster_resource_group_id_value}" \
44-
'. + {($region_var_name): $region_var_value, ($cluster_name_var_name): $cluster_name_value, ($cluster_resource_group_id_var_name): $cluster_resource_group_id_value}' "${JSON_FILE}" > tmpfile && mv tmpfile "${JSON_FILE}" || exit 1
48+
'. + {($region_var_name): $region_var_value, ($cpd_entitlement_key_var_name): $cpd_entitlement_key_var_value, ($cluster_name_var_name): $cluster_name_value, ($cluster_resource_group_id_var_name): $cluster_resource_group_id_value}' "${JSON_FILE}" > tmpfile && mv tmpfile "${JSON_FILE}" || exit 1
4549

4650
echo "Pre-validation complete successfully"
4751
)

0 commit comments

Comments
 (0)