Skip to content

Commit 62af40c

Browse files
fix JCS-13864 Allow namespace in OCIR Registry User Name (#204)
Implemented [JCS-13864] - Allow namespace in OCIR Registry User Name Note: This change is using terraform 0.12 compatible string handling functions. TEST: PASS. Stack Variable: **ocir_user = ax8cfrmecktw/oracleidentitycloudservice/[email protected]** 1. PASS: stack apply succeeded with autoscaling 2. PASS: metatada verification "ocir_user": "ax8cfrmecktw/oracleidentitycloudservice/[email protected]",
2 parents f26efcc + eec97f3 commit 62af40c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

terraform/locals.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ locals {
155155

156156
ocir_namespace = data.oci_objectstorage_namespace.object_namespace.namespace
157157

158-
ocir_user = format("%s/%s", local.ocir_namespace, var.ocir_user)
158+
ocir_namespace_with_slash = format("%s/",local.ocir_namespace)
159+
ocir_user_starts_with = substr(var.ocir_user, 0, length(local.ocir_namespace_with_slash))
160+
ocir_user = local.ocir_user_starts_with == local.ocir_namespace_with_slash ? var.ocir_user : "${format("%s%s", local.ocir_namespace_with_slash, var.ocir_user)}"
161+
159162
region_keys = data.oci_identity_regions.all_regions.regions.*.key
160163
region_names = data.oci_identity_regions.all_regions.regions.*.name
161164
ocir_region = var.ocir_region == "" ? lower(element(local.region_keys, index(local.region_names, lower(var.region)))) : var.ocir_region

0 commit comments

Comments
 (0)