Skip to content

Commit

Permalink
feat: support removed for deprecated OCP versions 4.12 and 4.13 (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashiq-J authored Feb 4, 2025
1 parent 2c98ea7 commit a10425b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/advanced/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 0 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a10425b

Please sign in to comment.