Skip to content

Commit 3041793

Browse files
authored
fix: the default value of enable_ocp_console was changed to null so that no action will be taken to configure the OCP console enable/disablement. Users can choose explicitly set this to true or false to enable or disable the console if required. NOTE: When upgrading from an older release, you will see an expected destroy of the ocp_console_management null resource. It is expected and non disruptive. (#616)
1 parent 2ada540 commit 3041793

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Optionally, you need the following permissions to attach Access Management tags
296296
| <a name="input_custom_security_group_ids"></a> [custom\_security\_group\_ids](#input\_custom\_security\_group\_ids) | Security groups to add to all worker nodes. This comes in addition to the IBM maintained security group if attach\_ibm\_managed\_security\_group is set to true. If this variable is set, the default VPC security group is NOT assigned to the worker nodes. | `list(string)` | `null` | no |
297297
| <a name="input_disable_outbound_traffic_protection"></a> [disable\_outbound\_traffic\_protection](#input\_disable\_outbound\_traffic\_protection) | Whether to allow public outbound access from the cluster workers. This is only applicable for `ocp_version` 4.15 | `bool` | `false` | no |
298298
| <a name="input_disable_public_endpoint"></a> [disable\_public\_endpoint](#input\_disable\_public\_endpoint) | Whether access to the public service endpoint is disabled when the cluster is created. Does not affect existing clusters. You can't disable a public endpoint on an existing cluster, so you can't convert a public cluster to a private cluster. To change a public endpoint to private, create another cluster with this input set to `true`. | `bool` | `false` | no |
299-
| <a name="input_enable_ocp_console"></a> [enable\_ocp\_console](#input\_enable\_ocp\_console) | Flag to specify whether to enable or disable the OpenShift console. | `bool` | `true` | no |
299+
| <a name="input_enable_ocp_console"></a> [enable\_ocp\_console](#input\_enable\_ocp\_console) | Flag to specify whether to enable or disable the OpenShift console. If set to `null` the module will not modify the setting currently set on the cluster. Bare in mind when setting this to `true` or `false` on a cluster with private only endpoint enabled, the runtime must be able to access the private endpoint. | `bool` | `null` | no |
300300
| <a name="input_enable_registry_storage"></a> [enable\_registry\_storage](#input\_enable\_registry\_storage) | Set to `true` to enable IBM Cloud Object Storage for the Red Hat OpenShift internal image registry. Set to `false` only for new cluster deployments in an account that is allowlisted for this feature. | `bool` | `true` | no |
301301
| <a name="input_existing_cos_id"></a> [existing\_cos\_id](#input\_existing\_cos\_id) | The COS id of an already existing COS instance to use for OpenShift internal registry storage. Only required if 'enable\_registry\_storage' and 'use\_existing\_cos' are true. | `string` | `null` | no |
302302
| <a name="input_force_delete_storage"></a> [force\_delete\_storage](#input\_force\_delete\_storage) | Flag indicating whether or not to delete attached storage when destroying the cluster - Default: false | `bool` | `false` | no |

main.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ resource "null_resource" "reset_api_key" {
299299
##############################################################################
300300

301301
data "ibm_container_cluster_config" "cluster_config" {
302-
count = var.enable_ocp_console || var.verify_worker_network_readiness || lookup(var.addons, "cluster-autoscaler", null) != null ? 1 : 0
302+
count = var.enable_ocp_console != null || var.verify_worker_network_readiness || lookup(var.addons, "cluster-autoscaler", null) != null ? 1 : 0
303303
cluster_name_id = local.cluster_id
304304
config_dir = "${path.module}/kubeconfig"
305305
admin = true # workaround for https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/issues/374
@@ -458,14 +458,12 @@ resource "null_resource" "confirm_network_healthy" {
458458
}
459459

460460
##############################################################################
461-
# OCP Console Patch enablement
461+
# Enable or Disable OCP Console Patch
462462
##############################################################################
463463
resource "null_resource" "ocp_console_management" {
464-
464+
count = var.enable_ocp_console != null ? 1 : 0
465465
depends_on = [null_resource.confirm_network_healthy]
466-
triggers = {
467-
enable_ocp_console = var.enable_ocp_console
468-
}
466+
469467
provisioner "local-exec" {
470468
command = "${path.module}/scripts/enable_disable_ocp_console.sh"
471469
interpreter = ["/bin/bash", "-c"]

variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,10 @@ variable "cluster_config_endpoint_type" {
343343
}
344344

345345
variable "enable_ocp_console" {
346-
description = "Flag to specify whether to enable or disable the OpenShift console."
346+
description = "Flag to specify whether to enable or disable the OpenShift console. If set to `null` the module will not modify the setting currently set on the cluster. Bare in mind when setting this to `true` or `false` on a cluster with private only endpoint enabled, the runtime must be able to access the private endpoint."
347347
type = bool
348-
default = true
348+
default = null
349+
nullable = true
349350
}
350351

351352
##############################################################################

0 commit comments

Comments
 (0)