Skip to content

Commit ae6e7d4

Browse files
fix: move fscloud tests to run in schematics
- Move fscloud test to execute in Schematics
1 parent 5dd1359 commit ae6e7d4

File tree

7 files changed

+94
-65
lines changed

7 files changed

+94
-65
lines changed

examples/fscloud/main.tf

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,20 +234,19 @@ locals {
234234
}
235235

236236
module "ocp_fscloud" {
237-
source = "../../modules/fscloud"
238-
cluster_name = var.prefix
239-
ibmcloud_api_key = var.ibmcloud_api_key
240-
resource_group_id = module.resource_group.resource_group_id
241-
region = "us-south"
242-
force_delete_storage = true
243-
vpc_id = module.vpc.vpc_id
244-
vpc_subnets = local.cluster_vpc_subnets
245-
existing_cos_id = module.cos_fscloud.cos_instance_id
246-
worker_pools = local.worker_pools
247-
tags = var.resource_tags
248-
access_tags = var.access_tags
249-
ocp_version = var.ocp_version
250-
verify_worker_network_readiness = false # No access from public internet to check worker network readiness
237+
source = "../../modules/fscloud"
238+
cluster_name = var.prefix
239+
ibmcloud_api_key = var.ibmcloud_api_key
240+
resource_group_id = module.resource_group.resource_group_id
241+
region = "us-south"
242+
force_delete_storage = true
243+
vpc_id = module.vpc.vpc_id
244+
vpc_subnets = local.cluster_vpc_subnets
245+
existing_cos_id = module.cos_fscloud.cos_instance_id
246+
worker_pools = local.worker_pools
247+
tags = var.resource_tags
248+
access_tags = var.access_tags
249+
ocp_version = var.ocp_version
251250
kms_config = {
252251
instance_id = var.hpcs_instance_guid
253252
crk_id = local.cluster_hpcs_cluster_key_id

modules/fscloud/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ No resources.
3434
|------|-------------|------|---------|:--------:|
3535
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | A list of access tags to apply to the resources created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details | `list(string)` | `[]` | no |
3636
| <a name="input_addons"></a> [addons](#input\_addons) | Map of OCP cluster add-on versions to install (NOTE: The 'vpc-block-csi-driver' add-on is installed by default for VPC clusters, however you can explicitly specify it here if you wish to choose a later version than the default one). For full list of all supported add-ons and versions, see https://cloud.ibm.com/docs/containers?topic=containers-supported-cluster-addon-versions | <pre>object({<br> debug-tool = optional(string)<br> image-key-synchronizer = optional(string)<br> openshift-data-foundation = optional(string)<br> vpc-file-csi-driver = optional(string)<br> static-route = optional(string)<br> cluster-autoscaler = optional(string)<br> vpc-block-csi-driver = optional(string)<br> })</pre> | `null` | no |
37+
| <a name="input_cluster_config_endpoint_type"></a> [cluster\_config\_endpoint\_type](#input\_cluster\_config\_endpoint\_type) | Specify which type of endpoint to use for for cluster config access: 'private', 'vpe', 'link'. | `string` | `"private"` | no |
3738
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The name that will be assigned to the provisioned cluster | `string` | n/a | yes |
3839
| <a name="input_cluster_ready_when"></a> [cluster\_ready\_when](#input\_cluster\_ready\_when) | The cluster is ready when one of the following: MasterNodeReady (not recommended), OneWorkerNodeReady, Normal, IngressReady | `string` | `"IngressReady"` | no |
3940
| <a name="input_existing_cos_id"></a> [existing\_cos\_id](#input\_existing\_cos\_id) | The COS id of an already existing COS instance | `string` | n/a | yes |

modules/fscloud/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "fscloud" {
1414
vpc_subnets = var.vpc_subnets
1515
worker_pools = var.worker_pools
1616
disable_public_endpoint = true
17+
cluster_config_endpoint_type = var.cluster_config_endpoint_type
1718
cluster_ready_when = var.cluster_ready_when
1819
ignore_worker_pool_size_changes = var.ignore_worker_pool_size_changes
1920
verify_worker_network_readiness = var.verify_worker_network_readiness

modules/fscloud/variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,15 @@ variable "access_tags" {
138138
default = []
139139
}
140140

141+
variable "cluster_config_endpoint_type" {
142+
description = "Specify which type of endpoint to use for for cluster config access: 'private', 'vpe', 'link'."
143+
type = string
144+
default = "private"
145+
nullable = false # use default if null is passed in
146+
validation {
147+
error_message = "Invalid Endpoint Type! Valid values are 'default', 'private', 'vpe', or 'link'"
148+
condition = contains(["private", "vpe", "link"], var.cluster_config_endpoint_type)
149+
}
150+
}
151+
141152
##############################################################################

tests/go.mod

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.21
44

55
require (
66
github.com/stretchr/testify v1.8.4
7-
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.27.2
7+
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.28.3
88
)
99

1010
require (
@@ -16,8 +16,9 @@ require (
1616
dario.cat/mergo v1.0.0 // indirect
1717
github.com/IBM-Cloud/bluemix-go v0.0.0-20240110132033-6ead1f81a985 // indirect
1818
github.com/IBM-Cloud/power-go-client v1.5.8 // indirect
19-
github.com/IBM/go-sdk-core/v5 v5.15.0 // indirect
20-
github.com/IBM/platform-services-go-sdk v0.56.3 // indirect
19+
github.com/IBM/go-sdk-core/v5 v5.15.1 // indirect
20+
github.com/IBM/platform-services-go-sdk v0.56.4 // indirect
21+
github.com/IBM/schematics-go-sdk v0.2.3 // indirect
2122
github.com/IBM/vpc-go-sdk v1.0.2 // indirect
2223
github.com/Microsoft/go-winio v0.6.1 // indirect
2324
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
@@ -31,7 +32,7 @@ require (
3132
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
3233
github.com/davecgh/go-spew v1.1.1 // indirect
3334
github.com/emirpasic/gods v1.18.1 // indirect
34-
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
35+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
3536
github.com/ghodss/yaml v1.0.0 // indirect
3637
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
3738
github.com/go-git/go-billy/v5 v5.5.0 // indirect
@@ -50,20 +51,20 @@ require (
5051
github.com/go-openapi/validate v0.22.4 // indirect
5152
github.com/go-playground/locales v0.14.1 // indirect
5253
github.com/go-playground/universal-translator v0.18.1 // indirect
53-
github.com/go-playground/validator/v10 v10.14.1 // indirect
54+
github.com/go-playground/validator/v10 v10.17.0 // indirect
5455
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5556
github.com/golang/protobuf v1.5.3 // indirect
5657
github.com/google/go-cmp v0.6.0 // indirect
5758
github.com/google/s2a-go v0.1.4 // indirect
58-
github.com/google/uuid v1.5.0 // indirect
59+
github.com/google/uuid v1.6.0 // indirect
5960
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
6061
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
6162
github.com/gruntwork-io/terratest v0.46.11 // indirect
6263
github.com/hashicorp/errwrap v1.1.0 // indirect
6364
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6465
github.com/hashicorp/go-getter v1.7.1 // indirect
6566
github.com/hashicorp/go-multierror v1.1.1 // indirect
66-
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
67+
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
6768
github.com/hashicorp/go-safetemp v1.0.0 // indirect
6869
github.com/hashicorp/go-version v1.6.0 // indirect
6970
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
@@ -74,7 +75,7 @@ require (
7475
github.com/josharian/intern v1.0.0 // indirect
7576
github.com/kevinburke/ssh_config v1.2.0 // indirect
7677
github.com/klauspost/compress v1.16.5 // indirect
77-
github.com/leodido/go-urn v1.2.4 // indirect
78+
github.com/leodido/go-urn v1.3.0 // indirect
7879
github.com/mailru/easyjson v0.7.7 // indirect
7980
github.com/mattn/go-zglob v0.0.4 // indirect
8081
github.com/mitchellh/go-homedir v1.1.0 // indirect
@@ -98,7 +99,7 @@ require (
9899
go.opentelemetry.io/otel/trace v1.16.0 // indirect
99100
golang.org/x/crypto v0.18.0 // indirect
100101
golang.org/x/mod v0.12.0 // indirect
101-
golang.org/x/net v0.19.0 // indirect
102+
golang.org/x/net v0.20.0 // indirect
102103
golang.org/x/oauth2 v0.10.0 // indirect
103104
golang.org/x/sync v0.4.0 // indirect
104105
golang.org/x/sys v0.16.0 // indirect

0 commit comments

Comments
 (0)