From a10425b7247e35613ba7a6157dc47a9f095016eb Mon Sep 17 00:00:00 2001 From: Aashiq-J <122446118+Aashiq-J@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:10:26 +0530 Subject: [PATCH] feat: support removed for deprecated OCP versions 4.12 and 4.13 (#589) --- examples/advanced/main.tf | 2 +- main.tf | 4 ++-- tests/other_test.go | 4 ++-- tests/pr_test.go | 6 ++---- variables.tf | 2 -- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/examples/advanced/main.tf b/examples/advanced/main.tf index ecf8e177..f2325544 100644 --- a/examples/advanced/main.tf +++ b/examples/advanced/main.tf @@ -171,7 +171,7 @@ module "ocp_base" { # Enable if using worker autoscaling. Stops Terraform managing worker count. ignore_worker_pool_size_changes = true addons = { - "cluster-autoscaler" = "1.2.1" + "cluster-autoscaler" = "1.2.3" } kms_config = { instance_id = module.kp_all_inclusive.kms_guid diff --git a/main.tf b/main.tf index 0cd44b1a..504e2d11 100644 --- a/main.tf +++ b/main.tf @@ -44,7 +44,7 @@ locals { cluster_security_groups = var.attach_ibm_managed_security_group == true ? (var.custom_security_group_ids == null ? null : concat(["cluster"], var.custom_security_group_ids)) : (var.custom_security_group_ids == null ? null : var.custom_security_group_ids) # for versions older than 4.15, this value must be null, or provider gives error - disable_outbound_traffic_protection = startswith(local.ocp_version, "4.12") || startswith(local.ocp_version, "4.13") || startswith(local.ocp_version, "4.14") ? null : var.disable_outbound_traffic_protection + disable_outbound_traffic_protection = startswith(local.ocp_version, "4.14") ? null : var.disable_outbound_traffic_protection } # Separate local block to handle os validations @@ -286,7 +286,7 @@ data "ibm_iam_account_settings" "iam_account_settings" { resource "null_resource" "reset_api_key" { provisioner "local-exec" { - command = "${path.module}/scripts/reset_iks_api_key.sh ${var.region} ${var.resource_group_id} ${var.use_private_endpoint} ${var.ocp_version == "4.13" && var.disable_public_endpoint ? "vpe" : var.cluster_config_endpoint_type}" # private only cluster on 4.13 will use VPE endpoint. + command = "${path.module}/scripts/reset_iks_api_key.sh ${var.region} ${var.resource_group_id} ${var.use_private_endpoint} ${var.cluster_config_endpoint_type}" interpreter = ["/bin/bash", "-c"] environment = { IAM_TOKEN = data.ibm_iam_auth_token.reset_api_key_tokendata.iam_access_token diff --git a/tests/other_test.go b/tests/other_test.go index f5f3e004..0d3ccb12 100644 --- a/tests/other_test.go +++ b/tests/other_test.go @@ -11,7 +11,7 @@ import ( func TestRunBasicExample(t *testing.T) { t.Parallel() - options := setupOptions(t, "base-ocp", basicExampleDir, ocpVersion6) + options := setupOptions(t, "base-ocp", basicExampleDir, ocpVersion4) output, err := options.RunTestConsistency() @@ -139,7 +139,7 @@ func TestCrossKmsSupportExample(t *testing.T) { "kms_instance_guid": permanentResources["kp_us_south_guid"], "kms_key_id": permanentResources["kp_us_south_root_key_id"], "kms_cross_account_id": permanentResources["ge_ops_account_id"], - "ocp_version": ocpVersion5, + "ocp_version": ocpVersion3, }, ImplicitDestroy: []string{ // workaround for the issue https://github.ibm.com/GoldenEye/issues/issues/10743 diff --git a/tests/pr_test.go b/tests/pr_test.go index 85e0ec3a..86e6f6b8 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -29,10 +29,8 @@ const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-res // Ensure there is one test per supported OCP version const ocpVersion1 = "4.17" // used by TestRunUpgradeAdvancedExample , TestFSCloudInSchematic and TestRunMultiClusterExample const ocpVersion2 = "4.16" // used by TestCustomSGExample and TestRunCustomsgExample -const ocpVersion3 = "4.15" // used by TestRunAdvancedExample -const ocpVersion4 = "4.14" // used by TestRunAddRulesToSGExample -const ocpVersion5 = "4.13" // used by TestCrossKmsSupportExample -const ocpVersion6 = "4.12" // used by TestRunBasicExample +const ocpVersion3 = "4.15" // used by TestRunAdvancedExample and TestCrossKmsSupportExample +const ocpVersion4 = "4.14" // used by TestRunAddRulesToSGExample and TestRunBasicExample var sharedInfoSvc *cloudinfo.CloudInfoService var permanentResources map[string]interface{} diff --git a/variables.tf b/variables.tf index 9e2d98af..c09fc81e 100644 --- a/variables.tf +++ b/variables.tf @@ -183,8 +183,6 @@ variable "ocp_version" { condition = anytrue([ var.ocp_version == null, var.ocp_version == "default", - var.ocp_version == "4.12", - var.ocp_version == "4.13", var.ocp_version == "4.14", var.ocp_version == "4.15", var.ocp_version == "4.16",